ScummVM API documentation
script_eob.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifdef ENABLE_EOB
23
24#ifndef KYRA_SCRIPT_EOB_H
25#define KYRA_SCRIPT_EOB_H
26
27#include "common/func.h"
28#include "common/substream.h"
29#include "common/savefile.h"
30
31namespace Kyra {
32
33class KyraRpgEngine;
34
35class EoBInfProcessor {
36public:
37 EoBInfProcessor(EoBCoreEngine *engine, Screen_EoB *_screen);
38 ~EoBInfProcessor();
39
40 void loadData(const uint8 *data, uint32 dataSize);
41 void run(int func, int flags);
42
43 void setFlags(uint32 flags);
44 void clearFlags(uint32 flags);
45 bool checkFlags(uint32 flags) const;
46 bool preventRest() const;
47
48 void loadState(Common::SeekableReadStreamEndian &in, bool origFile = false);
49 void saveState(Common::OutSaveFile *out, bool origFile = false);
50 void reset();
51
52private:
53 const char *getString(uint16 index);
54
55 int oeob_setWallType(int8 *data);
56 int oeob_toggleWallState(int8 *data);
57 int oeob_openDoor(int8 *data);
58 int oeob_closeDoor(int8 *data);
59 int oeob_replaceMonster(int8 *data);
60 int oeob_movePartyOrObject(int8 *data);
61 int oeob_moveInventoryItemToBlock(int8 *data);
62 int oeob_printMessage_v1(int8 *data);
63 int oeob_printMessage_v2(int8 *data);
64 int oeob_setFlags(int8 *data);
65 int oeob_playSoundEffect(int8 *data);
66 int oeob_removeFlags(int8 *data);
67 int oeob_modifyCharacterHitPoints(int8 *data);
68 int oeob_calcAndInflictCharacterDamage(int8 *data);
69 int oeob_jump(int8 *data);
70 int oeob_end(int8 *data);
71 int oeob_returnFromSubroutine(int8 *data);
72 int oeob_callSubroutine(int8 *data);
73 int oeob_eval_v1(int8 *data);
74 int oeob_eval_v2(int8 *data);
75 int oeob_deleteItem(int8 *data);
76 int oeob_loadNewLevelOrMonsters(int8 *data);
77 int oeob_increasePartyExperience(int8 *data);
78 int oeob_createItem_v1(int8 *data);
79 int oeob_createItem_v2(int8 *data);
80 int oeob_launchObject(int8 *data);
81 int oeob_changeDirection(int8 *data);
82 int oeob_identifyItems(int8 *data);
83 int oeob_sequence(int8 *data);
84 int oeob_delay(int8 *data);
85 int oeob_drawScene(int8 *data);
86 int oeob_dialogue(int8 *data);
87 int oeob_specialEvent(int8 *data);
88
89 EoBCoreEngine *_vm;
90 Screen_EoB *_screen;
91
93 struct InfOpcode : private Common::NonCopyable {
94 InfOpcode(InfProc *p, const char *d) : proc(p), desc(d) {}
95 ~InfOpcode() { delete proc; }
96
97 InfProc *proc;
98 Common::String desc;
99 };
101
102 int8 *_scriptData;
103 uint16 _scriptSize;
104
105 uint8 _abortScript;
106 uint16 _abortAfterSubroutine;
107 int _dlgResult;
108 uint8 _preventRest;
109
110 uint16 _lastScriptFunc;
111 uint16 _lastScriptFlags;
112
113 int8 **_subroutineStack;
114 int _subroutineStackPos;
115
116 uint32 *_flagTable;
117
118 int16 *_stack;
119 int _stackIndex;
120
121 int8 _activeCharacter;
122
123 static const uint8 _segaCDColorMap[16];
124
125 const int _commandMin;
126};
127
128} // End of namespace Kyra
129
130#endif
131
132#endif // ENABLE_EOB
Definition: array.h:52
Definition: func.h:452
Definition: noncopyable.h:39
Definition: savefile.h:54
Definition: stream.h:944
Definition: str.h:59
Definition: detection.h:27