22 #ifndef ZVISION_SCRIPT_MANAGER_H 23 #define ZVISION_SCRIPT_MANAGER_H 25 #include "common/events.h" 26 #include "common/hashmap.h" 27 #include "common/queue.h" 28 #include "zvision/scripting/control.h" 29 #include "zvision/scripting/puzzle.h" 30 #include "zvision/scripting/scripting_effect.h" 34 class SeekableReadStream;
47 StateKey_KeyPress = 8,
48 StateKey_InventoryItem = 9,
54 StateKey_MenuState = 19,
55 StateKey_RestoreFlag = 20,
56 StateKey_Quitting = 39,
57 StateKey_LastWorld = 40,
58 StateKey_LastRoom = 41,
59 StateKey_LastNode = 42,
60 StateKey_LastView = 43,
61 StateKey_LastViewPos = 44,
62 StateKey_Menu_LastWorld = 45,
63 StateKey_Menu_LastRoom = 46,
64 StateKey_Menu_LastNode = 47,
65 StateKey_Menu_LastView = 48,
66 StateKey_Menu_LastViewPos = 49,
67 StateKey_KbdRotateSpeed = 50,
68 StateKey_Subtitles = 51,
69 StateKey_StreamSkipKey = 52,
70 StateKey_RotateSpeed = 53,
73 StateKey_VenusEnable = 58,
74 StateKey_HighQuality = 59,
75 StateKey_VideoLineSkip = 65,
76 StateKey_Platform = 66,
77 StateKey_InstallLevel = 67,
78 StateKey_CountryCode = 68,
80 StateKey_MovieCursor = 70,
81 StateKey_NoTurnAnim = 71,
83 StateKey_ShowErrorDlg = 73,
84 StateKey_DebugCheats = 74,
85 StateKey_JapanFonts = 75,
86 StateKey_ExecScopeStyle = 76,
87 StateKey_Brightness = 77,
88 StateKey_MPEGMovies = 78,
92 StateKey_EF9_Speed = 94,
93 StateKey_Inv_Cnt_Slot = 100,
94 StateKey_Inv_1_Slot = 101,
95 StateKey_Inv_49_Slot = 149,
97 StateKey_Inv_TotalSlots = 150,
98 StateKey_Inv_StartSlot = 151,
99 StateKey_Spell_1 = 191,
100 StateKey_Active_Spell = 205,
101 StateKey_Reversed_Spellbooc = 206
105 Location() : world(
'g'), room(
'a'), node(
'r'), view(
'y'), offset(0) {}
116 lhs.world == rhs.world &&
117 lhs.room == rhs.room &&
118 lhs.node == rhs.node &&
123 inline bool operator==(
const Location& lhs,
const char* rhs) {
125 return lhsStr == rhs;
129 return !(lhs == rhs);
132 inline bool operator!=(
const Location& lhs,
const char* rhs) {
133 return !(lhs == rhs);
154 PuzzleList *scopeQueue;
155 PuzzleList *execQueue;
156 PuzzleList privQueueOne;
157 PuzzleList privQueueTwo;
160 ControlList controls;
175 StateMap _globalState;
177 StateMap _globalStateFlags;
179 PuzzleMap _referenceTable;
181 ControlList *_activeControls;
183 EventList _controlEvents;
185 ScriptScope _universe;
188 ScriptScope _nodeview;
191 SideFXList _activeSideFx;
195 int _changeLocationDelayCycles;
197 uint32 _currentlyFocusedControl;
200 void initialize(
bool restarted =
false);
201 void process(uint deltaTimeMillis);
202 void queuePuzzles(uint32 key);
204 int getStateValue(uint32 key);
205 void setStateValue(uint32 key,
int value);
207 uint getStateFlag(uint32 key);
208 void setStateFlag(uint32 key, uint value);
209 void unsetStateFlag(uint32 key, uint value);
211 void addControl(
Control *control);
212 Control *getControl(uint32 key);
214 void enableControl(uint32 key);
215 void disableControl(uint32 key);
217 void focusControl(uint32 key);
219 void setFocusControlKey(uint32 key);
223 void deleteSideFx(uint32 key);
224 void stopSideFx(uint32 key);
225 void killSideFx(uint32 key);
226 void killSideFxType(ScriptingEffect::ScriptingEffectType type);
267 void changeLocation(
char world,
char room,
char node,
char view, uint32 offset);
268 void changeLocation(
const Location &_newLocation);
270 bool changingLocation()
const;
275 Location getCurrentLocation()
const;
289 void referenceTableAddPuzzle(uint32 key, PuzzleRef ref);
290 void addPuzzlesToReferenceTable(ScriptScope &scope);
291 void updateNodes(uint deltaTimeMillis);
292 void updateControls(uint deltaTimeMillis);
293 bool checkPuzzleCriteria(
Puzzle *puzzle, uint counter);
294 void cleanStateTable();
295 void cleanScriptScope(ScriptScope &scope);
296 bool execScope(ScriptScope &scope);
299 void ChangeLocationReal(
bool isLoading);
301 int8 inventoryGetCount();
302 void inventorySetCount(int8 cnt);
303 int16 inventoryGetItem(int8
id);
304 void inventorySetItem(int8
id, int16 item);
306 void setStateFlagSilent(uint32 key, uint value);
307 void setStateValueSilent(uint32 key,
int value);
310 void inventoryAdd(int16 item);
311 void inventoryDrop(int16 item);
312 void inventoryCycle();
321 void parseScrFile(
const Common::Path &fileName, ScriptScope &scope);
static String format(MSVC_PRINTF const char *fmt,...) GCC_PRINTF(1
EventType
Definition: events.h:49
Definition: script_manager.h:143
Definition: focus_list.h:27
Definition: script_manager.h:104
Definition: scripting_effect.h:45
Definition: algorithm.h:29
Definition: script_manager.h:381
Definition: keyboard.h:294