22 #ifndef MYST_SCRIPTS_MECHANICAL_H 23 #define MYST_SCRIPTS_MECHANICAL_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 9931; }
54 void elevatorRotation_run();
55 void elevatorGoMiddle_run();
56 void fortressRotation_run();
57 void fortressSimulation_run();
66 DECLARE_OPCODE(o_throneEnablePassage);
67 DECLARE_OPCODE(o_birdCrankStart);
68 DECLARE_OPCODE(o_birdCrankStop);
69 DECLARE_OPCODE(o_snakeBoxTrigger);
70 DECLARE_OPCODE(o_fortressStaircaseMovie);
71 DECLARE_OPCODE(o_elevatorRotationStart);
72 DECLARE_OPCODE(o_elevatorRotationMove);
73 DECLARE_OPCODE(o_elevatorRotationStop);
74 DECLARE_OPCODE(o_fortressRotationSpeedStart);
75 DECLARE_OPCODE(o_fortressRotationSpeedMove);
76 DECLARE_OPCODE(o_fortressRotationSpeedStop);
77 DECLARE_OPCODE(o_fortressRotationBrakeStart);
78 DECLARE_OPCODE(o_fortressRotationBrakeMove);
79 DECLARE_OPCODE(o_fortressRotationBrakeStop);
80 DECLARE_OPCODE(o_fortressSimulationSpeedStart);
81 DECLARE_OPCODE(o_fortressSimulationSpeedMove);
82 DECLARE_OPCODE(o_fortressSimulationSpeedStop);
83 DECLARE_OPCODE(o_fortressSimulationBrakeStart);
84 DECLARE_OPCODE(o_fortressSimulationBrakeMove);
85 DECLARE_OPCODE(o_fortressSimulationBrakeStop);
86 DECLARE_OPCODE(o_elevatorWindowMovie);
87 DECLARE_OPCODE(o_elevatorGoMiddle);
88 DECLARE_OPCODE(o_elevatorTopMovie);
89 DECLARE_OPCODE(o_fortressRotationSetPosition);
90 DECLARE_OPCODE(o_mystStaircaseMovie);
91 DECLARE_OPCODE(o_elevatorWaitTimeout);
92 DECLARE_OPCODE(o_crystalEnterYellow);
93 DECLARE_OPCODE(o_crystalEnterGreen);
94 DECLARE_OPCODE(o_crystalEnterRed);
95 DECLARE_OPCODE(o_crystalLeaveYellow);
96 DECLARE_OPCODE(o_crystalLeaveGreen);
97 DECLARE_OPCODE(o_crystalLeaveRed);
99 DECLARE_OPCODE(o_throne_init);
100 DECLARE_OPCODE(o_fortressStaircase_init);
101 DECLARE_OPCODE(o_bird_init);
102 DECLARE_OPCODE(o_snakeBox_init);
103 DECLARE_OPCODE(o_elevatorRotation_init);
104 DECLARE_OPCODE(o_fortressRotation_init);
105 DECLARE_OPCODE(o_fortressSimulation_init);
106 DECLARE_OPCODE(o_fortressSimulationStartup_init);
110 bool _mystStaircaseState;
112 bool _fortressRotationRunning;
113 bool _gearsWereRunning;
114 uint16 _fortressRotationSpeed;
115 uint16 _fortressRotationBrake;
116 uint16 _fortressDirection;
117 uint16 _fortressRotationSounds[4];
120 bool _fortressRotationShortMovieWorkaround;
121 uint32 _fortressRotationShortMovieCount;
122 uint32 _fortressRotationShortMovieLast;
124 bool _fortressSimulationRunning;
125 bool _fortressSimulationInit;
126 uint16 _fortressSimulationSpeed;
127 uint16 _fortressSimulationBrake;
128 uint16 _fortressSimulationStartSound1;
129 uint16 _fortressSimulationStartSound2;
134 double _fortressSimulationHoloRate;
137 uint16 _elevatorGoingDown;
139 float _elevatorRotationSpeed;
140 float _elevatorRotationGearPosition;
141 uint16 _elevatorRotationSoundId;
142 bool _elevatorRotationLeverMoving;
144 bool _elevatorGoingMiddle;
145 bool _elevatorTooLate;
146 uint16 _elevatorPosition;
147 bool _elevatorInCabin;
148 uint16 _elevatorTopCounter;
149 uint32 _elevatorNextTime;
154 uint32 _birdCrankStartTime;
155 uint32 _birdSingEndTime;
165 #undef DECLARE_OPCODE Definition: myst_areas.h:107
Definition: mechanical.h:37
Definition: myst_scripts.h:60
Definition: myst_state.h:269