forked from EasyRPG/Player
/
game_interpreter_map.h
144 lines (130 loc) · 5.99 KB
/
game_interpreter_map.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/*
* This file is part of EasyRPG Player.
*
* EasyRPG Player is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* EasyRPG Player is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with EasyRPG Player. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _GAME_INTERPRETER_MAP_H_
#define _GAME_INTERPRETER_MAP_H_
// Headers
#include <map>
#include <string>
#include <vector>
#include "game_character.h"
#include "rpg_eventcommand.h"
#include "system.h"
#include "game_interpreter.h"
class Game_Event;
class Game_CommonEvent;
/**
* Game_Interpreter_Map class
*/
class Game_Interpreter_Map : public Game_Interpreter
{
public:
Game_Interpreter_Map(int _depth = 0, bool _main_flag = false);
~Game_Interpreter_Map();
/**
* Parses a SaveEventCommand to create an interpreter.
*
* @param save event to load.
* @param index index in the event list.
*
* @return If the setup was successful (fails when index out of range)
*/
bool SetupFromSave(const std::vector<RPG::SaveEventCommands>& save, int _event_id, int index = 0);
/**
* Generates a SaveEventCommands vector needed for the savefile.
*
* @return interpreter commands stored in SaveEventCommands
*/
std::vector<RPG::SaveEventCommands> GetSaveData() const;
bool ExecuteCommand();
void EndMoveRoute(Game_Character* moving_character);
private:
bool CommandMessageOptions(RPG::EventCommand const& com);
bool CommandChangeExp(RPG::EventCommand const& com);
bool CommandChangeParameters(RPG::EventCommand const& com);
bool CommandChangeHeroName(RPG::EventCommand const& com);
bool CommandChangeHeroTitle(RPG::EventCommand const& com);
bool CommandChangeSpriteAssociation(RPG::EventCommand const& com);
bool CommandMemorizeLocation(RPG::EventCommand const& com);
bool CommandRecallToLocation(RPG::EventCommand const& com);
bool CommandStoreTerrainID(RPG::EventCommand const& com);
bool CommandStoreEventID(RPG::EventCommand const& com);
bool CommandMemorizeBGM(RPG::EventCommand const& com);
bool CommandPlayMemorizedBGM(RPG::EventCommand const& com);
bool CommandChangeSystemBGM(RPG::EventCommand const& com);
bool CommandChangeSystemSFX(RPG::EventCommand const& com);
bool CommandChangeSaveAccess(RPG::EventCommand const& com);
bool CommandChangeTeleportAccess(RPG::EventCommand const& com);
bool CommandChangeEscapeAccess(RPG::EventCommand const& com);
bool CommandChangeMainMenuAccess(RPG::EventCommand const& com);
bool CommandChangeActorFace(RPG::EventCommand const& com);
bool CommandTeleport(RPG::EventCommand const& com);
bool CommandEraseScreen(RPG::EventCommand const& com);
bool CommandShowScreen(RPG::EventCommand const& com);
bool CommandShowPicture(RPG::EventCommand const& com);
bool CommandMovePicture(RPG::EventCommand const& com);
bool CommandErasePicture(RPG::EventCommand const& com);
bool CommandWeatherEffects(RPG::EventCommand const& com);
bool CommandChangeSystemGraphics(RPG::EventCommand const& com);
bool CommandChangeScreenTransitions(RPG::EventCommand const& com);
bool CommandChangeEventLocation(RPG::EventCommand const& com);
bool CommandTradeEventLocations(RPG::EventCommand const& com);
bool CommandTimerOperation(RPG::EventCommand const& com);
bool CommandChangePBG(RPG::EventCommand const& com);
bool CommandJumpToLabel(RPG::EventCommand const& com);
bool CommandBreakLoop(RPG::EventCommand const& com);
bool CommandEndLoop(RPG::EventCommand const& com);
bool CommandOpenShop(RPG::EventCommand const& com);
bool CommandShowInn(RPG::EventCommand const& com);
bool CommandEnterHeroName(RPG::EventCommand const& com);
bool CommandReturnToTitleScreen(RPG::EventCommand const& com);
bool CommandOpenSaveMenu(RPG::EventCommand const& com);
bool CommandOpenMainMenu(RPG::EventCommand const& com);
bool CommandEnemyEncounter(RPG::EventCommand const& com);
bool CommandTeleportTargets(RPG::EventCommand const& com);
bool CommandEscapeTarget(RPG::EventCommand const& com);
bool CommandMoveEvent(RPG::EventCommand const& com);
bool CommandFlashSprite(RPG::EventCommand const& com);
bool CommandSpriteTransparency(RPG::EventCommand const& com);
bool CommandEraseEvent(RPG::EventCommand const& com);
bool CommandChangeMapTileset(RPG::EventCommand const& com);
bool CommandCallEvent(RPG::EventCommand const& com);
bool CommandChangeEncounterRate(RPG::EventCommand const& com);
bool CommandProceedWithMovement(RPG::EventCommand const& com);
bool CommandPlayMovie(RPG::EventCommand const& com);
bool CommandChangeBattleCommands(RPG::EventCommand const& com);
bool CommandKeyInputProc(RPG::EventCommand const& com);
bool CommandChangeVehicleGraphic(RPG::EventCommand const& com);
bool CommandEnterExitVehicle(RPG::EventCommand const& com);
bool CommandSetVehicleLocation(RPG::EventCommand const& com);
bool CommandTileSubstitution(RPG::EventCommand const& com);
bool CommandPanScreen(RPG::EventCommand const& com);
bool CommandSimulatedAttack(RPG::EventCommand const& com);
bool CommandConditionalBranch(RPG::EventCommand const& com);
bool CommandShowBattleAnimation(RPG::EventCommand const& com);
bool CommandChangeClass(RPG::EventCommand const& com);
bool CommandHaltAllMovement(RPG::EventCommand const& com);
bool ContinuationOpenShop(RPG::EventCommand const& com);
bool ContinuationShowInnStart(RPG::EventCommand const& com);
bool ContinuationShowInnFinish(RPG::EventCommand const& com);
bool ContinuationEnemyEncounter(RPG::EventCommand const& com);
private:
int DecodeInt(std::vector<int>::const_iterator& it);
const std::string DecodeString(std::vector<int>::const_iterator& it);
RPG::MoveCommand DecodeMove(std::vector<int>::const_iterator& it);
static std::vector<Game_Character*> pending;
};
#endif