ScummVM API documentation
awaymission.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 STARTREK_AWAYMISSION_H
23 #define STARTREK_AWAYMISSION_H
24 
25 // All variables here get cleared to 0 upon starting an away mission.
26 // NOTE: Any changes here must be reflected in the corresponding serializer functions.
27 struct AwayMission {
28  // These timers count down automatically when nonzero. When they reach 0,
29  // ACTION_TIMER_EXPIRED is invoked with the corresponding index (0-7).
30  int16 timers[8]; // 0x00-0x0f
31 
32  int16 mouseX; // 0x10
33  int16 mouseY; // 0x12
34  int16 crewGetupTimers[4]; // 0x14
35  bool disableWalking; // 0x1c
36 
37  // 0 / false: input enabled
38  // 1 / true: input disabled, turns back on after walking or beaming into a room
39  // 2: input disabled, doesn't turn back on after walking or beaming into room
40  byte disableInput; // 0x1d
41 
42  bool redshirtDead; // 0x1e
43  char activeAction; // 0x1f
44  byte activeObject; // 0x20; The item that is going to be used on something
45  byte passiveObject; // 0x21; The item that the active item is used on (or the item looked at, etc).
46 
47  // If this is true after calling room-specific RDF code, the game will continue to run
48  // any "default" code for the event, if any.
49  bool rdfStillDoDefaultAction; // 0x23
50 
51  // If a bit in "crewDownBitset" is set, the corresponding timer in "crewGetupTimers"
52  // begins counting down. When it reaches 0, they get up.
53  byte crewDownBitset; // 0x24
54 
55  int8 crewDirectionsAfterWalk[4]; // 0x25: Sets an object's direction after they finish walking somewhere?
56 
57  // Mission-specific variables
58  union {
59  // Demon World (TODO: label remaining generic variables)
60  struct {
61  bool wasRudeToPrelate; // 0x29
62  bool insultedStephen; // 0x2b
63  bool field2d; // 0x2d
64  bool beatKlingons; // 0x2f
65  bool tookKlingonHand; // 0x31
66 
67  bool talkedToPrelate; // 0x33
68  bool stephenWelcomedToStudy; // 0x34
69  bool prelateWelcomedCrew; // 0x35
70  bool askedPrelateAboutSightings; // 0x36
71  byte field37; // 0x37
72  bool mccoyMentionedFlora; // 0x38
73  byte numBouldersGone; // 0x39
74  byte enteredFrom; // 0x3a
75  bool repairedHand; // 0x3b
76  bool healedMiner; // 0x3c
77  bool curedChub; // 0x3d
78  bool field3e; // 0x3e
79  bool knowAboutHypoDytoxin; // 0x3f
80  bool minerDead; // 0x40
81  byte field41; // 0x41
82  bool foundMiner; // 0x43
83  bool field45; // 0x45
84  bool gaveSkullToNauian; // 0x47
85  bool warpsDisabled; // 0x48
86  bool boulder1Gone; // 0x49
87  bool boulder2Gone; // 0x4a
88  bool boulder3Gone; // 0x4b
89  bool boulder4Gone; // 0x4c
90  bool doorOpened; // 0x4d
91  bool solvedSunPuzzle; // 0x4e
92  byte itemsTakenFromCase; // 0x4f
93  bool gotBerries; // 0x50
94  bool madeHypoDytoxin; // 0x51
95  bool metNauian; // 0x53
96  bool gavePointsForDytoxin; // 0x54
97  bool lookedAtComputer; // 0x55
98  byte field56; // 0x56
99  bool foundAlienRoom; // 0x57
100  int16 missionScore; // 0x58
101 
102  void saveLoadWithSerializer(Common::Serializer &ser) {
103  ser.syncAsByte(wasRudeToPrelate);
104  ser.syncAsByte(insultedStephen);
105  ser.syncAsByte(field2d);
106  ser.syncAsByte(beatKlingons);
107  ser.syncAsByte(tookKlingonHand);
108  ser.syncAsByte(talkedToPrelate);
109  ser.syncAsByte(stephenWelcomedToStudy);
110  ser.syncAsByte(prelateWelcomedCrew);
111  ser.syncAsByte(askedPrelateAboutSightings);
112  ser.syncAsByte(field37);
113  ser.syncAsByte(mccoyMentionedFlora);
114  ser.syncAsByte(numBouldersGone);
115  ser.syncAsByte(enteredFrom);
116  ser.syncAsByte(repairedHand);
117  ser.syncAsByte(healedMiner);
118  ser.syncAsByte(curedChub);
119  ser.syncAsByte(field3e);
120  ser.syncAsByte(knowAboutHypoDytoxin);
121  ser.syncAsByte(minerDead);
122  ser.syncAsByte(field41);
123  ser.syncAsByte(foundMiner);
124  ser.syncAsByte(field45);
125  ser.syncAsByte(gaveSkullToNauian);
126  ser.syncAsByte(warpsDisabled);
127  ser.syncAsByte(boulder1Gone);
128  ser.syncAsByte(boulder2Gone);
129  ser.syncAsByte(boulder3Gone);
130  ser.syncAsByte(boulder4Gone);
131  ser.syncAsByte(doorOpened);
132  ser.syncAsByte(solvedSunPuzzle);
133  ser.syncAsByte(itemsTakenFromCase);
134  ser.syncAsByte(gotBerries);
135  ser.syncAsByte(madeHypoDytoxin);
136  ser.syncAsByte(metNauian);
137  ser.syncAsByte(gavePointsForDytoxin);
138  ser.syncAsByte(lookedAtComputer);
139  ser.syncAsByte(field56);
140  ser.syncAsByte(foundAlienRoom);
141  ser.syncAsSint16LE(missionScore);
142  }
143  } demon;
144 
145  // Hijacked
146  struct {
147  int16 missionScore; // 0x29
148  int16 field2b; // 0x2b
149  int16 field2d; // 0x2d
150  bool engineerConscious; // 0x30
151  byte field35; // 0x35
152  bool gotWires; // 0x37
153  byte orbitalDecayCounter; // 0x3b
154  bool bridgeElasiDrewPhasers; // 0x3d
155  bool talkedToCereth; // 0x3e
156  bool gotJunkPile; // 0x3f
157  bool gotTransmogrifier; // 0x43
158  bool transporterRepaired; // 0x44
159  bool spockExaminedTransporter; // 0x45
160  bool usedTransmogrifierOnTransporter; // 0x46
161  bool bridgeForceFieldDown; // 0x47
162  bool savedPrisoners; // 0x48
163  bool haveBomb; // 0x49
164  bool brigElasiPhasersOnKill; // 0x4a
165  byte elasiTargetIndex; // 0x4b
166  byte guard1Status; // 0x4c
167  byte guard2Status; // 0x4d
168  byte field4e; // 0x4e
169  byte crewmanKilled[4]; // 0x4f
170  byte bridgeElasi1Status; // 0x53
171  byte bridgeElasi2Status; // 0x54
172  byte bridgeElasi3Status; // 0x55
173  byte bridgeElasi4Status; // 0x56
174  bool brigForceFieldDown; // 0x58
175  byte field59; // 0x59
176  byte field5b; // 0x5b
177  bool elasiSurrendered; // 0x5c
178  byte kirkPhaserDrawn; // 0x5d
179 
180  // 1: Decided to shoot them
181  // 2: Talked, and they surrendered immediately
182  // 3: They deorbited the ship (and perhaps surrendered after)
183  byte bridgeWinMethod; // 0x5e
184 
185  bool talkedToBrigCrewman; // 0x5f
186 
187  void saveLoadWithSerializer(Common::Serializer &ser) {
188  ser.syncAsSint16LE(missionScore);
189  ser.syncAsSint16LE(field2b);
190  ser.syncAsSint16LE(field2d);
191  ser.syncAsByte(engineerConscious);
192  ser.syncAsByte(field35);
193  ser.syncAsByte(gotWires);
194  ser.syncAsByte(orbitalDecayCounter);
195  ser.syncAsByte(bridgeElasiDrewPhasers);
196  ser.syncAsByte(talkedToCereth);
197  ser.syncAsByte(gotJunkPile);
198  ser.syncAsByte(gotTransmogrifier);
199  ser.syncAsByte(transporterRepaired);
200  ser.syncAsByte(spockExaminedTransporter);
201  ser.syncAsByte(usedTransmogrifierOnTransporter);
202  ser.syncAsByte(bridgeForceFieldDown);
203  ser.syncAsByte(savedPrisoners);
204  ser.syncAsByte(haveBomb);
205  ser.syncAsByte(brigElasiPhasersOnKill);
206  ser.syncAsByte(elasiTargetIndex);
207  ser.syncAsByte(guard1Status);
208  ser.syncAsByte(guard2Status);
209  ser.syncAsByte(field4e);
210  ser.syncBytes(crewmanKilled, 4);
211  ser.syncAsByte(bridgeElasi1Status);
212  ser.syncAsByte(bridgeElasi2Status);
213  ser.syncAsByte(bridgeElasi3Status);
214  ser.syncAsByte(bridgeElasi4Status);
215  ser.syncAsByte(brigForceFieldDown);
216  ser.syncAsByte(field59);
217  ser.syncAsByte(field5b);
218  ser.syncAsByte(elasiSurrendered);
219  ser.syncAsByte(kirkPhaserDrawn);
220  ser.syncAsByte(bridgeWinMethod);
221  ser.syncAsByte(talkedToBrigCrewman);
222  }
223  } tug;
224 
225  // Love's Labor Jeopardized
226  struct {
227  bool alreadyStartedMission; // 0x29
228  bool knowAboutVirus; // 0x2a
229  bool romulansUnconsciousFromLaughingGas; // 0x2b
230  bool releasedHumanLaughingGas; // 0x2c
231  bool releasedRomulanLaughingGas; // 0x2d
232  bool chamberHasCure; // 0x2e
233  bool freezerOpen; // 0x2f
234  bool chamberHasDish; // 0x30
235  byte bottleInNozzle; // 0x31
236  bool cabinetOpen; // 0x32
237  bool gasFeedOn; // 0x33
238  byte synthesizerBottleIndex; // 0x34
239  byte synthesizerContents; // 0x35
240  byte canister1; // 0x36
241  byte canister2; // 0x37
242  bool servicePanelOpen; // 0x38
243  bool gasTankUnscrewed; // 0x39
244  bool wrenchTaken; // 0x3a
245  bool tookN2TankFromServicePanel; // 0x3b
246  bool field3c; // 0x3c
247  bool grateRemoved; // 0x3d
248  bool insulationOnGround; // 0x3e
249  bool visitedRoomWithRomulans; // 0x3f
250  bool romulansCured; // 0x40
251  bool romulansUnconsciousFromVirus; // 0x41
252  bool freedMarcusAndCheever; // 0x42
253  bool preaxCured; // 0x43
254  byte spockInfectionCounter; // 0x45: When this reached 100, Spock dies.
255  bool spockCured; // 0x46
256  bool contactedEnterpriseBeforeCure; // 0x47
257  bool contactedEnterpriseAfterCure; // 0x48
258  bool spockAccessedConsole; // 0x49
259  bool mccoyAccessedConsole; // 0x4a
260  bool gotPolyberylcarbonate; // 0x4b
261  bool gotTLDH; // 0x4c (Got romulan laughing gas)
262  bool gotPointsForOpeningGrate; // 0x4d
263  bool gotPointsForGassingRomulans; // 0x4e
264  bool gotCure; // 0x4f
265  bool gotPointsForHydratingPreax; // 0x50
266  bool gotPointsForHydratingRomulans; // 0x51
267  int16 missionScore; // 0x52
268 
269  void saveLoadWithSerializer(Common::Serializer &ser) {
270  ser.syncAsByte(alreadyStartedMission);
271  ser.syncAsByte(knowAboutVirus);
272  ser.syncAsByte(romulansUnconsciousFromLaughingGas);
273  ser.syncAsByte(releasedHumanLaughingGas);
274  ser.syncAsByte(releasedRomulanLaughingGas);
275  ser.syncAsByte(chamberHasCure);
276  ser.syncAsByte(freezerOpen);
277  ser.syncAsByte(chamberHasDish);
278  ser.syncAsByte(bottleInNozzle);
279  ser.syncAsByte(cabinetOpen);
280  ser.syncAsByte(gasFeedOn);
281  ser.syncAsByte(synthesizerBottleIndex);
282  ser.syncAsByte(synthesizerContents);
283  ser.syncAsByte(canister1);
284  ser.syncAsByte(canister2);
285  ser.syncAsByte(servicePanelOpen);
286  ser.syncAsByte(gasTankUnscrewed);
287  ser.syncAsByte(wrenchTaken);
288  ser.syncAsByte(tookN2TankFromServicePanel);
289  ser.syncAsByte(field3c);
290  ser.syncAsByte(grateRemoved);
291  ser.syncAsByte(insulationOnGround);
292  ser.syncAsByte(visitedRoomWithRomulans);
293  ser.syncAsByte(romulansCured);
294  ser.syncAsByte(romulansUnconsciousFromVirus);
295  ser.syncAsByte(freedMarcusAndCheever);
296  ser.syncAsByte(preaxCured);
297  ser.syncAsByte(spockInfectionCounter);
298  ser.syncAsByte(spockCured);
299  ser.syncAsByte(contactedEnterpriseBeforeCure);
300  ser.syncAsByte(contactedEnterpriseAfterCure);
301  ser.syncAsByte(spockAccessedConsole);
302  ser.syncAsByte(mccoyAccessedConsole);
303  ser.syncAsByte(gotPolyberylcarbonate);
304  ser.syncAsByte(gotTLDH);
305  ser.syncAsByte(gotPointsForOpeningGrate);
306  ser.syncAsByte(gotPointsForGassingRomulans);
307  ser.syncAsByte(gotCure);
308  ser.syncAsByte(gotPointsForHydratingPreax);
309  ser.syncAsByte(gotPointsForHydratingRomulans);
310  ser.syncAsSint16LE(missionScore);
311  }
312  } love;
313 
314  struct {
315  // 0: Haven't entered first room yet
316  // 1: Have entered first room once
317  // 2: Mudd is gone from first room
318  byte muddFirstRoomState; // 0x29
319 
320  bool torpedoLoaded; // 0x33
321  bool knowAboutTorpedo; // 0x34
322  bool discoveredBase3System; // 0x35
323  bool translatedAlienLanguage; // 0x36
324  bool databaseDestroyed; // 0x37
325  bool muddInDatabaseRoom; // 0x38
326  bool muddCurrentlyInsane; // 0x39
327  bool computerDataErasedOrDestroyed; // 0x3a
328  bool muddErasedDatabase; // 0x3b
329 
330  // True if you've combined the lense + degrimer and fired it off, discovering
331  // it's a weapon
332  bool discoveredLenseAndDegrimerFunction; // 0x3c
333 
334  int16 torpedoStatus; // 0x3d
335  bool muddUnavailable; // 0x3f
336  bool muddVisitedDatabaseRoom; // 0x40
337  bool accessedAlienDatabase; // 0x41
338  bool tookRepairTool; // 0x42
339  bool gotPointsForDownloadingData; // 0x43
340  bool contactedEnterpriseFirstTime; // 0x44
341  bool viewScreenEnabled; // 0x45
342  bool lifeSupportMalfunctioning; // 0x46
343  byte numTimesEnteredRoom5; // 0x47
344  bool gotMemoryDisk; // 0x48
345  bool gotLense; // 0x49
346  bool gotDegrimer; // 0x4a
347  bool putCapsuleInMedicalMachine; // 0x4c
348  bool muddUnconscious; // 0x4d
349 
350  // 0: haven't entered room yet
351  // 1: will go insane next time room is entered (if he's available)
352  // 2: currently insane (or unconscious)
353  // 3: cured
354  byte muddInsanityState; // 0x4e
355 
356  bool muddInhaledGas; // 0x4f (mostly the same as "muddCurrentlyInsane"?)
357  int16 lifeSupportTimer; // 0x50
358  bool startedLifeSupportTimer; // 0x52
359  bool enteredRoom0ForFirstTime; // 0x54
360  bool gotPointsForLoadingTorpedo; // 0x55
361  bool gotPointsForPressingRedButton; // 0x56
362  bool gotPointsForEnablingViewscreen; // 0x57
363  bool enteredRoom1ForFirstTime; // 0x58
364  bool repairedLifeSupportGenerator; // 0x59
365  int16 missionScore; // 0x5a
366 
367  void saveLoadWithSerializer(Common::Serializer &ser) {
368  ser.syncAsByte(muddFirstRoomState);
369  ser.syncAsByte(torpedoLoaded);
370  ser.syncAsByte(knowAboutTorpedo);
371  ser.syncAsByte(discoveredBase3System);
372  ser.syncAsByte(translatedAlienLanguage);
373  ser.syncAsByte(databaseDestroyed);
374  ser.syncAsByte(muddInDatabaseRoom);
375  ser.syncAsByte(muddCurrentlyInsane);
376  ser.syncAsByte(computerDataErasedOrDestroyed);
377  ser.syncAsByte(muddErasedDatabase);
378  ser.syncAsByte(discoveredLenseAndDegrimerFunction);
379  ser.syncAsSint16LE(torpedoStatus);
380  ser.syncAsByte(muddUnavailable);
381  ser.syncAsByte(muddVisitedDatabaseRoom);
382  ser.syncAsByte(accessedAlienDatabase);
383  ser.syncAsByte(tookRepairTool);
384  ser.syncAsByte(gotPointsForDownloadingData);
385  ser.syncAsByte(contactedEnterpriseFirstTime);
386  ser.syncAsByte(viewScreenEnabled);
387  ser.syncAsByte(lifeSupportMalfunctioning);
388  ser.syncAsByte(numTimesEnteredRoom5);
389  ser.syncAsByte(gotMemoryDisk);
390  ser.syncAsByte(gotLense);
391  ser.syncAsByte(gotDegrimer);
392  ser.syncAsByte(putCapsuleInMedicalMachine);
393  ser.syncAsByte(muddUnconscious);
394  ser.syncAsByte(muddInsanityState);
395  ser.syncAsByte(muddInhaledGas);
396  ser.syncAsSint16LE(lifeSupportTimer);
397  ser.syncAsByte(startedLifeSupportTimer);
398  ser.syncAsByte(enteredRoom0ForFirstTime);
399  ser.syncAsByte(gotPointsForLoadingTorpedo);
400  ser.syncAsByte(gotPointsForPressingRedButton);
401  ser.syncAsByte(gotPointsForEnablingViewscreen);
402  ser.syncAsByte(enteredRoom1ForFirstTime);
403  ser.syncAsByte(repairedLifeSupportGenerator);
404  ser.syncAsSint16LE(missionScore);
405  }
406  } mudd;
407 
408  struct {
409  bool diedFromStalactites; // 0x29
410  // 0: initial state
411  // 1: one rock thrown at it
412  // 2: two rocks thrown at it (low enough to climb up)
413  byte vineState; // 0x2a
414 
415  bool gotRock; // 0x2b
416  bool gotSnake; // 0x2c
417  bool tookKnife; // 0x2d
418  bool field2e; // 0x2e
419  byte numRocksThrownAtTlaoxac; // 0x2f
420  bool gotFern; // 0x30
421  bool holeBlocked; // 0x31
422  bool tlaoxacTestPassed; // 0x32
423  bool knockedOutTlaoxac; // 0x33
424  bool waterMonsterRetreated; // 0x34
425  bool showedSnakeToTlaoxac; // 0x35
426  int16 missionScore; // 0x36
427 
428  void saveLoadWithSerializer(Common::Serializer &ser) {
429  ser.syncAsByte(diedFromStalactites);
430  ser.syncAsByte(vineState);
431  ser.syncAsByte(gotRock);
432  ser.syncAsByte(gotSnake);
433  ser.syncAsByte(tookKnife);
434  ser.syncAsByte(field2e);
435  ser.syncAsByte(numRocksThrownAtTlaoxac);
436  ser.syncAsByte(gotFern);
437  ser.syncAsByte(holeBlocked);
438  ser.syncAsByte(tlaoxacTestPassed);
439  ser.syncAsByte(knockedOutTlaoxac);
440  ser.syncAsByte(waterMonsterRetreated);
441  ser.syncAsByte(showedSnakeToTlaoxac);
442  ser.syncAsSint16LE(missionScore);
443  }
444  } feather;
445 
446  struct {
447  int16 missionScore; // 0x29
448  int16 field2b; // 0x2b
449  bool entityDefeated; // 0x31: Used iron rod on the energy being
450  bool doorOpen; // 0x32
451  bool scannedLock; // 0x33
452 
453  // 0: Don't know the door code yet
454  // 2: Will just open the door when the keypad is used
455  // 5: Will activate the unknown program when the keypad is used
456  byte doorCodeBehaviour; // 0x34
457 
458  bool globSplitInTwo; // 0x35
459  bool globDefeated; // 0x36
460  byte globEnergyLevels[3]; // 0x37
461  bool enteredTrial3FirstTime; // 0x3a
462  byte klingonShootIndex; // 0x3b
463  byte shotKlingons; // 0x3c
464 
465  // 0: Hasn't appeared yet
466  // 21: Is conscious
467  // 22: Is stunned
468  // 23: Is dead
469  int16 shotKlingonState; // 0x3d
470 
471  bool neuralInterfaceActive; // 0x43
472  int16 holeContents[3]; // 0x44 (Holes to put gems in for TRIAL5)
473 
474  bool enteredGlobRoom; // 0x5c
475  bool forceFieldDown; // 0x5d
476  bool uhuraAnalyzedCode; // 0x5e
477 
478  // 0: Gave up in court, letting Quetzecoatl die
479  // 1: Beamed to enterprise after calling Uhura
480  // 2: Lost the court battle after beaming back to the courtroom
481  // 3: Quetzecoatl goes free and Vlict doesn't die
482  // 4: Quetzecoatl goes free and Vlict dies
483  int16 missionEndMethod; // 0x5f
484 
485  bool gotPointsForGettingRod; // 0x61
486  bool gotPointsForCoatingRodWithIron; // 0x62
487  bool gotPointsForActivatingInterface; // 0x63
488  bool gotPointsForScanningGlob; // 0x64
489 
490  bool gotPointsForBeamingOut;
491 
492  void saveLoadWithSerializer(Common::Serializer &ser) {
493  ser.syncAsSint16LE(missionScore);
494  ser.syncAsSint16LE(field2b);
495  ser.syncAsByte(entityDefeated);
496  ser.syncAsByte(doorOpen);
497  ser.syncAsByte(scannedLock);
498  ser.syncAsByte(doorCodeBehaviour);
499  ser.syncAsByte(globSplitInTwo);
500  ser.syncAsByte(globDefeated);
501  ser.syncBytes(globEnergyLevels, 3);
502  ser.syncAsByte(enteredTrial3FirstTime);
503  ser.syncAsByte(klingonShootIndex);
504  ser.syncAsByte(shotKlingons);
505  ser.syncAsSint16LE(shotKlingonState);
506  ser.syncAsByte(neuralInterfaceActive);
507  for (int i = 0; i < 3; i++)
508  ser.syncAsSint16LE(holeContents[i]);
509  ser.syncAsByte(enteredGlobRoom);
510  ser.syncAsByte(forceFieldDown);
511  ser.syncAsByte(uhuraAnalyzedCode);
512  ser.syncAsSint16LE(missionEndMethod);
513  ser.syncAsByte(gotPointsForGettingRod);
514  ser.syncAsByte(gotPointsForCoatingRodWithIron);
515  ser.syncAsByte(gotPointsForActivatingInterface);
516  ser.syncAsByte(gotPointsForScanningGlob);
517  ser.syncAsByte(gotPointsForBeamingOut);
518  }
519  } trial;
520 
521  struct {
522  byte field31; // 0x31
523  byte field32; // 0x32
524  bool field33; // 0x33
525  bool doorLaserFiredOnce; // 0x34
526  bool gotPointsForAccessingTerminal; // 0x35
527  bool scannedKeycardLock; // 0x36
528  byte laserSetting; // 0x37
529 
530  // 0 if the laser hasn't been programmed with the keycard template;
531  // 1 if it has been programmed with the template;
532  // 2 if the rock has been placed on the wall.
533  byte laserPattern; // 0x38
534 
535  // bit 0: got a rock, or at least scanned the ground outside
536  // bit 1: entered mineshaft room
537  // bit 2: scanned the ID card panel
538  // bit 3: set after all 3 clues are obtained and Spock explains how to make
539  // the keycard
540  byte gatheredClues; // 0x39
541 
542  // bit 0: scanned left computer
543  // bit 1: scanned right computer
544  // bit 2: accessed left computer
545  // bit 3: accessed right computer
546  byte scannedAndUsedComputers; // 0x3a
547 
548  bool wireConnected1; // 0x3b
549  bool wireConnected2; // 0x3c
550  bool openedOuterDoor; // 0x3d
551  bool openedInnerDoor; // 0x3e
552  bool unlockedIDCardDoor; // 0x3f
553 
554  // 0: mold hasn't been created
555  // 2: mold for the keycard has been etched into the rock
556  // 3: rock placed top of the mold
557  // 4: a keycard is there
558  int8 moldState; // 0x40
559 
560  // 0: box closed
561  // 1: box open
562  // 2: box empty
563  byte boxState; // 0x41
564 
565  bool enteredRoom0FirstTime; // 0x42
566  bool scottyInformedKirkAboutVirus; // 0x43
567  bool enteredRoom2FirstTime; // 0x44
568  bool enteredRoom3FirstTime; // 0x45
569  bool enteredRoom4FirstTime; // 0x46
570  bool enteredRoom5FirstTime; // 0x47
571  bool gotPointsForScanningStatue; // 0x48
572  bool gotPointsForScanningRoom4; // 0x49
573  bool gotPointsForScanningRoom5; // 0x4a
574  bool gotPointsForScanningRightComputer; // 0x4b
575  bool gotPointsForScanningLeftComputer; // 0x4c
576  bool gotPointsForUsingRightComputer; // 0x4d
577  bool gotPointsForUsingLeftComputer; // 0x4e
578  bool discoveredComputersOutOfSync; // 0x4f
579  bool enteredRoom1FirstTime; // 0x50
580  bool playedMusicUponEnteringRoom5FirstTime; // 0x51
581  int16 missionScore; // 0x52
582 
583  void saveLoadWithSerializer(Common::Serializer &ser) {
584  ser.syncAsByte(field31);
585  ser.syncAsByte(field32);
586  ser.syncAsByte(field33);
587  ser.syncAsByte(doorLaserFiredOnce);
588  ser.syncAsByte(gotPointsForAccessingTerminal);
589  ser.syncAsByte(scannedKeycardLock);
590  ser.syncAsByte(laserSetting);
591  ser.syncAsByte(laserPattern);
592  ser.syncAsByte(gatheredClues);
593  ser.syncAsByte(scannedAndUsedComputers);
594  ser.syncAsByte(wireConnected1);
595  ser.syncAsByte(wireConnected2);
596  ser.syncAsByte(openedOuterDoor);
597  ser.syncAsByte(openedInnerDoor);
598  ser.syncAsByte(unlockedIDCardDoor);
599  ser.syncAsByte(moldState);
600  ser.syncAsByte(boxState);
601  ser.syncAsByte(enteredRoom0FirstTime);
602  ser.syncAsByte(scottyInformedKirkAboutVirus);
603  ser.syncAsByte(enteredRoom2FirstTime);
604  ser.syncAsByte(enteredRoom3FirstTime);
605  ser.syncAsByte(enteredRoom4FirstTime);
606  ser.syncAsByte(enteredRoom5FirstTime);
607  ser.syncAsByte(gotPointsForScanningStatue);
608  ser.syncAsByte(gotPointsForScanningRoom4);
609  ser.syncAsByte(gotPointsForScanningRoom5);
610  ser.syncAsByte(gotPointsForScanningRightComputer);
611  ser.syncAsByte(gotPointsForScanningLeftComputer);
612  ser.syncAsByte(gotPointsForUsingRightComputer);
613  ser.syncAsByte(gotPointsForUsingLeftComputer);
614  ser.syncAsByte(discoveredComputersOutOfSync);
615  ser.syncAsByte(enteredRoom1FirstTime);
616  ser.syncAsByte(playedMusicUponEnteringRoom5FirstTime);
617  ser.syncAsSint16LE(missionScore);
618  }
619  } sins;
620 
621  struct {
622  bool usedMedkitOnBrittany; // 0x29
623  bool talkedToBrittany; // 0x2a
624  bool brittanyDead; // 0x2b
625  bool lookedAtBrittany; // 0x2c
626  bool enteredRoom0FirstTime; // 0x2d
627  int16 missionScore; // 0x2e
628  bool bridgeCrewmanDead; // 0x30
629  bool scannedCaptainsChair; // 0x31
630  bool scannedComputerBank; // 0x32
631  bool showedRepublicMapFirstTime; // 0x33
632  bool impulseEnginesOn; // 0x34
633 
634  // 0: beam still in place
635  // 1: used saw on beam
636  // 2: beam taken
637  byte beamState; // 0x35
638 
639  bool enterpriseLeftForDistressCall; // 0x36
640  bool openedPanel; // 0x37
641  bool clearedPanelDebris; // 0x38
642  bool removedPanelDebris; // 0x39
643  bool oilInHypo; // 0x3a
644  bool loosenedDebrisWithOil; // 0x3b
645 
646  // 0: no power allocated
647  // 1: power to weapons
648  // 2: power to shields
649  // 3: power to transporter
650  byte poweredSystem; // 0x3c
651 
652  // 0: no tricorders plugged in
653  // 1: med tricorder plugged in
654  // 2: sci tricorder plugged in
655  // 3: both plugged in
656  byte tricordersPluggedIntoComputer; // 0x3d
657 
658  byte captainsLogIndex; // 0x3e
659  bool elasiShieldsDown; // 0x40
660  bool torpedoLoaded; // 0x41
661  bool firedTorpedo; // 0x42
662  bool elasiShipDecloaked; // 0x43
663  bool countdownStarted; // 0x44
664  bool toldElasiToBeamOver; // 0x45
665  bool scannedMainComputer; // 0x46
666  bool elasiHailedRepublic; // 0x47
667  bool tookRecordDeckFromAuxilaryControl; // 0x48
668 
669  // Counter used when shields are down and Elasi are present
670  int16 counterUntilElasiBoardWithShieldsDown; // 0x49
671 
672  // Counter used after talking with Elasi and they give you time to recover the
673  // data
674  int16 counterUntilElasiAttack; // 0x4b
675 
676  // Counter used after telling Elasi you'll turn off shields (initial warning)
677  int16 counterUntilElasiNagToDisableShields; // 0x4d
678 
679  // Counter used after telling Elasi you'll turn off shields (they destroy the
680  // ship this time)
681  int16 counterUntilElasiDestroyShip; // 0x4f
682 
683  // Counter used after telling Elasi to beam over
684  int16 counterUntilElasiBoardWithInvitation; // 0x51
685 
686  bool putSupportBeamInSickbayHallway; // 0x53
687  bool clearedDebris; // 0x54
688  bool lookedAtTurbolift2Door; // 0x55
689  bool kirkShouldSuggestReestablishingPower; // 0x56
690  bool tookHypoFromSickbay; // 0x57
691  bool tookDrillFromSickbay; // 0x58
692  bool clearedDebrisInRoom5; // 0x59
693  bool havePowerPack; // 0x5a
694  bool enteredRoom5FirstTime; // 0x5b
695  bool askedSpockAboutFire; // 0x5c
696 
697  // bits 0-1 are set for each of the 2 cables that can be connected to the
698  // junction box in engineering.
699  byte junctionCablesConnected; // 0x5d
700 
701  bool tookCableFromTransporterRoomHallway; // 0x5e
702  bool tookCableFromSickbayHallway; // 0x5f
703  bool tookMolecularSaw; // 0x60
704  bool readEngineeringJournal; // 0x61
705  bool tookEngineeringJournal; // 0x62
706  bool engineeringCabinetOpen; // 0x63
707  bool setTransporterCoordinates; // 0x65
708  bool examinedTorpedoControl; // 0x66
709  bool powerPackPluggedIntoTransporter; // 0x67
710  bool field68; // 0x68
711  bool getPointsForHealingBrittany; // 0x69
712  bool readAllLogs; // 0x6a
713  bool field6b; // 0x6b
714  bool field6c; // 0x6c
715 
716  void saveLoadWithSerializer(Common::Serializer &ser) {
717  ser.syncAsByte(usedMedkitOnBrittany);
718  ser.syncAsByte(talkedToBrittany);
719  ser.syncAsByte(brittanyDead);
720  ser.syncAsByte(lookedAtBrittany);
721  ser.syncAsByte(enteredRoom0FirstTime);
722  ser.syncAsSint16LE(missionScore);
723  ser.syncAsByte(bridgeCrewmanDead);
724  ser.syncAsByte(scannedCaptainsChair);
725  ser.syncAsByte(scannedComputerBank);
726  ser.syncAsByte(impulseEnginesOn);
727  ser.syncAsByte(beamState);
728  ser.syncAsByte(enterpriseLeftForDistressCall);
729  ser.syncAsByte(openedPanel);
730  ser.syncAsByte(clearedPanelDebris);
731  ser.syncAsByte(removedPanelDebris);
732  ser.syncAsByte(oilInHypo);
733  ser.syncAsByte(loosenedDebrisWithOil);
734  ser.syncAsByte(poweredSystem);
735  ser.syncAsByte(tricordersPluggedIntoComputer);
736  ser.syncAsByte(captainsLogIndex);
737  ser.syncAsByte(elasiShieldsDown);
738  ser.syncAsByte(torpedoLoaded);
739  ser.syncAsByte(firedTorpedo);
740  ser.syncAsByte(elasiShipDecloaked);
741  ser.syncAsByte(countdownStarted);
742  ser.syncAsByte(toldElasiToBeamOver);
743  ser.syncAsByte(scannedMainComputer);
744  ser.syncAsByte(elasiHailedRepublic);
745  ser.syncAsByte(tookRecordDeckFromAuxilaryControl);
746  ser.syncAsSint16LE(counterUntilElasiBoardWithShieldsDown);
747  ser.syncAsSint16LE(counterUntilElasiAttack);
748  ser.syncAsSint16LE(counterUntilElasiNagToDisableShields);
749  ser.syncAsSint16LE(counterUntilElasiDestroyShip);
750  ser.syncAsSint16LE(counterUntilElasiBoardWithInvitation);
751  ser.syncAsByte(clearedDebris);
752  ser.syncAsByte(lookedAtTurbolift2Door);
753  ser.syncAsByte(kirkShouldSuggestReestablishingPower);
754  ser.syncAsByte(tookHypoFromSickbay);
755  ser.syncAsByte(tookDrillFromSickbay);
756  ser.syncAsByte(clearedDebrisInRoom5);
757  ser.syncAsByte(havePowerPack);
758  ser.syncAsByte(enteredRoom5FirstTime);
759  ser.syncAsByte(askedSpockAboutFire);
760  ser.syncAsByte(junctionCablesConnected);
761  ser.syncAsByte(tookCableFromTransporterRoomHallway);
762  ser.syncAsByte(tookCableFromSickbayHallway);
763  ser.syncAsByte(tookMolecularSaw);
764  ser.syncAsByte(readEngineeringJournal);
765  ser.syncAsByte(tookEngineeringJournal);
766  ser.syncAsByte(engineeringCabinetOpen);
767  ser.syncAsByte(setTransporterCoordinates);
768  ser.syncAsByte(examinedTorpedoControl);
769  ser.syncAsByte(powerPackPluggedIntoTransporter);
770  ser.syncAsByte(field68);
771  ser.syncAsByte(getPointsForHealingBrittany);
772  ser.syncAsByte(readAllLogs);
773  ser.syncAsByte(field6b);
774  ser.syncAsByte(field6c);
775  }
776  } veng;
777  };
778 };
779 // Size: 0x129 bytes
780 
781 // Bottle types for Love's Labor Jeopardized
782 enum BottleTypes {
783  BOTTLETYPE_NONE = 0,
784  BOTTLETYPE_N2O = 1,
785  BOTTLETYPE_NH3 = 2,
786  BOTTLETYPE_H2O = 3,
787  BOTTLETYPE_RLG = 4 // Romulan Laughing Gas
788 };
789 
790 // Canister types for Love's Labor Jeopardized
791 enum CanisterTypes {
792  CANTYPE_NONE = 0,
793  CANTYPE_O2 = 1,
794  CANTYPE_H2 = 2,
795  CANTYPE_N2 = 3
796 };
797 
798 // Synthesizer contents for Love's Labor Jeopardized (values for synthesizerContents)
799 enum SynthesizerContent {
800  SYNTHITEM_NONE = 0,
801  SYNTHITEM_PBC = 1,
802  SYNTHITEM_VIRUS_SAMPLE = 2,
803  SYNTHITEM_CURE_SAMPLE = 3,
804  SYNTHITEM_BOTTLE = 9 // Contents of bottle determined by "synthesizerBottleIndex" variable
805 };
806 
807 #endif
void syncBytes(byte *buf, uint32 size, Version minVersion=0, Version maxVersion=kLastVersion)
Definition: serializer.h:204
Definition: serializer.h:79
Definition: awaymission.h:27