22 #ifndef ZVISION_SCRIPT_MANAGER_H 23 #define ZVISION_SCRIPT_MANAGER_H 25 #include "zvision/scripting/puzzle.h" 26 #include "zvision/scripting/control.h" 27 #include "zvision/scripting/scripting_effect.h" 29 #include "common/hashmap.h" 30 #include "common/queue.h" 31 #include "common/events.h" 35 class SeekableReadStream;
48 StateKey_KeyPress = 8,
49 StateKey_InventoryItem = 9,
55 StateKey_MenuState = 19,
56 StateKey_RestoreFlag = 20,
57 StateKey_Quitting = 39,
58 StateKey_LastWorld = 40,
59 StateKey_LastRoom = 41,
60 StateKey_LastNode = 42,
61 StateKey_LastView = 43,
62 StateKey_LastViewPos = 44,
63 StateKey_Menu_LastWorld = 45,
64 StateKey_Menu_LastRoom = 46,
65 StateKey_Menu_LastNode = 47,
66 StateKey_Menu_LastView = 48,
67 StateKey_Menu_LastViewPos = 49,
68 StateKey_KbdRotateSpeed = 50,
69 StateKey_Subtitles = 51,
70 StateKey_StreamSkipKey = 52,
71 StateKey_RotateSpeed = 53,
74 StateKey_VenusEnable = 58,
75 StateKey_HighQuality = 59,
76 StateKey_VideoLineSkip = 65,
77 StateKey_Platform = 66,
78 StateKey_InstallLevel = 67,
79 StateKey_CountryCode = 68,
81 StateKey_MovieCursor = 70,
82 StateKey_NoTurnAnim = 71,
84 StateKey_ShowErrorDlg = 73,
85 StateKey_DebugCheats = 74,
86 StateKey_JapanFonts = 75,
87 StateKey_ExecScopeStyle = 76,
88 StateKey_Brightness = 77,
89 StateKey_MPEGMovies = 78,
93 StateKey_EF9_Speed = 94,
94 StateKey_Inv_Cnt_Slot = 100,
95 StateKey_Inv_1_Slot = 101,
96 StateKey_Inv_49_Slot = 149,
98 StateKey_Inv_TotalSlots = 150,
99 StateKey_Inv_StartSlot = 151,
100 StateKey_Spell_1 = 191,
101 StateKey_Active_Spell = 205,
102 StateKey_Reversed_Spellbooc = 206
106 Location() : world(
'g'), room(
'a'), node(
'r'), view(
'y'), offset(0) {}
117 lhs.world == rhs.world &&
118 lhs.room == rhs.room &&
119 lhs.node == rhs.node &&
124 inline bool operator==(
const Location& lhs,
const char* rhs) {
126 return lhsStr == rhs;
130 return !(lhs == rhs);
133 inline bool operator!=(
const Location& lhs,
const char* rhs) {
134 return !(lhs == rhs);
155 PuzzleList *scopeQueue;
156 PuzzleList *execQueue;
157 PuzzleList privQueueOne;
158 PuzzleList privQueueTwo;
161 ControlList controls;
176 StateMap _globalState;
178 StateMap _globalStateFlags;
180 PuzzleMap _referenceTable;
182 ControlList *_activeControls;
184 EventList _controlEvents;
186 ScriptScope universe;
189 ScriptScope nodeview;
192 SideFXList _activeSideFx;
196 int _changeLocationDelayCycles;
198 uint32 _currentlyFocusedControl;
202 void update(uint deltaTimeMillis);
203 void queuePuzzles(uint32 key);
205 int getStateValue(uint32 key);
206 void setStateValue(uint32 key,
int value);
208 uint getStateFlag(uint32 key);
209 void setStateFlag(uint32 key, uint value);
210 void unsetStateFlag(uint32 key, uint value);
212 void addControl(
Control *control);
213 Control *getControl(uint32 key);
215 void enableControl(uint32 key);
216 void disableControl(uint32 key);
218 void focusControl(uint32 key);
220 void setFocusControlKey(uint32 key);
224 void deleteSideFx(uint32 key);
225 void stopSideFx(uint32 key);
226 void killSideFx(uint32 key);
227 void killSideFxType(ScriptingEffect::ScriptingEffectType type);
268 void changeLocation(
char world,
char room,
char node,
char view, uint32 offset);
269 void changeLocation(
const Location &_newLocation);
274 Location getCurrentLocation()
const;
288 void referenceTableAddPuzzle(uint32 key, PuzzleRef ref);
289 void addPuzzlesToReferenceTable(ScriptScope &scope);
290 void updateNodes(uint deltaTimeMillis);
291 void updateControls(uint deltaTimeMillis);
292 bool checkPuzzleCriteria(
Puzzle *puzzle, uint counter);
293 void cleanStateTable();
294 void cleanScriptScope(ScriptScope &scope);
295 bool execScope(ScriptScope &scope);
298 void ChangeLocationReal(
bool isLoading);
300 int8 inventoryGetCount();
301 void inventorySetCount(int8 cnt);
302 int16 inventoryGetItem(int8
id);
303 void inventorySetItem(int8
id, int16 item);
305 void setStateFlagSilent(uint32 key, uint value);
306 void setStateValueSilent(uint32 key,
int value);
309 void inventoryAdd(int16 item);
310 void inventoryDrop(int16 item);
311 void inventoryCycle();
320 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:144
Definition: script_manager.h:105
Definition: scripting_effect.h:45
Definition: algorithm.h:29
Definition: script_manager.h:369
Definition: keyboard.h:294