aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Stewart2018-07-26 00:42:24 -0400
committerEugene Sandulenko2018-08-09 08:37:30 +0200
commit20904176129e7ad6f9435e9563e1fa0bca5cb0f6 (patch)
treeadc0610471c8a08796fe4327741e63920f7ab9b8 /engines
parente3f00320ad76121430714f094dc8e9353eb04f2b (diff)
downloadscummvm-rg350-20904176129e7ad6f9435e9563e1fa0bca5cb0f6.tar.gz
scummvm-rg350-20904176129e7ad6f9435e9563e1fa0bca5cb0f6.tar.bz2
scummvm-rg350-20904176129e7ad6f9435e9563e1fa0bca5cb0f6.zip
STARTREK: Move save/load code for rooms to structs
Diffstat (limited to 'engines')
-rw-r--r--engines/startrek/awaymission.h210
-rw-r--r--engines/startrek/room.h151
-rw-r--r--engines/startrek/saveload.cpp339
3 files changed, 371 insertions, 329 deletions
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index 0817946e9c..a123c09161 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -24,7 +24,7 @@
#define STARTREK_AWAYMISSION_H
// All variables here get cleared to 0 upon starting an away mission.
-// NOTE: Any added or changed variables here must be mirrored in "saveload.cpp".
+// NOTE: Any changes here must be reflected in the corresponding serializer functions.
struct AwayMission {
// These timers count down automatically when nonzero. When they reach 0,
// ACTION_TIMER_EXPIRED is invoked with the corresponding index (0-7).
@@ -99,6 +99,48 @@ struct AwayMission {
byte field56; // 0x56
bool foundAlienRoom; // 0x57
int16 missionScore; // 0x58
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsByte(wasRudeToPrelate);
+ ser.syncAsByte(insultedStephen);
+ ser.syncAsByte(field2d);
+ ser.syncAsByte(beatKlingons);
+ ser.syncAsByte(tookKlingonHand);
+ ser.syncAsByte(talkedToPrelate);
+ ser.syncAsByte(stephenWelcomedToStudy);
+ ser.syncAsByte(prelateWelcomedCrew);
+ ser.syncAsByte(askedPrelateAboutSightings);
+ ser.syncAsByte(field37);
+ ser.syncAsByte(mccoyMentionedFlora);
+ ser.syncAsByte(numBouldersGone);
+ ser.syncAsByte(enteredFrom);
+ ser.syncAsByte(repairedHand);
+ ser.syncAsByte(healedMiner);
+ ser.syncAsByte(curedChub);
+ ser.syncAsByte(field3e);
+ ser.syncAsByte(knowAboutHypoDytoxin);
+ ser.syncAsByte(minerDead);
+ ser.syncAsByte(field41);
+ ser.syncAsByte(foundMiner);
+ ser.syncAsByte(field45);
+ ser.syncAsByte(gaveSkullToNauian);
+ ser.syncAsByte(warpsDisabled);
+ ser.syncAsByte(boulder1Gone);
+ ser.syncAsByte(boulder2Gone);
+ ser.syncAsByte(boulder3Gone);
+ ser.syncAsByte(boulder4Gone);
+ ser.syncAsByte(doorOpened);
+ ser.syncAsByte(solvedSunPuzzle);
+ ser.syncAsByte(itemsTakenFromCase);
+ ser.syncAsByte(gotBerries);
+ ser.syncAsByte(madeHypoDytoxin);
+ ser.syncAsByte(metNauian);
+ ser.syncAsByte(gavePointsForDytoxin);
+ ser.syncAsByte(lookedAtComputer);
+ ser.syncAsByte(field56);
+ ser.syncAsByte(foundAlienRoom);
+ ser.syncAsSint16LE(missionScore);
+ }
} demon;
// Hijacked
@@ -142,6 +184,43 @@ struct AwayMission {
byte bridgeWinMethod; // 0x5e
bool talkedToBrigCrewman; // 0x5f
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsSint16LE(missionScore);
+ ser.syncAsSint16LE(field2b);
+ ser.syncAsSint16LE(field2d);
+ ser.syncAsByte(engineerConscious);
+ ser.syncAsByte(field35);
+ ser.syncAsByte(gotWires);
+ ser.syncAsByte(orbitalDecayCounter);
+ ser.syncAsByte(bridgeElasiDrewPhasers);
+ ser.syncAsByte(talkedToCereth);
+ ser.syncAsByte(gotJunkPile);
+ ser.syncAsByte(gotTransmogrifier);
+ ser.syncAsByte(transporterRepaired);
+ ser.syncAsByte(spockExaminedTransporter);
+ ser.syncAsByte(usedTransmogrifierOnTransporter);
+ ser.syncAsByte(bridgeForceFieldDown);
+ ser.syncAsByte(savedPrisoners);
+ ser.syncAsByte(haveBomb);
+ ser.syncAsByte(brigElasiPhasersOnKill);
+ ser.syncAsByte(elasiTargetIndex);
+ ser.syncAsByte(guard1Status);
+ ser.syncAsByte(guard2Status);
+ ser.syncAsByte(field4e);
+ ser.syncBytes(crewmanKilled, 4);
+ ser.syncAsByte(bridgeElasi1Status);
+ ser.syncAsByte(bridgeElasi2Status);
+ ser.syncAsByte(bridgeElasi3Status);
+ ser.syncAsByte(bridgeElasi4Status);
+ ser.syncAsByte(brigForceFieldDown);
+ ser.syncAsByte(field59);
+ ser.syncAsByte(field5b);
+ ser.syncAsByte(elasiSurrendered);
+ ser.syncAsByte(kirkPhaserDrawn);
+ ser.syncAsByte(bridgeWinMethod);
+ ser.syncAsByte(talkedToBrigCrewman);
+ }
} tug;
// Love's Labor Jeopardized
@@ -187,6 +266,50 @@ struct AwayMission {
bool gotPointsForHydratingPreax; // 0x50
bool gotPointsForHydratingRomulans; // 0x51
int16 missionScore; // 0x52
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsByte(alreadyStartedMission);
+ ser.syncAsByte(knowAboutVirus);
+ ser.syncAsByte(romulansUnconsciousFromLaughingGas);
+ ser.syncAsByte(releasedHumanLaughingGas);
+ ser.syncAsByte(releasedRomulanLaughingGas);
+ ser.syncAsByte(chamberHasCure);
+ ser.syncAsByte(freezerOpen);
+ ser.syncAsByte(chamberHasDish);
+ ser.syncAsByte(bottleInNozzle);
+ ser.syncAsByte(cabinetOpen);
+ ser.syncAsByte(gasFeedOn);
+ ser.syncAsByte(synthesizerBottleIndex);
+ ser.syncAsByte(synthesizerContents);
+ ser.syncAsByte(canister1);
+ ser.syncAsByte(canister2);
+ ser.syncAsByte(servicePanelOpen);
+ ser.syncAsByte(gasTankUnscrewed);
+ ser.syncAsByte(wrenchTaken);
+ ser.syncAsByte(tookN2TankFromServicePanel);
+ ser.syncAsByte(field3c);
+ ser.syncAsByte(grateRemoved);
+ ser.syncAsByte(insulationOnGround);
+ ser.syncAsByte(visitedRoomWithRomulans);
+ ser.syncAsByte(romulansCured);
+ ser.syncAsByte(romulansUnconsciousFromVirus);
+ ser.syncAsByte(freedMarcusAndCheever);
+ ser.syncAsByte(preaxCured);
+ ser.syncAsByte(spockInfectionCounter);
+ ser.syncAsByte(spockCured);
+ ser.syncAsByte(contactedEnterpriseBeforeCure);
+ ser.syncAsByte(contactedEnterpriseAfterCure);
+ ser.syncAsByte(spockAccessedConsole);
+ ser.syncAsByte(mccoyAccessedConsole);
+ ser.syncAsByte(gotPolyberylcarbonate);
+ ser.syncAsByte(gotTLDH);
+ ser.syncAsByte(gotPointsForOpeningGrate);
+ ser.syncAsByte(gotPointsForGassingRomulans);
+ ser.syncAsByte(gotCure);
+ ser.syncAsByte(gotPointsForHydratingPreax);
+ ser.syncAsByte(gotPointsForHydratingRomulans);
+ ser.syncAsSint16LE(missionScore);
+ }
} love;
struct {
@@ -241,6 +364,46 @@ struct AwayMission {
bool enteredRoom1ForFirstTime; // 0x58
bool repairedLifeSupportGenerator; // 0x59
int16 missionScore; // 0x5a
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsByte(muddFirstRoomState);
+ ser.syncAsByte(torpedoLoaded);
+ ser.syncAsByte(knowAboutTorpedo);
+ ser.syncAsByte(discoveredBase3System);
+ ser.syncAsByte(translatedAlienLanguage);
+ ser.syncAsByte(databaseDestroyed);
+ ser.syncAsByte(muddInDatabaseRoom);
+ ser.syncAsByte(muddCurrentlyInsane);
+ ser.syncAsByte(computerDataErasedOrDestroyed);
+ ser.syncAsByte(muddErasedDatabase);
+ ser.syncAsByte(discoveredLenseAndDegrimerFunction);
+ ser.syncAsSint16LE(torpedoStatus);
+ ser.syncAsByte(muddUnavailable);
+ ser.syncAsByte(muddVisitedDatabaseRoom);
+ ser.syncAsByte(accessedAlienDatabase);
+ ser.syncAsByte(tookRepairTool);
+ ser.syncAsByte(gotPointsForDownloadingData);
+ ser.syncAsByte(contactedEnterpriseFirstTime);
+ ser.syncAsByte(viewScreenEnabled);
+ ser.syncAsByte(lifeSupportMalfunctioning);
+ ser.syncAsByte(numTimesEnteredRoom5);
+ ser.syncAsByte(gotMemoryDisk);
+ ser.syncAsByte(gotLense);
+ ser.syncAsByte(gotDegrimer);
+ ser.syncAsByte(putCapsuleInMedicalMachine);
+ ser.syncAsByte(muddUnconscious);
+ ser.syncAsByte(muddInsanityState);
+ ser.syncAsByte(muddInhaledGas);
+ ser.syncAsSint16LE(lifeSupportTimer);
+ ser.syncAsByte(startedLifeSupportTimer);
+ ser.syncAsByte(enteredRoom0ForFirstTime);
+ ser.syncAsByte(gotPointsForLoadingTorpedo);
+ ser.syncAsByte(gotPointsForPressingRedButton);
+ ser.syncAsByte(gotPointsForEnablingViewscreen);
+ ser.syncAsByte(enteredRoom1ForFirstTime);
+ ser.syncAsByte(repairedLifeSupportGenerator);
+ ser.syncAsSint16LE(missionScore);
+ }
} mudd;
struct {
@@ -262,6 +425,23 @@ struct AwayMission {
bool waterMonsterRetreated; // 0x34
bool showedSnakeToTlaoxac; // 0x35
int16 missionScore; // 0x36
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsByte(diedFromStalactites);
+ ser.syncAsByte(vineState);
+ ser.syncAsByte(gotRock);
+ ser.syncAsByte(gotSnake);
+ ser.syncAsByte(tookKnife);
+ ser.syncAsByte(field2e);
+ ser.syncAsByte(numRocksThrownAtTlaoxac);
+ ser.syncAsByte(gotFern);
+ ser.syncAsByte(holeBlocked);
+ ser.syncAsByte(tlaoxacTestPassed);
+ ser.syncAsByte(knockedOutTlaoxac);
+ ser.syncAsByte(waterMonsterRetreated);
+ ser.syncAsByte(showedSnakeToTlaoxac);
+ ser.syncAsSint16LE(missionScore);
+ }
} feather;
struct {
@@ -309,6 +489,34 @@ struct AwayMission {
bool gotPointsForScanningGlob; // 0x64
bool gotPointsForBeamingOut;
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ ser.syncAsSint16LE(missionScore);
+ ser.syncAsSint16LE(field2b);
+ ser.syncAsByte(entityDefeated);
+ ser.syncAsByte(doorOpen);
+ ser.syncAsByte(scannedLock);
+ ser.syncAsByte(doorCodeBehaviour);
+ ser.syncAsByte(globSplitInTwo);
+ ser.syncAsByte(globDefeated);
+ ser.syncBytes(globEnergyLevels, 3);
+ ser.syncAsByte(enteredTrial3FirstTime);
+ ser.syncAsByte(klingonShootIndex);
+ ser.syncAsByte(shotKlingons);
+ ser.syncAsSint16LE(shotKlingonState);
+ ser.syncAsByte(neuralInterfaceActive);
+ for (int i = 0; i < 3; i++)
+ ser.syncAsSint16LE(holeContents[i]);
+ ser.syncAsByte(enteredGlobRoom);
+ ser.syncAsByte(forceFieldDown);
+ ser.syncAsByte(uhuraAnalyzedCode);
+ ser.syncAsSint16LE(missionEndMethod);
+ ser.syncAsByte(gotPointsForGettingRod);
+ ser.syncAsByte(gotPointsForCoatingRodWithIron);
+ ser.syncAsByte(gotPointsForActivatingInterface);
+ ser.syncAsByte(gotPointsForScanningGlob);
+ ser.syncAsByte(gotPointsForBeamingOut);
+ }
} trial;
};
};
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index dad620e920..9f88f04981 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2146,7 +2146,7 @@ public:
public:
// Room-specific variables. This is memset'ed to 0 when the room is initialized.
- // NOTE: Any changes here must be reflected in saveload.cpp.
+ // NOTE: Any changes here must be reflected in the corresponding serializer functions.
union {
struct {
// demon0
@@ -2203,6 +2203,63 @@ public:
// common
bool movingToDoor;
byte doorCounter;
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ // demon0
+ ser.syncAsByte(bottomDoorCounter);
+ ser.syncAsByte(topDoorCounter);
+ ser.syncAsByte(movingToTopDoor);
+ ser.syncAsByte(movingToBottomDoor);
+
+ // demon1
+ ser.syncBytes((byte *)klingonShot, 3);
+ ser.syncAsSint16LE(numKlingonsKilled);
+ ser.syncAsByte(attackIndex);
+ ser.syncAsByte(kirkShooting);
+ ser.syncBytes((byte *)d6, 10);
+
+ // demon3
+ ser.syncAsByte(shootingBoulder);
+ ser.syncAsByte(boulder1Shot);
+ ser.syncAsByte(boulderBeingShot);
+ ser.syncAsByte(kirkInPosition);
+ ser.syncAsByte(redshirtInPosition);
+ ser.syncAsByte(spockInPosition);
+ ser.syncAsByte(mccoyInPosition);
+ ser.syncAsByte(inFiringPosition);
+ ser.syncAsByte(kirkPhaserOut);
+ ser.syncBytes((byte *)boulderAnim, 10);
+ ser.syncAsSint16LE(usedPhaserOnDoor);
+
+ // demon4
+ ser.syncAsByte(triedToShootNauian);
+ ser.syncAsByte(nauianEmerged);
+ ser.syncAsByte(disabledSecurity);
+ ser.syncAsByte(cd);
+ ser.syncAsByte(crewReadyToBeamOut);
+ ser.syncAsSint16LE(crewmanUsingPanel);
+
+ // demon5
+ ser.syncAsByte(scannedRoberts);
+ ser.syncAsByte(scannedChub);
+ ser.syncAsByte(scannedGrisnash);
+ ser.syncAsByte(scannedStephen);
+ ser.syncAsByte(numScanned);
+ ser.syncAsByte(numTalkedTo);
+ ser.syncAsByte(talkedToRoberts);
+ ser.syncAsByte(talkedToChub);
+ ser.syncAsByte(talkedToGrisnash);
+ ser.syncAsByte(talkedToStephen);
+
+ // demon6
+ ser.syncAsByte(insultedStephenRecently);
+ ser.syncAsByte(stephenInRoom);
+ ser.syncAsByte(caseOpened);
+
+ // common
+ ser.syncAsByte(movingToDoor);
+ ser.syncAsByte(doorCounter);
+ }
} demon;
struct {
@@ -2211,6 +2268,14 @@ public:
byte shootingTarget;
bool elasiPhaserOnKill;
bool shootKirkOverride; // 0x1ec4
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ // tug2
+ ser.syncAsByte(shootingObject);
+ ser.syncAsByte(shootingTarget);
+ ser.syncAsByte(elasiPhaserOnKill);
+ ser.syncAsByte(shootKirkOverride);
+ }
} tug;
struct {
@@ -2253,6 +2318,48 @@ public:
byte spockAndMccoyReadyToUseCure;
byte cmnXPosToCureSpock;
byte cmnYPosToCureSpock;
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ // love0
+ ser.syncAsByte(heardSummaryOfVirus);
+ ser.syncAsSint16LE(consoleCrewman);
+ ser.syncBytes((byte *)consoleAnimation, 10);
+ ser.syncAsSint32LE(consoleSpeaker);
+ ser.syncAsSint32LE(consoleText);
+
+ // love1
+ ser.syncAsSint32LE(dyingSpeaker);
+ ser.syncAsSint16LE(crewmanUsingFreezerRetX);
+ ser.syncAsSint16LE(crewmanUsingFreezerRetY);
+ ser.syncAsSint16LE(crewmanUsingDevice);
+ ser.syncAsSint16LE(itemInNozzle);
+ ser.syncBytes((byte *)bottleAnimation, 10);
+
+ // love2
+ ser.syncAsByte(canisterType);
+ ser.syncAsByte(cb);
+ ser.syncAsSint16LE(canisterItem);
+ ser.syncBytes((byte *)canisterAnim, 10);
+ ser.syncAsSint16LE(chamberObject);
+ ser.syncBytes((byte *)chamberInputAnim, 10);
+ ser.syncBytes((byte *)chamberOutputAnim, 10);
+
+ // love3
+ ser.syncAsByte(activeCrewman);
+
+ // love4
+ ser.syncAsByte(gaveWaterToRomulans);
+
+ // love5
+ ser.syncAsByte(numCrewmenReadyToBeamOut);
+
+ // common
+ ser.syncAsByte(walkingToDoor);
+ ser.syncAsByte(doorOpenCounter);
+ ser.syncAsByte(spockAndMccoyReadyToUseCure);
+ ser.syncAsByte(cmnXPosToCureSpock);
+ ser.syncAsByte(cmnYPosToCureSpock);
+ }
} love;
struct {
@@ -2266,6 +2373,19 @@ public:
// common
byte walkingToDoor;
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ // mudd3
+ ser.syncAsByte(suggestedUsingTricorders);
+ ser.syncAsByte(tricordersUnavailable);
+
+ // mudd4
+ ser.syncAsByte(usingLeftConsole);
+ ser.syncAsByte(kirkUsingRightConsole);
+
+ // common
+ ser.syncAsByte(walkingToDoor);
+ }
} mudd;
struct {
@@ -2284,6 +2404,24 @@ public:
// feather7
bool insultedQuetzecoatl;
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ // feather1
+ ser.syncAsByte(snakeInHole);
+ ser.syncAsByte(scannedSnake);
+ ser.syncBytes(crewEscaped, 4);
+ ser.syncAsByte(crewmanClimbingVine);
+
+ // feather2
+ ser.syncAsByte(showedSnakeToTlaoxac);
+ ser.syncAsByte(tlaoxacUnconscious);
+
+ // feather6
+ ser.syncAsByte(usedRockOnCrystalsOnce);
+
+ // feather7
+ ser.syncAsByte(insultedQuetzecoatl);
+ }
} feather;
struct {
@@ -2295,6 +2433,17 @@ public:
int16 itemToUse; // 0x1386
int16 objectToUse; // 0x1388
int16 hole;
+
+ void saveLoadWithSerializer(Common::Serializer &ser) {
+ // trial2
+ ser.syncAsByte(globBeingShot);
+ ser.syncAsByte(phaserOnKill);
+
+ // trial5
+ ser.syncAsSint16LE(itemToUse);
+ ser.syncAsSint16LE(objectToUse);
+ ser.syncAsSint16LE(hole);
+ }
} trial;
} _roomVar;
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index cac8a7830d..f42d2f128b 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -307,338 +307,23 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
ser.syncAsByte(_awayMission.crewDirectionsAfterWalk[i]);
if (_missionName == "DEMON") {
- ser.syncAsByte(_awayMission.demon.wasRudeToPrelate);
- ser.syncAsByte(_awayMission.demon.insultedStephen);
- ser.syncAsByte(_awayMission.demon.field2d);
- ser.syncAsByte(_awayMission.demon.beatKlingons);
- ser.syncAsByte(_awayMission.demon.tookKlingonHand);
- ser.syncAsByte(_awayMission.demon.talkedToPrelate);
- ser.syncAsByte(_awayMission.demon.stephenWelcomedToStudy);
- ser.syncAsByte(_awayMission.demon.prelateWelcomedCrew);
- ser.syncAsByte(_awayMission.demon.askedPrelateAboutSightings);
- ser.syncAsByte(_awayMission.demon.field37);
- ser.syncAsByte(_awayMission.demon.mccoyMentionedFlora);
- ser.syncAsByte(_awayMission.demon.numBouldersGone);
- ser.syncAsByte(_awayMission.demon.enteredFrom);
- ser.syncAsByte(_awayMission.demon.repairedHand);
- ser.syncAsByte(_awayMission.demon.healedMiner);
- ser.syncAsByte(_awayMission.demon.curedChub);
- ser.syncAsByte(_awayMission.demon.field3e);
- ser.syncAsByte(_awayMission.demon.knowAboutHypoDytoxin);
- ser.syncAsByte(_awayMission.demon.minerDead);
- ser.syncAsByte(_awayMission.demon.field41);
- ser.syncAsByte(_awayMission.demon.foundMiner);
- ser.syncAsByte(_awayMission.demon.field45);
- ser.syncAsByte(_awayMission.demon.gaveSkullToNauian);
- ser.syncAsByte(_awayMission.demon.warpsDisabled);
- ser.syncAsByte(_awayMission.demon.boulder1Gone);
- ser.syncAsByte(_awayMission.demon.boulder2Gone);
- ser.syncAsByte(_awayMission.demon.boulder3Gone);
- ser.syncAsByte(_awayMission.demon.boulder4Gone);
- ser.syncAsByte(_awayMission.demon.doorOpened);
- ser.syncAsByte(_awayMission.demon.solvedSunPuzzle);
- ser.syncAsByte(_awayMission.demon.itemsTakenFromCase);
- ser.syncAsByte(_awayMission.demon.gotBerries);
- ser.syncAsByte(_awayMission.demon.madeHypoDytoxin);
- ser.syncAsByte(_awayMission.demon.metNauian);
- ser.syncAsByte(_awayMission.demon.gavePointsForDytoxin);
- ser.syncAsByte(_awayMission.demon.lookedAtComputer);
- ser.syncAsByte(_awayMission.demon.field56);
- ser.syncAsByte(_awayMission.demon.foundAlienRoom);
- ser.syncAsSint16LE(_awayMission.demon.missionScore);
-
- // demon0
- ser.syncAsByte(_room->_roomVar.demon.bottomDoorCounter);
- ser.syncAsByte(_room->_roomVar.demon.topDoorCounter);
- ser.syncAsByte(_room->_roomVar.demon.movingToTopDoor);
- ser.syncAsByte(_room->_roomVar.demon.movingToBottomDoor);
-
- // demon1
- ser.syncBytes((byte *)_room->_roomVar.demon.klingonShot, 3);
- ser.syncAsSint16LE(_room->_roomVar.demon.numKlingonsKilled);
- ser.syncAsByte(_room->_roomVar.demon.attackIndex);
- ser.syncAsByte(_room->_roomVar.demon.kirkShooting);
- ser.syncBytes((byte *)_room->_roomVar.demon.d6, 10);
-
- // demon3
- ser.syncAsByte(_room->_roomVar.demon.shootingBoulder);
- ser.syncAsByte(_room->_roomVar.demon.boulder1Shot);
- ser.syncAsByte(_room->_roomVar.demon.boulderBeingShot);
- ser.syncAsByte(_room->_roomVar.demon.kirkInPosition);
- ser.syncAsByte(_room->_roomVar.demon.redshirtInPosition);
- ser.syncAsByte(_room->_roomVar.demon.spockInPosition);
- ser.syncAsByte(_room->_roomVar.demon.mccoyInPosition);
- ser.syncAsByte(_room->_roomVar.demon.inFiringPosition);
- ser.syncAsByte(_room->_roomVar.demon.kirkPhaserOut);
- ser.syncBytes((byte *)_room->_roomVar.demon.boulderAnim, 10);
- ser.syncAsSint16LE(_room->_roomVar.demon.usedPhaserOnDoor);
-
- // demon4
- ser.syncAsByte(_room->_roomVar.demon.triedToShootNauian);
- ser.syncAsByte(_room->_roomVar.demon.nauianEmerged);
- ser.syncAsByte(_room->_roomVar.demon.disabledSecurity);
- ser.syncAsByte(_room->_roomVar.demon.cd);
- ser.syncAsByte(_room->_roomVar.demon.crewReadyToBeamOut);
- ser.syncAsSint16LE(_room->_roomVar.demon.crewmanUsingPanel);
-
- // demon5
- ser.syncAsByte(_room->_roomVar.demon.scannedRoberts);
- ser.syncAsByte(_room->_roomVar.demon.scannedChub);
- ser.syncAsByte(_room->_roomVar.demon.scannedGrisnash);
- ser.syncAsByte(_room->_roomVar.demon.scannedStephen);
- ser.syncAsByte(_room->_roomVar.demon.numScanned);
- ser.syncAsByte(_room->_roomVar.demon.numTalkedTo);
- ser.syncAsByte(_room->_roomVar.demon.talkedToRoberts);
- ser.syncAsByte(_room->_roomVar.demon.talkedToChub);
- ser.syncAsByte(_room->_roomVar.demon.talkedToGrisnash);
- ser.syncAsByte(_room->_roomVar.demon.talkedToStephen);
-
- // demon6
- ser.syncAsByte(_room->_roomVar.demon.insultedStephenRecently);
- ser.syncAsByte(_room->_roomVar.demon.stephenInRoom);
- ser.syncAsByte(_room->_roomVar.demon.caseOpened);
-
- // common
- ser.syncAsByte(_room->_roomVar.demon.movingToDoor);
- ser.syncAsByte(_room->_roomVar.demon.doorCounter);
+ _awayMission.demon.saveLoadWithSerializer(ser);
+ _room->_roomVar.demon.saveLoadWithSerializer(ser);
} else if (_missionName == "TUG") {
- ser.syncAsSint16LE(_awayMission.tug.missionScore);
- ser.syncAsSint16LE(_awayMission.tug.field2b);
- ser.syncAsSint16LE(_awayMission.tug.field2d);
- ser.syncAsByte(_awayMission.tug.engineerConscious);
- ser.syncAsByte(_awayMission.tug.field35);
- ser.syncAsByte(_awayMission.tug.gotWires);
- ser.syncAsByte(_awayMission.tug.orbitalDecayCounter);
- ser.syncAsByte(_awayMission.tug.bridgeElasiDrewPhasers);
- ser.syncAsByte(_awayMission.tug.talkedToCereth);
- ser.syncAsByte(_awayMission.tug.gotJunkPile);
- ser.syncAsByte(_awayMission.tug.gotTransmogrifier);
- ser.syncAsByte(_awayMission.tug.transporterRepaired);
- ser.syncAsByte(_awayMission.tug.spockExaminedTransporter);
- ser.syncAsByte(_awayMission.tug.usedTransmogrifierOnTransporter);
- ser.syncAsByte(_awayMission.tug.bridgeForceFieldDown);
- ser.syncAsByte(_awayMission.tug.savedPrisoners);
- ser.syncAsByte(_awayMission.tug.haveBomb);
- ser.syncAsByte(_awayMission.tug.brigElasiPhasersOnKill);
- ser.syncAsByte(_awayMission.tug.elasiTargetIndex);
- ser.syncAsByte(_awayMission.tug.guard1Status);
- ser.syncAsByte(_awayMission.tug.guard2Status);
- ser.syncAsByte(_awayMission.tug.field4e);
- ser.syncBytes(_awayMission.tug.crewmanKilled, 4);
- ser.syncAsByte(_awayMission.tug.bridgeElasi1Status);
- ser.syncAsByte(_awayMission.tug.bridgeElasi2Status);
- ser.syncAsByte(_awayMission.tug.bridgeElasi3Status);
- ser.syncAsByte(_awayMission.tug.bridgeElasi4Status);
- ser.syncAsByte(_awayMission.tug.brigForceFieldDown);
- ser.syncAsByte(_awayMission.tug.field59);
- ser.syncAsByte(_awayMission.tug.field5b);
- ser.syncAsByte(_awayMission.tug.elasiSurrendered);
- ser.syncAsByte(_awayMission.tug.kirkPhaserDrawn);
- ser.syncAsByte(_awayMission.tug.bridgeWinMethod);
- ser.syncAsByte(_awayMission.tug.talkedToBrigCrewman);
-
- // tug2
- ser.syncAsByte(_room->_roomVar.tug.shootingObject);
- ser.syncAsByte(_room->_roomVar.tug.shootingTarget);
- ser.syncAsByte(_room->_roomVar.tug.elasiPhaserOnKill);
- ser.syncAsByte(_room->_roomVar.tug.shootKirkOverride);
+ _awayMission.tug.saveLoadWithSerializer(ser);
+ _room->_roomVar.tug.saveLoadWithSerializer(ser);
} else if (_missionName == "LOVE") {
- ser.syncAsByte(_awayMission.love.alreadyStartedMission);
- ser.syncAsByte(_awayMission.love.knowAboutVirus);
- ser.syncAsByte(_awayMission.love.romulansUnconsciousFromLaughingGas);
- ser.syncAsByte(_awayMission.love.releasedHumanLaughingGas);
- ser.syncAsByte(_awayMission.love.releasedRomulanLaughingGas);
- ser.syncAsByte(_awayMission.love.chamberHasCure);
- ser.syncAsByte(_awayMission.love.freezerOpen);
- ser.syncAsByte(_awayMission.love.chamberHasDish);
- ser.syncAsByte(_awayMission.love.bottleInNozzle);
- ser.syncAsByte(_awayMission.love.cabinetOpen);
- ser.syncAsByte(_awayMission.love.gasFeedOn);
- ser.syncAsByte(_awayMission.love.synthesizerBottleIndex);
- ser.syncAsByte(_awayMission.love.synthesizerContents);
- ser.syncAsByte(_awayMission.love.canister1);
- ser.syncAsByte(_awayMission.love.canister2);
- ser.syncAsByte(_awayMission.love.servicePanelOpen);
- ser.syncAsByte(_awayMission.love.gasTankUnscrewed);
- ser.syncAsByte(_awayMission.love.wrenchTaken);
- ser.syncAsByte(_awayMission.love.tookN2TankFromServicePanel);
- ser.syncAsByte(_awayMission.love.field3c);
- ser.syncAsByte(_awayMission.love.grateRemoved);
- ser.syncAsByte(_awayMission.love.insulationOnGround);
- ser.syncAsByte(_awayMission.love.visitedRoomWithRomulans);
- ser.syncAsByte(_awayMission.love.romulansCured);
- ser.syncAsByte(_awayMission.love.romulansUnconsciousFromVirus);
- ser.syncAsByte(_awayMission.love.freedMarcusAndCheever);
- ser.syncAsByte(_awayMission.love.preaxCured);
- ser.syncAsByte(_awayMission.love.spockInfectionCounter);
- ser.syncAsByte(_awayMission.love.spockCured);
- ser.syncAsByte(_awayMission.love.contactedEnterpriseBeforeCure);
- ser.syncAsByte(_awayMission.love.contactedEnterpriseAfterCure);
- ser.syncAsByte(_awayMission.love.spockAccessedConsole);
- ser.syncAsByte(_awayMission.love.mccoyAccessedConsole);
- ser.syncAsByte(_awayMission.love.gotPolyberylcarbonate);
- ser.syncAsByte(_awayMission.love.gotTLDH);
- ser.syncAsByte(_awayMission.love.gotPointsForOpeningGrate);
- ser.syncAsByte(_awayMission.love.gotPointsForGassingRomulans);
- ser.syncAsByte(_awayMission.love.gotCure);
- ser.syncAsByte(_awayMission.love.gotPointsForHydratingPreax);
- ser.syncAsByte(_awayMission.love.gotPointsForHydratingRomulans);
- ser.syncAsSint16LE(_awayMission.love.missionScore);
-
- // love0
- ser.syncAsByte(_room->_roomVar.love.heardSummaryOfVirus);
- ser.syncAsSint16LE(_room->_roomVar.love.consoleCrewman);
- ser.syncBytes((byte *)_room->_roomVar.love.consoleAnimation, 10);
- ser.syncAsSint32LE(_room->_roomVar.love.consoleSpeaker);
- ser.syncAsSint32LE(_room->_roomVar.love.consoleText);
-
- // love1
- ser.syncAsSint32LE(_room->_roomVar.love.dyingSpeaker);
- ser.syncAsSint16LE(_room->_roomVar.love.crewmanUsingFreezerRetX);
- ser.syncAsSint16LE(_room->_roomVar.love.crewmanUsingFreezerRetY);
- ser.syncAsSint16LE(_room->_roomVar.love.crewmanUsingDevice);
- ser.syncAsSint16LE(_room->_roomVar.love.itemInNozzle);
- ser.syncBytes((byte *)_room->_roomVar.love.bottleAnimation, 10);
-
- // love2
- ser.syncAsByte(_room->_roomVar.love.canisterType);
- ser.syncAsByte(_room->_roomVar.love.cb);
- ser.syncAsSint16LE(_room->_roomVar.love.canisterItem);
- ser.syncBytes((byte *)_room->_roomVar.love.canisterAnim, 10);
- ser.syncAsSint16LE(_room->_roomVar.love.chamberObject);
- ser.syncBytes((byte *)_room->_roomVar.love.chamberInputAnim, 10);
- ser.syncBytes((byte *)_room->_roomVar.love.chamberOutputAnim, 10);
-
- // love3
- ser.syncAsByte(_room->_roomVar.love.activeCrewman);
-
- // love4
- ser.syncAsByte(_room->_roomVar.love.gaveWaterToRomulans);
-
- // love5
- ser.syncAsByte(_room->_roomVar.love.numCrewmenReadyToBeamOut);
-
- // common
- ser.syncAsByte(_room->_roomVar.love.walkingToDoor);
- ser.syncAsByte(_room->_roomVar.love.doorOpenCounter);
- ser.syncAsByte(_room->_roomVar.love.spockAndMccoyReadyToUseCure);
- ser.syncAsByte(_room->_roomVar.love.cmnXPosToCureSpock);
- ser.syncAsByte(_room->_roomVar.love.cmnYPosToCureSpock);
+ _awayMission.love.saveLoadWithSerializer(ser);
+ _room->_roomVar.love.saveLoadWithSerializer(ser);
} else if (_missionName == "MUDD") {
- ser.syncAsByte(_awayMission.mudd.muddFirstRoomState);
- ser.syncAsByte(_awayMission.mudd.torpedoLoaded);
- ser.syncAsByte(_awayMission.mudd.knowAboutTorpedo);
- ser.syncAsByte(_awayMission.mudd.discoveredBase3System);
- ser.syncAsByte(_awayMission.mudd.translatedAlienLanguage);
- ser.syncAsByte(_awayMission.mudd.databaseDestroyed);
- ser.syncAsByte(_awayMission.mudd.muddInDatabaseRoom);
- ser.syncAsByte(_awayMission.mudd.muddCurrentlyInsane);
- ser.syncAsByte(_awayMission.mudd.computerDataErasedOrDestroyed);
- ser.syncAsByte(_awayMission.mudd.muddErasedDatabase);
- ser.syncAsByte(_awayMission.mudd.discoveredLenseAndDegrimerFunction);
- ser.syncAsSint16LE(_awayMission.mudd.torpedoStatus);
- ser.syncAsByte(_awayMission.mudd.muddUnavailable);
- ser.syncAsByte(_awayMission.mudd.muddVisitedDatabaseRoom);
- ser.syncAsByte(_awayMission.mudd.accessedAlienDatabase);
- ser.syncAsByte(_awayMission.mudd.tookRepairTool);
- ser.syncAsByte(_awayMission.mudd.gotPointsForDownloadingData);
- ser.syncAsByte(_awayMission.mudd.contactedEnterpriseFirstTime);
- ser.syncAsByte(_awayMission.mudd.viewScreenEnabled);
- ser.syncAsByte(_awayMission.mudd.lifeSupportMalfunctioning);
- ser.syncAsByte(_awayMission.mudd.numTimesEnteredRoom5);
- ser.syncAsByte(_awayMission.mudd.gotMemoryDisk);
- ser.syncAsByte(_awayMission.mudd.gotLense);
- ser.syncAsByte(_awayMission.mudd.gotDegrimer);
- ser.syncAsByte(_awayMission.mudd.putCapsuleInMedicalMachine);
- ser.syncAsByte(_awayMission.mudd.muddUnconscious);
- ser.syncAsByte(_awayMission.mudd.muddInsanityState);
- ser.syncAsByte(_awayMission.mudd.muddInhaledGas);
- ser.syncAsSint16LE(_awayMission.mudd.lifeSupportTimer);
- ser.syncAsByte(_awayMission.mudd.startedLifeSupportTimer);
- ser.syncAsByte(_awayMission.mudd.enteredRoom0ForFirstTime);
- ser.syncAsByte(_awayMission.mudd.gotPointsForLoadingTorpedo);
- ser.syncAsByte(_awayMission.mudd.gotPointsForPressingRedButton);
- ser.syncAsByte(_awayMission.mudd.gotPointsForEnablingViewscreen);
- ser.syncAsByte(_awayMission.mudd.enteredRoom1ForFirstTime);
- ser.syncAsByte(_awayMission.mudd.repairedLifeSupportGenerator);
- ser.syncAsSint16LE(_awayMission.mudd.missionScore);
-
- // mudd3
- ser.syncAsByte(_room->_roomVar.mudd.suggestedUsingTricorders);
- ser.syncAsByte(_room->_roomVar.mudd.tricordersUnavailable);
-
- // mudd4
- ser.syncAsByte(_room->_roomVar.mudd.usingLeftConsole);
- ser.syncAsByte(_room->_roomVar.mudd.kirkUsingRightConsole);
-
- // common
- ser.syncAsByte(_room->_roomVar.mudd.walkingToDoor);
+ _awayMission.mudd.saveLoadWithSerializer(ser);
+ _room->_roomVar.mudd.saveLoadWithSerializer(ser);
} else if (_missionName == "FEATHER") {
- ser.syncAsByte(_awayMission.feather.diedFromStalactites);
- ser.syncAsByte(_awayMission.feather.vineState);
- ser.syncAsByte(_awayMission.feather.gotRock);
- ser.syncAsByte(_awayMission.feather.gotSnake);
- ser.syncAsByte(_awayMission.feather.tookKnife);
- ser.syncAsByte(_awayMission.feather.field2e);
- ser.syncAsByte(_awayMission.feather.numRocksThrownAtTlaoxac);
- ser.syncAsByte(_awayMission.feather.gotFern);
- ser.syncAsByte(_awayMission.feather.holeBlocked);
- ser.syncAsByte(_awayMission.feather.tlaoxacTestPassed);
- ser.syncAsByte(_awayMission.feather.knockedOutTlaoxac);
- ser.syncAsByte(_awayMission.feather.waterMonsterRetreated);
- ser.syncAsByte(_awayMission.feather.showedSnakeToTlaoxac);
- ser.syncAsSint16LE(_awayMission.feather.missionScore);
-
- // feather1
- ser.syncAsByte(_room->_roomVar.feather.snakeInHole);
- ser.syncAsByte(_room->_roomVar.feather.scannedSnake);
- ser.syncBytes(_room->_roomVar.feather.crewEscaped, 4);
- ser.syncAsByte(_room->_roomVar.feather.crewmanClimbingVine);
-
- // feather2
- ser.syncAsByte(_room->_roomVar.feather.showedSnakeToTlaoxac);
- ser.syncAsByte(_room->_roomVar.feather.tlaoxacUnconscious);
-
- // feather6
- ser.syncAsByte(_room->_roomVar.feather.usedRockOnCrystalsOnce);
-
- // feather7
- ser.syncAsByte(_room->_roomVar.feather.insultedQuetzecoatl);
+ _awayMission.feather.saveLoadWithSerializer(ser);
+ _room->_roomVar.feather.saveLoadWithSerializer(ser);
} else if (_missionName == "TRIAL") {
- ser.syncAsSint16LE(_awayMission.trial.missionScore);
- ser.syncAsSint16LE(_awayMission.trial.field2b);
- ser.syncAsByte(_awayMission.trial.entityDefeated);
- ser.syncAsByte(_awayMission.trial.doorOpen);
- ser.syncAsByte(_awayMission.trial.scannedLock);
- ser.syncAsByte(_awayMission.trial.doorCodeBehaviour);
- ser.syncAsByte(_awayMission.trial.globSplitInTwo);
- ser.syncAsByte(_awayMission.trial.globDefeated);
- ser.syncBytes(_awayMission.trial.globEnergyLevels, 3);
- ser.syncAsByte(_awayMission.trial.enteredTrial3FirstTime);
- ser.syncAsByte(_awayMission.trial.klingonShootIndex);
- ser.syncAsByte(_awayMission.trial.shotKlingons);
- ser.syncAsSint16LE(_awayMission.trial.shotKlingonState);
- ser.syncAsByte(_awayMission.trial.neuralInterfaceActive);
- for (int i = 0; i < 3; i++)
- ser.syncAsSint16LE(_awayMission.trial.holeContents[i]);
- ser.syncAsByte(_awayMission.trial.enteredGlobRoom);
- ser.syncAsByte(_awayMission.trial.forceFieldDown);
- ser.syncAsByte(_awayMission.trial.uhuraAnalyzedCode);
- ser.syncAsSint16LE(_awayMission.trial.missionEndMethod);
- ser.syncAsByte(_awayMission.trial.gotPointsForGettingRod);
- ser.syncAsByte(_awayMission.trial.gotPointsForCoatingRodWithIron);
- ser.syncAsByte(_awayMission.trial.gotPointsForActivatingInterface);
- ser.syncAsByte(_awayMission.trial.gotPointsForScanningGlob);
- ser.syncAsByte(_awayMission.trial.gotPointsForBeamingOut);
-
- // trial2
- ser.syncAsByte(_room->_roomVar.trial.globBeingShot);
- ser.syncAsByte(_room->_roomVar.trial.phaserOnKill);
-
- // trial5
- ser.syncAsSint16LE(_room->_roomVar.trial.itemToUse);
- ser.syncAsSint16LE(_room->_roomVar.trial.objectToUse);
- ser.syncAsSint16LE(_room->_roomVar.trial.hole);
+ _awayMission.trial.saveLoadWithSerializer(ser);
+ _room->_roomVar.trial.saveLoadWithSerializer(ser);
}
// The action queue