ScummVM API documentation
global.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#ifndef MADS_NEBULAR_GLOBAL_H
23#define MADS_NEBULAR_GLOBAL_H
24
25#include "common/serializer.h"
26#include "mads/core/vocabh.h"
27
28namespace MADS {
29namespace RexNebular {
30
31namespace Rooms {
32extern int16 g_sprite_ids[30];
33extern int16 g_sequence_ids[30];
34} // namespace Rooms
35
36enum GlobalId {
37 kSexOfRex = 0,
38 kOldSexOfRex = 1,
39 kWalkerTiming = 2,
40// kWalkerTiming0 = 3,
41 kTalkInanimateCount = 4,
42 kCopyProtectFailed = 5,
43
44 /* Section #1 variables */
45 kNeedToStandUp = 10,
46 kTurkeyExploded = 11,
47 kMedicineCabinetOpen = 12,
48 kMedicineCabinetVirgin = 13,
49 kWatchedViewScreen = 14,
50 kHoovicAlive = 15,
51 kHoovicSated = 16,
52 kHoovicFishEaten = 17,
53 kWaterInAPuddle = 18,
54 kFishIn105 = 19,
55 kFishIn107 = 20,
56 kFishIn108 = 21,
57 kRandomNumber = 29,
58
59 /* Section #2 variables */
60 kCurtainOpen = 30,
61 kLadderBroken = 31,
62 kBone202Status = 32,
63 kMeteorologistStatus = 33,
64 kRhotundaStatus = 34,
65 kLeavesStatus = 35,
66 kMonkeyStatus = 36,
67 kMeteorologistEverSeen = 37,
68 kMeteorologistWatch = 38,
69 kTeleporterCommand = 39,
70
71 kTeleporterDestination = 40,
72 kTeleporterUnderstood = 41,
73 kConv205 = 42,
74 kChickenPermitted = 43,
75 kTwinklesStatus = 44,
76 kTwinklesApproached = 45,
77 kConvTwinkles1 = 46,
78 kConvTwinkles2 = 47,
79 kConvTwinkles3 = 48,
80 kConvTwinkles5 = 49,
81
82 kConvTwinkles6 = 50,
83 kConvTwinkles7 = 51,
84 kConvTwinkles8 = 52,
85 kBlowgunStatus = 53,
86
87 /* Section #3 Variables */
88 kAfterHavoc = 60,
89 kHaveYourStuff = 61,
90 kRightView320 = 62,
91 kConvBuddy1 = 63,
92 kConvBuddy2 = 64,
93 kMetBuddyBeast = 65,
94 kKnowsBuddyBeast = 66,
95 kConvSlache1 = 67,
96 kConvSlache2 = 68,
97 kConvSlache3 = 69,
98
99 kRexHasMetSlache = 70,
100 kConvIntern = 71,
101 kHasSeenProfPyro = 72,
102 kKickedIn391Grate = 73,
103
104 /* Section #4 Variables */
105 kArmoryDoorOpen = 80,
106 kStorageDoorOpen = 81,
107 kNextIngredient = 82,
108 kIngredientList = 83,
109 kIngredientList1 = 84,
110 kIngredientList2 = 85,
111 kIngredientList3 = 86,
112 kIngredientQuantity = 87,
113 kIngredientQuantity1 = 88,
114 kIngredientQuantity2 = 89,
115
116 kIngredientQuantity3 = 90,
117 kconvPyro_1 = 91,
118 kconvPyro_2 = 92,
119 kconvPyro_3 = 93,
120 kconvPyro_4 = 94,
121 kBadFirstIngredient = 95,
122 kConvBartender1 = 96,
123 kConvBartender2 = 97,
124 kConvBartender3 = 98,
125 kConvBartender4 = 99,
126
127 kHasPurchased = 100,
128 kBeenThruHelgaScene = 101,
129 kHasSaidBinocs = 102,
130 kHasSaidTimer = 103,
131 kBottleDisplayed = 104,
132 kHasBeenScanned = 105,
133 kSomeoneHasExploded = 106,
134
135 /* Section #5 Variables */
136 kBoatRaised = 110,
137 kCarStatus = 111,
138 kCityFlooded = 112,
139 kLaserOn = 113,
140 kLaserHoleIsThere = 114,
141 kCarIsGone = 115,
142 kRegisterOpen = 116,
143 kSafeStatus = 117,
144 kDogStatus = 118,
145 kLineStatus = 119,
146
147 kHoverCarLocation = 120,
148 kHoverCarDestination = 121,
149
150 /* Section #6 Variables */
151 kConvHermit1 = 130,
152 kConvHermit2 = 131,
153 kHasTalkedToHermit = 132,
154 kHermitWantsBatteries = 133,
155 kHandsetCellStatus = 134,
156 kBeenInVideoStore = 135,
157 kDurafailRecharged = 136,
158 kPenlightCellStatus = 137,
159 kTimebombStatus = 138,
160 kCheckDaemonTimebomb = 140,
161
162 kResurrectRoom = 141,
163
164 /* Section #6 Time-Bomb Variables */
165 kTimebombClock = 142,
166// kTimebombClock0 = 143,
167 kTimebombTimer = 144,
168// kTimebombTimer0 = 145,
169 kWarnedFloodCity = 146,
170
171 /* Section #7 Variables */
172 kBottleStatus = 150,
173 kMonsterAlive = 151,
174 kConvBottleFillNode = 152,
175 kBoatStatus = 153,
176
177 /* Section #8 Variables */
178 kAntigravClock = 160,
179// kAntigravClock0 = 161,
180 kAntigravTiming = 162,
181// kAntigravTiming0 = 163,
182 kWindowFixed = 164,
183 kInSpace = 165,
184 kReturnFromCut = 166,
185 kBeamIsUp = 167,
186 kForceBeamDown = 168,
187 kCameFromCut = 169,
188
189 kCutX = 170,
190 kCutY = 171,
191 kCutFacing = 172,
192 kDontRepeat = 173,
193 kHoppyDead = 174,
194 kHasWatchedAntigrav = 175,
195 kRemoteSequenceRan = 176,
196 kRemoteOnGround = 177,
197 kFromCockpit = 178,
198 kExitShip = 179,
199
200 kBetweenRooms = 180,
201 kTopButtonPushed = 181,
202 kTargetModInstalled = 182,
203 kShieldModInstalled = 183,
204 kUpBecauseOfRemote = 184,
205
206 kTeleporterRoom = 190,
207 kTeleporterCode = 200
208};
209
210enum {
211 SEX_MALE = 0, SEX_UNKNOWN = 1, SEX_FEMALE = 2
212};
213
214
215// Enums used for specific individual globals
216// Section #1
217// Rex's sex/swimming state
218enum {
219 REX_MALE = 0, REX_MALE_SWIMMER = 1, REX_FEMALE = 2
220};
221
222// Section #2
223// State of Meteorologist in the outpost
224enum {
225 METEOROLOGIST_ABSENT = 0, METEOROLOGIST_PRESENT = 1, METEOROLOGIST_GONE = 2
226};
227
228// State of watching the Meteorologist
229enum {
230 METEOROLOGIST_NORMAL = 0, METEOROLOGIST_GROUND = 1, METEOROLOGIST_TOWER = 2
231};
232
233// The fat bouncy lady that can squish you on the plains
234enum {
235 RHOTUNDA_HUNGRY = 0, RHOTUNDA_STUCK = 1, RHOTUNDA_GONE = 2
236};
237
238// Flags for the bones you can take
239enum {
240 BONE_202_LEFT_GONE = 1, BONE_202_RIGHT_GONE = 2
241};
242
243// Leaves used to cover the trap
244enum {
245 LEAVES_ON_GROUND = 0, LEAVES_WITH_PLAYER = 1, LEAVES_ON_TRAP = 2
246};
247
248// Monkey ambush state
249enum {
250 MONKEY_AMBUSH_READY = 0, MONKEY_HAS_BINOCULARS = 1, MONKEY_IS_GONE = 2
251};
252
253// Teleporter status flags
254enum {
255 TELEPORTER_NONE = 0, TELEPORTER_BEAM_IN = 1, TELEPORTER_BEAM_OUT = 2,
256 TELEPORTER_STEP_OUT = 3, TELEPORTER_WRONG = 4
257};
258
259// Twinkles status
260enum {
261 TWINKLES_AT_HOME = 0, TWINKLES_GONE = 1
262};
263
264// Section #4
265// Status of the explosives
266enum {
267 EXPLOSIVES_INSIDE = 3
268};
269
270// Section #5
271// Dog status (room 602, outside Abdul's garage)
272enum {
273 DOG_PRESENT = 1, DOG_LEFT = 2, DOG_GONE = 3, DOG_DEAD = 4
274};
275
276// Dog status (room 608, inside Abdul's garage)
277enum {
278 CAR_UP = 0, CAR_SQUASHES_DOG = 1, CAR_SQUASHES_DOG_AGAIN = 2, CAR_DOWN = 3, CAR_DOWN_ON_SQUASHED_DOG = 4
279};
280
281enum {
282 SAFE_CLOSED = 0, SAFE_OPENED = 1, SAFE_CLOSED_WITH_HOLE = 2, SAFE_OPENED_WITH_HOLE = 3
283};
284
285enum {
286 LINE_NOT_DROPPED = 1, LINE_DROPPED = 2, LINE_TIED = 3, LINE_NOW_UNTIED = 4
287};
288
289// Section #6
290enum {
291 NO_CELLS = 0, // Handset doesn't contain any cells
292 CHARGED_DURAFAIL = 1, // Handset has charged durafail cells
293 UNCHARGED_DURAFAIL = 2, // Handset has uncharged durafail cells */
294 PHONE_CELLS = 3, // Handset has already charged phone cells
295 FIRST_TIME_PHONE_CELLS = 4, // First time phone cells are in the handset
296 FIRST_TIME_UNCHARGED_DURAFAIL = 5, // First time uncharged cells are in penlight
297 FIRST_TIME_CHARGED_DURAFAIL = 6 // First time charged cells are in penlight
298};
299
300// Time bomb status
301enum {
302 TIMEBOMB_DEACTIVATED = 0, TIMEBOMB_ACTIVATED = 1,
303 TIMEBOMB_BLOW_UP = 2, TIMEBOMB_DEAD = 3
304};
305
306/* Section #7 */
307// Status of the bottle
308enum {
309 BOTTLE_EMPTY = 0, BOTTLE_ONE_QUARTER_FULL = 1, BOTTLE_HALF_FULL = 2,
310 BOTTLE_THREE_QUARTERS_FULL = 3, BOTTLE_FULL = 4
311};
312
313// Status of the boat
314enum {
315 BOAT_UNFLOODED = 0, BOAT_ADRIFT = 1, BOAT_TIED_FLOATING = 2,
316 BOAT_TIED = 3, BOAT_GONE = 4
317};
318
319/* Miscellaneous defines */
320#define TELEPORTER_COUNT 10 // Total number of teleporters
321#define TELEPORTER_WORK_COUNT 6 // Total number that actually work
322
323#define FONT_CONVERSATION "*FONTCONV.FF"
324#define FONT_INTERFACE "*FONTINTR.FF"
325
326#define INDEFINITE_TIMEOUT 9999999
327
328#define READGLOBAL32(INDEX) ((int32)global[INDEX] | ((int32)global[INDEX + 1] << 16))
329#define WRITEGLOBAL32(INDEX, VALUE) { uint32 v = VALUE; global[INDEX] = v & 0xffff; global[INDEX+1] = v >> 16; } while(0)
330
331extern void global_init_code();
332extern void global_section_constructor();
333extern void sync_room(Common::Serializer &s);
334
335} // namespace RexNebular
336} // namespace MADS
337
338#endif
Definition: serializer.h:80