22 #ifndef MYST_SCRIPTS_MYST_H 23 #define MYST_SCRIPTS_MYST_H 25 #include "common/scummsys.h" 26 #include "common/util.h" 27 #include "mohawk/myst_scripts.h" 31 struct MystScriptEntry;
33 namespace MystStacks {
35 #define DECLARE_OPCODE(x) void x(uint16 var, const ArgumentsArray &args) 42 void disablePersistentScripts()
override;
43 void runPersistentScripts()
override;
47 uint16 getVar(uint16 var)
override;
48 void toggleVar(uint16 var)
override;
49 bool setVarValue(uint16 var, uint16 value)
override;
51 uint16 getMap()
override {
return 9934; }
53 void towerRotationMap_run();
54 virtual void libraryBookcaseTransform_run();
55 void generatorControlRoom_run();
56 void libraryCombinationBook_run();
57 void libraryBook_run();
58 void clockWheel_run();
60 void boilerPressureIncrease_run();
61 void boilerPressureDecrease_run();
62 void basementPressureIncrease_run();
63 void basementPressureDecrease_run();
65 void imagerValidation_run();
67 void observatory_run();
68 void observatoryMonthChange_run();
69 void observatoryDayChange_run();
70 void observatoryYearChange_run();
71 void observatoryTimeChange_run();
73 void clockGears_run();
78 DECLARE_OPCODE(o_libraryBookPageTurnLeft);
79 DECLARE_OPCODE(o_libraryBookPageTurnRight);
80 DECLARE_OPCODE(o_fireplaceToggleButton);
81 DECLARE_OPCODE(o_fireplaceRotation);
82 DECLARE_OPCODE(o_courtyardBoxesCheckSolution);
83 DECLARE_OPCODE(o_towerRotationStart);
84 DECLARE_OPCODE(o_towerRotationEnd);
85 DECLARE_OPCODE(o_imagerChangeSelection);
86 DECLARE_OPCODE(o_dockVaultOpen);
87 DECLARE_OPCODE(o_dockVaultClose);
88 DECLARE_OPCODE(o_bookGivePage);
89 DECLARE_OPCODE(o_clockWheelsExecute);
90 DECLARE_OPCODE(o_imagerPlayButton);
91 DECLARE_OPCODE(o_imagerEraseButton);
92 DECLARE_OPCODE(o_towerElevatorAnimation);
93 DECLARE_OPCODE(o_generatorButtonPressed);
94 DECLARE_OPCODE(o_cabinSafeChangeDigit);
95 DECLARE_OPCODE(o_cabinSafeHandleStartMove);
96 DECLARE_OPCODE(o_cabinSafeHandleMove);
97 DECLARE_OPCODE(o_cabinSafeHandleEndMove);
98 DECLARE_OPCODE(o_treePressureReleaseStart);
99 DECLARE_OPCODE(o_observatoryMonthChangeStartIncrease);
100 DECLARE_OPCODE(o_observatoryMonthChangeStartDecrease);
101 DECLARE_OPCODE(o_observatoryDayChangeStartIncrease);
102 DECLARE_OPCODE(o_observatoryDayChangeStartDecrease);
103 DECLARE_OPCODE(o_observatoryGoButton);
104 DECLARE_OPCODE(o_observatoryMonthSliderMove);
105 DECLARE_OPCODE(o_observatoryDaySliderMove);
106 DECLARE_OPCODE(o_observatoryYearSliderMove);
107 DECLARE_OPCODE(o_observatoryTimeSliderMove);
108 DECLARE_OPCODE(o_circuitBreakerStartMove);
109 DECLARE_OPCODE(o_circuitBreakerMove);
110 DECLARE_OPCODE(o_circuitBreakerEndMove);
111 DECLARE_OPCODE(o_boilerIncreasePressureStart);
112 DECLARE_OPCODE(o_boilerLightPilot);
113 DECLARE_OPCODE(o_boilerIncreasePressureStop);
114 DECLARE_OPCODE(o_boilerDecreasePressureStart);
115 DECLARE_OPCODE(o_boilerDecreasePressureStop);
116 DECLARE_OPCODE(o_basementIncreasePressureStart);
117 DECLARE_OPCODE(o_basementIncreasePressureStop);
118 DECLARE_OPCODE(o_basementDecreasePressureStart);
119 DECLARE_OPCODE(o_basementDecreasePressureStop);
120 DECLARE_OPCODE(o_rocketPianoStart);
121 DECLARE_OPCODE(o_rocketPianoMove);
122 DECLARE_OPCODE(o_rocketPianoStop);
123 DECLARE_OPCODE(o_rocketSoundSliderStartMove);
124 DECLARE_OPCODE(o_rocketSoundSliderMove);
125 DECLARE_OPCODE(o_rocketSoundSliderEndMove);
126 DECLARE_OPCODE(o_rocketLeverStartMove);
127 DECLARE_OPCODE(o_rocketOpenBook);
128 DECLARE_OPCODE(o_rocketLeverMove);
129 DECLARE_OPCODE(o_rocketLeverEndMove);
130 DECLARE_OPCODE(o_cabinLeave);
131 DECLARE_OPCODE(o_treePressureReleaseStop);
132 DECLARE_OPCODE(o_observatoryMonthSliderStartMove);
133 DECLARE_OPCODE(o_observatoryMonthSliderEndMove);
134 DECLARE_OPCODE(o_observatoryDaySliderStartMove);
135 DECLARE_OPCODE(o_observatoryDaySliderEndMove);
136 DECLARE_OPCODE(o_observatoryYearSliderStartMove);
137 DECLARE_OPCODE(o_observatoryYearSliderEndMove);
138 DECLARE_OPCODE(o_observatoryTimeSliderStartMove);
139 DECLARE_OPCODE(o_observatoryTimeSliderEndMove);
140 DECLARE_OPCODE(o_libraryBookPageTurnStartLeft);
141 DECLARE_OPCODE(o_libraryBookPageTurnStartRight);
142 DECLARE_OPCODE(o_libraryCombinationBookStop);
143 DECLARE_OPCODE(o_cabinMatchLight);
144 DECLARE_OPCODE(o_courtyardBoxEnter);
145 DECLARE_OPCODE(o_courtyardBoxLeave);
146 DECLARE_OPCODE(o_clockMinuteWheelStartTurn);
147 DECLARE_OPCODE(o_clockWheelEndTurn);
148 DECLARE_OPCODE(o_clockHourWheelStartTurn);
149 DECLARE_OPCODE(o_clockLeverStartMove);
150 DECLARE_OPCODE(o_clockLeverMoveLeft);
151 DECLARE_OPCODE(o_clockLeverMoveRight);
152 DECLARE_OPCODE(o_clockLeverEndMove);
153 DECLARE_OPCODE(o_clockResetLeverStartMove);
154 DECLARE_OPCODE(o_clockResetLeverMove);
155 DECLARE_OPCODE(o_clockResetLeverEndMove);
157 DECLARE_OPCODE(o_libraryCombinationBookStartRight);
158 DECLARE_OPCODE(o_libraryCombinationBookStartLeft);
159 DECLARE_OPCODE(o_observatoryTimeChangeStartIncrease);
160 DECLARE_OPCODE(o_observatoryTimeChangeStartDecrease);
161 DECLARE_OPCODE(o_observatoryChangeSettingStop);
162 DECLARE_OPCODE(o_observatoryYearChangeStartIncrease);
163 DECLARE_OPCODE(o_observatoryYearChangeStartDecrease);
164 DECLARE_OPCODE(o_dockVaultForceClose);
165 DECLARE_OPCODE(o_imagerEraseStop);
167 DECLARE_OPCODE(o_libraryBook_init);
168 DECLARE_OPCODE(o_courtyardBox_init);
169 DECLARE_OPCODE(o_towerRotationMap_init);
170 DECLARE_OPCODE(o_forechamberDoor_init);
171 DECLARE_OPCODE(o_shipAccess_init);
172 DECLARE_OPCODE(o_butterflies_init);
173 DECLARE_OPCODE(o_imager_init);
174 DECLARE_OPCODE(o_libraryBookcaseTransform_init);
175 DECLARE_OPCODE(o_generatorControlRoom_init);
176 DECLARE_OPCODE(o_fireplace_init);
177 DECLARE_OPCODE(o_clockGears_init);
178 DECLARE_OPCODE(o_gulls1_init);
179 DECLARE_OPCODE(o_observatory_init);
180 DECLARE_OPCODE(o_gulls2_init);
181 DECLARE_OPCODE(o_treeCard_init);
182 DECLARE_OPCODE(o_treeEntry_init);
183 DECLARE_OPCODE(o_boilerMovies_init);
184 DECLARE_OPCODE(o_rocketSliders_init);
185 DECLARE_OPCODE(o_rocketLinkVideo_init);
186 DECLARE_OPCODE(o_greenBook_init);
187 DECLARE_OPCODE(o_gulls3_init);
189 DECLARE_OPCODE(o_bookAddSpecialPage_exit);
190 DECLARE_OPCODE(o_treeCard_exit);
191 DECLARE_OPCODE(o_treeEntry_exit);
192 DECLARE_OPCODE(o_boiler_exit);
193 DECLARE_OPCODE(o_generatorControlRoom_exit);
194 DECLARE_OPCODE(o_rocketSliders_exit);
199 bool _generatorControlRoomRunning;
200 uint16 _generatorVoltage;
202 uint16 _rocketPianoSound;
208 uint16 _rocketSliderSound;
209 uint16 _rocketLeverPosition;
212 bool _libraryBookPagesTurning;
213 bool _libraryCombinationBookPagesTurning;
214 int16 _libraryBookPage;
215 uint16 _libraryBookNumPages;
216 uint16 _libraryBookBaseImage;
218 bool _butterfliesMoviePlayed;
223 uint32 _gullsNextTime;
225 bool _libraryBookcaseMoving;
227 uint16 _libraryBookcaseSoundId;
228 bool _libraryBookcaseChanged;
229 uint16 _libraryBookSound1;
230 uint16 _libraryBookSound2;
232 uint16 _courtyardBoxSound;
234 bool _imagerValidationRunning;
236 uint16 _imagerSound[4];
237 uint16 _imagerValidationCard;
238 uint16 _imagerValidationStep;
243 uint16 _fireplaceLines[6];
245 uint16 _clockTurningWheel;
249 uint16 _clockGearsPositions[3];
250 uint16 _clockWeightPosition;
251 bool _clockMiddleGearMovedAlone;
252 bool _clockLeverPulled;
254 uint16 _dockVaultState;
256 bool _towerRotationMapRunning;
257 bool _towerRotationBlinkLabel;
258 uint16 _towerRotationBlinkLabelCount;
259 uint16 _towerRotationMapInitialized;
262 uint16 _towerRotationSpeed;
263 bool _towerRotationMapClicked;
264 bool _towerRotationOverSpot;
268 uint16 _matchGoOutCnt;
269 uint16 _cabinDoorOpened;
270 uint16 _cabinHandleDown;
271 uint16 _cabinMatchState;
272 uint32 _matchGoOutTime;
276 bool _cabinGaugeMovieEnabled;
279 bool _boilerPressureIncreasing;
280 bool _boilerPressureDecreasing;
281 bool _basementPressureIncreasing;
282 bool _basementPressureDecreasing;
287 uint16 _treeMinPosition;
288 uint16 _treeMinAccessiblePosition;
289 uint16 _treeMaxAccessiblePosition;
291 bool _observatoryRunning;
292 bool _observatoryMonthChanging;
293 bool _observatoryDayChanging;
294 bool _observatoryYearChanging;
295 bool _observatoryTimeChanging;
302 uint32 _observatoryLastTime;
303 bool _observatoryNotInitialized;
304 int16 _observatoryIncrement;
307 bool _greenBookRunning;
309 void generatorRedrawRocket();
310 void generatorButtonValue(
MystArea *button, uint16 &offset, uint16 &value);
312 void rocketSliderMove();
313 uint16 rocketSliderGetSound(uint16 pos);
314 uint16 rocketCheckIfSoundMatches(uint16 sound1, uint16 sound2);
315 void rocketCheckSolution();
317 void libraryBookPageTurnLeft();
318 void libraryBookPageTurnRight();
319 void libraryCombinationBookTurnRight();
320 void libraryCombinationBookTurnLeft();
322 uint16 bookCountPages(uint16 var);
324 void clockWheelStartTurn(uint16 wheel);
325 void clockWheelTurn(uint16 var);
327 void clockLeverMove(
bool leftLever);
328 void clockGearForwardOneStep(uint16 gear);
329 void clockWeightDownOneStep();
330 void clockGearsCheckSolution();
332 void clockResetWeight();
333 void clockResetGear(uint16 gear);
335 void towerRotationMapRotate();
336 void towerRotationMapRedraw();
337 void towerRotationDrawBuildings();
338 uint16 towerRotationMapComputeAngle();
340 void towerRotationMapDrawLine(
const Common::Point &end,
bool rotationLabelVisible);
342 void boilerFireInit();
343 void boilerFireUpdate(
bool init);
344 void boilerGaugeInit();
348 void treeSetAlcoveAccessible();
349 uint32 treeNextMoveDelay(uint16 pressure);
351 bool observatoryIsDDMMYYYY2400();
352 void observatorySetTargetToSetting();
353 void observatoryUpdateVisualizer(uint16 x, uint16 y);
354 void observatoryMonthChangeStart(
bool increase);
355 void observatoryDayChangeStart(
bool increase);
356 void observatoryYearChangeStart(
bool increase);
357 void observatoryTimeChangeStart(
bool increase);
358 void observatoryIncrementMonth(int16 increment);
359 void observatoryIncrementDay(int16 increment);
360 void observatoryIncrementYear(int16 increment);
361 void observatoryIncrementTime(int16 increment);
362 void observatoryUpdateMonth();
363 void observatoryUpdateDay();
364 void observatoryUpdateYear();
365 void observatoryUpdateTime();
371 #undef DECLARE_OPCODE Definition: myst_areas.h:107
Definition: rational.h:40
Definition: myst_scripts.h:60
Definition: myst_areas.h:216
Definition: myst_areas.h:59
Definition: myst_areas.h:154
Definition: myst_state.h:192