aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Stewart2018-07-27 20:32:29 -0400
committerEugene Sandulenko2018-08-09 08:37:30 +0200
commit8970909318c158b18eb5612f26db1d4db941160f (patch)
tree90e18c918e1cdca7b9fb6b9e6bf8b13c7ff4ed52 /engines
parent42b228144ad5f19c412e24a8c98e536908748f95 (diff)
downloadscummvm-rg350-8970909318c158b18eb5612f26db1d4db941160f.tar.gz
scummvm-rg350-8970909318c158b18eb5612f26db1d4db941160f.tar.bz2
scummvm-rg350-8970909318c158b18eb5612f26db1d4db941160f.zip
STARTREK: Reorganize includes in room.h
This should avoid the costly rebuild of everything in the 'rooms/' folder, at least sometimes...
Diffstat (limited to 'engines')
-rw-r--r--engines/startrek/awaymission.h2
-rw-r--r--engines/startrek/room.cpp6
-rw-r--r--engines/startrek/room.h8
-rw-r--r--engines/startrek/rooms/demon0.cpp52
-rw-r--r--engines/startrek/rooms/demon1.cpp146
-rw-r--r--engines/startrek/rooms/demon2.cpp16
-rw-r--r--engines/startrek/rooms/demon3.cpp132
-rw-r--r--engines/startrek/rooms/demon4.cpp97
-rw-r--r--engines/startrek/rooms/demon5.cpp44
-rw-r--r--engines/startrek/rooms/demon6.cpp61
-rw-r--r--engines/startrek/rooms/feather0.cpp8
-rw-r--r--engines/startrek/rooms/feather1.cpp98
-rw-r--r--engines/startrek/rooms/feather3.cpp106
-rw-r--r--engines/startrek/rooms/feather5.cpp58
-rw-r--r--engines/startrek/rooms/feather6.cpp26
-rw-r--r--engines/startrek/rooms/feather7.cpp18
-rw-r--r--engines/startrek/rooms/love0.cpp44
-rw-r--r--engines/startrek/rooms/love1.cpp122
-rw-r--r--engines/startrek/rooms/love2.cpp174
-rw-r--r--engines/startrek/rooms/love3.cpp118
-rw-r--r--engines/startrek/rooms/love4.cpp54
-rw-r--r--engines/startrek/rooms/love5.cpp94
-rw-r--r--engines/startrek/rooms/lovea.cpp66
-rw-r--r--engines/startrek/rooms/mudd0.cpp70
-rw-r--r--engines/startrek/rooms/mudd1.cpp62
-rw-r--r--engines/startrek/rooms/mudd2.cpp128
-rw-r--r--engines/startrek/rooms/mudd3.cpp158
-rw-r--r--engines/startrek/rooms/mudd4.cpp168
-rw-r--r--engines/startrek/rooms/mudd5.cpp54
-rw-r--r--engines/startrek/rooms/mudda.cpp36
-rw-r--r--engines/startrek/rooms/sins0.cpp30
-rw-r--r--engines/startrek/rooms/sins1.cpp54
-rw-r--r--engines/startrek/rooms/trial0.cpp22
-rw-r--r--engines/startrek/rooms/trial1.cpp150
-rw-r--r--engines/startrek/rooms/trial2.cpp74
-rw-r--r--engines/startrek/rooms/trial3.cpp92
-rw-r--r--engines/startrek/rooms/trial4.cpp4
-rw-r--r--engines/startrek/rooms/trial5.cpp60
-rw-r--r--engines/startrek/rooms/tug0.cpp138
-rw-r--r--engines/startrek/rooms/tug1.cpp68
-rw-r--r--engines/startrek/rooms/tug2.cpp386
-rw-r--r--engines/startrek/rooms/tug3.cpp220
-rw-r--r--engines/startrek/sound.h61
-rw-r--r--engines/startrek/soundeffects.h87
44 files changed, 1856 insertions, 1816 deletions
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index e1ecc1ff6e..ad3206f255 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -180,7 +180,7 @@ struct AwayMission {
// 1: Decided to shoot them
// 2: Talked, and they surrendered immediately
- // 3: They deorbited the ship (and perhps surrendered after)
+ // 3: They deorbited the ship (and perhaps surrendered after)
byte bridgeWinMethod; // 0x5e
bool talkedToBrigCrewman; // 0x5f
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index a8a4b490f4..59ed8fb115 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -45,7 +45,7 @@
namespace StarTrek {
-Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
+Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm), _awayMission(&vm->_awayMission) {
SharedPtr<FileStream> rdfFile = _vm->loadFile(name + ".RDF");
int size = rdfFile->size();
@@ -502,6 +502,10 @@ void Room::stopAllVocSounds() {
_vm->_sound->stopAllVocSounds();
}
+Common::String Room::getCrewmanAnimFilename(int object, const Common::String &str) {
+ return _vm->getCrewmanAnimFilename(object, str);
+}
+
void Room::spockScan(int direction, TextRef text, bool changeDirection) {
const char *dirs = "nsew";
Common::String anim = "sscan_";
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index dff0bcaad1..53c0b07f04 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -27,8 +27,11 @@
#include "common/ptr.h"
#include "common/str.h"
+#include "startrek/action.h"
+#include "startrek/awaymission.h"
#include "startrek/fixedint.h"
-#include "startrek/startrek.h"
+#include "startrek/object.h"
+#include "startrek/soundeffects.h"
#include "startrek/text.h"
using Common::SharedPtr;
@@ -141,6 +144,7 @@ public:
private:
StarTrekEngine *_vm;
+ AwayMission *_awayMission;
const RoomAction *_roomActionList;
int _numRoomActions;
@@ -252,6 +256,8 @@ private:
// Helper functions for repetitive stuff.
+ Common::String getCrewmanAnimFilename(int object, const Common::String &str);
+
/**
* If "changeDirection" is true, they remain facing that direction even after their
* animation is finished. The game is inconsistent about doing this.
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp
index 189509a3cf..6dd3315c62 100644
--- a/engines/startrek/rooms/demon0.cpp
+++ b/engines/startrek/rooms/demon0.cpp
@@ -31,42 +31,42 @@ void Room::demon0Tick1() {
}
void Room::demon0Tick2() {
- if (_vm->_awayMission.demon.talkedToPrelate)
+ if (_awayMission->demon.talkedToPrelate)
return;
loadActorAnim(8, "prel", 120, 190, 0);
}
void Room::demon0Tick60() {
- if (_vm->_awayMission.demon.talkedToPrelate)
+ if (_awayMission->demon.talkedToPrelate)
return;
loadActorAnim2(8, "prelclap", 120, 190, 0);
}
void Room::demon0Tick100() {
- if (_vm->_awayMission.demon.talkedToPrelate || _vm->_awayMission.demon.prelateWelcomedCrew)
+ if (_awayMission->demon.talkedToPrelate || _awayMission->demon.prelateWelcomedCrew)
return;
- _vm->_awayMission.demon.prelateWelcomedCrew = true;
+ _awayMission->demon.prelateWelcomedCrew = true;
showText(TX_SPEAKER_ANGIVEN, TX_DEM0_036);
}
void Room::demon0Tick140() {
- if (_vm->_awayMission.demon.mccoyMentionedFlora)
+ if (_awayMission->demon.mccoyMentionedFlora)
return;
showText(TX_SPEAKER_MCCOY, TX_DEM0_016);
- _vm->_awayMission.demon.mccoyMentionedFlora = true;
+ _awayMission->demon.mccoyMentionedFlora = true;
}
void Room::demon0TouchedWarp0() {
- _vm->_awayMission.demon.enteredFrom = 1;
- _vm->_awayMission.rdfStillDoDefaultAction = true;
+ _awayMission->demon.enteredFrom = 1;
+ _awayMission->rdfStillDoDefaultAction = true;
}
void Room::demon0WalkToBottomDoor() {
- _vm->_awayMission.disableInput = 1;
+ _awayMission->disableInput = 1;
_roomVar.demon.movingToBottomDoor = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 243, 158, 1);
}
@@ -84,9 +84,9 @@ void Room::demon0ReachedBottomDoor() {
}
void Room::demon0WalkToTopDoor() {
- _vm->_awayMission.disableInput = 1;
+ _awayMission->disableInput = 1;
_roomVar.demon.movingToTopDoor = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 157, 134, 2);
}
@@ -154,11 +154,11 @@ void Room::demon0TalkToPrelate() {
TX_BLANK
};
- if (_vm->_awayMission.demon.talkedToPrelate)
+ if (_awayMission->demon.talkedToPrelate)
return;
- _vm->_awayMission.demon.missionScore += 3;
- _vm->_awayMission.demon.talkedToPrelate = true;
+ _awayMission->demon.missionScore += 3;
+ _awayMission->demon.talkedToPrelate = true;
const int *response = nullptr;
@@ -187,7 +187,7 @@ void Room::demon0TalkToPrelate() {
showText(thirdResponse);
- if (_vm->_awayMission.demon.wasRudeToPrelate)
+ if (_awayMission->demon.wasRudeToPrelate)
showText(badConclusion);
else
showText(goodConclusion);
@@ -209,7 +209,7 @@ void Room::demon0UsePhaserOnSign() {
void Room::demon0UsePhaserOnShelter() {
showText(TX_SPEAKER_MCCOY, TX_DEM0_015);
showText(TX_SPEAKER_SPOCK, TX_DEM0_013);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_EVERTS, TX_DEM0_040);
}
@@ -274,15 +274,15 @@ void Room::demon0TalkToRedshirt() {
}
void Room::demon0TalkToMcCoy() {
- if (_vm->_awayMission.demon.talkedToPrelate) {
+ if (_awayMission->demon.talkedToPrelate) {
showText(TX_SPEAKER_KIRK, TX_DEM0_011);
showText(TX_SPEAKER_MCCOY, TX_DEM0_023);
showText(TX_SPEAKER_SPOCK, TX_DEM0_029);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_EVERTS, TX_DEM0_041);
} else {
showText(TX_SPEAKER_MCCOY, TX_DEM0_019);
- if (!_vm->_awayMission.demon.askedPrelateAboutSightings) {
+ if (!_awayMission->demon.askedPrelateAboutSightings) {
demon0AskPrelateAboutSightings();
}
}
@@ -291,7 +291,7 @@ void Room::demon0TalkToMcCoy() {
void Room::demon0TalkToSpock() {
showText(TX_SPEAKER_SPOCK, TX_DEM0_014);
- if (!_vm->_awayMission.demon.talkedToPrelate && !_vm->_awayMission.demon.askedPrelateAboutSightings)
+ if (!_awayMission->demon.talkedToPrelate && !_awayMission->demon.askedPrelateAboutSightings)
demon0AskPrelateAboutSightings();
}
@@ -299,7 +299,7 @@ void Room::demon0AskPrelateAboutSightings() {
showText(TX_SPEAKER_KIRK, TX_DEM0_001);
showText(TX_SPEAKER_ANGIVEN, TX_DEM0_030);
- _vm->_awayMission.demon.askedPrelateAboutSightings = true;
+ _awayMission->demon.askedPrelateAboutSightings = true;
}
void Room::demon0UseSTricorderAnywhere() {
@@ -318,7 +318,7 @@ void Room::demon0UseMTricorderOnPrelate() {
loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
playSoundEffectIndex(0x04);
- if (_vm->_awayMission.demon.talkedToPrelate)
+ if (_awayMission->demon.talkedToPrelate)
showText(TX_SPEAKER_MCCOY, TX_DEM0_018);
else
showText(TX_SPEAKER_MCCOY, TX_DEM0_022);
@@ -326,11 +326,11 @@ void Room::demon0UseMTricorderOnPrelate() {
// Helper functions
void Room::demon0BadResponse() {
- if (_vm->_awayMission.demon.wasRudeToPrelate)
+ if (_awayMission->demon.wasRudeToPrelate)
return;
- _vm->_awayMission.demon.missionScore -= 3;
- _vm->_awayMission.demon.wasRudeToPrelate = true;
+ _awayMission->demon.missionScore -= 3;
+ _awayMission->demon.wasRudeToPrelate = true;
showText(TX_SPEAKER_ANGIVEN, TX_DEM0_033);
}
diff --git a/engines/startrek/rooms/demon1.cpp b/engines/startrek/rooms/demon1.cpp
index c1519b79a2..92882abf4b 100644
--- a/engines/startrek/rooms/demon1.cpp
+++ b/engines/startrek/rooms/demon1.cpp
@@ -29,27 +29,27 @@ namespace StarTrek {
void Room::demon1Tick1() {
playVoc("DEM1LOOP");
- if (!_vm->_awayMission.demon.beatKlingons)
+ if (!_awayMission->demon.beatKlingons)
playMidiMusicTracks(1, -1);
- if (_vm->_awayMission.demon.enteredFrom == 1) { // Entered from south
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
- } else if (_vm->_awayMission.demon.enteredFrom == 2) { // Entered from north?
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+ if (_awayMission->demon.enteredFrom == 1) { // Entered from south
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
+ } else if (_awayMission->demon.enteredFrom == 2) { // Entered from north?
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
}
- if (!_vm->_awayMission.demon.beatKlingons) {
- _vm->_awayMission.disableWalking = true;
- _vm->_awayMission.timers[2] = 50;
+ if (!_awayMission->demon.beatKlingons) {
+ _awayMission->disableWalking = true;
+ _awayMission->timers[2] = 50;
} else {
loadActorAnim(8, "klg1d2", 0x120, 0x82, 0);
- if (!_vm->_awayMission.demon.tookKlingonHand)
+ if (!_awayMission->demon.tookKlingonHand)
loadActorAnim(13, "klghnd", 0x10b, 0x8e, 0);
loadActorAnim(9, "klg2d2", 0xaa, 0x7c, 0);
loadActorAnim(10, "klg3d2", 0, 0, 0);
@@ -68,26 +68,26 @@ void Room::demon1WalkToCave() {
}
void Room::demon1TouchedTopWarp() {
- if (_vm->_awayMission.demon.warpsDisabled)
+ if (_awayMission->demon.warpsDisabled)
return;
loadRoomIndex(2, 1);
}
void Room::demon1TouchedBottomWarp() {
- if (_vm->_awayMission.demon.warpsDisabled)
+ if (_awayMission->demon.warpsDisabled)
return;
loadRoomIndex(0, 0);
}
void Room::demon1Timer2Expired() {
- if (_vm->_awayMission.demon.beatKlingons)
+ if (_awayMission->demon.beatKlingons)
return;
- _vm->_awayMission.demon.field37 = 1;
- _vm->_awayMission.demon.beatKlingons = true;
- _vm->_awayMission.demon.warpsDisabled = true;
- _vm->_awayMission.timers[0] = 5;
- _vm->_awayMission.timers[3] = 2;
- _vm->_awayMission.timers[1] = 100;
+ _awayMission->demon.field37 = 1;
+ _awayMission->demon.beatKlingons = true;
+ _awayMission->demon.warpsDisabled = true;
+ _awayMission->timers[0] = 5;
+ _awayMission->timers[3] = 2;
+ _awayMission->timers[1] = 100;
loadActorAnim(8, "klg1u", 0x120, 0x82, 0);
}
@@ -189,11 +189,11 @@ void Room::demon1KlingonFinishedAimingWeapon() {
crewman = OBJECT_KIRK;
}
- _vm->_awayMission.crewDirectionsAfterWalk[crewman] = DIR_N;
- _vm->_awayMission.crewGetupTimers[crewman] = 650;
- _vm->_awayMission.crewDownBitset |= (1 << crewman);
+ _awayMission->crewDirectionsAfterWalk[crewman] = DIR_N;
+ _awayMission->crewGetupTimers[crewman] = 650;
+ _awayMission->crewDownBitset |= (1 << crewman);
- _vm->_awayMission.timers[1] = 100;
+ _awayMission->timers[1] = 100;
}
void Room::demon1KirkShot() {
@@ -209,7 +209,7 @@ void Room::demon1UsePhaserOnAnything() {
void Room::demon1UsePhaserOnKlingon1() {
if (_roomVar.demon.klingonShot[0])
return;
- _vm->_awayMission.disableInput = 1;
+ _awayMission->disableInput = 1;
_roomVar.demon.klingonShot[0] = true;
if (_roomVar.demon.kirkShooting) {
@@ -223,11 +223,11 @@ void Room::demon1UsePhaserOnKlingon1() {
void Room::demon1ShootKlingon1() {
_roomVar.demon.numKlingonsKilled++;
if (_roomVar.demon.numKlingonsKilled == 3) {
- _vm->_awayMission.timers[1] = 0;
- _vm->_awayMission.timers[5] = 180;
- _vm->_awayMission.timers[6] = 1;
- _vm->_awayMission.demon.warpsDisabled = false;
- _vm->_awayMission.disableWalking = false;
+ _awayMission->timers[1] = 0;
+ _awayMission->timers[5] = 180;
+ _awayMission->timers[6] = 1;
+ _awayMission->demon.warpsDisabled = false;
+ _awayMission->disableWalking = false;
}
loadActorAnim(12, "s0ks1", 0, 0, 0);
playSoundEffectIndex(0x06);
@@ -237,11 +237,11 @@ void Room::demon1ShootKlingon1() {
void Room::demon1KlingonDropsHand() {
loadActorAnim(13, "klghnd", 0x10b, 0x8e, 0);
- _vm->_awayMission.disableInput = 0;
- _vm->_awayMission.timers[1] = 0;
+ _awayMission->disableInput = 0;
+ _awayMission->timers[1] = 0;
showText(TX_DEM1N020);
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_REDSHIRT))
return;
showText(TX_SPEAKER_EVERTS, TX_DEM1_025);
@@ -251,13 +251,13 @@ void Room::demon1KlingonDropsHand() {
showText(TX_SPEAKER_KLINGON, TX_DEM1_F23);
- _vm->_awayMission.timers[1] = 1;
+ _awayMission->timers[1] = 1;
}
void Room::demon1UsePhaserOnKlingon2() {
if (_roomVar.demon.klingonShot[1])
return;
- _vm->_awayMission.disableInput = 1;
+ _awayMission->disableInput = 1;
_roomVar.demon.klingonShot[1] = true;
if (_roomVar.demon.kirkShooting) {
@@ -271,22 +271,22 @@ void Room::demon1UsePhaserOnKlingon2() {
void Room::demon1ShootKlingon2() {
_roomVar.demon.numKlingonsKilled++;
if (_roomVar.demon.numKlingonsKilled == 3) {
- _vm->_awayMission.timers[1] = 0;
- _vm->_awayMission.timers[5] = 180;
- _vm->_awayMission.timers[6] = 1;
- _vm->_awayMission.demon.warpsDisabled = false;
- _vm->_awayMission.disableWalking = false;
+ _awayMission->timers[1] = 0;
+ _awayMission->timers[5] = 180;
+ _awayMission->timers[6] = 1;
+ _awayMission->demon.warpsDisabled = false;
+ _awayMission->disableWalking = false;
}
loadActorAnim(12, "s0ks2", 0, 0, 0);
playSoundEffectIndex(0x06);
loadActorAnim2(9, "klg2d", 0xaa, 0x7c, 0);
- _vm->_awayMission.disableInput = 0;
+ _awayMission->disableInput = 0;
}
void Room::demon1UsePhaserOnKlingon3() {
if (_roomVar.demon.klingonShot[2])
return;
- _vm->_awayMission.disableInput = 1;
+ _awayMission->disableInput = 1;
_roomVar.demon.klingonShot[2] = true;
if (_roomVar.demon.kirkShooting) {
@@ -300,28 +300,28 @@ void Room::demon1UsePhaserOnKlingon3() {
void Room::demon1ShootKlingon3() {
_roomVar.demon.numKlingonsKilled++;
if (_roomVar.demon.numKlingonsKilled == 3) {
- _vm->_awayMission.timers[1] = 0;
- _vm->_awayMission.timers[5] = 180;
- _vm->_awayMission.timers[6] = 1;
- _vm->_awayMission.demon.warpsDisabled = false;
- _vm->_awayMission.disableWalking = false;
+ _awayMission->timers[1] = 0;
+ _awayMission->timers[5] = 180;
+ _awayMission->timers[6] = 1;
+ _awayMission->demon.warpsDisabled = false;
+ _awayMission->disableWalking = false;
}
loadActorAnim(12, "s0ks3", 0, 0, 0);
playSoundEffectIndex(0x06);
loadActorAnim2(10, "klg3d", 0, 0, 0);
- _vm->_awayMission.disableInput = 0;
+ _awayMission->disableInput = 0;
}
// Timer 6 expired
void Room::demon1AllKlingonsDead() {
- _vm->_awayMission.crewGetupTimers[OBJECT_KIRK] = 45;
- _vm->_awayMission.crewGetupTimers[OBJECT_SPOCK] = 45;
- _vm->_awayMission.crewGetupTimers[OBJECT_MCCOY] = 45;
- _vm->_awayMission.crewGetupTimers[OBJECT_REDSHIRT] = 45;
+ _awayMission->crewGetupTimers[OBJECT_KIRK] = 45;
+ _awayMission->crewGetupTimers[OBJECT_SPOCK] = 45;
+ _awayMission->crewGetupTimers[OBJECT_MCCOY] = 45;
+ _awayMission->crewGetupTimers[OBJECT_REDSHIRT] = 45;
}
void Room::demon1Timer5Expired() {
- if (_vm->_awayMission.crewDownBitset != 0)
+ if (_awayMission->crewDownBitset != 0)
return;
showText(TX_SPEAKER_UHURA, TX_DEM1U077);
@@ -377,7 +377,7 @@ void Room::demon1UseSTricorderOnKlingon1() {
playSoundEffectIndex(0x04);
- if (_roomVar.demon.numKlingonsKilled == 3 && !_vm->_awayMission.demon.tookKlingonHand && _rdfData[0xcf] != 1) {
+ if (_roomVar.demon.numKlingonsKilled == 3 && !_awayMission->demon.tookKlingonHand && _rdfData[0xcf] != 1) {
showText(TX_SPEAKER_SPOCK, TX_DEM1_018);
_rdfData[0xcf] = 1;
} else {
@@ -392,17 +392,17 @@ void Room::demon1UseSTricorderOnKlingon2Or3() {
}
void Room::demon1UseMTricorderOnKirk() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_KIRK))
demon1UseMTricorderOnCrewman();
}
void Room::demon1UseMTricorderOnSpock() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_SPOCK))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_SPOCK))
demon1UseMTricorderOnCrewman();
}
void Room::demon1UseMTricorderOnRedshirt() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_REDSHIRT))
demon1UseMTricorderOnCrewman();
}
@@ -424,18 +424,18 @@ void Room::demon1ReachedHand() {
void Room::demon1PickedUpHand() {
loadActorStandAnim(13);
- _vm->_awayMission.demon.missionScore += 3;
+ _awayMission->demon.missionScore += 3;
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.timers[4] = 2;
+ _awayMission->timers[4] = 2;
}
// Timer 4 expired
void Room::demon1FinishedGettingHand() {
- if (_vm->_awayMission.demon.tookKlingonHand)
+ if (_awayMission->demon.tookKlingonHand)
showText(TX_DEM1N005);
else {
- _vm->_awayMission.demon.tookKlingonHand = true;
+ _awayMission->demon.tookKlingonHand = true;
giveItem(OBJECT_IHAND);
showText(TX_DEM1N007);
}
@@ -481,42 +481,42 @@ void Room::demon1LookAnywhere() {
}
void Room::demon1LookAtKirk() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_KIRK))
showText(TX_DEM1N012);
else
showText(TX_DEM1N003);
}
void Room::demon1LookAtSpock() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_SPOCK))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_SPOCK))
showText(TX_DEM1N015);
else
showText(TX_DEM1N008);
}
void Room::demon1LookAtMcCoy() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_MCCOY))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_MCCOY))
showText(TX_DEM1N013);
else
showText(TX_DEM1N001);
}
void Room::demon1LookAtRedshirt() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_REDSHIRT))
showText(TX_DEM1N014);
else
showText(TX_DEM1N002);
}
void Room::demon1TalkToKirk() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_KIRK))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_KIRK))
demon1TalkToUnconsciousCrewman();
else if (_roomVar.demon.numKlingonsKilled == 3)
showText(TX_SPEAKER_KIRK, TX_DEM1_001);
}
void Room::demon1TalkToSpock() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_SPOCK))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_SPOCK))
demon1TalkToUnconsciousCrewman();
else {
showText(TX_SPEAKER_SPOCK, TX_DEM1_022);
@@ -527,7 +527,7 @@ void Room::demon1TalkToSpock() {
}
void Room::demon1TalkToMcCoy() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_MCCOY))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_MCCOY))
demon1TalkToUnconsciousCrewman();
else {
showText(TX_SPEAKER_MCCOY, TX_DEM1_015);
@@ -536,7 +536,7 @@ void Room::demon1TalkToMcCoy() {
}
void Room::demon1TalkToRedshirt() {
- if (_vm->_awayMission.crewDownBitset & (1 << OBJECT_REDSHIRT))
+ if (_awayMission->crewDownBitset & (1 << OBJECT_REDSHIRT))
demon1TalkToUnconsciousCrewman();
else
showText(TX_SPEAKER_EVERTS, TX_DEM1_026);
diff --git a/engines/startrek/rooms/demon2.cpp b/engines/startrek/rooms/demon2.cpp
index 4e8f8b248e..d31f417a44 100644
--- a/engines/startrek/rooms/demon2.cpp
+++ b/engines/startrek/rooms/demon2.cpp
@@ -37,8 +37,8 @@ void Room::demon2ReachedCave() {
}
void Room::demon2TouchedWarp1() {
- _vm->_awayMission.demon.enteredFrom = 2;
- _vm->_awayMission.rdfStillDoDefaultAction = true;
+ _awayMission->demon.enteredFrom = 2;
+ _awayMission->rdfStillDoDefaultAction = true;
}
void Room::demon2LookAtCave() {
@@ -141,18 +141,18 @@ void Room::demon2UseMTricorderOnBerries() {
loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
playSoundEffectIndex(0x04);
- if (_vm->_awayMission.demon.curedChub)
+ if (_awayMission->demon.curedChub)
showText(TX_SPEAKER_MCCOY, TX_DEM2_013);
- else if (_vm->_awayMission.demon.madeHypoDytoxin)
+ else if (_awayMission->demon.madeHypoDytoxin)
showText(TX_SPEAKER_MCCOY, TX_DEM2_009);
- else if (_vm->_awayMission.demon.knowAboutHypoDytoxin)
+ else if (_awayMission->demon.knowAboutHypoDytoxin)
showText(TX_SPEAKER_MCCOY, TX_DEM2_010);
else
showText(TX_SPEAKER_MCCOY, TX_DEM2_012);
}
void Room::demon2GetBerries() {
- if (_vm->_awayMission.demon.gotBerries)
+ if (_awayMission->demon.gotBerries)
showText(TX_SPEAKER_MCCOY, TX_DEM2_014);
else
walkCrewman(OBJECT_KIRK, 0xe8, 0x97, 1);
@@ -166,8 +166,8 @@ void Room::demon2ReachedBerries() {
void Room::demon2PickedUpBerries() {
showText(TX_DEM2N013);
giveItem(OBJECT_IBERRY);
- _vm->_awayMission.demon.gotBerries = true;
- _vm->_awayMission.demon.missionScore += 1;
+ _awayMission->demon.gotBerries = true;
+ _awayMission->demon.missionScore += 1;
}
}
diff --git a/engines/startrek/rooms/demon3.cpp b/engines/startrek/rooms/demon3.cpp
index f862838483..e30a5fc671 100644
--- a/engines/startrek/rooms/demon3.cpp
+++ b/engines/startrek/rooms/demon3.cpp
@@ -29,36 +29,36 @@ void Room::demon3Tick1() {
loadActorAnim(8, "light", 0xab, 0x03, 0);
_roomVar.demon.boulder1Shot = true;
- if (!_vm->_awayMission.demon.boulder1Gone) {
+ if (!_awayMission->demon.boulder1Gone) {
loadActorAnim(9, "bldr1", 0x26, 0, 0);
_roomVar.demon.boulder1Shot = false;
}
- if (!_vm->_awayMission.demon.boulder2Gone) {
+ if (!_awayMission->demon.boulder2Gone) {
loadActorAnim(10, "bldr2", 0x22, 0, 0);
}
- if (!_vm->_awayMission.demon.boulder3Gone) {
+ if (!_awayMission->demon.boulder3Gone) {
loadActorAnim(11, "bldr3", 0x22, 0, 0);
}
- if (!_vm->_awayMission.demon.boulder4Gone) {
+ if (!_awayMission->demon.boulder4Gone) {
loadActorAnim(12, "bldr4", 0x22, 0, 0);
}
- if (_vm->_awayMission.demon.doorOpened) {
+ if (_awayMission->demon.doorOpened) {
loadActorAnim(14, "door2", 0x82, 0x0c, 0);
} else {
loadMapFile("demon3a");
}
- if (!_vm->_awayMission.demon.healedMiner && _vm->_awayMission.demon.boulder4Gone)
+ if (!_awayMission->demon.healedMiner && _awayMission->demon.boulder4Gone)
loadActorAnim(13, "miner", 0xda, 0x6c, 0);
- if (_vm->_awayMission.redshirtDead && !_vm->_awayMission.demon.field45)
+ if (_awayMission->redshirtDead && !_awayMission->demon.field45)
loadActorAnim(OBJECT_REDSHIRT, "deadre", 0x46, 0xa0, 0);
- if (_vm->_awayMission.demon.field41 == 0)
- _vm->_awayMission.demon.field41++;
+ if (_awayMission->demon.field41 == 0)
+ _awayMission->demon.field41++;
- if (!_vm->_awayMission.demon.field56) {
- _vm->_awayMission.demon.field56 = true;
+ if (!_awayMission->demon.field56) {
+ _awayMission->demon.field56 = true;
playMidiMusicTracks(0, -1);
}
}
@@ -67,10 +67,10 @@ void Room::demon3Tick1() {
void Room::demon3Timer0Expired() {
_roomVar.demon.boulder1Shot = true;
loadActorAnim2(9, "drbldr", 0x26, 0, 0);
- _vm->_awayMission.timers[1] = 13;
- _vm->_awayMission.demon.boulder1Gone = true;
- _vm->_awayMission.demon.numBouldersGone++;
- _vm->_awayMission.disableInput = true;
+ _awayMission->timers[1] = 13;
+ _awayMission->demon.boulder1Gone = true;
+ _awayMission->demon.numBouldersGone++;
+ _awayMission->disableInput = true;
playMidiMusicTracks(2, -1);
playVoc("BOULDERK");
}
@@ -84,12 +84,12 @@ void Room::demon3Timer1Expired() {
// Door just opened
void Room::demon3Timer3Expired() {
- if (_vm->_awayMission.demon.repairedHand) {
+ if (_awayMission->demon.repairedHand) {
showText(TX_DEM3N008);
loadActorAnim(14, "door", 0x82, 0xc, 0);
loadMapFile("demon3");
- _vm->_awayMission.demon.doorOpened = true;
- _vm->_awayMission.demon.missionScore += 2;
+ _awayMission->demon.doorOpened = true;
+ _awayMission->demon.missionScore += 2;
} else {
showText(TX_DEM3N007);
}
@@ -101,7 +101,7 @@ void Room::demon3FinishedAnimation1() {
loadActorStandAnim(OBJECT_SPOCK);
walkCrewman(OBJECT_MCCOY, 0x9c, 0xb2, 5);
_roomVar.demon.inFiringPosition = false;
- _vm->_awayMission.redshirtDead = true;
+ _awayMission->redshirtDead = true;
}
// Just destroyed boulder 4 (revealing the miner)
@@ -114,7 +114,7 @@ void Room::demon3FinishedWalking5() {
playSoundEffectIndex(0x04);
showText(TX_SPEAKER_MCCOY, TX_DEM3_019);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::demon3McCoyInFiringPosition() {
@@ -142,7 +142,7 @@ void Room::demon3KirkInFiringPosition() {
}
void Room::demon3CrewmanInFiringPosition() {
- if (_roomVar.demon.kirkInPosition && _roomVar.demon.spockInPosition && _roomVar.demon.mccoyInPosition && (_vm->_awayMission.redshirtDead || _roomVar.demon.redshirtInPosition))
+ if (_roomVar.demon.kirkInPosition && _roomVar.demon.spockInPosition && _roomVar.demon.mccoyInPosition && (_awayMission->redshirtDead || _roomVar.demon.redshirtInPosition))
demon3PullOutPhaserAndFireAtBoulder();
}
@@ -191,12 +191,12 @@ void Room::demon3FireAtBoulder() {
loadActorAnim(17, _roomVar.demon.boulderAnim, 0, 0, 0);
playSoundEffectIndex(0x06);
if (!_roomVar.demon.boulder1Shot)
- _vm->_awayMission.timers[0] = 1;
- _vm->_awayMission.disableInput = false;
+ _awayMission->timers[0] = 1;
+ _awayMission->disableInput = false;
}
void Room::demon3UsePhaserOnRedshirt() {
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
return;
showText(TX_SPEAKER_MCCOY, TX_DEM3_013);
}
@@ -206,10 +206,10 @@ void Room::demon3UseStunPhaserOnBoulder() {
}
void Room::demon3UsePhaserOnBoulder1() {
- if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder1Gone)
+ if (_roomVar.demon.shootingBoulder || _awayMission->demon.boulder1Gone)
return;
- _vm->_awayMission.demon.boulder1Gone = true;
- _vm->_awayMission.demon.numBouldersGone++;
+ _awayMission->demon.boulder1Gone = true;
+ _awayMission->demon.numBouldersGone++;
_roomVar.demon.boulderBeingShot = 1;
_roomVar.demon.boulder1Shot = true;
strcpy(_roomVar.demon.boulderAnim, "s0r3s2");
@@ -217,21 +217,21 @@ void Room::demon3UsePhaserOnBoulder1() {
}
void Room::demon3UsePhaserOnBoulder2() {
- if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder2Gone)
+ if (_roomVar.demon.shootingBoulder || _awayMission->demon.boulder2Gone)
return;
- _vm->_awayMission.demon.boulder2Gone = true;
- _vm->_awayMission.demon.numBouldersGone++;
+ _awayMission->demon.boulder2Gone = true;
+ _awayMission->demon.numBouldersGone++;
_roomVar.demon.boulderBeingShot = 2;
strcpy(_roomVar.demon.boulderAnim, "s0r3s3");
demon3BoulderCommon();
}
void Room::demon3UsePhaserOnBoulder3() {
- if (_vm->_awayMission.demon.boulder1Gone) {
- if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder3Gone)
+ if (_awayMission->demon.boulder1Gone) {
+ if (_roomVar.demon.shootingBoulder || _awayMission->demon.boulder3Gone)
return;
- _vm->_awayMission.demon.boulder3Gone = true;
- _vm->_awayMission.demon.numBouldersGone++;
+ _awayMission->demon.boulder3Gone = true;
+ _awayMission->demon.numBouldersGone++;
_roomVar.demon.boulderBeingShot = 3;
strcpy(_roomVar.demon.boulderAnim, "s0r3s1");
demon3BoulderCommon();
@@ -241,14 +241,14 @@ void Room::demon3UsePhaserOnBoulder3() {
}
void Room::demon3UsePhaserOnBoulder4() {
- if (_vm->_awayMission.demon.boulder2Gone) {
- if (_roomVar.demon.shootingBoulder || _vm->_awayMission.demon.boulder4Gone)
+ if (_awayMission->demon.boulder2Gone) {
+ if (_roomVar.demon.shootingBoulder || _awayMission->demon.boulder4Gone)
return;
- _vm->_awayMission.demon.boulder4Gone = true;
- _vm->_awayMission.demon.numBouldersGone++;
+ _awayMission->demon.boulder4Gone = true;
+ _awayMission->demon.numBouldersGone++;
_roomVar.demon.boulderBeingShot = 4;
strcpy(_roomVar.demon.boulderAnim, "s0r3s4");
- _vm->_awayMission.demon.foundMiner = true;
+ _awayMission->demon.foundMiner = true;
demon3BoulderCommon();
} else {
// BUGFIX: In the original, the audio didn't play, despite the file existing (and
@@ -258,7 +258,7 @@ void Room::demon3UsePhaserOnBoulder4() {
}
void Room::demon3BoulderCommon() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
Common::Point pos = getActorPos(OBJECT_KIRK);
if (!(pos.x == 0x79 && pos.y == 0xa0)) {
_roomVar.demon.inFiringPosition = false;
@@ -273,7 +273,7 @@ void Room::demon3BoulderCommon() {
walkCrewman(OBJECT_KIRK, 0x79, 0xa0, 1);
walkCrewman(OBJECT_SPOCK, 0xae, 0xb4, 2);
walkCrewman(OBJECT_MCCOY, 0xd6, 0xb8, 3);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
walkCrewman(OBJECT_REDSHIRT, 0x46, 0xa0, 4);
_roomVar.demon.shootingBoulder = true;
@@ -294,7 +294,7 @@ void Room::demon3UseSTricorderOnPanel() {
}
void Room::demon3UseSTricorderOnBoulder() {
- if (_vm->_awayMission.demon.foundMiner)
+ if (_awayMission->demon.foundMiner)
return;
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(0x04);
@@ -302,7 +302,7 @@ void Room::demon3UseSTricorderOnBoulder() {
}
void Room::demon3UseMTricorderOnBoulder() {
- if (_vm->_awayMission.demon.foundMiner)
+ if (_awayMission->demon.foundMiner)
return;
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(0x04);
@@ -310,17 +310,17 @@ void Room::demon3UseMTricorderOnBoulder() {
}
void Room::demon3UseCrewmanOnPanel() {
- if (_vm->_awayMission.demon.numBouldersGone != 4 || _vm->_awayMission.redshirtDead)
+ if (_awayMission->demon.numBouldersGone != 4 || _awayMission->redshirtDead)
return;
showText(TX_SPEAKER_EVERTS, TX_DEM3_031);
demon3UseRedshirtOnPanel();
}
void Room::demon3UseRedshirtOnPanel() {
- if (_vm->_awayMission.redshirtDead)
+ if (_awayMission->redshirtDead)
return;
- if (_vm->_awayMission.demon.numBouldersGone != 4)
+ if (_awayMission->demon.numBouldersGone != 4)
showText(TX_SPEAKER_EVERTS, TX_DEM3_030);
else
walkCrewman(OBJECT_REDSHIRT, 0xd8, 0x70, 8);
@@ -331,18 +331,18 @@ void Room::demon3RedshirtReachedPanel() {
}
void Room::demon3RedshirtUsedPanel() {
- if (!_vm->_awayMission.demon.foundMiner)
+ if (!_awayMission->demon.foundMiner)
return;
- _vm->_awayMission.demon.field41++;
- if (_vm->_awayMission.demon.field41 == 5) {
+ _awayMission->demon.field41++;
+ if (_awayMission->demon.field41 == 5) {
playVoc("EFX3");
showText(TX_SPEAKER_EVERTS, TX_DEM3_A32);
loadActorAnim2(OBJECT_REDSHIRT, "rkille", -1, -1, 3);
playSoundEffectIndex(0x06);
- _vm->_awayMission.redshirtDead = true;
- _vm->_awayMission.demon.field45 = true;
+ _awayMission->redshirtDead = true;
+ _awayMission->demon.field45 = true;
} else {
const int textTable[] = {
TX_DEM3N005,
@@ -356,7 +356,7 @@ void Room::demon3RedshirtUsedPanel() {
TX_NULL,
TX_BLANK
};
- text[1] = textTable[_vm->_awayMission.demon.field41 - 1];
+ text[1] = textTable[_awayMission->demon.field41 - 1];
showText(text);
walkCrewman(OBJECT_REDSHIRT, 0xbe, 0x9b, 0);
}
@@ -394,8 +394,8 @@ void Room::demon3UsePhaserOnDoor() {
}
void Room::demon3UseHandOnPanel() {
- if (_vm->_awayMission.demon.numBouldersGone == 4) {
- if (_vm->_awayMission.demon.doorOpened)
+ if (_awayMission->demon.numBouldersGone == 4) {
+ if (_awayMission->demon.doorOpened)
return;
walkCrewman(OBJECT_KIRK, 0xd8, 0x70, 7);
} else {
@@ -405,13 +405,13 @@ void Room::demon3UseHandOnPanel() {
void Room::demon3KirkReachedHandPanel() {
loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 6);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
playVoc("MUR4E1");
}
void Room::demon3KirkUsedHandPanel() {
loadActorAnim(15, "panel", 0xd6, 0x3d, 0);
- _vm->_awayMission.timers[3] = 10;
+ _awayMission->timers[3] = 10;
playVoc("SE0FORCE");
}
@@ -419,7 +419,7 @@ void Room::demon3UseMTricorderOnMiner() {
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(0x04);
- if (_vm->_awayMission.demon.minerDead) {
+ if (_awayMission->demon.minerDead) {
showText(TX_SPEAKER_MCCOY, TX_DEM3_022);
} else {
showText(TX_SPEAKER_MCCOY, TX_DEM3_023);
@@ -427,7 +427,7 @@ void Room::demon3UseMTricorderOnMiner() {
}
void Room::demon3UseMedkitOnMiner() {
- if (_vm->_awayMission.demon.healedMiner) {
+ if (_awayMission->demon.healedMiner) {
showText(TX_SPEAKER_MCCOY, TX_DEM3_015);
} else {
walkCrewman(OBJECT_MCCOY, 0xe6, 0x7b, 6);
@@ -441,13 +441,13 @@ void Room::demon3McCoyReachedMiner() {
}
void Room::demon3McCoyFinishedHealingMiner() {
- if (_vm->_awayMission.demon.minerDead) {
+ if (_awayMission->demon.minerDead) {
showText(TX_SPEAKER_MCCOY, TX_DEM3_022);
} else {
showText(TX_SPEAKER_MCCOY, TX_DEM3_021);
- _vm->_awayMission.demon.healedMiner = true;
+ _awayMission->demon.healedMiner = true;
loadActorAnim2(13, "drmine", 0xda, 0x6c, 0);
- _vm->_awayMission.demon.missionScore += 2;
+ _awayMission->demon.missionScore += 2;
walkCrewman(OBJECT_MCCOY, 0x104, 0x96, 0);
}
}
@@ -457,7 +457,7 @@ void Room::demon3GetMiner() {
}
void Room::demon3TalkToMiner() {
- if (!_vm->_awayMission.demon.healedMiner)
+ if (!_awayMission->demon.healedMiner)
return;
showText(TX_SPEAKER_KANDREY, TX_DEM3_F21);
}
@@ -473,7 +473,7 @@ void Room::demon3TalkToSpock() {
}
void Room::demon3TalkToMccoy() {
- if (_vm->_awayMission.redshirtDead) {
+ if (_awayMission->redshirtDead) {
showText(TX_SPEAKER_MCCOY, TX_DEM3_014);
} else {
showText(TX_SPEAKER_MCCOY, TX_DEM3_025);
@@ -503,7 +503,7 @@ void Room::demon3LookAtMccoy() {
}
void Room::demon3LookAtRedshirt() {
- if (_vm->_awayMission.redshirtDead) {
+ if (_awayMission->redshirtDead) {
showText(TX_DEM3N017);
// NOTE: there's an alternate string that isn't used? (TX_DEM3N018)
} else {
@@ -516,7 +516,7 @@ void Room::demon3LookAnywhere() {
}
void Room::demon3LookAtMiner() {
- if (_vm->_awayMission.demon.healedMiner) {
+ if (_awayMission->demon.healedMiner) {
showText(TX_DEM3N000);
} else {
showText(TX_DEM3N006);
@@ -544,7 +544,7 @@ void Room::demon3LookAtStructure() {
}
void Room::demon3LookAtDoor() {
- if (_vm->_awayMission.demon.doorOpened) {
+ if (_awayMission->demon.doorOpened) {
showText(TX_DEM3N014);
} else {
showText(TX_DEM3N012);
diff --git a/engines/startrek/rooms/demon4.cpp b/engines/startrek/rooms/demon4.cpp
index 7a8d95f911..615a19a811 100644
--- a/engines/startrek/rooms/demon4.cpp
+++ b/engines/startrek/rooms/demon4.cpp
@@ -21,6 +21,7 @@
*/
#include "startrek/room.h"
+#include "startrek/startrek.h"
namespace StarTrek {
@@ -30,20 +31,20 @@ namespace StarTrek {
void Room::demon4Tick1() {
playVoc("DEM4LOOP");
- if (!_vm->_awayMission.demon.healedMiner)
- _vm->_awayMission.demon.minerDead = true;
+ if (!_awayMission->demon.healedMiner)
+ _awayMission->demon.minerDead = true;
- if (_vm->_awayMission.demon.solvedSunPuzzle) {
+ if (_awayMission->demon.solvedSunPuzzle) {
loadActorAnim(10, "bxrise2", 0x122, 0x91, 0);
loadActorAnim(8, "stpout2", 0x107, 0x92, 0);
_roomVar.demon.nauianEmerged = true;
- if ((_vm->_awayMission.demon.itemsTakenFromCase & 0x10) && !_vm->_awayMission.demon.gaveSkullToNauian)
- _vm->_awayMission.timers[6] = 20;
+ if ((_awayMission->demon.itemsTakenFromCase & 0x10) && !_awayMission->demon.gaveSkullToNauian)
+ _awayMission->timers[6] = 20;
}
- if (!_vm->_awayMission.demon.foundAlienRoom) {
- _vm->_awayMission.demon.foundAlienRoom = true;
+ if (!_awayMission->demon.foundAlienRoom) {
+ _awayMission->demon.foundAlienRoom = true;
playMidiMusicTracks(1, -1);
}
}
@@ -52,8 +53,8 @@ void Room::demon4Tick1() {
void Room::demon4FinishedAnimation1() {
loadActorAnim(8, "stpout", 0x107, 0x92, 5);
_roomVar.demon.nauianEmerged = true;
- if (_vm->_awayMission.demon.itemsTakenFromCase & 0x10)
- _vm->_awayMission.timers[6] = 45;
+ if (_awayMission->demon.itemsTakenFromCase & 0x10)
+ _awayMission->timers[6] = 45;
}
void Room::demon4FinishedAnimation2() {
@@ -67,7 +68,7 @@ void Room::demon4FinishedAnimation2() {
// WORKAROUND: original game has the below line; however, it's never executed anyway
// since the game over menu manipulates the stack. Here, the menu could delete this
// room object, so it should be the last statement...
- //_vm->_awayMission.disableInput = false;
+ //_awayMission->disableInput = false;
}
void Room::demon4FinishedAnimation3() {
@@ -76,15 +77,15 @@ void Room::demon4FinishedAnimation3() {
showText(TX_SPEAKER_NAUIAN, TX_DEM4_035);
showText(TX_SPEAKER_SPOCK, TX_DEM4_030);
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.demon.missionScore += 5;
- _vm->_awayMission.timers[1] = 20;
+ _awayMission->disableInput = true;
+ _awayMission->demon.missionScore += 5;
+ _awayMission->timers[1] = 20;
}
// Just solved sun puzzle
void Room::demon4Timer0Expired() {
loadActorAnim(10, "bxrise", 0x122, 0x91, 1);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
loadActorStandAnim(OBJECT_KIRK);
playVoc("SE2POWER");
}
@@ -97,7 +98,7 @@ void Room::demon4Timer1Expired() {
walkCrewman(OBJECT_SPOCK, 0xb4, 0x9b, 4);
walkCrewman(OBJECT_MCCOY, 0xc8, 0x9b, 4);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
walkCrewman(OBJECT_REDSHIRT, 0xc1, 0x91, 4);
else
_roomVar.demon.crewReadyToBeamOut++;
@@ -108,12 +109,12 @@ void Room::demon4CrewmanReachedBeamoutPosition() {
if (_roomVar.demon.crewReadyToBeamOut != 4)
return;
- if (!_vm->_awayMission.demon.insultedStephen)
- _vm->_awayMission.demon.missionScore += 3;
- if (!_vm->_awayMission.redshirtDead)
- _vm->_awayMission.demon.missionScore += 2;
+ if (!_awayMission->demon.insultedStephen)
+ _awayMission->demon.missionScore += 3;
+ if (!_awayMission->redshirtDead)
+ _awayMission->demon.missionScore += 2;
- endMission(_vm->_awayMission.demon.missionScore, 0x24, 0);
+ endMission(_awayMission->demon.missionScore, 0x24, 0);
}
void Room::demon4Timer2Expired() {
@@ -144,16 +145,16 @@ void Room::demon4UsePhaserOnNauian() {
showText(TX_SPEAKER_NAUIAN, TX_DEM4_032);
loadActorAnim2(10, "bxfire", 0, 0, 2);
playVoc("V0SPOCKT");
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.timers[2] = 7;
- _vm->_awayMission.timers[3] = 8;
- _vm->_awayMission.timers[4] = 7;
- _vm->_awayMission.timers[5] = 8;
+ _awayMission->disableInput = true;
+ _awayMission->timers[2] = 7;
+ _awayMission->timers[3] = 8;
+ _awayMission->timers[4] = 7;
+ _awayMission->timers[5] = 8;
}
}
void Room::demon4UseMetalOnSecurityEquipment() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xf5, 0x90, 5);
}
@@ -162,20 +163,20 @@ void Room::demon4KirkReachedSecurityEquipment() {
}
void Room::demon4KirkFinishedUsingSecurityEquipment() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_DEM4N014);
}
void Room::demon4UseMetalOnNauian() {
walkCrewman(OBJECT_KIRK, 0xe9, 0x90, 1);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
}
void Room::demon4KirkReachedNauian() {
loadActorAnim2(8, "usekey", 0x107, 0x8e, 3);
loseItem(OBJECT_IMETAL);
- _vm->_awayMission.demon.missionScore += 2;
- _vm->_awayMission.demon.itemsTakenFromCase &= ~1;
+ _awayMission->demon.missionScore += 2;
+ _awayMission->demon.itemsTakenFromCase &= ~1;
}
void Room::demon4UseSkullOnNauian() {
@@ -190,11 +191,11 @@ void Room::demon4KirkReachedNauianWithSkull() {
switch (choice) {
case 0:
- _vm->_awayMission.demon.missionScore++;
+ _awayMission->demon.missionScore++;
loadActorAnim2(8, "takesk", 0x107, 0x8e, 0);
loseItem(OBJECT_ISKULL);
- _vm->_awayMission.demon.itemsTakenFromCase &= ~16; // BUG: skull reappears in case? Can abuse for infinite ponits?
- _vm->_awayMission.demon.gaveSkullToNauian = true;
+ _awayMission->demon.itemsTakenFromCase &= ~16; // BUG: skull reappears in case? Can abuse for infinite ponits?
+ _awayMission->demon.gaveSkullToNauian = true;
break;
case 1:
@@ -220,10 +221,10 @@ void Room::demon4UsePhaserOnMccoy() {
}
void Room::demon4TalkToNauian() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
- if (!_vm->_awayMission.demon.metNauian) {
- _vm->_awayMission.demon.metNauian = true;
+ if (!_awayMission->demon.metNauian) {
+ _awayMission->demon.metNauian = true;
showText(TX_SPEAKER_NAUIAN, TX_DEM4_044);
const int choices[] = { TX_SPEAKER_KIRK, TX_DEM4_002, TX_DEM4_004, TX_DEM4_009, TX_BLANK };
@@ -231,7 +232,7 @@ void Room::demon4TalkToNauian() {
switch (choice) {
case 0:
- _vm->_awayMission.demon.field2d = true;
+ _awayMission->demon.field2d = true;
showText(TX_SPEAKER_NAUIAN, TX_DEM4_042);
break;
@@ -254,7 +255,7 @@ void Room::demon4TalkToNauian() {
switch (choice) {
case 0:
- _vm->_awayMission.demon.field2d = true;
+ _awayMission->demon.field2d = true;
showText(TX_SPEAKER_NAUIAN, TX_DEM4_041);
break;
case 1:
@@ -275,9 +276,9 @@ void Room::demon4TalkToNauian() {
showText(TX_SPEAKER_NAUIAN, TX_DEM4_035);
showText(TX_SPEAKER_SPOCK, TX_DEM4_030);
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.demon.missionScore += 5;
- _vm->_awayMission.timers[1] = 20;
+ _awayMission->disableInput = true;
+ _awayMission->demon.missionScore += 5;
+ _awayMission->timers[1] = 20;
} else {
showText(TX_SPEAKER_NAUIAN, TX_DEM4_038);
}
@@ -351,24 +352,24 @@ void Room::demon4UseRedshirtOnPanel() {
}
void Room::demon4UseCrewmanOnPanel() {
- if (_vm->_awayMission.demon.solvedSunPuzzle)
+ if (_awayMission->demon.solvedSunPuzzle)
return;
walkCrewman(_roomVar.demon.crewmanUsingPanel, 0xda, 0x83, 3);
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.demon.crewmanUsingPanel] = DIR_N;
- _vm->_awayMission.disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[_roomVar.demon.crewmanUsingPanel] = DIR_N;
+ _awayMission->disableInput = true;
}
void Room::demon4CrewmanReachedPanel() {
if (demon4ShowSunPuzzle()) {
- _vm->_awayMission.demon.solvedSunPuzzle = true;
+ _awayMission->demon.solvedSunPuzzle = true;
loadActorAnim(9, "ctrl", 0, 0, 0);
- _vm->_awayMission.demon.missionScore += 3;
- _vm->_awayMission.timers[0] = 10;
+ _awayMission->demon.missionScore += 3;
+ _awayMission->timers[0] = 10;
} else
showText(TX_DEM4N013);
walkCrewman(_roomVar.demon.crewmanUsingPanel, 0xae, 0x93, 0);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
bool Room::demon4ShowSunPuzzle() {
diff --git a/engines/startrek/rooms/demon5.cpp b/engines/startrek/rooms/demon5.cpp
index 8af51febc5..5a3738c9f1 100644
--- a/engines/startrek/rooms/demon5.cpp
+++ b/engines/startrek/rooms/demon5.cpp
@@ -27,7 +27,7 @@ namespace StarTrek {
void Room::demon5Tick1() {
playVoc("DEM5LOOP");
- if (!_vm->_awayMission.demon.curedChub || _vm->_awayMission.demon.field37 != 1)
+ if (!_awayMission->demon.curedChub || _awayMission->demon.field37 != 1)
loadActorAnim(11, "oldman", 0x7a, 0xb0, 0);
loadActorAnim(8, "brorob", 0xc9, 0xa8, 0);
loadActorAnim(9, "crip", 0xe3, 0xa8, 0);
@@ -36,7 +36,7 @@ void Room::demon5Tick1() {
}
void Room::demon5WalkToDoor() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.demon.movingToDoor = true;
walkCrewman(OBJECT_KIRK, 0xa0, 0x94, 1);
}
@@ -68,14 +68,14 @@ void Room::demon5UsePhaserOnAnything() {
}
void Room::demon5UseHandOnStephen() {
- if (_vm->_awayMission.demon.repairedHand)
+ if (_awayMission->demon.repairedHand)
showText(TX_SPEAKER_STEPHEN, TX_DEM5_036);
else
showText(TX_SPEAKER_STEPHEN, TX_DEM5_039);
}
void Room::demon5UseBerryOnStephen() {
- if (_vm->_awayMission.demon.knowAboutHypoDytoxin)
+ if (_awayMission->demon.knowAboutHypoDytoxin)
showText(TX_SPEAKER_STEPHEN, TX_DEM5_033);
else
showText(TX_SPEAKER_STEPHEN, TX_DEM5_037);
@@ -91,11 +91,11 @@ void Room::demon5MccoyReachedChub() {
void Room::demon5MccoyHealedChub() {
walkCrewman(OBJECT_MCCOY, 0xc8, 0xba, 0);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
showText(TX_SPEAKER_CHUB, TX_DEM5L027);
loseItem(OBJECT_IDETOXIN);
- _vm->_awayMission.demon.curedChub = true;
- _vm->_awayMission.demon.missionScore += 2;
+ _awayMission->demon.curedChub = true;
+ _awayMission->demon.missionScore += 2;
}
void Room::demon5UseHypoDytoxinOnAnything() {
@@ -151,7 +151,7 @@ void Room::demon5LookAtChub() {
}
void Room::demon5TalkToRoberts() {
- if (_vm->_awayMission.demon.curedChub) {
+ if (_awayMission->demon.curedChub) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_030);
if (!_roomVar.demon.talkedToRoberts) {
_roomVar.demon.talkedToRoberts = true;
@@ -164,7 +164,7 @@ void Room::demon5TalkToRoberts() {
}
void Room::demon5TalkToChub() {
- if (_vm->_awayMission.demon.curedChub) {
+ if (_awayMission->demon.curedChub) {
showText(TX_SPEAKER_CHUB, TX_DEM5L029);
showText(TX_SPEAKER_KIRK, TX_DEM5_002);
showText(TX_SPEAKER_CHUB, TX_DEM5L030);
@@ -182,7 +182,7 @@ void Room::demon5TalkToChub() {
}
void Room::demon5TalkToGrisnash() {
- if (_vm->_awayMission.demon.curedChub) {
+ if (_awayMission->demon.curedChub) {
showText(TX_SPEAKER_GRISNASH, TX_DEM5_028);
showText(TX_SPEAKER_SPOCK, TX_DEM5_024);
showText(TX_SPEAKER_GRISNASH, TX_DEM5_029);
@@ -199,7 +199,7 @@ void Room::demon5TalkToGrisnash() {
}
void Room::demon5TalkToStephen() {
- if (_vm->_awayMission.demon.curedChub) {
+ if (_awayMission->demon.curedChub) {
showText(TX_SPEAKER_STEPHEN, TX_DEM5_041);
showText(TX_SPEAKER_MCCOY, TX_DEM5_022);
showText(TX_SPEAKER_STEPHEN, TX_DEM5_043);
@@ -211,14 +211,14 @@ void Room::demon5TalkToStephen() {
_roomVar.demon.numTalkedTo++;
demon5CheckCompletedStudy();
}
- } else if (!_vm->_awayMission.demon.knowAboutHypoDytoxin) {
+ } else if (!_awayMission->demon.knowAboutHypoDytoxin) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_034);
- } else if (_vm->_awayMission.demon.madeHypoDytoxin) {
+ } else if (_awayMission->demon.madeHypoDytoxin) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_035);
- } else if (_vm->_awayMission.demon.gotBerries) {
+ } else if (_awayMission->demon.gotBerries) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_032);
- _vm->_awayMission.demon.field3e = false;
- } else if (_vm->_awayMission.demon.field3e) {
+ _awayMission->demon.field3e = false;
+ } else if (_awayMission->demon.field3e) {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_038);
} else {
showText(TX_SPEAKER_ROBERTS, TX_DEM5_034);
@@ -241,10 +241,10 @@ void Room::demon5TalkToRedshirt() {
}
void Room::demon5TalkToMccoy() {
- if (_vm->_awayMission.demon.curedChub) {
+ if (_awayMission->demon.curedChub) {
showText(TX_SPEAKER_MCCOY, TX_DEM5_023);
showText(TX_SPEAKER_KIRK, TX_DEM5_004);
- if (!_vm->_awayMission.redshirtDead) {
+ if (!_awayMission->redshirtDead) {
showText(TX_SPEAKER_EVERTS, TX_DEM5_044);
showText(TX_SPEAKER_MCCOY, TX_DEM5_020);
showText(TX_SPEAKER_SPOCK, TX_DEM5_026);
@@ -271,7 +271,7 @@ void Room::demon5UseMTricorderOnChub() {
loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0);
playSoundEffectIndex(0x04);
- if (_vm->_awayMission.demon.curedChub) {
+ if (_awayMission->demon.curedChub) {
if (_roomVar.demon.scannedChub)
return;
showText(TX_SPEAKER_MCCOY, TX_DEM5_016);
@@ -279,13 +279,13 @@ void Room::demon5UseMTricorderOnChub() {
_roomVar.demon.numScanned++;
demon5CheckCompletedStudy();
} else {
- if (_vm->_awayMission.demon.field3e)
+ if (_awayMission->demon.field3e)
showText(TX_SPEAKER_MCCOY, TX_DEM5_010);
else {
showText(TX_SPEAKER_MCCOY, TX_DEM5_012);
showText(TX_SPEAKER_STEPHEN, TX_DEM5_040);
- _vm->_awayMission.demon.knowAboutHypoDytoxin = true;
- _vm->_awayMission.demon.field3e = true;
+ _awayMission->demon.knowAboutHypoDytoxin = true;
+ _awayMission->demon.field3e = true;
}
}
}
diff --git a/engines/startrek/rooms/demon6.cpp b/engines/startrek/rooms/demon6.cpp
index 19c6d07bbb..488683eb28 100644
--- a/engines/startrek/rooms/demon6.cpp
+++ b/engines/startrek/rooms/demon6.cpp
@@ -21,12 +21,13 @@
*/
#include "startrek/room.h"
+#include "startrek/startrek.h"
namespace StarTrek {
void Room::demon6Tick1() {
playVoc("DEM6LOOP");
- if (_vm->_awayMission.demon.gotBerries || (!_vm->_awayMission.demon.field3e && _vm->_awayMission.demon.field37)) {
+ if (_awayMission->demon.gotBerries || (!_awayMission->demon.field3e && _awayMission->demon.field37)) {
loadActorAnim(8, "oldman", 0x5f, 0xb1, 0);
_roomVar.demon.stephenInRoom = true;
}
@@ -35,17 +36,17 @@ void Room::demon6Tick1() {
}
void Room::demon6Tick30() {
- if (!_vm->_awayMission.demon.gotBerries)
+ if (!_awayMission->demon.gotBerries)
return;
- if (_vm->_awayMission.demon.field3e)
+ if (_awayMission->demon.field3e)
return;
- if (!_vm->_awayMission.demon.field37)
+ if (!_awayMission->demon.field37)
return;
- if (_vm->_awayMission.demon.stephenWelcomedToStudy)
+ if (_awayMission->demon.stephenWelcomedToStudy)
return;
showText(TX_SPEAKER_STEPHEN, TX_DEM6_042);
- _vm->_awayMission.demon.stephenWelcomedToStudy = true;
+ _awayMission->demon.stephenWelcomedToStudy = true;
}
void Room::demon6SpockReachedComputer() {
@@ -53,7 +54,7 @@ void Room::demon6SpockReachedComputer() {
}
void Room::demon6WalkToDoor() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.demon.movingToDoor = true;
walkCrewman(OBJECT_KIRK, 0xa0, 0x94, 4);
}
@@ -137,9 +138,9 @@ void Room::demon6LookAtRedshirt() {
void Room::demon6LookAtComputer() {
showText(TX_DEM6N006);
- if (!_vm->_awayMission.demon.lookedAtComputer) {
- _vm->_awayMission.demon.lookedAtComputer = true;
- _vm->_awayMission.demon.missionScore++;
+ if (!_awayMission->demon.lookedAtComputer) {
+ _awayMission->demon.lookedAtComputer = true;
+ _awayMission->demon.missionScore++;
}
}
@@ -172,7 +173,7 @@ void Room::demon6TalkToStephen() {
}
void Room::demon6UseBerryOnStephen() {
- if (_vm->_awayMission.demon.knowAboutHypoDytoxin) {
+ if (_awayMission->demon.knowAboutHypoDytoxin) {
showText(TX_SPEAKER_STEPHEN, TX_DEM6_027);
} else {
showText(TX_SPEAKER_STEPHEN, TX_DEM6_026);
@@ -180,7 +181,7 @@ void Room::demon6UseBerryOnStephen() {
}
void Room::demon6UseBerryOnSynthesizer() {
- if (!_vm->_awayMission.demon.knowAboutHypoDytoxin)
+ if (!_awayMission->demon.knowAboutHypoDytoxin)
return;
walkCrewman(OBJECT_MCCOY, 0x104, 0xa5, 1);
}
@@ -196,20 +197,20 @@ void Room::demon6FinishedMakingHypoDytoxin() {
showText(TX_SPEAKER_MCCOY, TX_DEM6_018);
giveItem(OBJECT_IDETOXIN);
- _vm->_awayMission.demon.madeHypoDytoxin = true;
+ _awayMission->demon.madeHypoDytoxin = true;
loseItem(OBJECT_IBERRY);
- if (!_vm->_awayMission.demon.gavePointsForDytoxin) {
- _vm->_awayMission.demon.gavePointsForDytoxin = true;
- _vm->_awayMission.demon.missionScore++;
+ if (!_awayMission->demon.gavePointsForDytoxin) {
+ _awayMission->demon.gavePointsForDytoxin = true;
+ _awayMission->demon.missionScore++;
}
}
void Room::demon6UseHandOnWorkspace() {
- if (_vm->_awayMission.demon.repairedHand) {
+ if (_awayMission->demon.repairedHand) {
showText(TX_SPEAKER_SPOCK, TX_DEM6N018); // FIXME
} else {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
showText(TX_SPEAKER_KIRK, TX_DEM6_005);
walkCrewman(OBJECT_SPOCK, 0xb3, 0xbb, 2);
}
@@ -221,10 +222,10 @@ void Room::demon6SpockReachedWorkspace() {
void Room::demon6SpockFinishedRepairingHand() {
showText(TX_SPEAKER_SPOCK, TX_DEM6_024);
- _vm->_awayMission.demon.repairedHand = true;
- _vm->_awayMission.demon.missionScore += 2;
+ _awayMission->demon.repairedHand = true;
+ _awayMission->demon.missionScore += 2;
loadActorStandAnim(OBJECT_SPOCK);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
// FIXME: doesn't work
@@ -244,7 +245,7 @@ void Room::demon6UseCrewmanOnCase() {
insult:
showText(TX_SPEAKER_STEPHEN, TX_DEM6_030);
_roomVar.demon.insultedStephenRecently = true;
- _vm->_awayMission.demon.insultedStephen = true;
+ _awayMission->demon.insultedStephen = true;
} else if (choice == 1) {
showText(TX_SPEAKER_STEPHEN, TX_DEM6_034);
explain:
@@ -316,27 +317,27 @@ void Room::demon6UseSpockOnComputer() {
}
void Room::demon6UseMineralOnStephen() {
- _vm->_awayMission.demon.itemsTakenFromCase &= ~8;
+ _awayMission->demon.itemsTakenFromCase &= ~8;
demon6ReturnItemToStephen(OBJECT_IMINERAL);
}
void Room::demon6UseShellsOnStephen() {
- _vm->_awayMission.demon.itemsTakenFromCase &= ~2;
+ _awayMission->demon.itemsTakenFromCase &= ~2;
demon6ReturnItemToStephen(OBJECT_ISHELLS);
}
void Room::demon6UseMeteorOnStephen() {
- _vm->_awayMission.demon.itemsTakenFromCase &= ~4;
+ _awayMission->demon.itemsTakenFromCase &= ~4;
demon6ReturnItemToStephen(OBJECT_IMETEOR);
}
void Room::demon6UseSkullOnStephen() {
- _vm->_awayMission.demon.itemsTakenFromCase &= ~16;
+ _awayMission->demon.itemsTakenFromCase &= ~16;
demon6ReturnItemToStephen(OBJECT_ISKULL);
}
void Room::demon6UseMetalOnStephen() {
- _vm->_awayMission.demon.itemsTakenFromCase &= ~1;
+ _awayMission->demon.itemsTakenFromCase &= ~1;
demon6ReturnItemToStephen(OBJECT_IMETAL);
}
@@ -347,7 +348,7 @@ void Room::demon6ReturnItemToStephen(int item) {
}
void Room::demon6UseHandOnStephen() {
- if (_vm->_awayMission.demon.repairedHand)
+ if (_awayMission->demon.repairedHand)
showText(TX_SPEAKER_STEPHEN, TX_DEM6_037);
else
showText(TX_SPEAKER_STEPHEN, TX_DEM6_043);
@@ -422,8 +423,8 @@ void Room::demon6GetCase() {
void Room::demon6KirkReachedCase() {
const int items[] = { OBJECT_IMETAL, OBJECT_ISHELLS, OBJECT_IMETEOR, OBJECT_IMINERAL, OBJECT_ISKULL };
- byte ret = 0x1f ^ demon6ShowCase(_vm->_awayMission.demon.itemsTakenFromCase ^ 0x1f);
- _vm->_awayMission.demon.itemsTakenFromCase = ret;
+ byte ret = 0x1f ^ demon6ShowCase(_awayMission->demon.itemsTakenFromCase ^ 0x1f);
+ _awayMission->demon.itemsTakenFromCase = ret;
const int *i = items;
while (ret != 0) {
diff --git a/engines/startrek/rooms/feather0.cpp b/engines/startrek/rooms/feather0.cpp
index a533af05bd..820614b62f 100644
--- a/engines/startrek/rooms/feather0.cpp
+++ b/engines/startrek/rooms/feather0.cpp
@@ -122,11 +122,11 @@ void Room::feather0TalkToQuetzecoatl() {
}
// Quetzecoatl ultimately warps the crew away no matter what
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnim(OBJECT_QUETZECOATL, "s5r0qt");
playMidiMusicTracks(1);
- _vm->_awayMission.timers[0] = 50;
- _vm->_awayMission.timers[1] = 64;
+ _awayMission->timers[0] = 50;
+ _awayMission->timers[1] = 64;
}
void Room::feather0Timer0Expired() {
@@ -139,7 +139,7 @@ void Room::feather0Timer0Expired() {
}
void Room::feather0Timer1Expired() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadRoomIndex(1, 5);
}
diff --git a/engines/startrek/rooms/feather1.cpp b/engines/startrek/rooms/feather1.cpp
index 667608a7ff..1621ecabbd 100644
--- a/engines/startrek/rooms/feather1.cpp
+++ b/engines/startrek/rooms/feather1.cpp
@@ -148,12 +148,12 @@ void Room::feather1Tick1() {
playVoc("FEA1LOOP");
playMidiMusicTracks(27);
- if (_vm->_awayMission.feather.vineState == 0)
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->feather.vineState == 0)
+ _awayMission->disableInput = true;
- if (!_vm->_awayMission.feather.gotSnake)
+ if (!_awayMission->feather.gotSnake)
loadActorAnim(OBJECT_SNAKE, "s5r1so", 0x9c, 0xc1);
- if (_vm->_awayMission.feather.vineState == 0)
+ if (_awayMission->feather.vineState == 0)
loadActorAnim(OBJECT_LEFT_VINE, "s5r1v0", 0xa0, 0x23);
else {
_roomVar.feather.crewEscaped[OBJECT_KIRK] = true;
@@ -165,26 +165,26 @@ void Room::feather1Tick1() {
}
void Room::feather1Tick45() {
- if (_vm->_awayMission.feather.vineState == 0) {
+ if (_awayMission->feather.vineState == 0) {
playVoc("LD3MAGAP");
loadActorAnim(OBJECT_QUETZECOATL, "s5r1qa", 0xb4, 0x32);
}
}
void Room::feather1Tick85() {
- if (_vm->_awayMission.feather.vineState == 0)
+ if (_awayMission->feather.vineState == 0)
showText(TX_SPEAKER_QUETZECOATL, TX_FEA1_057);
}
void Room::feather1Tick95() {
- if (_vm->_awayMission.feather.vineState == 0) {
+ if (_awayMission->feather.vineState == 0) {
playVoc("LD3MAGDI");
loadActorAnimC(OBJECT_QUETZECOATL, "s5r1qd", -1, -1, &Room::feather1QuetzecoatlDisappeared);
}
}
void Room::feather1QuetzecoatlDisappeared() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::feather1GetRightVine() {
@@ -192,7 +192,7 @@ void Room::feather1GetRightVine() {
}
void Room::feather1GetLeftVine() {
- if (_vm->_awayMission.feather.vineState == 0)
+ if (_awayMission->feather.vineState == 0)
showText(TX_FEA1N009);
else
showText(TX_FEA1N008);
@@ -201,11 +201,11 @@ void Room::feather1GetLeftVine() {
void Room::feather1GetRocks() {
if (_roomVar.feather.crewEscaped[OBJECT_KIRK])
showText(TX_FEA1N021);
- else if (_vm->_awayMission.feather.gotRock)
+ else if (_awayMission->feather.gotRock)
showText(TX_FEA1N019);
else {
walkCrewmanC(OBJECT_KIRK, 0x90, 0xb6, &Room::feather1ReachedRocks);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
}
@@ -214,20 +214,20 @@ void Room::feather1ReachedRocks() {
}
void Room::feather1PickedUpRocks() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
giveItem(OBJECT_IROCK);
showText(TX_FEA1N022);
- _vm->_awayMission.feather.gotRock = true;
+ _awayMission->feather.gotRock = true;
}
void Room::feather1GetSnake() {
// BUG: Infinite score mechanism. Just keep trying and failing to get the snake.
- _vm->_awayMission.feather.missionScore++;
+ _awayMission->feather.missionScore++;
if (!_roomVar.feather.crewEscaped[OBJECT_KIRK]) {
walkCrewmanC(OBJECT_KIRK, 0x90, 0xbe, &Room::feather1ReachedSnake);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
} else
showText(TX_FEA1N021);
}
@@ -238,26 +238,26 @@ void Room::feather1ReachedSnake() {
// TX_FEA1N018: "With nowhere for the snake to go, you capture it"
loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::feather1PickedUpSnake);
- if (_vm->_awayMission.feather.holeBlocked)
- _vm->_awayMission.timers[1] = 20;
+ if (_awayMission->feather.holeBlocked)
+ _awayMission->timers[1] = 20;
else
- _vm->_awayMission.timers[2] = 6;
+ _awayMission->timers[2] = 6;
}
void Room::feather1Timer1Expired() {
giveItem(OBJECT_ISNAKE);
loadActorStandAnim(OBJECT_SNAKE);
- _vm->_awayMission.feather.gotSnake = true;
+ _awayMission->feather.gotSnake = true;
}
void Room::feather1Timer2Expired() { // Snake retreats into hole
loadActorAnim2(OBJECT_SNAKE, "s5r1si");
- _vm->_awayMission.timers[0] = 80;
+ _awayMission->timers[0] = 80;
_roomVar.feather.snakeInHole = true;
}
void Room::feather1PickedUpSnake() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
}
@@ -273,29 +273,29 @@ void Room::feather1UseCommunicator() {
void Room::feather1UseRockOnHole() {
if (_roomVar.feather.crewEscaped[OBJECT_KIRK])
showText(TX_FEA1N021);
- else if (_vm->_awayMission.feather.holeBlocked)
+ else if (_awayMission->feather.holeBlocked)
showText(TX_FEA1N005);
else {
- _vm->_awayMission.feather.missionScore++;
+ _awayMission->feather.missionScore++;
walkCrewmanC(OBJECT_KIRK, 0xa3, 0xb6, &Room::feather1ReachedHole);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
if (_roomVar.feather.snakeInHole)
- _vm->_awayMission.timers[0] = 12;
+ _awayMission->timers[0] = 12;
}
}
void Room::feather1ReachedHole() {
loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::feather1PutRockInHole);
- _vm->_awayMission.timers[3] = 18;
+ _awayMission->timers[3] = 18;
}
void Room::feather1Timer3Expired() {
loadActorAnim(OBJECT_ROCK_IN_HOLE, "s5r1rk", 0xad, 0xba);
- _vm->_awayMission.feather.holeBlocked = true;
+ _awayMission->feather.holeBlocked = true;
}
void Room::feather1PutRockInHole() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
}
@@ -322,9 +322,9 @@ void Room::feather1UseSnakeOnRedshirt() {
}
void Room::feather1UseRockOnSnake() {
- if (!_vm->_awayMission.feather.gotSnake) {
+ if (!_awayMission->feather.gotSnake) {
loadActorAnim2(OBJECT_SNAKE, "s5r1si");
- _vm->_awayMission.timers[0] = 80;
+ _awayMission->timers[0] = 80;
_roomVar.feather.snakeInHole = true;
showText(TX_SPEAKER_SPOCK, TX_FEA1_034); // BUGFIX: speaker is Spock, not Stragey
}
@@ -392,13 +392,13 @@ void Room::feather1UseRedshirtOnMoss() {
}
void Room::feather1UseRockOnLeftVine() {
- if (_vm->_awayMission.feather.vineState == 0) {
- _vm->_awayMission.feather.vineState++;
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->feather.vineState == 0) {
+ _awayMission->feather.vineState++;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0x7a, 0xb6, &Room::feather1ReadyToThrowRock1);
- } else if (_vm->_awayMission.feather.vineState == 1) {
- _vm->_awayMission.feather.vineState++;
- _vm->_awayMission.disableInput = true;
+ } else if (_awayMission->feather.vineState == 1) {
+ _awayMission->feather.vineState++;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xa2, 0xb9, &Room::feather1ReadyToThrowRock2);
}
}
@@ -411,7 +411,7 @@ void Room::feather1ReadyToThrowRock1() {
}
void Room::feather1ThrewRock1() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_SPEAKER_SPOCK, TX_FEA1_042);
@@ -427,9 +427,9 @@ void Room::feather1ReadyToThrowRock2() {
}
void Room::feather1ThrewRock2() {
- _vm->_awayMission.feather.missionScore += 6;
+ _awayMission->feather.missionScore += 6;
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_SPOCK, TX_FEA1_043);
showText(TX_SPEAKER_MCCOY, TX_FEA1_021);
@@ -438,7 +438,7 @@ void Room::feather1ThrewRock2() {
void Room::feather1UseSpockOnVine() {
- if (_vm->_awayMission.feather.vineState == 2) {
+ if (_awayMission->feather.vineState == 2) {
_roomVar.feather.crewmanClimbingVine = OBJECT_SPOCK;
feather1CrewmanClimbVine();
} else
@@ -446,7 +446,7 @@ void Room::feather1UseSpockOnVine() {
}
void Room::feather1UseMccoyOnVine() {
- if (_vm->_awayMission.feather.vineState == 2) {
+ if (_awayMission->feather.vineState == 2) {
_roomVar.feather.crewmanClimbingVine = OBJECT_MCCOY;
feather1CrewmanClimbVine();
} else
@@ -454,7 +454,7 @@ void Room::feather1UseMccoyOnVine() {
}
void Room::feather1UseRedshirtOnVine() {
- if (_vm->_awayMission.feather.vineState == 2) {
+ if (_awayMission->feather.vineState == 2) {
_roomVar.feather.crewmanClimbingVine = OBJECT_REDSHIRT;
feather1CrewmanClimbVine();
} else
@@ -462,7 +462,7 @@ void Room::feather1UseRedshirtOnVine() {
}
void Room::feather1UseKirkOnVine() {
- if (_vm->_awayMission.feather.vineState == 2) {
+ if (_awayMission->feather.vineState == 2) {
_roomVar.feather.crewmanClimbingVine = OBJECT_KIRK;
feather1CrewmanClimbVine();
} else
@@ -472,7 +472,7 @@ void Room::feather1UseKirkOnVine() {
// This was refactored, due to the similarity of the code for each crewman. Originally, the
// following 5 vine-climbing functions were repeated for each crewman.
void Room::feather1CrewmanClimbVine() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
if (_roomVar.feather.crewEscaped[_roomVar.feather.crewmanClimbingVine])
walkCrewmanC(_roomVar.feather.crewmanClimbingVine, VINE_TOP_X, VINE_TOP_Y,
&Room::feather1ReachedVineToClimbDown);
@@ -489,10 +489,10 @@ void Room::feather1ReachedVineToClimbUp() {
}
void Room::feather1ClimbedUpVine() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
_roomVar.feather.crewEscaped[_roomVar.feather.crewmanClimbingVine] = true;
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.feather.crewmanClimbingVine, "stndw");
+ Common::String anim = getCrewmanAnimFilename(_roomVar.feather.crewmanClimbingVine, "stndw");
loadActorAnim2(_roomVar.feather.crewmanClimbingVine, anim, VINE_TOP_X, VINE_TOP_Y);
switch (_roomVar.feather.crewmanClimbingVine) {
@@ -519,10 +519,10 @@ void Room::feather1ReachedVineToClimbDown() {
}
void Room::feather1ClimbedDownVine() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
_roomVar.feather.crewEscaped[_roomVar.feather.crewmanClimbingVine] = false;
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.feather.crewmanClimbingVine, "stndw");
+ Common::String anim = getCrewmanAnimFilename(_roomVar.feather.crewmanClimbingVine, "stndw");
loadActorAnim2(_roomVar.feather.crewmanClimbingVine, anim, VINE_BOT_X, VINE_BOT_Y);
switch (_roomVar.feather.crewmanClimbingVine) {
@@ -667,7 +667,7 @@ void Room::feather1LookAtRedshirt() {
}
void Room::feather1LookAtLeftVine() {
- if (_vm->_awayMission.feather.vineState == 0)
+ if (_awayMission->feather.vineState == 0)
showText(TX_FEA1N012);
else
showText(TX_FEA1N015);
diff --git a/engines/startrek/rooms/feather3.cpp b/engines/startrek/rooms/feather3.cpp
index ebdf48abf7..0b3a1ce537 100644
--- a/engines/startrek/rooms/feather3.cpp
+++ b/engines/startrek/rooms/feather3.cpp
@@ -97,20 +97,20 @@ void Room::feather3Tick1() {
playVoc("FEA3LOOP");
playMidiMusicTracks(27);
- if (!_vm->_awayMission.feather.tlaoxacTestPassed) {
+ if (!_awayMission->feather.tlaoxacTestPassed) {
loadActorAnim(OBJECT_TLAOXAC, "s5r3as", 0x2e, 0xab);
loadMapFile("feath3b");
- } else if (!_vm->_awayMission.feather.tookKnife)
+ } else if (!_awayMission->feather.tookKnife)
loadActorAnim(OBJECT_KNIFE, "s5r3nf", 0x64, 0xb4);
}
void Room::feather3Tick40() {
- if (!_vm->_awayMission.feather.tlaoxacTestPassed)
+ if (!_awayMission->feather.tlaoxacTestPassed)
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_036);
}
void Room::feather3TouchedHotspot0() { // Tlaoxac prevents you from passing this point
- if (!_vm->_awayMission.feather.tlaoxacTestPassed)
+ if (!_awayMission->feather.tlaoxacTestPassed)
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_035);
}
@@ -128,12 +128,12 @@ void Room::feather3UseMccoyOnTlaoxac() {
}
void Room::feather3UseRedshirtOnTlaoxac() {
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_STRAGEY, TX_FEA3_029);
}
void Room::feather3UseCrewmanOnLeftExit() {
- if (!_vm->_awayMission.feather.tlaoxacTestPassed)
+ if (!_awayMission->feather.tlaoxacTestPassed)
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_041);
}
@@ -142,14 +142,14 @@ void Room::feather3UseCommunicator() {
}
void Room::feather3UseSnakeOnKirk() {
- if (!_vm->_awayMission.feather.tlaoxacTestPassed && !_vm->_awayMission.redshirtDead) {
- if (_roomVar.feather.showedSnakeToTlaoxac && _vm->_awayMission.feather.numRocksThrownAtTlaoxac == 0) {
+ if (!_awayMission->feather.tlaoxacTestPassed && !_awayMission->redshirtDead) {
+ if (_roomVar.feather.showedSnakeToTlaoxac && _awayMission->feather.numRocksThrownAtTlaoxac == 0) {
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_043);
- _vm->_awayMission.feather.tlaoxacTestPassed = true;
- _vm->_awayMission.feather.missionScore += 2;
+ _awayMission->feather.tlaoxacTestPassed = true;
+ _awayMission->feather.missionScore += 2;
loadMapFile("feather3");
loadActorAnim(OBJECT_KNIFE, "s5r3nf", KNIFE_X, KNIFE_Y);
- _vm->_awayMission.feather.field2e = true;
+ _awayMission->feather.field2e = true;
} else
showText(TX_FEA3N004);
}
@@ -163,26 +163,26 @@ void Room::feather3UseSnakeOnSpock() {
}
void Room::feather3UseSnakeOnRedshirt() {
- if (!_vm->_awayMission.feather.tlaoxacTestPassed && !_vm->_awayMission.redshirtDead) {
- if (_roomVar.feather.showedSnakeToTlaoxac && _vm->_awayMission.feather.numRocksThrownAtTlaoxac == 0) {
+ if (!_awayMission->feather.tlaoxacTestPassed && !_awayMission->redshirtDead) {
+ if (_roomVar.feather.showedSnakeToTlaoxac && _awayMission->feather.numRocksThrownAtTlaoxac == 0) {
walkCrewmanC(OBJECT_KIRK, 0x7c, 0xbc, &Room::feather3KirkReachedRedshirtWithSnake);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
} else
showText(TX_SPEAKER_STRAGEY, TX_FEA3_031);
}
}
void Room::feather3KirkReachedRedshirtWithSnake() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_STRAGEY, TX_FEA3_034);
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_044);
- _vm->_awayMission.feather.tlaoxacTestPassed = true;
- _vm->_awayMission.feather.missionScore += 1;
+ _awayMission->feather.tlaoxacTestPassed = true;
+ _awayMission->feather.missionScore += 1;
loadMapFile("feather3");
loadActorAnim(OBJECT_KNIFE, "s5r3nf", KNIFE_X, KNIFE_Y);
- _vm->_awayMission.feather.field2e = true;
+ _awayMission->feather.field2e = true;
}
void Room::feather3UseSnakeOnMccoy() {
@@ -190,12 +190,12 @@ void Room::feather3UseSnakeOnMccoy() {
}
void Room::feather3UseSnakeOnTlaoxac() {
- if (!_vm->_awayMission.feather.tlaoxacTestPassed && _vm->_awayMission.feather.numRocksThrownAtTlaoxac == 0) {
+ if (!_awayMission->feather.tlaoxacTestPassed && _awayMission->feather.numRocksThrownAtTlaoxac == 0) {
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_039);
_roomVar.feather.showedSnakeToTlaoxac = true;
- if (!_vm->_awayMission.feather.showedSnakeToTlaoxac) {
- _vm->_awayMission.feather.showedSnakeToTlaoxac = true;
- _vm->_awayMission.feather.missionScore += 1;
+ if (!_awayMission->feather.showedSnakeToTlaoxac) {
+ _awayMission->feather.showedSnakeToTlaoxac = true;
+ _awayMission->feather.missionScore += 1;
}
}
}
@@ -209,7 +209,7 @@ void Room::feather3UseKnifeOnMccoy() {
}
void Room::feather3UseKnifeOnRedshirt() {
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_STRAGEY, TX_FEA3_033); // BUGFIX: Speaker is Stragey, not Spock.
}
@@ -217,28 +217,28 @@ void Room::feather3UseRockOnTlaoxac() {
if (_roomVar.feather.tlaoxacUnconscious)
showText(TX_SPEAKER_MCCOY, TX_FEA3_009);
else {
- _vm->_awayMission.feather.numRocksThrownAtTlaoxac++;
- _vm->_awayMission.disableInput = true;
+ _awayMission->feather.numRocksThrownAtTlaoxac++;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xac, 0xb4, &Room::feather3KirkReachedPositionToThrowRock);
}
}
void Room::feather3KirkReachedPositionToThrowRock() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
loadActorAnim2(OBJECT_KIRK, "s5r3kt");
loadActorAnim(OBJECT_ROCK, "s5r3rt", 0x80, 0x7e);
- _vm->_awayMission.timers[4] = 21;
+ _awayMission->timers[4] = 21;
- if (_vm->_awayMission.feather.numRocksThrownAtTlaoxac == 2) {
- _vm->_awayMission.feather.knockedOutTlaoxac = true;
- _vm->_awayMission.feather.missionScore -= 2;
+ if (_awayMission->feather.numRocksThrownAtTlaoxac == 2) {
+ _awayMission->feather.knockedOutTlaoxac = true;
+ _awayMission->feather.missionScore -= 2;
loadActorAnimC(OBJECT_TLAOXAC, "s5r3ad", -1, -1, &Room::feather3TlaoxacKnockedOutFromRockThrow);
playVoc("ROCKFACE");
- _vm->_awayMission.timers[2] = 24;
+ _awayMission->timers[2] = 24;
} else {
loadActorAnim2(OBJECT_TLAOXAC, "s5r3ah");
playVoc("ROCKFACE");
- _vm->_awayMission.timers[3] = 97;
+ _awayMission->timers[3] = 97;
}
}
@@ -247,24 +247,24 @@ void Room::feather3Timer4Expired() {
}
void Room::feather3Timer2Expired() {
- if (!_vm->_awayMission.feather.tookKnife)
+ if (!_awayMission->feather.tookKnife)
loadActorAnim(OBJECT_KNIFE, "s5r3nf", KNIFE_X, KNIFE_Y);
}
void Room::feather3Timer3Expired() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
}
void Room::feather3TlaoxacKnockedOutFromRockThrow() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_FEA3N006);
- if (!_vm->_awayMission.feather.tookKnife && !_vm->_awayMission.feather.field2e)
+ if (!_awayMission->feather.tookKnife && !_awayMission->feather.field2e)
showText(TX_SPEAKER_MCCOY, TX_FEA3_008);
- _vm->_awayMission.feather.tlaoxacTestPassed = true;
+ _awayMission->feather.tlaoxacTestPassed = true;
_roomVar.feather.tlaoxacUnconscious = true;
loadMapFile("feather3");
}
@@ -282,15 +282,15 @@ void Room::feather3TalkToSpock() {
}
void Room::feather3TalkToRedshirt() {
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_STRAGEY, TX_FEA3_032);
}
void Room::feather3TalkToTlaoxac() {
- if (!_vm->_awayMission.feather.tlaoxacTestPassed && !_vm->_awayMission.redshirtDead && !_roomVar.feather.tlaoxacUnconscious) {
+ if (!_awayMission->feather.tlaoxacTestPassed && !_awayMission->redshirtDead && !_roomVar.feather.tlaoxacUnconscious) {
if (!_roomVar.feather.showedSnakeToTlaoxac)
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_038);
- else if (_vm->_awayMission.feather.numRocksThrownAtTlaoxac != 0)
+ else if (_awayMission->feather.numRocksThrownAtTlaoxac != 0)
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_038);
else {
const TextRef choices[] = {
@@ -306,11 +306,11 @@ void Room::feather3TalkToTlaoxac() {
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_042);
else if (choice == 2) { // Accidentally insulted Quetzecoatl
showText(TX_SPEAKER_TLAOXAC, TX_FEA3_040);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_TLAOXAC, "s5r3aj", -1, -1, &Room::feather3TlaoxacKilledRedshirt);
playMidiMusicTracks(2);
loadActorAnim(OBJECT_REDSHIRT, "s5r3rd");
- _vm->_awayMission.redshirtDead = true;
+ _awayMission->redshirtDead = true;
} else
showText(TX_DIALOG_ERROR);
}
@@ -318,7 +318,7 @@ void Room::feather3TalkToTlaoxac() {
}
void Room::feather3TlaoxacKilledRedshirt() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::feather3UseMTricorderOnTlaoxac() {
@@ -329,12 +329,12 @@ void Room::feather3UseMTricorderOnTlaoxac() {
}
void Room::feather3UseMedkitOnTlaoxac() {
- if (_vm->_awayMission.feather.knockedOutTlaoxac)
+ if (_awayMission->feather.knockedOutTlaoxac)
showText(TX_SPEAKER_MCCOY, TX_FEA3_012);
}
void Room::feather3UseMedkitOnRedshirt() {
- if (_vm->_awayMission.redshirtDead) {
+ if (_awayMission->redshirtDead) {
// BUGFIX: Original voice clip (TX_FEA3_030) is someone who's clearly not Kelley
// saying "he's dead, Jim". He recorded the line a few other times, so use one of
// those instead.
@@ -359,14 +359,14 @@ void Room::feather3UseSTricorderAnywhere() {
}
void Room::feather3GetKnife() {
- _vm->_awayMission.feather.missionScore += 1;
+ _awayMission->feather.missionScore += 1;
walkCrewmanC(OBJECT_KIRK, 0x57, 0xb4, &Room::feather3ReachedKnife);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::feather3ReachedKnife() {
loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::feather3PickedUpKnife);
- _vm->_awayMission.timers[1] = 20;
+ _awayMission->timers[1] = 20;
}
void Room::feather3Timer1Expired() {
@@ -375,27 +375,27 @@ void Room::feather3Timer1Expired() {
}
void Room::feather3PickedUpKnife() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_FEA3N010);
}
void Room::feather3LookAtSpock() {
- if (!_vm->_awayMission.feather.knockedOutTlaoxac && !_vm->_awayMission.feather.tlaoxacTestPassed)
+ if (!_awayMission->feather.knockedOutTlaoxac && !_awayMission->feather.tlaoxacTestPassed)
showText(TX_FEA3N002);
else // ENHANCEMENT: Originally did nothing here. Fall back to default behaviour in the engine.
- _vm->_awayMission.rdfStillDoDefaultAction = true;
+ _awayMission->rdfStillDoDefaultAction = true;
}
void Room::feather3LookAtRedshirt() {
- if (_vm->_awayMission.redshirtDead)
+ if (_awayMission->redshirtDead)
showText(TX_FEA3N005);
else
showText(TX_FEA3N012);
}
void Room::feather3LookAtTlaoxac() {
- if (_vm->_awayMission.feather.knockedOutTlaoxac)
+ if (_awayMission->feather.knockedOutTlaoxac)
showText(TX_FEA3N003);
else
showText(TX_FEA3N007);
diff --git a/engines/startrek/rooms/feather5.cpp b/engines/startrek/rooms/feather5.cpp
index a8ca002aa2..f1da4633f3 100644
--- a/engines/startrek/rooms/feather5.cpp
+++ b/engines/startrek/rooms/feather5.cpp
@@ -118,16 +118,16 @@ void Room::feather5Tick1() {
playVoc("FEA5LOOP");
playMidiMusicTracks(29);
- if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ if (!_awayMission->feather.waterMonsterRetreated)
loadActorAnim(OBJECT_MONSTER, "s5r5os", 0x4e, 0xa4);
else
loadMapFile("feath5b");
}
void Room::feather5TouchedHotspot0() { // Approached the log
- if (!_vm->_awayMission.feather.waterMonsterRetreated) {
+ if (!_awayMission->feather.waterMonsterRetreated) {
showText(TX_SPEAKER_SPOCK, TX_FEA5_005);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_STRAGEY, TX_FEA5_033);
}
}
@@ -145,9 +145,9 @@ void Room::feather5UseRedshirtOnFern() {
}
void Room::feather5UseRedshirtOnLeftExit() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated) {
+ if (!_awayMission->feather.waterMonsterRetreated) {
showText(TX_SPEAKER_STRAGEY, TX_FEA5_034);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadMapFile("feath5b");
walkCrewmanC(OBJECT_REDSHIRT, 0x8f, 0x64, &Room::feather5RedshirtReachedLog);
}
@@ -158,22 +158,22 @@ void Room::feather5RedshirtReachedLog() {
playVoc("TENTICL2");
loadActorAnim(OBJECT_MONSTER, "s5r5oh", 0x4e, 0xa4);
loadActorAnimC(OBJECT_REDSHIRT, "s5r5ol", 0x8f, 0x64, &Room::feather5RedshirtDeathFinished);
- _vm->_awayMission.feather.waterMonsterRetreated = true;
- _vm->_awayMission.redshirtDead = true;
+ _awayMission->feather.waterMonsterRetreated = true;
+ _awayMission->redshirtDead = true;
}
void Room::feather5RedshirtDeathFinished() {
loadActorStandAnim(OBJECT_REDSHIRT);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::feather5UseSpockOnLeftExit() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ if (!_awayMission->feather.waterMonsterRetreated)
showText(TX_SPEAKER_SPOCK, TX_FEA5_002);
}
void Room::feather5UseMccoyOnLeftExit() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ if (!_awayMission->feather.waterMonsterRetreated)
showText(TX_SPEAKER_MCCOY, TX_FEA5_015);
}
@@ -231,11 +231,11 @@ void Room::feather5GetFern() {
}
void Room::feather5UseKnifeOnFern() {
- if (_vm->_awayMission.feather.gotFern)
+ if (_awayMission->feather.gotFern)
showText(TX_FEA5N015);
else {
walkCrewmanC(OBJECT_KIRK, 0x106, 0x8a, &Room::feather5ReachedFern);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
}
@@ -244,18 +244,18 @@ void Room::feather5ReachedFern() {
}
void Room::feather5PickedUpFern() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
giveItem(OBJECT_IFERN);
- _vm->_awayMission.feather.gotFern = true;
+ _awayMission->feather.gotFern = true;
}
void Room::feather5UseFernOnMonster() {
// BUG: Infinite score mechanism. Just keep throwing ferns into the water.
- _vm->_awayMission.feather.missionScore += 2;
+ _awayMission->feather.missionScore += 2;
walkCrewmanC(OBJECT_KIRK, 0x106, 0x8a, &Room::feather5ReachedPositionToUseFern);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::feather5ReachedPositionToUseFern() {
@@ -264,16 +264,16 @@ void Room::feather5ReachedPositionToUseFern() {
}
void Room::feather5DoneThrowingFern() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
loseItem(OBJECT_IFERN);
- _vm->_awayMission.feather.gotFern = false;
+ _awayMission->feather.gotFern = false;
}
void Room::feather5FernFellIntoWater() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated) {
- _vm->_awayMission.feather.waterMonsterRetreated = true;
- _vm->_awayMission.timers[1] = 20;
+ if (!_awayMission->feather.waterMonsterRetreated) {
+ _awayMission->feather.waterMonsterRetreated = true;
+ _awayMission->timers[1] = 20;
loadActorStandAnim(OBJECT_MONSTER);
loadMapFile("feath5b");
}
@@ -351,24 +351,24 @@ void Room::feather5LookAtSpock() {
}
void Room::feather5LookAtKirk() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ if (!_awayMission->feather.waterMonsterRetreated)
showText(TX_FEA5N001);
else // ENHANCEMENT: Fall back to default behaviour instead of doing nothing
- _vm->_awayMission.rdfStillDoDefaultAction = true;
+ _awayMission->rdfStillDoDefaultAction = true;
}
void Room::feather5LookAtMccoy() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ if (!_awayMission->feather.waterMonsterRetreated)
showText(TX_FEA5N002);
else // ENHANCEMENT: Fall back to default behaviour instead of doing nothing
- _vm->_awayMission.rdfStillDoDefaultAction = true;
+ _awayMission->rdfStillDoDefaultAction = true;
}
void Room::feather5LookAtRedshirt() {
- if (!_vm->_awayMission.feather.waterMonsterRetreated)
+ if (!_awayMission->feather.waterMonsterRetreated)
showText(TX_FEA5N004);
else // ENHANCEMENT: Fall back to default behaviour instead of doing nothing
- _vm->_awayMission.rdfStillDoDefaultAction = true;
+ _awayMission->rdfStillDoDefaultAction = true;
}
void Room::feather5TalkToMccoy() {
@@ -384,7 +384,7 @@ void Room::feather5TalkToRedshirt() {
}
void Room::feather5UseMTricorderOnWater() {
- if (_vm->_awayMission.feather.waterMonsterRetreated)
+ if (_awayMission->feather.waterMonsterRetreated)
mccoyScan(DIR_W, TX_FEA5_011);
else
mccoyScan(DIR_W, TX_FEA5_014);
@@ -403,7 +403,7 @@ void Room::feather5UseSTricorderAnywhere() {
}
void Room::feather5UseSTricorderOnWater() {
- if (_vm->_awayMission.feather.waterMonsterRetreated)
+ if (_awayMission->feather.waterMonsterRetreated)
spockScan(DIR_W, TX_FEA5_031);
else
spockScan(DIR_W, TX_FEA5_030);
diff --git a/engines/startrek/rooms/feather6.cpp b/engines/startrek/rooms/feather6.cpp
index 204d349459..8ae54d1353 100644
--- a/engines/startrek/rooms/feather6.cpp
+++ b/engines/startrek/rooms/feather6.cpp
@@ -126,7 +126,7 @@ void Room::feather6UseRedshirtOnCrystals() {
void Room::feather6UseRockOnStalactites() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0x94, 0x97, &Room::feather6ReachedPositionToThrowRock);
}
@@ -143,21 +143,21 @@ void Room::feather6DoneThrowingRock() {
}
void Room::feather6KirkDiedFromStalactites() {
- _vm->_awayMission.feather.missionScore -= 3;
- _vm->_awayMission.feather.diedFromStalactites = true;
- _vm->_awayMission.disableInput = false;
+ _awayMission->feather.missionScore -= 3;
+ _awayMission->feather.diedFromStalactites = true;
+ _awayMission->disableInput = false;
showText(TX_FEA6N000);
showText(TX_FEA6N004);
loadRoomIndex(7, 5);
}
void Room::feather6UseRockOnCrystals() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0x9a, 0x97, &Room::feather6ReachedCrystalsWithRock);
}
void Room::feather6ReachedCrystalsWithRock() {
- _vm->_awayMission.timers[2] = 174;
+ _awayMission->timers[2] = 174;
loadActorAnim2(OBJECT_STALACTITES, "s5r6tm");
if (!_roomVar.feather.usedRockOnCrystalsOnce) {
_roomVar.feather.usedRockOnCrystalsOnce = true;
@@ -167,12 +167,12 @@ void Room::feather6ReachedCrystalsWithRock() {
}
void Room::feather6Tick() {
- if (_vm->_awayMission.timers[2] == 55 || _vm->_awayMission.timers[2] == 89 || _vm->_awayMission.timers[2] == 119)
+ if (_awayMission->timers[2] == 55 || _awayMission->timers[2] == 89 || _awayMission->timers[2] == 119)
playSoundEffectIndex(SND_BLANK_0b);
}
void Room::feather6HitCrystalsWithRockFirstTime() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_SPEAKER_KIRK, TX_FEA6_001);
}
@@ -302,7 +302,7 @@ void Room::feather6TalkToRedshirt() {
}
void Room::feather6TalkToSpock() {
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_SPOCK, TX_FEA6_035);
else {
showText(TX_SPEAKER_SPOCK, TX_FEA6_038);
@@ -361,19 +361,19 @@ void Room::feather6GetCrystals() {
}
void Room::feather6UseKnifeOnCrystals() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0x9a, 0x97, &Room::feather6ReachedCrystalsWithKnife);
}
void Room::feather6ReachedCrystalsWithKnife() {
loadActorAnimC(OBJECT_KIRK, "s5r6kp", -1, -1, &Room::feather6DoneCuttingCrystals);
- _vm->_awayMission.timers[4] = 122;
+ _awayMission->timers[4] = 122;
}
void Room::feather6DoneCuttingCrystals() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.feather.missionScore += 1;
+ _awayMission->feather.missionScore += 1;
giveItem(OBJECT_ICRYSTAL);
showText(TX_FEA6N017);
}
diff --git a/engines/startrek/rooms/feather7.cpp b/engines/startrek/rooms/feather7.cpp
index 3527014cda..1641ddfc1e 100644
--- a/engines/startrek/rooms/feather7.cpp
+++ b/engines/startrek/rooms/feather7.cpp
@@ -43,22 +43,22 @@ extern const int feather7NumActions = sizeof(feather7ActionList) / sizeof(RoomAc
void Room::feather7Tick1() {
playVoc("FEA7LOOP");
playMidiMusicTracks(33);
- _vm->_awayMission.disableInput = 2;
+ _awayMission->disableInput = 2;
loadActorAnim(OBJECT_QUETZECOATL, "s5r7qn", 0x106, 0x98);
}
void Room::feather7Tick40() {
- if (_vm->_awayMission.feather.diedFromStalactites)
+ if (_awayMission->feather.diedFromStalactites)
showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_017);
showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_022);
- if (_vm->_awayMission.redshirtDead)
+ if (_awayMission->redshirtDead)
showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_021);
// BUGFIX: Show this even if redshirt isn't dead (he wishes you wouldn't have knocked
// out Tlaoxac)
- if (_vm->_awayMission.feather.knockedOutTlaoxac)
+ if (_awayMission->feather.knockedOutTlaoxac)
showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_023);
showText(TX_SPEAKER_QUETZECOATL, TX_FEA7_027);
@@ -146,19 +146,19 @@ void Room::feather7KirkSatDown() {
}
void Room::feather7ReadyToBeamOut() {
- if (_vm->_awayMission.redshirtDead)
+ if (_awayMission->redshirtDead)
showText(TX_SPEAKER_KIRK, TX_FEA7_002);
else {
- _vm->_awayMission.feather.missionScore += 1;
+ _awayMission->feather.missionScore += 1;
showText(TX_SPEAKER_KIRK, TX_FEA7_001);
}
if (!_roomVar.feather.insultedQuetzecoatl)
- _vm->_awayMission.feather.missionScore += 2;
- _vm->_awayMission.feather.missionScore += 4;
+ _awayMission->feather.missionScore += 2;
+ _awayMission->feather.missionScore += 4;
loadActorAnim2(OBJECT_QUETZECOATL, "s5r7qt");
- endMission(_vm->_awayMission.feather.missionScore, 0x13, 0);
+ endMission(_awayMission->feather.missionScore, 0x13, 0);
}
}
diff --git a/engines/startrek/rooms/love0.cpp b/engines/startrek/rooms/love0.cpp
index 49ba136b60..1ad949bacc 100644
--- a/engines/startrek/rooms/love0.cpp
+++ b/engines/startrek/rooms/love0.cpp
@@ -36,17 +36,17 @@ void Room::love0Tick1() {
// BUGFIX: moved this out of the if statement below.
playVoc("LOV0LOOP");
- if (!_vm->_awayMission.love.alreadyStartedMission) {
- _vm->_awayMission.love.canister1 = CANTYPE_O2;
- _vm->_awayMission.love.canister2 = CANTYPE_H2;
- _vm->_awayMission.love.alreadyStartedMission = true;
+ if (!_awayMission->love.alreadyStartedMission) {
+ _awayMission->love.canister1 = CANTYPE_O2;
+ _awayMission->love.canister2 = CANTYPE_H2;
+ _awayMission->love.alreadyStartedMission = true;
}
- if (_vm->_awayMission.love.releasedHumanLaughingGas)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.releasedRomulanLaughingGas)
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
- _vm->_awayMission.timers[2] = 200;
+ if (_awayMission->love.releasedHumanLaughingGas)
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
+ if (_awayMission->love.releasedRomulanLaughingGas)
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[2] = 200;
loadActorAnim(OBJECT_DOOR2, "s3r0d2a", 0xe6, 0x80, 0);
loadActorAnim(OBJECT_DOOR1, "s3r0d1a", 0x123, 0x8d, 0);
@@ -59,10 +59,10 @@ void Room::love0Tick10() {
}
void Room::love0WalkToDoor2() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = 2;
walkCrewman(OBJECT_KIRK, 0xe6, 0x81, 4);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love0OpenDoor2() {
@@ -79,7 +79,7 @@ void Room::love0ReachedDoor2() {
}
void Room::love0WalkToDoor1() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = 1;
walkCrewman(OBJECT_KIRK, 0x125, 0x8d, 5);
}
@@ -150,7 +150,7 @@ void Room::love0TalkToRedshirt() {
}
void Room::love0UseMTricorderAnywhere() {
- if (_vm->_awayMission.love.knowAboutVirus)
+ if (_awayMission->love.knowAboutVirus)
mccoyScan(DIR_N, TX_LOV0_008, false);
else
mccoyScan(DIR_N, TX_LOV0_006, false);
@@ -180,9 +180,9 @@ void Room::love0UseSpockOnConsole() {
strcpy(_roomVar.love.consoleAnimation, "susemn");
walkCrewman(_roomVar.love.consoleCrewman, 0x9a, 0x9a, 2);
- if (!_vm->_awayMission.love.spockAccessedConsole) {
- _vm->_awayMission.love.spockAccessedConsole = true;
- _vm->_awayMission.love.missionScore += 4;
+ if (!_awayMission->love.spockAccessedConsole) {
+ _awayMission->love.spockAccessedConsole = true;
+ _awayMission->love.missionScore += 4;
}
}
@@ -192,7 +192,7 @@ void Room::love0SpockReachedConsole() {
void Room::love0SpockAccessedConsole() {
playVoc("V6KIRKTY");
- if (_vm->_awayMission.love.knowAboutVirus)
+ if (_awayMission->love.knowAboutVirus)
love0InteractWithConsole();
else {
showText(TX_SPEAKER_COMPUTER, TX_COMPU188);
@@ -211,12 +211,12 @@ void Room::love0MccoyReachedConsole() {
void Room::love0MccoyAccessedConsole() {
playVoc("V6KIRKTY");
- if (!_vm->_awayMission.love.mccoyAccessedConsole) {
- _vm->_awayMission.love.mccoyAccessedConsole = true;
- _vm->_awayMission.love.missionScore += 2;
+ if (!_awayMission->love.mccoyAccessedConsole) {
+ _awayMission->love.mccoyAccessedConsole = true;
+ _awayMission->love.missionScore += 2;
}
- if (_vm->_awayMission.love.knowAboutVirus)
+ if (_awayMission->love.knowAboutVirus)
love0InteractWithConsole();
else {
if (!_roomVar.love.heardSummaryOfVirus) {
@@ -228,7 +228,7 @@ void Room::love0MccoyAccessedConsole() {
showText(TX_SPEAKER_MCCOY, TX_LOV0_023);
showText(TX_SPEAKER_KIRK, TX_LOV0_004);
showText(TX_SPEAKER_MCCOY, TX_LOV0_009);
- _vm->_awayMission.love.knowAboutVirus = true;
+ _awayMission->love.knowAboutVirus = true;
}
}
diff --git a/engines/startrek/rooms/love1.cpp b/engines/startrek/rooms/love1.cpp
index 612cd8cd8c..be7ffc97b6 100644
--- a/engines/startrek/rooms/love1.cpp
+++ b/engines/startrek/rooms/love1.cpp
@@ -46,18 +46,18 @@ namespace StarTrek {
void Room::love1Tick1() {
playVoc("LOV1LOOP");
- if (_vm->_awayMission.love.freezerOpen)
+ if (_awayMission->love.freezerOpen)
loadActorAnim(OBJECT_FREEZER, "s3r2d4o", 0x67, 0x8d, 0);
- if (_vm->_awayMission.love.chamberHasDish)
+ if (_awayMission->love.chamberHasDish)
loadActorAnim(OBJECT_CHAMBER, "s3r2d5o", 0xb4, 0x75, 0);
else
loadActorAnim(OBJECT_CHAMBER, "s3r2d5c", 0xb4, 0x75, 0);
- if (_vm->_awayMission.love.chamberHasDish)
+ if (_awayMission->love.chamberHasDish)
loadActorAnim(OBJECT_DISH_IN_CHAMBER, "dishes", 0xb4, 0x71, 0);
- switch (_vm->_awayMission.love.bottleInNozzle) {
+ switch (_awayMission->love.bottleInNozzle) {
case BOTTLETYPE_N2O:
strcpy(_roomVar.love.bottleAnimation, "btle1");
_roomVar.love.itemInNozzle = OBJECT_IN2O;
@@ -83,11 +83,11 @@ common:
break;
}
- if (_vm->_awayMission.love.releasedHumanLaughingGas)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.releasedRomulanLaughingGas)
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
- _vm->_awayMission.timers[2] = 200;
+ if (_awayMission->love.releasedHumanLaughingGas)
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
+ if (_awayMission->love.releasedRomulanLaughingGas)
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[2] = 200;
loadActorAnim(OBJECT_DOOR3, "s3r2d3a", 0xdb, 0x7e, 0);
loadActorAnim(OBJECT_DOOR1, "s3r2d1a", 0, 0, 0);
@@ -98,7 +98,7 @@ common:
}
void Room::love1WalkToDoor3() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = true;
walkCrewman(OBJECT_KIRK, 0xd9, 0x81, 15);
}
@@ -118,7 +118,7 @@ void Room::love1ReachedDoor3() {
}
void Room::love1WalkToDoor1() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = true;
walkCrewman(OBJECT_KIRK, 0x42, 0x97, 16);
}
@@ -138,7 +138,7 @@ void Room::love1ReachedDoor1() {
}
void Room::love1WalkToDoor2() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = true;
walkCrewman(OBJECT_KIRK, 0x79, 0x85, 17);
}
@@ -202,7 +202,7 @@ void Room::love1LookAtDistillator() {
}
void Room::love1LookAtChamber() {
- if (_vm->_awayMission.love.chamberHasCure)
+ if (_awayMission->love.chamberHasCure)
showText(TX_LOV1N013);
else
showText(TX_LOV1N014);
@@ -213,7 +213,7 @@ void Room::love1LookAtReplicator() {
}
void Room::love1LookAtFreezer() {
- if (_vm->_awayMission.love.freezerOpen)
+ if (_awayMission->love.freezerOpen)
showText(TX_LOV1N023);
else
showText(TX_LOV1N018);
@@ -245,7 +245,7 @@ void Room::love1UseMTricorderOnDishes() {
}
void Room::love1UseMTricorderAnywhere() {
- if (_vm->_awayMission.love.knowAboutVirus)
+ if (_awayMission->love.knowAboutVirus)
mccoyScan(DIR_S, TX_LOV1_009, false);
else
mccoyScan(DIR_S, TX_LOV1_010, false);
@@ -281,7 +281,7 @@ void Room::love1GetFreezer() {
}
void Room::love1KirkReachedFreezer() {
- if (_vm->_awayMission.love.freezerOpen)
+ if (_awayMission->love.freezerOpen)
loadActorAnim2(OBJECT_KIRK, "kusehw", -1, -1, 9);
else
showText(TX_LOV1N010);
@@ -293,7 +293,7 @@ void Room::love1KirkGotVirusCulture() {
}
void Room::love1GetFromChamber() {
- if (!_vm->_awayMission.love.chamberHasDish)
+ if (!_awayMission->love.chamberHasDish)
showText(TX_LOV1N009);
else
walkCrewman(OBJECT_KIRK, 0xb5, 0x8c, 8);
@@ -304,13 +304,13 @@ void Room::love1KirkReachedChamber() {
}
void Room::love1KirkGotCureSample() {
- if (_vm->_awayMission.love.chamberHasCure) {
+ if (_awayMission->love.chamberHasCure) {
giveItem(OBJECT_ISAMPLE);
showText(TX_LOV1N035);
// BUGFIX: after removing the cure, unset this variable.
// Otherwise, any normal dish inserted afterward automagically becomes a cure.
- _vm->_awayMission.love.chamberHasCure = false;
+ _awayMission->love.chamberHasCure = false;
} else {
giveItem(OBJECT_IDISHES);
showText(TX_LOV1N006);
@@ -319,7 +319,7 @@ void Room::love1KirkGotCureSample() {
loadActorStandAnim(OBJECT_DISH_IN_CHAMBER);
loadActorAnim2(OBJECT_CHAMBER, "s3r2d6", 0xb4, 0x75, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.chamberHasDish = false;
+ _awayMission->love.chamberHasDish = false;
}
void Room::love1GetFromNozzle() {
@@ -327,14 +327,14 @@ void Room::love1GetFromNozzle() {
}
void Room::love1KirkReachedNozzleToGet() {
- if (_vm->_awayMission.love.bottleInNozzle == 0)
+ if (_awayMission->love.bottleInNozzle == 0)
showText(TX_LOV1N011);
else
loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 11);
}
void Room::love1KirkGotBottleFromNozzle() {
- switch (_vm->_awayMission.love.bottleInNozzle) {
+ switch (_awayMission->love.bottleInNozzle) {
case BOTTLETYPE_N2O:
giveItem(OBJECT_IN2O);
break;
@@ -352,44 +352,44 @@ void Room::love1KirkGotBottleFromNozzle() {
break;
}
- _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_NONE;
+ _awayMission->love.bottleInNozzle = BOTTLETYPE_NONE;
loadActorStandAnim(OBJECT_BOTTLE);
showText(TX_LOV1N007);
_roomVar.love.itemInNozzle = 0;
}
void Room::love1UseN2OOnNozzle() {
- if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ if (_awayMission->love.bottleInNozzle == BOTTLETYPE_NONE) {
_roomVar.love.itemInNozzle = OBJECT_IN2O;
strcpy(_roomVar.love.bottleAnimation, "btle1");
- _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_N2O;
+ _awayMission->love.bottleInNozzle = BOTTLETYPE_N2O;
walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
}
}
void Room::love1UseH2OOnNozzle() {
- if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ if (_awayMission->love.bottleInNozzle == BOTTLETYPE_NONE) {
_roomVar.love.itemInNozzle = OBJECT_IH2O;
strcpy(_roomVar.love.bottleAnimation, "btle3");
- _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_H2O;
+ _awayMission->love.bottleInNozzle = BOTTLETYPE_H2O;
walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
}
}
void Room::love1UseNH3OnNozzle() {
- if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ if (_awayMission->love.bottleInNozzle == BOTTLETYPE_NONE) {
_roomVar.love.itemInNozzle = OBJECT_INH3;
strcpy(_roomVar.love.bottleAnimation, "btle2");
- _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_NH3;
+ _awayMission->love.bottleInNozzle = BOTTLETYPE_NH3;
walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
}
}
void Room::love1UseRLGOnNozzle() {
- if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ if (_awayMission->love.bottleInNozzle == BOTTLETYPE_NONE) {
_roomVar.love.itemInNozzle = OBJECT_IRLG;
strcpy(_roomVar.love.bottleAnimation, "btle4");
- _vm->_awayMission.love.bottleInNozzle = BOTTLETYPE_RLG;
+ _awayMission->love.bottleInNozzle = BOTTLETYPE_RLG;
walkCrewman(OBJECT_KIRK, 0xa6, 0x90, 3);
}
}
@@ -420,10 +420,10 @@ void Room::love1UseMccoyOnReplicator() {
}
void Room::love1MccoyReachedReplicator() {
- if (_vm->_awayMission.love.bottleInNozzle == BOTTLETYPE_NONE) {
+ if (_awayMission->love.bottleInNozzle == BOTTLETYPE_NONE) {
showText(TX_SPEAKER_MCCOY, TX_LOV1_021);
walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
- } else if (!_vm->_awayMission.love.chamberHasDish) {
+ } else if (!_awayMission->love.chamberHasDish) {
showText(TX_SPEAKER_MCCOY, TX_LOV1_015);
walkCrewman(OBJECT_MCCOY, 0xbf, 0x98, 0);
} else
@@ -450,7 +450,7 @@ void Room::love1ChamberClosed() {
void Room::love1ChamberOpened() {
loadActorAnim(OBJECT_DISH_IN_CHAMBER, "dishes", 0xb4, 0x71, 0);
showText(TX_SPEAKER_MCCOY, TX_LOV1_018);
- _vm->_awayMission.love.chamberHasCure = true;
+ _awayMission->love.chamberHasCure = true;
}
void Room::love1UseAnythingOnChamber() {
@@ -462,7 +462,7 @@ void Room::love1UseDishesOnChamber() {
}
void Room::love1KirkReachedChamberToPut() {
- if (_vm->_awayMission.love.chamberHasDish)
+ if (_awayMission->love.chamberHasDish)
showText(TX_SPEAKER_MCCOY, TX_LOV1_014); // TODO: test
else {
loadActorAnim(OBJECT_CHAMBER, "s3r2d5", 0xb4, 0x75, 1);
@@ -477,7 +477,7 @@ void Room::love1ChamberOpenedForDish() {
void Room::love1KirkPutDishInChamber() {
loadActorAnim(OBJECT_DISH_IN_CHAMBER, "dishes", 0xb4, 0x71, 0);
loseItem(OBJECT_IDISHES);
- _vm->_awayMission.love.chamberHasDish = true;
+ _awayMission->love.chamberHasDish = true;
}
void Room::love1UseInsulationOnDistillator() {
@@ -492,9 +492,9 @@ void Room::love1KirkReachedDistillator() {
void Room::love1KirkGotPolyberylcarbonate() {
// Result of using insulation on distillator
showText(TX_LOV1N034);
- if (!_vm->_awayMission.love.gotPolyberylcarbonate) {
- _vm->_awayMission.love.gotPolyberylcarbonate = true;
- _vm->_awayMission.love.missionScore++;
+ if (!_awayMission->love.gotPolyberylcarbonate) {
+ _awayMission->love.gotPolyberylcarbonate = true;
+ _awayMission->love.missionScore++;
}
giveItem(OBJECT_IPBC);
@@ -506,7 +506,7 @@ void Room::love1UseKirkOnFreezer() {
_roomVar.love.crewmanUsingFreezerRetX = 0x96;
_roomVar.love.crewmanUsingDevice = OBJECT_KIRK;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x71, 0x8e, 7);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1UseRedshirtOnFreezer() {
@@ -514,7 +514,7 @@ void Room::love1UseRedshirtOnFreezer() {
_roomVar.love.crewmanUsingFreezerRetX = 0x95;
_roomVar.love.crewmanUsingDevice = OBJECT_REDSHIRT;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x71, 0x8e, 7);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1UseSpockOnFreezer() {
@@ -522,7 +522,7 @@ void Room::love1UseSpockOnFreezer() {
_roomVar.love.crewmanUsingFreezerRetX = 0x61;
_roomVar.love.crewmanUsingDevice = OBJECT_SPOCK;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x71, 0x8e, 7);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1UseMccoyOnFreezer() {
@@ -530,26 +530,26 @@ void Room::love1UseMccoyOnFreezer() {
_roomVar.love.crewmanUsingFreezerRetX = 0xbf;
_roomVar.love.crewmanUsingDevice = OBJECT_MCCOY;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x71, 0x8e, 7);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1CrewmanReachedFreezer() {
- Common::String useAnim = _vm->getCrewmanAnimFilename(_roomVar.love.crewmanUsingDevice, "usehw");
+ Common::String useAnim = getCrewmanAnimFilename(_roomVar.love.crewmanUsingDevice, "usehw");
loadActorAnim2(_roomVar.love.crewmanUsingDevice, useAnim, -1, -1, 16);
}
void Room::love1CrewmanOpenedOrClosedFreezer() {
- if (_vm->_awayMission.love.freezerOpen)
+ if (_awayMission->love.freezerOpen)
loadActorAnim(OBJECT_FREEZER, "s3r2d4a", 0x67, 0x8d, 0);
else
loadActorAnim(OBJECT_FREEZER, "s3r2d4", 0x67, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.freezerOpen = !_vm->_awayMission.love.freezerOpen;
+ _awayMission->love.freezerOpen = !_awayMission->love.freezerOpen;
walkCrewman(_roomVar.love.crewmanUsingDevice, _roomVar.love.crewmanUsingFreezerRetX, _roomVar.love.crewmanUsingFreezerRetY, 0);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::love1UseAnythingOnFreezer() {
@@ -590,30 +590,30 @@ void Room::love1FinishedUsingArbitraryItemOnDistillator() {
void Room::love1UseKirkOnLadder() {
_roomVar.love.crewmanUsingDevice = OBJECT_KIRK;
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x102, 0x89, 1);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1UseSpockOnLadder() {
_roomVar.love.crewmanUsingDevice = OBJECT_SPOCK;
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x102, 0x89, 1);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1UseMccoyOnLadder() {
_roomVar.love.crewmanUsingDevice = OBJECT_MCCOY;
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x102, 0x89, 1);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1UseRedshirtOnLadder() {
_roomVar.love.crewmanUsingDevice = OBJECT_REDSHIRT;
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[_roomVar.love.crewmanUsingDevice] = DIR_N;
walkCrewman(_roomVar.love.crewmanUsingDevice, 0x102, 0x89, 1);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love1CrewmanReachedLadder() {
@@ -624,13 +624,13 @@ void Room::love1CrewmanReachedLadder() {
TX_SPEAKER_FERRIS
};
- if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas || _vm->_awayMission.love.romulansUnconsciousFromVirus) // Romulans unconscious
+ if (_awayMission->love.romulansUnconsciousFromLaughingGas || _awayMission->love.romulansUnconsciousFromVirus) // Romulans unconscious
loadRoomIndex(4, 3);
else { // Romulans still conscious, they shoot you
loadActorAnim(OBJECT_PHASERSHOT, "s3r2s2", 0xf3, 0x89, 0);
playSoundEffectIndex(SND_PHASSHOT);
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love.crewmanUsingDevice, "killw");
+ Common::String anim = getCrewmanAnimFilename(_roomVar.love.crewmanUsingDevice, "killw");
loadActorAnim(_roomVar.love.crewmanUsingDevice, anim, 0x102, 0x89, 6);
_roomVar.love.dyingSpeaker = speakers[_roomVar.love.crewmanUsingDevice];
}
@@ -638,9 +638,9 @@ void Room::love1CrewmanReachedLadder() {
void Room::love1CrewmanDiedFromPhaser() {
if (_roomVar.love.crewmanUsingDevice == OBJECT_REDSHIRT) {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_FERRIS, TX_LOV1_024);
- _vm->_awayMission.redshirtDead = true;
+ _awayMission->redshirtDead = true;
} else {
showText(_roomVar.love.dyingSpeaker, TX_LOV1_025);
showGameOverMenu();
@@ -649,11 +649,11 @@ void Room::love1CrewmanDiedFromPhaser() {
// Romulans fire a "warning shot" when you go to the right part of the room.
void Room::love1TouchedHotspot0() {
- if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas || _vm->_awayMission.love.romulansUnconsciousFromVirus)
+ if (_awayMission->love.romulansUnconsciousFromLaughingGas || _awayMission->love.romulansUnconsciousFromVirus)
return;
loadActorAnim(OBJECT_PHASERSHOT, "s3r2s1", 0xf3, 0x89, 0);
playSoundEffectIndex(SND_PHASSHOT);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_FERRIS, TX_LOV1_028);
}
diff --git a/engines/startrek/rooms/love2.cpp b/engines/startrek/rooms/love2.cpp
index 61feac9921..5a0d802b0d 100644
--- a/engines/startrek/rooms/love2.cpp
+++ b/engines/startrek/rooms/love2.cpp
@@ -49,7 +49,7 @@ void Room::love2Tick1() {
char canName[10];
- switch (_vm->_awayMission.love.canister1) {
+ switch (_awayMission->love.canister1) {
case CANTYPE_O2:
strcpy(canName, "o2can");
break;
@@ -63,10 +63,10 @@ void Room::love2Tick1() {
break;
}
- if (_vm->_awayMission.love.canister1 >= 1 && _vm->_awayMission.love.canister1 <= 3)
+ if (_awayMission->love.canister1 >= 1 && _awayMission->love.canister1 <= 3)
loadActorAnim(OBJECT_CAN1, canName, 0xa7, 0xae, 0);
- switch (_vm->_awayMission.love.canister2) {
+ switch (_awayMission->love.canister2) {
case CANTYPE_O2:
strcpy(canName, "o2can");
break;
@@ -80,30 +80,30 @@ void Room::love2Tick1() {
break;
}
- if (_vm->_awayMission.love.canister2 >= 1 && _vm->_awayMission.love.canister2 <= 3)
+ if (_awayMission->love.canister2 >= 1 && _awayMission->love.canister2 <= 3)
loadActorAnim(OBJECT_CAN2, canName, 0xb1, 0xaf, 0);
- if (_vm->_awayMission.love.gasFeedOn)
+ if (_awayMission->love.gasFeedOn)
loadActorAnim(OBJECT_GAS_FEED, "s3r3vo", 0xac, 0x75, 0);
else
loadActorAnim(OBJECT_GAS_FEED, "s3r3vc", 0xac, 0x75, 0);
- if (_vm->_awayMission.love.cabinetOpen)
+ if (_awayMission->love.cabinetOpen)
loadActorAnim(OBJECT_CABINET, "s3r3d1o", 0x1e, 0xaf, 0);
else
loadActorAnim(OBJECT_CABINET, "s3r3d1c", 0x1e, 0xaf, 0);
- if (_vm->_awayMission.love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
+ if (_awayMission->love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
loadActorAnim(OBJECT_ANTIGRAV, "antigr", 0x1f, 0xa7, 0);
- if (_vm->_awayMission.love.synthesizerContents != 0)
+ if (_awayMission->love.synthesizerContents != 0)
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2o", 0x8a, 0x8d, 0);
else
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2c", 0x8a, 0x8d, 0);
bool valid = true;
- switch (_vm->_awayMission.love.synthesizerContents) {
+ switch (_awayMission->love.synthesizerContents) {
case SYNTHITEM_PBC:
strcpy(_roomVar.love.chamberInputAnim, "pbcanm");
_roomVar.love.chamberObject = OBJECT_POLYBERYLCARBONATE;
@@ -117,7 +117,7 @@ void Room::love2Tick1() {
_roomVar.love.chamberObject = OBJECT_CURESAMPLE;
break;
case SYNTHITEM_BOTTLE:
- switch (_vm->_awayMission.love.synthesizerBottleIndex) {
+ switch (_awayMission->love.synthesizerBottleIndex) {
case 1:
strcpy(_roomVar.love.chamberOutputAnim, "btle1");
_roomVar.love.chamberObject = OBJECT_SYNTHESIZER_OUTPUT;
@@ -146,17 +146,17 @@ void Room::love2Tick1() {
}
if (valid) {
- if (_vm->_awayMission.love.synthesizerContents == 9)
+ if (_awayMission->love.synthesizerContents == 9)
loadActorAnim2(_roomVar.love.chamberObject, _roomVar.love.chamberOutputAnim, 0x8a, 0x8b, 0);
else
loadActorAnim2(_roomVar.love.chamberObject, _roomVar.love.chamberInputAnim, 0x8a, 0x8b, 0);
}
- if (_vm->_awayMission.love.releasedHumanLaughingGas)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.releasedRomulanLaughingGas)
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
- _vm->_awayMission.timers[2] = 200;
+ if (_awayMission->love.releasedHumanLaughingGas)
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
+ if (_awayMission->love.releasedRomulanLaughingGas)
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[2] = 200;
loadActorAnim(OBJECT_DOOR, "s3r3d3a", 0x12a, 0xb5, 0);
@@ -165,9 +165,9 @@ void Room::love2Tick1() {
}
void Room::love2TouchedWarp1() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.timers[3] = 10;
+ _awayMission->timers[3] = 10;
}
void Room::love2Timer3Expired() {
@@ -175,7 +175,7 @@ void Room::love2Timer3Expired() {
}
void Room::love2WalkToDoor() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = true;
walkCrewman(OBJECT_KIRK, 0x127, 0xba, 14);
}
@@ -244,7 +244,7 @@ void Room::love2LookAtChamber() {
}
void Room::love2LookAtCan1() {
- switch (_vm->_awayMission.love.canister1) {
+ switch (_awayMission->love.canister1) {
case CANTYPE_O2:
showText(TX_LOV2N004);
break;
@@ -259,7 +259,7 @@ void Room::love2LookAtCan1() {
}
void Room::love2LookAtCan2() {
- switch (_vm->_awayMission.love.canister2) {
+ switch (_awayMission->love.canister2) {
case CANTYPE_O2:
showText(TX_LOV2N004);
break;
@@ -290,7 +290,7 @@ void Room::love2TalkToRedshirt() {
}
void Room::love2UseMTricorderAnywhere() {
- if (_vm->_awayMission.love.knowAboutVirus)
+ if (_awayMission->love.knowAboutVirus)
mccoyScan(DIR_S, TX_LOV2_008, false);
else
// BUGFIX: should be TX_LOV2_012, but the audio file is missing. Using equivalent
@@ -323,26 +323,26 @@ void Room::love2UseRedshirtOnCabinet() {
}
void Room::love2CrewmanReachedCabinet() {
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love.chamberObject, "usehw");
+ Common::String anim = getCrewmanAnimFilename(_roomVar.love.chamberObject, "usehw");
loadActorAnim2(_roomVar.love.chamberObject, anim, -1, -1, 11);
}
void Room::love2CrewmanAccessedCabinet() {
- if (_vm->_awayMission.love.cabinetOpen)
+ if (_awayMission->love.cabinetOpen)
loadActorAnim2(OBJECT_CABINET, "s3r3d4", 0x1e, 0xaf, 2);
else
loadActorAnim2(OBJECT_CABINET, "s3r3d1", 0x1e, 0xaf, 2);
playSoundEffectIndex(SND_DOOR1);
- if (_vm->_awayMission.love.cabinetOpen)
+ if (_awayMission->love.cabinetOpen)
loadActorStandAnim(OBJECT_ANTIGRAV);
- _vm->_awayMission.love.cabinetOpen = !_vm->_awayMission.love.cabinetOpen;
+ _awayMission->love.cabinetOpen = !_awayMission->love.cabinetOpen;
}
void Room::love2CrewmanOpenedOrClosedCabinet() {
- if (_vm->_awayMission.love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
+ if (_awayMission->love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
loadActorAnim(OBJECT_ANTIGRAV, "antigr", 0x1f, 0xa7, 0);
}
@@ -356,12 +356,12 @@ void Room::love2ReachedGasFeed() {
}
void Room::love2ChangedGasFeed() {
- if (_vm->_awayMission.love.gasFeedOn) {
- _vm->_awayMission.love.gasFeedOn = false;
+ if (_awayMission->love.gasFeedOn) {
+ _awayMission->love.gasFeedOn = false;
loadActorAnim2(OBJECT_GAS_FEED, "s3r3v2", 0xac, 0x75, 0);
showText(TX_LOV2N007);
} else {
- _vm->_awayMission.love.gasFeedOn = true;
+ _awayMission->love.gasFeedOn = true;
loadActorAnim2(OBJECT_GAS_FEED, "s3r3v1", 0xac, 0x75, 0);
showText(TX_LOV2N008);
}
@@ -389,12 +389,12 @@ void Room::love2UseN2GasOnCanisterSlot() {
}
void Room::love2ReachedCanisterSlot() {
- if (_vm->_awayMission.love.gasFeedOn)
+ if (_awayMission->love.gasFeedOn)
showText(TX_SPEAKER_SPOCK, TX_LOV2_026);
else {
- if (_vm->_awayMission.love.canister1 == CANTYPE_NONE)
+ if (_awayMission->love.canister1 == CANTYPE_NONE)
loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 13);
- else if (_vm->_awayMission.love.canister2 == CANTYPE_NONE)
+ else if (_awayMission->love.canister2 == CANTYPE_NONE)
loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 14);
else
showText(TX_LOV2N024);
@@ -404,7 +404,7 @@ void Room::love2ReachedCanisterSlot() {
void Room::love2PutCanisterInSlot1() {
playVoc("SE6FOOD");
loadActorAnim(OBJECT_CAN1, _roomVar.love.canisterAnim, 0xa7, 0xae, 0);
- _vm->_awayMission.love.canister1 = _roomVar.love.canisterType;
+ _awayMission->love.canister1 = _roomVar.love.canisterType;
showText(TX_LOV2N034);
loseItem(_roomVar.love.canisterItem);
}
@@ -412,7 +412,7 @@ void Room::love2PutCanisterInSlot1() {
void Room::love2PutCanisterInSlot2() {
playVoc("SE6FOOD");
loadActorAnim(OBJECT_CAN2, _roomVar.love.canisterAnim, 0xb1, 0xaf, 0);
- _vm->_awayMission.love.canister2 = _roomVar.love.canisterType;
+ _awayMission->love.canister2 = _roomVar.love.canisterType;
showText(TX_LOV2N035);
loseItem(_roomVar.love.canisterItem);
}
@@ -422,7 +422,7 @@ void Room::love2UseAntigravOnCanister1() {
}
void Room::love2ReachedCanisterSlot1ToGet() {
- if (_vm->_awayMission.love.gasFeedOn)
+ if (_awayMission->love.gasFeedOn)
showText(TX_SPEAKER_SPOCK, TX_LOV2_025);
else {
loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 15);
@@ -435,7 +435,7 @@ void Room::love2TookCanister1() {
showText(TX_LOV2N030);
loadActorStandAnim(OBJECT_CAN1);
- switch (_vm->_awayMission.love.canister1) {
+ switch (_awayMission->love.canister1) {
case CANTYPE_O2:
giveItem(OBJECT_IO2GAS);
break;
@@ -448,7 +448,7 @@ void Room::love2TookCanister1() {
break;
}
- _vm->_awayMission.love.canister1 = CANTYPE_NONE;
+ _awayMission->love.canister1 = CANTYPE_NONE;
}
void Room::love2UseAntigravOnCanister2() {
@@ -456,7 +456,7 @@ void Room::love2UseAntigravOnCanister2() {
}
void Room::love2ReachedCanisterSlot2ToGet() {
- if (_vm->_awayMission.love.gasFeedOn)
+ if (_awayMission->love.gasFeedOn)
showText(TX_SPEAKER_SPOCK, TX_LOV2_025);
else {
loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 16);
@@ -468,7 +468,7 @@ void Room::love2TookCanister2() {
showText(TX_LOV2N031);
loadActorStandAnim(OBJECT_CAN2);
- switch (_vm->_awayMission.love.canister2) {
+ switch (_awayMission->love.canister2) {
case CANTYPE_O2:
giveItem(OBJECT_IO2GAS);
break;
@@ -481,7 +481,7 @@ void Room::love2TookCanister2() {
break;
}
- _vm->_awayMission.love.canister2 = CANTYPE_NONE;
+ _awayMission->love.canister2 = CANTYPE_NONE;
}
void Room::love2UseKirkOnSynthesizer() {
@@ -505,12 +505,12 @@ void Room::love2UseRedshirtOnSynthesizer() {
}
void Room::love2CrewmanReachedSynthesizer() {
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love.chamberObject, "usemn");
+ Common::String anim = getCrewmanAnimFilename(_roomVar.love.chamberObject, "usemn");
loadActorAnim2(_roomVar.love.chamberObject, anim, -1, -1, 17);
}
void Room::love2CrewmanUsedSynthesizer() {
- if (_vm->_awayMission.love.gasFeedOn) {
+ if (_awayMission->love.gasFeedOn) {
love2UseSynthesizer();
} else {
if (_roomVar.love.cb == 3) {
@@ -532,7 +532,7 @@ void Room::love2SpockReachedGasFeeds() {
}
void Room::love2SpockEnabledGasFeeds() {
- _vm->_awayMission.love.gasFeedOn = true;
+ _awayMission->love.gasFeedOn = true;
loadActorAnim2(OBJECT_GAS_FEED, "s3r3v1", 0xac, 0x75, 0);
showText(TX_LOV2N008);
@@ -543,10 +543,10 @@ void Room::love2SpockEnabledGasFeeds() {
// Synthesizer takes the input and produces some output
void Room::love2UseSynthesizer() {
- if (_vm->_awayMission.love.canister1 != 0) {
- if (_vm->_awayMission.love.canister2 != 0) {
- int c1 = _vm->_awayMission.love.canister1;
- int c2 = _vm->_awayMission.love.canister2;
+ if (_awayMission->love.canister1 != 0) {
+ if (_awayMission->love.canister2 != 0) {
+ int c1 = _awayMission->love.canister1;
+ int c2 = _awayMission->love.canister2;
if (c1 > c2) {
int tmp = c1;
c1 = c2;
@@ -554,7 +554,7 @@ void Room::love2UseSynthesizer() {
}
if (c1 == CANTYPE_O2 && c2 == CANTYPE_H2) {
- switch (_vm->_awayMission.love.synthesizerContents) {
+ switch (_awayMission->love.synthesizerContents) {
case SYNTHITEM_PBC: // Romulan Laughing Gas
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", -1, -1, 27); // -> love2ClosedSynthesizerDoorMakingRLG
playSoundEffectIndex(SND_DOOR1);
@@ -581,7 +581,7 @@ bottleFailure:
case SYNTHITEM_NONE: // Water
default:
- _vm->_awayMission.love.synthesizerBottleIndex = BOTTLETYPE_H2O;
+ _awayMission->love.synthesizerBottleIndex = BOTTLETYPE_H2O;
strcpy(_roomVar.love.chamberOutputAnim, "btle3");
produceBottle:
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3); // -> love2SynthesizerDoorClosed
@@ -591,11 +591,11 @@ produceBottle:
closeSynthesizerDoor:
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.synthesizerContents = 0;
+ _awayMission->love.synthesizerContents = 0;
break;
}
} else if (c1 == CANTYPE_H2 && c2 == CANTYPE_N2) {
- switch (_vm->_awayMission.love.synthesizerContents) {
+ switch (_awayMission->love.synthesizerContents) {
case SYNTHITEM_PBC: // Inert matter
inertMatterFailure:
showText(TX_LOV2N049);
@@ -621,12 +621,12 @@ inertMatterFailure:
case SYNTHITEM_NONE: // Ammonia
default:
- _vm->_awayMission.love.synthesizerBottleIndex = BOTTLETYPE_NH3;
+ _awayMission->love.synthesizerBottleIndex = BOTTLETYPE_NH3;
strcpy(_roomVar.love.chamberOutputAnim, "btle2");
goto produceBottle;
}
} else if (c1 == CANTYPE_O2 && c2 == CANTYPE_N2) {
- switch (_vm->_awayMission.love.synthesizerContents) {
+ switch (_awayMission->love.synthesizerContents) {
case SYNTHITEM_PBC: // Inert matter
goto inertMatterFailure;
@@ -644,7 +644,7 @@ inertMatterFailure:
case SYNTHITEM_NONE: // Laughing gas
default:
- _vm->_awayMission.love.synthesizerBottleIndex = BOTTLETYPE_N2O;
+ _awayMission->love.synthesizerBottleIndex = BOTTLETYPE_N2O;
strcpy(_roomVar.love.chamberOutputAnim, "btle1");
goto produceBottle;
}
@@ -664,12 +664,12 @@ inertMatterFailure:
void Room::love2SynthesizerDoorClosed() {
playVoc("LD1SCAN");
loadActorAnim(OBJECT_SYNTHESIZER_OUTPUT, _roomVar.love.chamberOutputAnim, 0x8a, 0x8d, 4); // -> love2SynthesizerFinished
- _vm->_awayMission.love.synthesizerContents = SYNTHITEM_BOTTLE;
+ _awayMission->love.synthesizerContents = SYNTHITEM_BOTTLE;
}
// Final product of synthesizer is produced
void Room::love2SynthesizerFinished() {
- switch (_vm->_awayMission.love.synthesizerBottleIndex) {
+ switch (_awayMission->love.synthesizerBottleIndex) {
case BOTTLETYPE_N2O:
showText(TX_LOV2N017);
showText(TX_SPEAKER_SPOCK, TX_LOV2_032);
@@ -679,7 +679,7 @@ void Room::love2SynthesizerFinished() {
case BOTTLETYPE_NH3:
showText(TX_LOV2N016);
- if (!_vm->_awayMission.redshirtDead) {
+ if (!_awayMission->redshirtDead) {
showText(TX_SPEAKER_FERRIS, TX_LOV2_043);
showText(TX_SPEAKER_KIRK, TX_LOV2_003);
}
@@ -703,7 +703,7 @@ void Room::love2SynthesizerFinished() {
}
void Room::love2ClosedSynthesizerDoorMakingRLG() {
- _vm->_awayMission.love.synthesizerBottleIndex = BOTTLETYPE_RLG;
+ _awayMission->love.synthesizerBottleIndex = BOTTLETYPE_RLG;
strcpy(_roomVar.love.chamberOutputAnim, "btle4");
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3); // -> love2SynthesizerDoorClosed
playSoundEffectIndex(SND_DOOR1);
@@ -727,11 +727,11 @@ void Room::love2CureSynthesized() {
// Put polycarbonate in synthesizer
void Room::love2UsePolyberylcarbonateOnSynthesizerDoor() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 6);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2KirkReachedSynthesizerWithPolyberylcarbonate() {
- if (_vm->_awayMission.love.synthesizerContents != 0)
+ if (_awayMission->love.synthesizerContents != 0)
showText(TX_LOV2N025);
else {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 5);
@@ -746,18 +746,18 @@ void Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate() {
void Room::love2PutPolyberylcarbonateInSynthesizer() {
loadActorAnim(OBJECT_POLYBERYLCARBONATE, "pbcanm", 0x8a, 0x8b, 0);
loseItem(OBJECT_IPBC);
- _vm->_awayMission.love.synthesizerContents = SYNTHITEM_PBC;
+ _awayMission->love.synthesizerContents = SYNTHITEM_PBC;
}
// Put dish (virus sample) in synthesizer
void Room::love2UseVirusSampleOnSynthesizerDoor() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 7);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2KirkReachedSynthesizerWithVirusSample() {
- if (_vm->_awayMission.love.synthesizerContents != 0)
+ if (_awayMission->love.synthesizerContents != 0)
showText(TX_LOV2N025);
else {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 6);
@@ -772,18 +772,18 @@ void Room::love2SynthesizerDoorOpenedWithVirusSample() {
void Room::love2PutVirusSampleInSynthesizer() {
loadActorAnim(OBJECT_VIRUSSAMPLE, "dishes", 0x8a, 0x8b, 0);
loseItem(OBJECT_IDISHES);
- _vm->_awayMission.love.synthesizerContents = SYNTHITEM_VIRUS_SAMPLE;
+ _awayMission->love.synthesizerContents = SYNTHITEM_VIRUS_SAMPLE;
}
// Put cure sample in synthesizer
void Room::love2UseCureSampleOnSynthesizerDoor() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 8);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2KirkReachedSynthesizerWithCureSample() {
- if (_vm->_awayMission.love.synthesizerContents != 0)
+ if (_awayMission->love.synthesizerContents != 0)
showText(TX_LOV2N025); // BUGFIX: original didn't play audio
else {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 7);
@@ -798,7 +798,7 @@ void Room::love2SynthesizerDoorOpenedWithCureSample() {
void Room::love2PutCureSampleInSynthesizer() {
loadActorAnim(OBJECT_CURESAMPLE, "dishes", 0x8a, 0x8b, 0);
loseItem(OBJECT_ISAMPLE);
- _vm->_awayMission.love.synthesizerContents = SYNTHITEM_CURE_SAMPLE;
+ _awayMission->love.synthesizerContents = SYNTHITEM_CURE_SAMPLE;
}
@@ -812,7 +812,7 @@ void Room::love2UseAnythingOnSynthesizer() {
}
void Room::love2GetCanister() {
- if (_vm->_awayMission.redshirtDead)
+ if (_awayMission->redshirtDead)
showText(TX_SPEAKER_MCCOY, TX_LOV2_011);
else
showText(TX_SPEAKER_FERRIS, TX_LOV2_040);
@@ -838,7 +838,7 @@ void Room::love2GotAntigrav() {
// Get polyberylcarbonate from synthesizer
void Room::love2GetPolyberylcarbonate() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 18);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2ReachedPolyberylcarbonate() {
@@ -849,7 +849,7 @@ void Room::love2GotPolyberylcarbonate() {
loadActorStandAnim(OBJECT_POLYBERYLCARBONATE);
showText(TX_LOV2N044);
giveItem(OBJECT_IPBC);
- _vm->_awayMission.love.synthesizerContents = 0;
+ _awayMission->love.synthesizerContents = 0;
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
}
@@ -858,7 +858,7 @@ void Room::love2GotPolyberylcarbonate() {
// Get virus sample from synthesizer
void Room::love2GetDishes() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 17);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2ReachedDishes() {
@@ -869,7 +869,7 @@ void Room::love2GotDishes() {
loadActorStandAnim(OBJECT_VIRUSSAMPLE);
showText(TX_LOV2N036); // FIXME: text doesn't match audio
giveItem(OBJECT_IDISHES);
- _vm->_awayMission.love.synthesizerContents = 0;
+ _awayMission->love.synthesizerContents = 0;
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
}
@@ -878,7 +878,7 @@ void Room::love2GotDishes() {
// Get cure sample from synthesizer
void Room::love2GetSample() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 19);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2ReachedSample() {
@@ -889,7 +889,7 @@ void Room::love2GotSample() {
loadActorStandAnim(OBJECT_CURESAMPLE);
showText(TX_LOV2N037);
giveItem(OBJECT_ISAMPLE);
- _vm->_awayMission.love.synthesizerContents = 0;
+ _awayMission->love.synthesizerContents = 0;
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
}
@@ -898,7 +898,7 @@ void Room::love2GotSample() {
// Get synthesizer output
void Room::love2GetSynthesizerOutput() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 10);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2ReachedSynthesizerOutput() {
@@ -906,7 +906,7 @@ void Room::love2ReachedSynthesizerOutput() {
}
void Room::love2GotSynthesizerOutput() {
- switch (_vm->_awayMission.love.synthesizerBottleIndex) {
+ switch (_awayMission->love.synthesizerBottleIndex) {
case BOTTLETYPE_N2O:
showText(TX_LOV2N040);
giveItem(OBJECT_IN2O);
@@ -925,9 +925,9 @@ void Room::love2GotSynthesizerOutput() {
case BOTTLETYPE_RLG:
default:
showText(TX_LOV2N038);
- if (!_vm->_awayMission.love.gotTLDH) {
- _vm->_awayMission.love.gotTLDH = true;
- _vm->_awayMission.love.missionScore += 4;
+ if (!_awayMission->love.gotTLDH) {
+ _awayMission->love.gotTLDH = true;
+ _awayMission->love.missionScore += 4;
}
giveItem(OBJECT_IRLG);
break;
@@ -937,14 +937,14 @@ void Room::love2GotSynthesizerOutput() {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.synthesizerContents = 0;
- _vm->_awayMission.love.synthesizerBottleIndex = 0;
+ _awayMission->love.synthesizerContents = 0;
+ _awayMission->love.synthesizerBottleIndex = 0;
}
// Get the cure
void Room::love2GetCure() {
walkCrewman(OBJECT_KIRK, 0x85, 0xad, 11);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love2ReachedCure() {
@@ -952,9 +952,9 @@ void Room::love2ReachedCure() {
}
void Room::love2GotCure() {
- if (!_vm->_awayMission.love.gotCure) {
- _vm->_awayMission.love.gotCure = true;
- _vm->_awayMission.love.missionScore += 5;
+ if (!_awayMission->love.gotCure) {
+ _awayMission->love.gotCure = true;
+ _awayMission->love.missionScore += 5;
}
giveItem(OBJECT_ICURE);
@@ -963,7 +963,7 @@ void Room::love2GotCure() {
loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.love.synthesizerContents = 0;
+ _awayMission->love.synthesizerContents = 0;
}
}
diff --git a/engines/startrek/rooms/love3.cpp b/engines/startrek/rooms/love3.cpp
index 03ae5840b7..48d93f2cf5 100644
--- a/engines/startrek/rooms/love3.cpp
+++ b/engines/startrek/rooms/love3.cpp
@@ -38,46 +38,46 @@ namespace StarTrek {
void Room::love3Tick1() {
playVoc("LOV3LOOP");
- if (!_vm->_awayMission.love.wrenchTaken)
+ if (!_awayMission->love.wrenchTaken)
loadActorAnim(OBJECT_WRENCH, "wrench", 0x10a, 0xb6, 0);
- if (_vm->_awayMission.love.grateRemoved)
+ if (_awayMission->love.grateRemoved)
loadActorAnim(OBJECT_GRATE, "s3r4g3", 0, 0, 0);
else
loadActorAnim(OBJECT_GRATE, "s3r4g1", 0x116, 0x8f, 0);
- if (_vm->_awayMission.love.insulationOnGround)
+ if (_awayMission->love.insulationOnGround)
loadActorAnim(OBJECT_INSULATION, "s3r4p2", 0, 0, 0);
- if (!_vm->_awayMission.love.tookN2TankFromServicePanel)
+ if (!_awayMission->love.tookN2TankFromServicePanel)
loadActorAnim(OBJECT_GAS_TANK, "r4n2", 0, 0, 0);
- if (_vm->_awayMission.love.servicePanelOpen)
+ if (_awayMission->love.servicePanelOpen)
loadActorAnim(OBJECT_SERVICE_PANEL, "s3r4d1a", 1, 0, 0);
else
loadActorAnim(OBJECT_SERVICE_PANEL, "s3r4d2", 1, 0, 0);
- if (_vm->_awayMission.love.releasedHumanLaughingGas)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.releasedRomulanLaughingGas)
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
- _vm->_awayMission.timers[2] = 200;
+ if (_awayMission->love.releasedHumanLaughingGas)
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
+ if (_awayMission->love.releasedRomulanLaughingGas)
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[2] = 200;
_roomVar.love.cmnXPosToCureSpock = 0xb4;
_roomVar.love.cmnYPosToCureSpock = 0xb7;
}
void Room::love3Tick80() {
- if (!_vm->_awayMission.love.visitedRoomWithRomulans && haveItem(OBJECT_IRLG)) {
+ if (!_awayMission->love.visitedRoomWithRomulans && haveItem(OBJECT_IRLG)) {
showText(TX_SPEAKER_MCCOY, TX_LOV3_010);
showText(TX_SPEAKER_SPOCK, TX_LOV3_020);
}
}
void Room::love3TouchedWarp1() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.timers[3] = 10;
+ _awayMission->timers[3] = 10;
}
void Room::love3Timer3Expired() {
@@ -125,7 +125,7 @@ void Room::love3LookAtGrate() {
}
void Room::love3LookAtPanel() {
- if (_vm->_awayMission.love.insulationOnGround)
+ if (_awayMission->love.insulationOnGround)
showText(TX_LOV3N017);
else
showText(TX_LOV3NA22);
@@ -139,7 +139,7 @@ void Room::love3LookAtTurbines() {
showText(TX_LOV3N026);
showText(TX_SPEAKER_MCCOY, TX_LOV3_009);
showText(TX_SPEAKER_SPOCK, TX_LOV3_019);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_FERRIS, TX_LOV3_026);
}
@@ -148,9 +148,9 @@ void Room::love3TalkToKirk() {
}
void Room::love3TalkToSpock() {
- if (_vm->_awayMission.love.visitedRoomWithRomulans)
+ if (_awayMission->love.visitedRoomWithRomulans)
showText(TX_SPEAKER_SPOCK, TX_LOV3_003);
- else if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
+ else if (_awayMission->love.romulansUnconsciousFromLaughingGas)
showText(TX_SPEAKER_SPOCK, TX_LOV3_017);
else if (haveItem(OBJECT_IRLG))
showText(TX_SPEAKER_SPOCK, TX_LOV3_004);
@@ -167,7 +167,7 @@ void Room::love3TalkToRedshirt() {
}
void Room::love3UseMTricorderAnywhere() {
- if (_vm->_awayMission.love.knowAboutVirus)
+ if (_awayMission->love.knowAboutVirus)
mccoyScan(DIR_S, TX_LOV3_005, false);
else
mccoyScan(DIR_S, TX_LOV3_006, false);
@@ -178,7 +178,7 @@ void Room::love3UseSTricorderOnTurbines() {
}
void Room::love3UseSTricorderOnInsulation() {
- if (_vm->_awayMission.love.insulationOnGround)
+ if (_awayMission->love.insulationOnGround)
spockScan(DIR_W, TX_LOV3_002, false);
}
@@ -207,21 +207,21 @@ void Room::love3UseRedshirtOnServicePanel() {
}
void Room::love3CrewmanReachedServicePanel() {
- Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love.activeCrewman, "usehe");
+ Common::String anim = getCrewmanAnimFilename(_roomVar.love.activeCrewman, "usehe");
loadActorAnim2(_roomVar.love.activeCrewman, anim, -1, -1, 1);
}
void Room::love3OpenedOrClosedServicePanel() {
- if (_vm->_awayMission.love.servicePanelOpen)
+ if (_awayMission->love.servicePanelOpen)
loadActorAnim2(OBJECT_SERVICE_PANEL, "s3r4d1b", 1, 0, 0);
else
loadActorAnim2(OBJECT_SERVICE_PANEL, "s3r4d1", 1, 0, 0);
playVoc("SMADOOR1");
- _vm->_awayMission.love.servicePanelOpen = !_vm->_awayMission.love.servicePanelOpen;
+ _awayMission->love.servicePanelOpen = !_awayMission->love.servicePanelOpen;
- if (_vm->_awayMission.love.servicePanelOpen) {
- if (_vm->_awayMission.love.tookN2TankFromServicePanel)
+ if (_awayMission->love.servicePanelOpen) {
+ if (_awayMission->love.tookN2TankFromServicePanel)
showText(TX_LOV3N023);
else
showText(TX_LOV3N022);
@@ -240,14 +240,14 @@ void Room::love3ReachedGasTankToUnscrew() {
}
void Room::love3ScrewedOrUnscrewedGasTank() {
- if (!_vm->_awayMission.love.gasTankUnscrewed) {
+ if (!_awayMission->love.gasTankUnscrewed) {
showText(TX_LOV3N012);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_FERRIS, TX_LOV3_022);
- _vm->_awayMission.love.gasTankUnscrewed = true;
+ _awayMission->love.gasTankUnscrewed = true;
} else {
showText(TX_LOV3N015);
- _vm->_awayMission.love.gasTankUnscrewed = false;
+ _awayMission->love.gasTankUnscrewed = false;
}
}
@@ -269,7 +269,7 @@ void Room::love3ReachedGasTankToPutDown() {
void Room::love3PutN2TankBack() {
showText(TX_LOV3N013);
- _vm->_awayMission.love.tookN2TankFromServicePanel = false;
+ _awayMission->love.tookN2TankFromServicePanel = false;
loseItem(OBJECT_IN2GAS);
loadActorAnim(OBJECT_GAS_TANK, "r4n2", 0, 0, 0);
}
@@ -286,10 +286,10 @@ void Room::love3ReachedEngineeringPanel() {
}
void Room::love3OpenedEngineeringPanel() {
- if (!_vm->_awayMission.love.insulationOnGround) {
+ if (!_awayMission->love.insulationOnGround) {
playVoc("MADR4E4A");
loadActorAnim(OBJECT_INSULATION, "s3r4p1", 0, 0, 0);
- _vm->_awayMission.love.insulationOnGround = true;
+ _awayMission->love.insulationOnGround = true;
}
showText(TX_LOV3N021);
}
@@ -325,11 +325,11 @@ void Room::love3UseCrewmanOnEngineeringPanelOrGrate() {
void Room::love3UseWrenchOnGrate() {
walkCrewmanC(OBJECT_KIRK, 0xf6, 0xaa, &Room::love3ReachedGateWithWrench);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::love3ReachedGateWithWrench() {
- if (_vm->_awayMission.love.grateRemoved)
+ if (_awayMission->love.grateRemoved)
loadActorAnimC(OBJECT_KIRK, "s3r4g2a", -1, -1, &Room::love3OpenedOrClosedGrate);
else
loadActorAnimC(OBJECT_KIRK, "s3r4g2", -1, -1, &Room::love3OpenedOrClosedGrate);
@@ -338,20 +338,20 @@ void Room::love3ReachedGateWithWrench() {
}
void Room::love3OpenedOrClosedGrate() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
- if (!_vm->_awayMission.love.grateRemoved) {
- _vm->_awayMission.love.grateRemoved = true;
+ if (!_awayMission->love.grateRemoved) {
+ _awayMission->love.grateRemoved = true;
loadActorAnim(OBJECT_GRATE, "s3r4g3", 0, 0, 0);
showText(TX_LOV3N016);
- if (!_vm->_awayMission.love.gotPointsForOpeningGrate) {
- _vm->_awayMission.love.gotPointsForOpeningGrate = true;
- _vm->_awayMission.love.missionScore++;
+ if (!_awayMission->love.gotPointsForOpeningGrate) {
+ _awayMission->love.gotPointsForOpeningGrate = true;
+ _awayMission->love.missionScore++;
}
} else {
loadActorAnim(OBJECT_GRATE, "s3r4g1", 0x116, 0x8f, 0);
- _vm->_awayMission.love.grateRemoved = false;
+ _awayMission->love.grateRemoved = false;
showText(TX_LOV3N032);
}
}
@@ -367,7 +367,7 @@ void Room::love3UseWaterOnShaft() {
}
void Room::love3ReachedShaftUsingWater() {
- if (!_vm->_awayMission.love.grateRemoved)
+ if (!_awayMission->love.grateRemoved)
showText(TX_LOV3N025);
else
loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::love3PouredWaterDownShaft);
@@ -384,7 +384,7 @@ void Room::love3UseNitrousOxideOnShaft() {
}
void Room::love3ReachedShaftUsingNitrousOxide() {
- if (!_vm->_awayMission.love.grateRemoved)
+ if (!_awayMission->love.grateRemoved)
showText(TX_LOV3N025);
else
loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::love3PouredNitrousOxideDownShaft);
@@ -402,16 +402,16 @@ void Room::love3UseAmmoniaOnShaft() {
}
void Room::love3ReachedShaftUsingAmmonia() {
- if (!_vm->_awayMission.love.grateRemoved)
+ if (!_awayMission->love.grateRemoved)
showText(TX_LOV3N025);
else
loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::love3PouredAmmoniaDownShaft);
}
void Room::love3PouredAmmoniaDownShaft() {
- if (!_vm->_awayMission.love.romulansUnconsciousFromVirus) {
+ if (!_awayMission->love.romulansUnconsciousFromVirus) {
showText(TX_LOV3N001);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_FERRIS, TX_LOV3_023);
}
@@ -420,13 +420,13 @@ void Room::love3PouredAmmoniaDownShaft() {
void Room::love3UseRomulanLaughingGasOnShaft() {
- if (_vm->_awayMission.love.gotPointsForGassingRomulans) {
+ if (_awayMission->love.gotPointsForGassingRomulans) {
// BUG-ish: you could get the points for this by starting the action, then
// canceling it before Kirk reaches the shaft.
- _vm->_awayMission.love.gotPointsForGassingRomulans = true;
- _vm->_awayMission.love.missionScore += 6;
+ _awayMission->love.gotPointsForGassingRomulans = true;
+ _awayMission->love.missionScore += 6;
}
- if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
+ if (_awayMission->love.romulansUnconsciousFromLaughingGas)
showText(TX_SPEAKER_SPOCK, TX_LOV3_011);
else {
walkCrewmanC(OBJECT_KIRK, 0xf6, 0xa4, &Room::love3ReachedShaftUsingRomulanLaughingGas);
@@ -434,7 +434,7 @@ void Room::love3UseRomulanLaughingGasOnShaft() {
}
void Room::love3ReachedShaftUsingRomulanLaughingGas() {
- if (!_vm->_awayMission.love.grateRemoved)
+ if (!_awayMission->love.grateRemoved)
showText(TX_LOV3N025);
else {
loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::love3PouredRomulanLaughingGasDownShaft);
@@ -444,11 +444,11 @@ void Room::love3ReachedShaftUsingRomulanLaughingGas() {
void Room::love3PouredRomulanLaughingGasDownShaft() {
loseItem(OBJECT_IRLG);
- _vm->_awayMission.love.romulansUnconsciousFromLaughingGas = true;
+ _awayMission->love.romulansUnconsciousFromLaughingGas = true;
- if (_vm->_awayMission.love.romulansUnconsciousFromVirus) {
+ if (_awayMission->love.romulansUnconsciousFromVirus) {
showText(TX_LOV3NA08);
- _vm->_awayMission.love.romulansUnconsciousFromLaughingGas = false;
+ _awayMission->love.romulansUnconsciousFromLaughingGas = false;
} else {
showText(TX_LOV3NA09);
playVoc("ROMULANL");
@@ -469,7 +469,7 @@ void Room::love3PickedUpWrench() {
loadActorStandAnim(OBJECT_KIRK);
giveItem(OBJECT_IWRENCH);
loadActorStandAnim(OBJECT_WRENCH);
- _vm->_awayMission.love.wrenchTaken = true;
+ _awayMission->love.wrenchTaken = true;
showText(TX_LOV3N031);
}
@@ -480,7 +480,7 @@ void Room::love3GetGasTank() {
}
void Room::love3ReachedGasTankToGet() {
- if (_vm->_awayMission.love.gasTankUnscrewed)
+ if (_awayMission->love.gasTankUnscrewed)
showText(TX_LOV3N007);
else
showText(TX_LOV3N014);
@@ -493,7 +493,7 @@ void Room::love3UseAntigravOnGasTank() {
}
void Room::love3ReachedGasTankUsingAntigrav() {
- if (_vm->_awayMission.love.gasTankUnscrewed) {
+ if (_awayMission->love.gasTankUnscrewed) {
loadActorAnimC(OBJECT_KIRK, "kusehe", -1, -1, &Room::love3PickedUpGasTank);
playVoc("SE3PLBAT");
} else {
@@ -505,10 +505,10 @@ void Room::love3ReachedGasTankUsingAntigrav() {
void Room::love3PickedUpGasTank() {
giveItem(OBJECT_IN2GAS);
loadActorStandAnim(OBJECT_GAS_TANK);
- _vm->_awayMission.love.tookN2TankFromServicePanel = true;
+ _awayMission->love.tookN2TankFromServicePanel = true;
showText(TX_LOV3NJ32);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_FERRIS, TX_LOV3_025);
}
@@ -517,7 +517,7 @@ void Room::love3GetInsulation() {
}
void Room::love3ReachedInsulationToGet() {
- if (!_vm->_awayMission.love.field3c)
+ if (!_awayMission->love.field3c)
loadActorAnimC(OBJECT_KIRK, "s5r1kg", -1, -1, &Room::love3PickedUpInsulation);
}
diff --git a/engines/startrek/rooms/love4.cpp b/engines/startrek/rooms/love4.cpp
index 447f763928..6eeef1050a 100644
--- a/engines/startrek/rooms/love4.cpp
+++ b/engines/startrek/rooms/love4.cpp
@@ -36,7 +36,7 @@ namespace StarTrek {
void Room::love4Tick1() {
playVoc("LOV4LOOP");
- if (_vm->_awayMission.love.romulansCured) {
+ if (_awayMission->love.romulansCured) {
loadActorAnim2(OBJECT_ROMULAN_1, "s3r5r1b", 0x36, 0xb3, 0);
loadActorAnim2(OBJECT_ROMULAN_2, "s3r5r2b", 0xb9, 0xbb, 0);
loadActorAnim2(OBJECT_ROMULAN_3, "s3r5r3b", 0xef, 0xc4, 0);
@@ -48,11 +48,11 @@ void Room::love4Tick1() {
loadActorAnim2(OBJECT_ROMULAN_4, "s3r5r4a", 0x12a, 0xaa, 0);
}
- if (_vm->_awayMission.love.releasedHumanLaughingGas)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.releasedRomulanLaughingGas)
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
- _vm->_awayMission.timers[2] = 200;
+ if (_awayMission->love.releasedHumanLaughingGas)
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
+ if (_awayMission->love.releasedRomulanLaughingGas)
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[2] = 200;
loadActorAnim(OBJECT_DOOR, "s3r5d1a", 0x90, 0x99, 0);
@@ -61,14 +61,14 @@ void Room::love4Tick1() {
}
void Room::love4Tick10() {
- if (!_vm->_awayMission.love.visitedRoomWithRomulans) {
+ if (!_awayMission->love.visitedRoomWithRomulans) {
playMidiMusicTracks(1, -1);
- _vm->_awayMission.love.visitedRoomWithRomulans = true;
+ _awayMission->love.visitedRoomWithRomulans = true;
}
}
void Room::love4WalkToDoor() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
_roomVar.love.walkingToDoor = true;
walkCrewmanC(OBJECT_KIRK, 0x91, 0x9c, &Room::love4DoorOpenedOrReached);
}
@@ -133,7 +133,7 @@ void Room::love4LookAtRedshirt() {
}
void Room::love4LookAtRomulan() {
- if (!_vm->_awayMission.love.romulansCured)
+ if (!_awayMission->love.romulansCured)
showText(TX_LOV4N006);
else
showText(TX_LOV4N011);
@@ -146,7 +146,7 @@ void Room::love4TalkToKirk() {
}
void Room::love4TalkToMccoy() {
- if (_vm->_awayMission.love.romulansCured)
+ if (_awayMission->love.romulansCured)
showText(TX_SPEAKER_MCCOY, TX_LOV4_022);
else
showText(TX_SPEAKER_MCCOY, TX_LOV4_010);
@@ -162,21 +162,21 @@ void Room::love4TalkToSpock() {
}
void Room::love4TalkToRomulan() {
- if (_vm->_awayMission.love.romulansCured)
+ if (_awayMission->love.romulansCured)
showText(TX_LOV4N007); // BUGFIX: original didn't play audio
}
void Room::love4UseMTricorderOnRomulan() {
- if (_vm->_awayMission.love.romulansCured)
+ if (_awayMission->love.romulansCured)
mccoyScan(DIR_S, TX_LOV4_018, false);
else
mccoyScan(DIR_S, TX_LOV4_015, false);
}
void Room::love4UseMTricorderAnywhere() {
- if (_vm->_awayMission.love.romulansCured)
+ if (_awayMission->love.romulansCured)
mccoyScan(DIR_S, TX_LOV4_019, false);
- else if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
+ else if (_awayMission->love.romulansUnconsciousFromLaughingGas)
mccoyScan(DIR_S, TX_LOV4_020, false);
else
mccoyScan(DIR_S, TX_LOV4_021, false);
@@ -189,12 +189,12 @@ void Room::love4UseSTricorderAnywhere() {
// Mccoy walks around to all romulans, giving each the cure
void Room::love4UseCureOnRomulan() {
- if (_vm->_awayMission.love.romulansCured)
+ if (_awayMission->love.romulansCured)
showText(TX_SPEAKER_MCCOY, TX_LOV4_013);
else {
- _vm->_awayMission.love.missionScore += 2;
- _vm->_awayMission.love.romulansCured = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->love.missionScore += 2;
+ _awayMission->love.romulansCured = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_MCCOY, 0x10e, 0xb1, &Room::love4MccoyReachedRomulan4);
}
}
@@ -237,7 +237,7 @@ void Room::love4MccoyCuredRomulan1() {
if (!_roomVar.love.gaveWaterToRomulans)
showText(TX_SPEAKER_MCCOY, TX_LOV4_023);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
@@ -245,17 +245,17 @@ void Room::love4UseWaterOnRomulan() {
// BUGFIX: If the romulans are unconscious, you can't use water on them.
// In the original, you could use water on them, but there would be no corresponding
// narration, you'd get no points for it, and you'd lose the water anyway.
- if (!_vm->_awayMission.love.romulansCured)
+ if (!_awayMission->love.romulansCured)
showText(TX_SPEAKER_MCCOY, TX_LOV4_009);
else {
_roomVar.love.gaveWaterToRomulans = true;
- if (_vm->_awayMission.love.romulansCured) {
+ if (_awayMission->love.romulansCured) {
showText(TX_LOV4N013);
showText(TX_SPEAKER_MCCOY, TX_LOV4_026);
showText(TX_SPEAKER_KIRK, TX_LOV4_001);
- if (!_vm->_awayMission.love.gotPointsForHydratingRomulans) {
- _vm->_awayMission.love.gotPointsForHydratingRomulans = true;
- _vm->_awayMission.love.missionScore += 2;
+ if (!_awayMission->love.gotPointsForHydratingRomulans) {
+ _awayMission->love.gotPointsForHydratingRomulans = true;
+ _awayMission->love.missionScore += 2;
}
}
@@ -270,11 +270,11 @@ void Room::love4UseWaterOnRomulan() {
// These events don't make too much sense, probably cut in the original release, but
// they did get voice acted anyway.
if (false) {
- if (_vm->_awayMission.love.romulansUnconsciousFromVirus)
+ if (_awayMission->love.romulansUnconsciousFromVirus)
showText(TX_SPEAKER_MCCOY, TX_LOV4_009);
else {
showText(TX_LOV4N004);
- if (!_vm->_awayMission.redshirtDead) {
+ if (!_awayMission->redshirtDead) {
showText(TX_SPEAKER_FERRIS, TX_LOV4_029);
showText(TX_SPEAKER_KIRK, TX_LOV4_004);
}
diff --git a/engines/startrek/rooms/love5.cpp b/engines/startrek/rooms/love5.cpp
index fdad4a3a8b..370f06336a 100644
--- a/engines/startrek/rooms/love5.cpp
+++ b/engines/startrek/rooms/love5.cpp
@@ -37,7 +37,7 @@ void Room::love5Tick1() {
loadActorAnim(OBJECT_8, "s3r6c1", 0x27, 0xa9);
- if (_vm->_awayMission.love.freedMarcusAndCheever) {
+ if (_awayMission->love.freedMarcusAndCheever) {
loadActorAnim(OBJECT_MARCUS, "marcusst", 0x28, 0xa6);
loadActorAnim(OBJECT_CHEEVER, "s3gtupst", 0x49, 0xac);
} else {
@@ -45,25 +45,25 @@ void Room::love5Tick1() {
loadActorAnim(OBJECT_CHEEVER, "s3gtup2", 0x49, 0xac);
}
- if (_vm->_awayMission.love.preaxCured)
+ if (_awayMission->love.preaxCured)
loadActorAnim(OBJECT_PREAX, "s3r6r3", 0x116, 0xba);
else
loadActorAnim(OBJECT_PREAX, "s3r6r2", 0x116, 0xba);
- if (_vm->_awayMission.love.releasedHumanLaughingGas)
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
- if (_vm->_awayMission.love.releasedRomulanLaughingGas)
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
- _vm->_awayMission.timers[2] = 200;
+ if (_awayMission->love.releasedHumanLaughingGas)
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
+ if (_awayMission->love.releasedRomulanLaughingGas)
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[2] = 200;
_roomVar.love.cmnXPosToCureSpock = 0x89;
_roomVar.love.cmnXPosToCureSpock = 0xb9;
}
void Room::love5TouchedWarp1() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
playSoundEffectIndex(SND_DOOR1);
- _vm->_awayMission.timers[4] = 10;
+ _awayMission->timers[4] = 10;
}
void Room::love5Timer4Expired() {
@@ -121,7 +121,7 @@ void Room::love5LookAtConsole() {
}
void Room::love5LookAtDrMarcus() {
- if (_vm->_awayMission.love.freedMarcusAndCheever)
+ if (_awayMission->love.freedMarcusAndCheever)
showText(TX_LOV5N001);
else {
// BUGFIX: originally played audio "LOV5N001", which is only the first sentence of
@@ -133,12 +133,12 @@ void Room::love5LookAtDrMarcus() {
}
void Room::love5LookAtDrCheever() {
- if (_vm->_awayMission.love.freedMarcusAndCheever)
+ if (_awayMission->love.freedMarcusAndCheever)
showText(TX_LOV5N000);
else {
showText(TX_LOV5N014);
showText(TX_SPEAKER_CHEEVER, TX_LOV5_057);
- if (!_vm->_awayMission.redshirtDead) {
+ if (!_awayMission->redshirtDead) {
showText(TX_SPEAKER_FERRIS, TX_LOV5_054);
showText(TX_SPEAKER_CHEEVER, TX_LOV5_058);
}
@@ -146,15 +146,15 @@ void Room::love5LookAtDrCheever() {
}
void Room::love5LookAtPreax() {
- if (_vm->_awayMission.love.preaxCured)
+ if (_awayMission->love.preaxCured)
showText(TX_LOV5N011);
else
showText(TX_LOV5N012);
}
void Room::love5TalkToPreax() {
- if (_vm->_awayMission.love.preaxCured) {
- if (!_vm->_awayMission.love.freedMarcusAndCheever)
+ if (_awayMission->love.preaxCured) {
+ if (!_awayMission->love.freedMarcusAndCheever)
showText(TX_LOV5N006);
else {
const int choices[] = {
@@ -193,9 +193,9 @@ void Room::love5TalkToPreax() {
showText(TX_SPEAKER_KIRK, TX_LOV5_002);
showText(TX_SPEAKER_MARCUS, TX_LOV5_045);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
- if (!_vm->_awayMission.love.spockCured) {
+ if (!_awayMission->love.spockCured) {
showText(TX_SPEAKER_MCCOY, TX_LOV5_021);
walkCrewmanC(OBJECT_MCCOY, 0x87, 0xc3, &Room::love5MccoyReachedSpockToCure);
} else
@@ -221,17 +221,17 @@ void Room::love5MccoyCuredSpock() {
void Room::love5EndMission() {
showText(TX_SPEAKER_KIRK, TX_LOV5_001);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
walkCrewmanC(OBJECT_KIRK, 0x64, 0xc2, &Room::love5CrewmanReachedBeamoutPosition);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
walkCrewmanC(OBJECT_SPOCK, 0x5a, 0xb8, &Room::love5CrewmanReachedBeamoutPosition);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
walkCrewmanC(OBJECT_MCCOY, 0x6e, 0xb8, &Room::love5CrewmanReachedBeamoutPosition);
- if (!_vm->_awayMission.redshirtDead) {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+ if (!_awayMission->redshirtDead) {
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
walkCrewmanC(OBJECT_REDSHIRT, 0x69, 0xae, &Room::love5CrewmanReachedBeamoutPosition);
_roomVar.love.numCrewmenReadyToBeamOut--;
}
@@ -240,13 +240,13 @@ void Room::love5EndMission() {
void Room::love5CrewmanReachedBeamoutPosition() {
_roomVar.love.numCrewmenReadyToBeamOut++;
if (_roomVar.love.numCrewmenReadyToBeamOut == 3) {
- _vm->_awayMission.love.missionScore += 17;
- endMission(_vm->_awayMission.love.missionScore, 0x2c, 0);
+ _awayMission->love.missionScore += 17;
+ endMission(_awayMission->love.missionScore, 0x2c, 0);
}
}
void Room::love5TalkToDrMarcus() {
- if (!_vm->_awayMission.love.freedMarcusAndCheever)
+ if (!_awayMission->love.freedMarcusAndCheever)
showText(TX_SPEAKER_MARCUS, TX_LOV5_040);
else {
if (!haveItem(OBJECT_ICURE))
@@ -257,7 +257,7 @@ void Room::love5TalkToDrMarcus() {
}
void Room::love5TalkToDrCheever() {
- if (!_vm->_awayMission.love.freedMarcusAndCheever)
+ if (!_awayMission->love.freedMarcusAndCheever)
showText(TX_SPEAKER_CHEEVER, TX_LOV5_055);
else
showText(TX_SPEAKER_CHEEVER, TX_LOV5_056);
@@ -277,7 +277,7 @@ void Room::love5TalkToSpock() {
}
void Room::love5TalkToMccoy() {
- if (!_vm->_awayMission.love.preaxCured)
+ if (!_awayMission->love.preaxCured)
showText(TX_SPEAKER_MCCOY, TX_LOV5_014);
}
@@ -299,8 +299,8 @@ void Room::love5UseMTricorderOnMarcusOrCheever() {
}
void Room::love5UseMTricorderOnPreax() {
- if (!_vm->_awayMission.love.preaxCured) {
- if (_vm->_awayMission.love.romulansUnconsciousFromLaughingGas)
+ if (!_awayMission->love.preaxCured) {
+ if (_awayMission->love.romulansUnconsciousFromLaughingGas)
mccoyScan(DIR_E, TX_LOV5_024, false);
else
mccoyScan(DIR_E, TX_LOV5_016, false);
@@ -308,30 +308,30 @@ void Room::love5UseMTricorderOnPreax() {
}
void Room::love5UseMedkitOnPreax() {
- if (_vm->_awayMission.love.preaxCured)
+ if (_awayMission->love.preaxCured)
showText(TX_SPEAKER_MCCOY, TX_LOV5_015);
else
showText(TX_SPEAKER_MCCOY, TX_LOV5_019);
}
void Room::love5UseWaterOnPreax() {
- if (_vm->_awayMission.love.preaxCured) {
+ if (_awayMission->love.preaxCured) {
showText(TX_LOV5N018);
showText(TX_SPEAKER_MCCOY, TX_LOV5_029);
showText(TX_SPEAKER_KIRK, TX_LOV5_007);
- if (!_vm->_awayMission.love.gotPointsForHydratingPreax) {
- _vm->_awayMission.love.gotPointsForHydratingPreax = true;
- _vm->_awayMission.love.missionScore++;
+ if (!_awayMission->love.gotPointsForHydratingPreax) {
+ _awayMission->love.gotPointsForHydratingPreax = true;
+ _awayMission->love.missionScore++;
}
loseItem(OBJECT_IH2O);
} else {
- if (_vm->_awayMission.love.romulansUnconsciousFromVirus) {
+ if (_awayMission->love.romulansUnconsciousFromVirus) {
showText(TX_SPEAKER_MCCOY, TX_LOV5_013);
// BUGFIX: original didn't have correct speaker. Also, you shouldn't lose your
// water since it's not actually used here, so a "loseItem" line was removed.
} else {
showText(TX_LOV5N017);
- if (!_vm->_awayMission.redshirtDead) {
+ if (!_awayMission->redshirtDead) {
showText(TX_SPEAKER_FERRIS, TX_LOV5_053);
showText(TX_SPEAKER_KIRK, TX_LOV5_005);
}
@@ -340,9 +340,9 @@ void Room::love5UseWaterOnPreax() {
// BUGFIX: give a point for hydrating the Preax. It's inconsistent to only
// give points if he's already cured.
- if (!_vm->_awayMission.love.gotPointsForHydratingPreax) {
- _vm->_awayMission.love.gotPointsForHydratingPreax = true;
- _vm->_awayMission.love.missionScore++;
+ if (!_awayMission->love.gotPointsForHydratingPreax) {
+ _awayMission->love.gotPointsForHydratingPreax = true;
+ _awayMission->love.missionScore++;
}
}
}
@@ -354,7 +354,7 @@ void Room::love5UseCureSampleOnPreax() {
void Room::love5UseCureOnPreax() {
- if (!_vm->_awayMission.love.preaxCured)
+ if (!_awayMission->love.preaxCured)
walkCrewmanC(OBJECT_MCCOY, 0x116, 0xbf, &Room::love5ReachedPreaxUsingCure);
}
@@ -364,7 +364,7 @@ void Room::love5ReachedPreaxUsingCure() {
void Room::love5CuredPreax() {
walkCrewman(OBJECT_MCCOY, 0xdc, 0xc3);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
showText(TX_LOV5N007);
@@ -375,7 +375,7 @@ void Room::love5CuredPreax() {
showText(TX_SPEAKER_MCCOY, TX_LOV5_017);
loadActorAnim2(OBJECT_PREAX, "s3r6r1", 0x116, 0xba);
- _vm->_awayMission.love.preaxCured = true;
+ _awayMission->love.preaxCured = true;
}
@@ -386,10 +386,10 @@ void Room::love5UseAnythingOnPreax() {
// Kirk walks to Cheever, unties him, then walks to Marcus, unties her.
void Room::love5UseKirkOnMarcusOrCheever() {
- if (!_vm->_awayMission.love.freedMarcusAndCheever) {
- _vm->_awayMission.disableInput = true;
+ if (!_awayMission->love.freedMarcusAndCheever) {
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0x49, 0xb1, &Room::love5KirkReachedCheever);
- _vm->_awayMission.love.freedMarcusAndCheever = true;
+ _awayMission->love.freedMarcusAndCheever = true;
}
}
@@ -410,11 +410,11 @@ void Room::love5KirkUntiedMarcus() {
loadActorStandAnim(OBJECT_KIRK);
loadActorAnimC(OBJECT_MARCUS, "marcus", 0x28, 0xa6, &Room::love5MarcusStoodUp);
walkCrewman(OBJECT_KIRK, 0x35, 0xb9);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
}
void Room::love5MarcusStoodUp() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_MARCUS, TX_LOV5_041);
}
diff --git a/engines/startrek/rooms/lovea.cpp b/engines/startrek/rooms/lovea.cpp
index e4e9f1c158..2f0bf77732 100644
--- a/engines/startrek/rooms/lovea.cpp
+++ b/engines/startrek/rooms/lovea.cpp
@@ -64,7 +64,7 @@ void Room::loveaTimer0Expired() {
const TextRef *textTable;
- if (randomVal == 0 || _vm->_awayMission.redshirtDead) {
+ if (randomVal == 0 || _awayMission->redshirtDead) {
speaker = TX_SPEAKER_MCCOY;
textTable = mccoyText;
} else {
@@ -76,7 +76,7 @@ void Room::loveaTimer0Expired() {
showText(speaker, textTable[randomVal]);
- if (!_vm->_awayMission.love.releasedRomulanLaughingGas) {
+ if (!_awayMission->love.releasedRomulanLaughingGas) {
const int spockText[] = {
TX_LOV0_029,
TX_LOV0_033,
@@ -88,7 +88,7 @@ void Room::loveaTimer0Expired() {
// BUG(?): This is in an if statement, meaning the human crewmen stop talking from
// laughing gas if Spock is under laughing gas effects. Might be intentional, to
// reduce "spamming" of text?
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
}
}
@@ -107,18 +107,18 @@ void Room::loveaTimer1Expired() {
showText(TX_SPEAKER_SPOCK, spockText[getRandomWordInRange(0, 7)]);
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
}
void Room::loveaUseMedkitOnSpock() {
- if (_vm->_awayMission.love.spockCured)
+ if (_awayMission->love.spockCured)
showText(TX_SPEAKER_MCCOY, TX_LOV5_015);
else
showText(TX_SPEAKER_MCCOY, TX_LOV5_019);
}
void Room::loveaUseCureSampleOnSpock() {
- if (_vm->_awayMission.love.spockCured) {
+ if (_awayMission->love.spockCured) {
walkCrewman(OBJECT_SPOCK, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock, 99);
walkCrewman(OBJECT_MCCOY, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock + 10, 99);
} else
@@ -127,7 +127,7 @@ void Room::loveaUseCureSampleOnSpock() {
void Room::loveaUseCureOnSpock() {
- if (_vm->_awayMission.love.spockCured)
+ if (_awayMission->love.spockCured)
showText(TX_SPEAKER_MCCOY, TX_LOV5_015);
else {
walkCrewman(OBJECT_SPOCK, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock, 99);
@@ -146,37 +146,37 @@ void Room::loveaFinishedCuringSpock() {
showText(TX_SPEAKER_SPOCK, TX_LOV5_038);
showText(TX_SPEAKER_MCCOY, TX_LOV5_027);
showText(TX_SPEAKER_SPOCK, TX_LOV5C001);
- _vm->_awayMission.love.spockCured = true;
+ _awayMission->love.spockCured = true;
}
// Timer 2 counts down the time until Spock and the Romulans succumb to the virus.
// BUG(-ish): once Spock is cured, the romulans will never succumb to the virus.
void Room::loveaTimer2Expired() {
- if (!_vm->_awayMission.love.spockCured) {
- _vm->_awayMission.love.spockInfectionCounter++;
- if (_vm->_awayMission.love.spockInfectionCounter >= 100) { // Spock succumbs, game over
+ if (!_awayMission->love.spockCured) {
+ _awayMission->love.spockInfectionCounter++;
+ if (_awayMission->love.spockInfectionCounter >= 100) { // Spock succumbs, game over
loadActorAnim(OBJECT_SPOCK, "sgetdn", -1, -1, 0);
playMidiMusicTracks(2, -1); // FIXME: assembly had no second parameter...?
showText(TX_GENER004);
showGameOverMenu();
- } else if (_vm->_awayMission.love.spockInfectionCounter == 15) {
+ } else if (_awayMission->love.spockInfectionCounter == 15) {
showText(TX_SPEAKER_SPOCK, TX_SPOKCOFF);
- _vm->_awayMission.love.spockInfectionCounter++;
- } else if (_vm->_awayMission.love.spockInfectionCounter == 30) {
+ _awayMission->love.spockInfectionCounter++;
+ } else if (_awayMission->love.spockInfectionCounter == 30) {
showText(TX_SPEAKER_MCCOY, TX_LOVA_F08);
- _vm->_awayMission.love.spockInfectionCounter++;
- } else if (_vm->_awayMission.love.spockInfectionCounter == 45) {
+ _awayMission->love.spockInfectionCounter++;
+ } else if (_awayMission->love.spockInfectionCounter == 45) {
showText(TX_SPEAKER_SPOCK, TX_SPOKCOFF);
- _vm->_awayMission.love.spockInfectionCounter++;
- } else if (_vm->_awayMission.love.spockInfectionCounter == 60) {
+ _awayMission->love.spockInfectionCounter++;
+ } else if (_awayMission->love.spockInfectionCounter == 60) {
showText(TX_SPEAKER_SPOCK, TX_LOVA_F54);
- _vm->_awayMission.love.romulansUnconsciousFromVirus = true;
- _vm->_awayMission.love.spockInfectionCounter++;
+ _awayMission->love.romulansUnconsciousFromVirus = true;
+ _awayMission->love.spockInfectionCounter++;
}
}
- _vm->_awayMission.timers[2] = 200;
+ _awayMission->timers[2] = 200;
}
void Room::loveaUseMTricorderOnSpock() {
@@ -184,19 +184,19 @@ void Room::loveaUseMTricorderOnSpock() {
// (possible future enhancement?)
playSoundEffectIndex(SND_TRICORDER);
- if (_vm->_awayMission.love.spockCured)
+ if (_awayMission->love.spockCured)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F01);
- else if (!_vm->_awayMission.love.knowAboutVirus)
+ else if (!_awayMission->love.knowAboutVirus)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F02);
- else if (_vm->_awayMission.love.spockInfectionCounter < 10)
+ else if (_awayMission->love.spockInfectionCounter < 10)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F04);
- else if (_vm->_awayMission.love.spockInfectionCounter < 30)
+ else if (_awayMission->love.spockInfectionCounter < 30)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F03);
- else if (_vm->_awayMission.love.spockInfectionCounter < 50)
+ else if (_awayMission->love.spockInfectionCounter < 50)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F08);
- else if (_vm->_awayMission.love.spockInfectionCounter < 70) // BUGFIX: < 70 instead of == 70
+ else if (_awayMission->love.spockInfectionCounter < 70) // BUGFIX: < 70 instead of == 70
showText(TX_SPEAKER_MCCOY, TX_TUG2_010);
- else if (_vm->_awayMission.love.spockInfectionCounter < 100)
+ else if (_awayMission->love.spockInfectionCounter < 100)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F10);
else
showText(TX_SPEAKER_MCCOY, TX_LOVA_100);
@@ -209,22 +209,22 @@ void Room::loveaUseMTricorderOnHuman() {
void Room::loveaUseRomulanLaughingGas() {
showText(TX_LOV2N005);
- _vm->_awayMission.love.releasedRomulanLaughingGas = true;
+ _awayMission->love.releasedRomulanLaughingGas = true;
loseItem(OBJECT_IRLG);
// BUGFIX: start the effects immediately
- _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+ _awayMission->timers[1] = getRandomWordInRange(200, 400);
}
void Room::loveaUseHumanLaughingGas() {
showText(TX_LOV2N005);
showText(TX_SPEAKER_SPOCK, TX_MUD2_040);
- _vm->_awayMission.love.releasedHumanLaughingGas = true;
+ _awayMission->love.releasedHumanLaughingGas = true;
loseItem(OBJECT_IN2O);
playMidiMusicTracks(3, -1); // FIXME: assembly had no second parameter...?
// BUGFIX: start the effects immediately
- _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ _awayMission->timers[0] = getRandomWordInRange(200, 400);
}
void Room::loveaUseAmmonia() {
@@ -242,7 +242,7 @@ void Room::loveaUseCommunicator() {
showText(TX_SPEAKER_KIRK, TX_MUD4_018);
showText(TX_SPEAKER_UHURA, TX_BRIDU146);
showText(TX_SPEAKER_KIRK, TX_VENA_F41);
- _vm->_awayMission.love.contactedEnterpriseBeforeCure = true;
+ _awayMission->love.contactedEnterpriseBeforeCure = true;
}
}
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
index 0b450e08fb..ae9d682164 100644
--- a/engines/startrek/rooms/mudd0.cpp
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -46,27 +46,27 @@ void Room::mudd0Tick1() {
// the first meeting. Fixes an issue where Mudd appears in the first room when he's
// supposed to be in the medbay.
// TODO: verify this matches with floppy version's code
- if (_vm->_awayMission.mudd.muddFirstRoomState != 0)
- _vm->_awayMission.mudd.muddFirstRoomState = 2;
+ if (_awayMission->mudd.muddFirstRoomState != 0)
+ _awayMission->mudd.muddFirstRoomState = 2;
else {
- _vm->_awayMission.disableInput = 2;
+ _awayMission->disableInput = 2;
loadActorAnim(OBJECT_MUDD, "s4cbhr", 0xa2, 0xa9, 0);
}
}
void Room::mudd0Tick50() {
- if (!_vm->_awayMission.mudd.enteredRoom0ForFirstTime) {
+ if (!_awayMission->mudd.enteredRoom0ForFirstTime) {
playMidiMusicTracks(3);
- _vm->_awayMission.mudd.enteredRoom0ForFirstTime = true;
+ _awayMission->mudd.enteredRoom0ForFirstTime = true;
}
}
void Room::mudd0Tick60() {
- if (_vm->_awayMission.mudd.muddFirstRoomState == 0) {
+ if (_awayMission->mudd.muddFirstRoomState == 0) {
// ENHANCEMENT: Move this into if statement (related to above enhancement)
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
- _vm->_awayMission.mudd.muddFirstRoomState++;
+ _awayMission->mudd.muddFirstRoomState++;
showText(TX_SPEAKER_MUDD, TX_MUD0_037);
showText(TX_SPEAKER_KIRK, TX_MUD0_009);
@@ -90,13 +90,13 @@ void Room::mudd0UseCommunicator() {
}
void Room::mudd0LookAtFoodBox() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_MUD0N012);
}
void Room::mudd0LookAtComponentBox() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_MUD0N013);
}
@@ -106,19 +106,19 @@ void Room::mudd0LookAnywhere() {
}
void Room::mudd0LookAtMemoryDiskBox() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_MUD0N010);
}
void Room::mudd0LookAtDegrimerBox() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_MUD0N008);
}
void Room::mudd0LookAtLense() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_MUD0N014);
}
@@ -145,52 +145,52 @@ void Room::mudd0UseSTricorderOnMemoryDiskBox() {
void Room::mudd0UseSTricorderOnDegrimerBox() {
// Narrator says something, not Spock (so we don't use "spockScan" function)
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
loadActorAnim2(OBJECT_SPOCK, "sscanw", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_MUD0N000);
}
void Room::mudd0UseMTricorderOnLense() {
- if (_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction)
+ if (_awayMission->mudd.discoveredLenseAndDegrimerFunction)
mccoyScan(DIR_E, TX_MUD0_012, true);
else
mccoyScan(DIR_E, TX_MUD0_013, true);
}
void Room::mudd0GetLense() {
- if (_vm->_awayMission.mudd.gotLense)
+ if (_awayMission->mudd.gotLense)
showText(TX_MUD0N016);
else {
- _vm->_awayMission.mudd.gotLense = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.gotLense = true;
+ _awayMission->mudd.missionScore++;
giveItem(OBJECT_ILENSES);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
loadActorAnim2(OBJECT_KIRK, "s5r1kg", -1, -1);
- _vm->_awayMission.timers[1] = 27;
+ _awayMission->timers[1] = 27;
}
}
void Room::mudd0GetMemoryDisk() {
- if (_vm->_awayMission.mudd.gotMemoryDisk)
+ if (_awayMission->mudd.gotMemoryDisk)
showText(TX_MUD0N016);
else {
- _vm->_awayMission.mudd.gotMemoryDisk = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.gotMemoryDisk = true;
+ _awayMission->mudd.missionScore++;
giveItem(OBJECT_IDISKS);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::mudd0PickedUpItem);
}
}
void Room::mudd0GetDegrimer() {
- if (_vm->_awayMission.mudd.gotDegrimer)
+ if (_awayMission->mudd.gotDegrimer)
showText(TX_MUD0N016);
else {
- _vm->_awayMission.mudd.gotDegrimer = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.gotDegrimer = true;
+ _awayMission->mudd.missionScore++;
giveItem(OBJECT_IDEGRIME);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorAnimC(OBJECT_KIRK, "kusemw", -1, -1, &Room::mudd0PickedUpItem);
}
}
@@ -202,14 +202,14 @@ void Room::mudd0PickedUpLense() {
}
void Room::mudd0PickedUpItem() {
- _vm->_awayMission.disableInput = false; // NOTE: this was never set to true
+ _awayMission->disableInput = false; // NOTE: this was never set to true
showText(TX_LOV1N007);
}
void Room::mudd0WalkToSouthDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x5a, 0xc7);
}
@@ -220,7 +220,7 @@ void Room::mudd0TouchedHotspot1() { // Trigger bottom door opening
void Room::mudd0WalkToNorthDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xa0, 0x68);
}
@@ -256,7 +256,7 @@ void Room::mudd0LookAtMudd() {
}
void Room::mudd0TalkToKirk() {
- if (_vm->_awayMission.mudd.muddFirstRoomState == 2)
+ if (_awayMission->mudd.muddFirstRoomState == 2)
showText(TX_SPEAKER_KIRK, TX_MUD0_010);
else {
showText(TX_SPEAKER_KIRK, TX_MUD0_010);
@@ -266,7 +266,7 @@ void Room::mudd0TalkToKirk() {
}
void Room::mudd0TalkToSpock() {
- if (_vm->_awayMission.mudd.muddFirstRoomState == 2)
+ if (_awayMission->mudd.muddFirstRoomState == 2)
showText(TX_SPEAKER_SPOCK, TX_MUD0_022);
else {
showText(TX_SPEAKER_SPOCK, TX_MUD0_022);
@@ -278,7 +278,7 @@ void Room::mudd0TalkToSpock() {
}
void Room::mudd0TalkToMccoy() {
- if (_vm->_awayMission.mudd.muddFirstRoomState == 2)
+ if (_awayMission->mudd.muddFirstRoomState == 2)
showText(TX_SPEAKER_MCCOY, TX_MUD0_016);
else {
showText(TX_SPEAKER_MCCOY, TX_MUD0_016);
@@ -289,7 +289,7 @@ void Room::mudd0TalkToMccoy() {
}
void Room::mudd0TalkToRedshirt() {
- if (_vm->_awayMission.mudd.muddFirstRoomState == 2) {
+ if (_awayMission->mudd.muddFirstRoomState == 2) {
showText(TX_SPEAKER_BUCHERT, TX_MUD0_039);
showText(TX_SPEAKER_KIRK, TX_MUD0_008);
} else {
diff --git a/engines/startrek/rooms/mudd1.cpp b/engines/startrek/rooms/mudd1.cpp
index d741478f6d..f3da75350b 100644
--- a/engines/startrek/rooms/mudd1.cpp
+++ b/engines/startrek/rooms/mudd1.cpp
@@ -48,14 +48,14 @@ namespace StarTrek {
void Room::mudd1Tick1() {
playVoc("MUD1LOOP"); // BUGFIX: moved this out of below if statement
- if (!_vm->_awayMission.mudd.enteredRoom1ForFirstTime) {
+ if (!_awayMission->mudd.enteredRoom1ForFirstTime) {
playMidiMusicTracks(0);
- _vm->_awayMission.mudd.enteredRoom1ForFirstTime = true;
+ _awayMission->mudd.enteredRoom1ForFirstTime = true;
}
loadActorAnim2(OBJECT_CRANE, "s4wbhs", 0x9b, 0x31);
- if (!_vm->_awayMission.mudd.torpedoLoaded)
+ if (!_awayMission->mudd.torpedoLoaded)
loadActorAnim(OBJECT_TORPEDO, "s4wbcs", 0x32, 0x65);
}
@@ -70,20 +70,20 @@ void Room::mudd1UseCommunicator() {
void Room::mudd1UseSpockOnBlueButton() { // Loads up the torpedo
- if (!_vm->_awayMission.mudd.torpedoLoaded) {
+ if (!_awayMission->mudd.torpedoLoaded) {
walkCrewmanC(OBJECT_SPOCK, 0x2f, 0x9f, &Room::mudd1SpockReachedBlueButton);
- _vm->_awayMission.disableInput = true;
- if (!_vm->_awayMission.mudd.gotPointsForLoadingTorpedo) {
- _vm->_awayMission.mudd.gotPointsForLoadingTorpedo = true;
- _vm->_awayMission.mudd.missionScore += 2;
+ _awayMission->disableInput = true;
+ if (!_awayMission->mudd.gotPointsForLoadingTorpedo) {
+ _awayMission->mudd.gotPointsForLoadingTorpedo = true;
+ _awayMission->mudd.missionScore += 2;
}
}
}
void Room::mudd1SpockReachedBlueButton() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::mudd1SpockPressedBlueButton);
- _vm->_awayMission.timers[1] = 5;
+ _awayMission->timers[1] = 5;
}
void Room::mudd1SpockPressedBlueButton() {
@@ -91,14 +91,14 @@ void Room::mudd1SpockPressedBlueButton() {
loadActorAnim(OBJECT_CRANE, "s4wbcr");
loadActorAnim(OBJECT_TORPEDO, "s4wbcn");
loadActorAnimC(OBJECT_CRANE_ANIMATION, "s4wbsl", 0x77, 0x83, &Room::mudd1CraneFinishedMoving);
- _vm->_awayMission.mudd.torpedoLoaded = true;
+ _awayMission->mudd.torpedoLoaded = true;
}
void Room::mudd1CraneFinishedMoving() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
walkCrewman(OBJECT_SPOCK, 0x43, 0x9f);
- if (_vm->_awayMission.mudd.torpedoLoaded)
+ if (_awayMission->mudd.torpedoLoaded)
showText(TX_SPEAKER_SPOCK, TX_MUD1_017);
else
showText(TX_SPEAKER_SPOCK, TX_MUD1_016);
@@ -106,16 +106,16 @@ void Room::mudd1CraneFinishedMoving() {
void Room::mudd1UseSpockOnYellowButton() { // Unloads the torpedo
- if (_vm->_awayMission.mudd.torpedoLoaded) {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ if (_awayMission->mudd.torpedoLoaded) {
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewmanC(OBJECT_SPOCK, 0x2f, 0x9f, &Room::mudd1SpockReachedYellowButton);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
}
void Room::mudd1SpockReachedYellowButton() {
loadActorAnim2(OBJECT_SPOCK, "susemn", -1, -1, 3);
- _vm->_awayMission.timers[1] = 5;
+ _awayMission->timers[1] = 5;
}
void Room::mudd1SpockPressedYellowButton() {
@@ -123,24 +123,24 @@ void Room::mudd1SpockPressedYellowButton() {
loadActorAnim2(OBJECT_CRANE, "s4wbhb");
loadActorAnim2(OBJECT_TORPEDO, "s4wbcb", 0x32, 0x65, 0);
loadActorAnimC(OBJECT_CRANE_ANIMATION, "s4wbsb", -1, -1, &Room::mudd1CraneFinishedMoving);
- _vm->_awayMission.mudd.torpedoLoaded = false;
+ _awayMission->mudd.torpedoLoaded = false;
}
void Room::mudd1UseSpockOnRedButton() {
- if (_vm->_awayMission.mudd.torpedoLoaded) {
+ if (_awayMission->mudd.torpedoLoaded) {
walkCrewmanC(OBJECT_SPOCK, 0x2f, 0x9f, &Room::mudd1SpockReachedRedButton);
- _vm->_awayMission.disableInput = true;
- if (!_vm->_awayMission.mudd.gotPointsForPressingRedButton) {
- _vm->_awayMission.mudd.gotPointsForPressingRedButton = true;
- _vm->_awayMission.mudd.missionScore += 3;
+ _awayMission->disableInput = true;
+ if (!_awayMission->mudd.gotPointsForPressingRedButton) {
+ _awayMission->mudd.gotPointsForPressingRedButton = true;
+ _awayMission->mudd.missionScore += 3;
}
}
}
void Room::mudd1SpockReachedRedButton() {
loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::mudd1SpockPressedRedButton);
- _vm->_awayMission.timers[1] = 5;
+ _awayMission->timers[1] = 5;
}
void Room::mudd1SpockPressedRedButton() {
@@ -150,8 +150,8 @@ void Room::mudd1SpockPressedRedButton() {
showText(TX_SPEAKER_SPOCK, TX_MUD1_021);
showText(TX_SPEAKER_SPOCK, TX_MUD1_023);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.mudd.knowAboutTorpedo = true;
+ _awayMission->disableInput = false;
+ _awayMission->mudd.knowAboutTorpedo = true;
const int choices[] = {
TX_SPEAKER_KIRK,
@@ -165,7 +165,7 @@ void Room::mudd1SpockPressedRedButton() {
switch (choice) {
case 0:
- _vm->_awayMission.mudd.torpedoStatus = 0;
+ _awayMission->mudd.torpedoStatus = 0;
// ENHANCEMENT: Original text was just "(Spock raises eyebrow)" without any audio.
// This changes it to a narration to make it flow better.
@@ -177,7 +177,7 @@ void Room::mudd1SpockPressedRedButton() {
// fall through
case 2:
- _vm->_awayMission.mudd.torpedoStatus = 1;
+ _awayMission->mudd.torpedoStatus = 1;
showText(TX_SPEAKER_UHURA, TX_STATICU1);
break;
}
@@ -284,7 +284,7 @@ void Room::mudd1TalkToRedshirt() {
void Room::mudd1WalkToSouthDoor() {
_roomVar.mudd.walkingToDoor = 1;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xa0, 0xc7);
}
@@ -296,7 +296,7 @@ void Room::mudd1TouchedHotspot2() { // Trigger door at bottom of room
void Room::mudd1WalkToNorthDoor() {
_roomVar.mudd.walkingToDoor = 1;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xab, 0x71);
}
@@ -309,7 +309,7 @@ void Room::mudd1TouchedHotspot1() { // Trigger door at top of room
void Room::mudd1WalkToWestDoor() {
_roomVar.mudd.walkingToDoor = 2;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x35, 0x71);
}
diff --git a/engines/startrek/rooms/mudd2.cpp b/engines/startrek/rooms/mudd2.cpp
index ef1ec6afb5..43c381a161 100644
--- a/engines/startrek/rooms/mudd2.cpp
+++ b/engines/startrek/rooms/mudd2.cpp
@@ -38,7 +38,7 @@ namespace StarTrek {
void Room::mudd2WalkToNorthDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xbc, 0x6a);
}
@@ -51,7 +51,7 @@ void Room::mudd2TouchedHotspot0() { // Trigger north door
void Room::mudd2WalkToSouthDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x46, 0x6f);
}
@@ -63,33 +63,33 @@ void Room::mudd2TouchedHotspot1() {
void Room::mudd2Tick1() {
playVoc("MUD2LOOP");
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
- _vm->_awayMission.mudd.muddCurrentlyInsane = false;
-
- if (_vm->_awayMission.mudd.muddInsanityState == 0) { // First time entering room
- _vm->_awayMission.mudd.muddInsanityState = 1;
- } else if (_vm->_awayMission.mudd.muddInsanityState == 2) { // Currently insane
- _vm->_awayMission.mudd.muddCurrentlyInsane = true;
- if (!_vm->_awayMission.mudd.muddUnconscious) {
- _vm->_awayMission.mudd.muddUnconscious = false;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->mudd.muddCurrentlyInsane = false;
+
+ if (_awayMission->mudd.muddInsanityState == 0) { // First time entering room
+ _awayMission->mudd.muddInsanityState = 1;
+ } else if (_awayMission->mudd.muddInsanityState == 2) { // Currently insane
+ _awayMission->mudd.muddCurrentlyInsane = true;
+ if (!_awayMission->mudd.muddUnconscious) {
+ _awayMission->mudd.muddUnconscious = false;
loadActorAnim2(OBJECT_MUDD, "s4sbhn", 0x9f, 0xbf);
loadActorAnim2(OBJECT_CAPSULE, "s4sbvp", 0x93, 0xc3);
} else {
loadActorAnim2(OBJECT_MUDD, "s4sbob", 0x9f, 0xba);
}
- } else if (_vm->_awayMission.mudd.muddUnavailable) {
- _vm->_awayMission.mudd.muddInsanityState = 1;
- } else if (_vm->_awayMission.mudd.muddInsanityState == 1) { // Second time entering room, start cutscene
+ } else if (_awayMission->mudd.muddUnavailable) {
+ _awayMission->mudd.muddInsanityState = 1;
+ } else if (_awayMission->mudd.muddInsanityState == 1) { // Second time entering room, start cutscene
playMidiMusicTracks(3);
loadActorAnim2(OBJECT_MUDD, "s4sbhw", 0x99, 0xbf);
- _vm->_awayMission.disableInput = 2;
- _vm->_awayMission.mudd.muddInhaledGas = true;
- _vm->_awayMission.timers[1] = 70;
- _vm->_awayMission.mudd.muddInsanityState = 2;
- _vm->_awayMission.mudd.muddUnavailable = true;
+ _awayMission->disableInput = 2;
+ _awayMission->mudd.muddInhaledGas = true;
+ _awayMission->timers[1] = 70;
+ _awayMission->mudd.muddInsanityState = 2;
+ _awayMission->mudd.muddUnavailable = true;
}
}
@@ -106,8 +106,8 @@ void Room::mudd2UseSpockOnCapsules() {
}
void Room::mudd2GetCapsules() {
- if (!_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
- if (!_vm->_awayMission.mudd.translatedAlienLanguage)
+ if (!_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious) {
+ if (!_awayMission->mudd.translatedAlienLanguage)
showText(TX_SPEAKER_MCCOY, TX_MUD2_024);
else
walkCrewmanC(OBJECT_MCCOY, 0x9f, 0xbf, &Room::mudd2MccoyReachedCapsules);
@@ -122,7 +122,7 @@ void Room::mudd2MccoyReachedCapsules() {
}
void Room::mudd2MccoyPickedUpCapsules() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_MCCOY, 0xfe, 0xb2);
}
@@ -142,39 +142,39 @@ void Room::mudd2UseMTricorderOnCapsules() {
}
void Room::mudd2UseCapsuleOnControlPanel() {
- if (!_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious)
+ if (!_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious)
walkCrewmanC(OBJECT_MCCOY, 0x9f, 0xbf, &Room::mudd2MccoyReachedControlPanel);
else
showText(TX_SPEAKER_MCCOY, TX_MUD2_023);
}
void Room::mudd2MccoyReachedControlPanel() {
- if (_vm->_awayMission.mudd.translatedAlienLanguage)
+ if (_awayMission->mudd.translatedAlienLanguage)
loadActorAnimC(OBJECT_MCCOY, "musehn", -1, -1, &Room::mudd2MccoyPutCapsuleInControlPanel);
else // NOTE: Unused, since you can't get capsules without translating the language first
showText(TX_SPEAKER_MCCOY, TX_MUD2_014);
}
void Room::mudd2MccoyPutCapsuleInControlPanel() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
loadActorStandAnim(OBJECT_MCCOY);
showText(TX_SPEAKER_MCCOY, TX_MUD2_020);
showText(TX_SPEAKER_MCCOY, TX_MUD2_029);
showText(TX_SPEAKER_SPOCK, TX_MUD2_039);
- if (_vm->_awayMission.mudd.muddUnconscious)
+ if (_awayMission->mudd.muddUnconscious)
showText(TX_SPEAKER_MCCOY, TX_MUD2_034);
- _vm->_awayMission.mudd.putCapsuleInMedicalMachine = true;
+ _awayMission->mudd.putCapsuleInMedicalMachine = true;
loseItem(OBJECT_ICAPSULE);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_MCCOY, 0xfe, 0xb2);
}
void Room::mudd2UseKirkOnBed() {
- if (!_vm->_awayMission.mudd.putCapsuleInMedicalMachine && !_vm->_awayMission.mudd.translatedAlienLanguage) {
+ if (!_awayMission->mudd.putCapsuleInMedicalMachine && !_awayMission->mudd.translatedAlienLanguage) {
walkCrewmanC(OBJECT_KIRK, 0xd7, 0xbd, &Room::mudd2KirkReachedBed);
- } else if (_vm->_awayMission.mudd.translatedAlienLanguage) {
+ } else if (_awayMission->mudd.translatedAlienLanguage) {
walkCrewman(OBJECT_KIRK, 0xd7, 0xbd, 7); // BUG(?): no continuation?
}
}
@@ -195,7 +195,7 @@ void Room::mudd2MuddNoticedKirk() {
void Room::mudd2MuddDroppedCapsule() {
loadActorAnim2(OBJECT_MUDD, "s4sbhn", 0x9f, 0xbf, 3); // NOTE: no callback from this
loadActorAnim2(OBJECT_CAPSULE, "s4sbvp", 0x93, 0xc3);
- _vm->_awayMission.mudd.muddCurrentlyInsane = true;
+ _awayMission->mudd.muddCurrentlyInsane = true;
showText(TX_SPEAKER_MCCOY, TX_MUD2_032);
showText(TX_SPEAKER_MUDD, TX_MUD2_049);
@@ -204,12 +204,12 @@ void Room::mudd2MuddDroppedCapsule() {
showText(TX_SPEAKER_MCCOY, TX_MUD2_031);
showText(TX_SPEAKER_MUDD, TX_MUD2_050);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::mudd2UsePhaserOnMudd() {
- if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious) {
+ if (_awayMission->mudd.muddInhaledGas && !_awayMission->mudd.muddUnconscious) {
showText(TX_SPEAKER_BUCHERT, TX_MUD2_053);
showText(TX_SPEAKER_MUDD, TX_MUD2_042);
showText(TX_SPEAKER_MUDD, TX_MUD2_043);
@@ -219,8 +219,8 @@ void Room::mudd2UsePhaserOnMudd() {
// Spock neck-pinches Mudd
void Room::mudd2UseSpockOnMudd() {
- if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious) {
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->mudd.muddInhaledGas && !_awayMission->mudd.muddUnconscious) {
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_SPOCK, 0x8a, 0xbf, &Room::mudd2SpockReachedMudd);
}
}
@@ -236,14 +236,14 @@ void Room::mudd2SpockPinchedMudd() {
showText(TX_SPEAKER_SPOCK, TX_MUD2_012);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.mudd.muddUnconscious = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->disableInput = false;
+ _awayMission->mudd.muddUnconscious = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0x118, 0xc4);
}
void Room::mudd2UseKirkOnMudd() {
- if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious) {
+ if (_awayMission->mudd.muddInhaledGas && !_awayMission->mudd.muddUnconscious) {
showText(TX_SPEAKER_KIRK, TX_MUD2_001);
mudd2UseSpockOnMudd();
}
@@ -251,14 +251,14 @@ void Room::mudd2UseKirkOnMudd() {
void Room::mudd2UseRedshirtOnMudd() {
- if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious) {
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->mudd.muddInhaledGas && !_awayMission->mudd.muddUnconscious) {
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_REDSHIRT, 0xc3, 0xbe, &Room::mudd2RedshirtReachedMudd);
}
}
void Room::mudd2RedshirtReachedMudd() {
- _vm->_awayMission.timers[2] = 8;
+ _awayMission->timers[2] = 8;
loadActorAnimC(OBJECT_REDSHIRT, "s4sbrh", -1, -1, &Room::mudd2RedshirtPushedAway);
playVoc("ROCKFACE");
loadActorAnimC(OBJECT_MUDD, "s4sbhh", 0x9f, 0xbf, &Room::mudd2MuddFinishedPushingRedshirt);
@@ -275,8 +275,8 @@ void Room::mudd2MuddFinishedPushingRedshirt() {
void Room::mudd2RedshirtPushedAway() {
showText(TX_SPEAKER_BUCHERT, TX_MUD2_052);
loadActorAnim(OBJECT_REDSHIRT, "rstnds", 0xd8, 0xc3);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->disableInput = false;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
walkCrewman(OBJECT_REDSHIRT, 0x117, 0xae);
}
@@ -286,18 +286,18 @@ void Room::mudd2RedshirtPushedAway() {
// OBJECT_IMTRICOR in a USE action.
// The function itself was also modified (ie. condition for showing text was inverted).
void Room::mudd2UseMTricorderOnMudd() {
- if (_vm->_awayMission.mudd.muddInhaledGas && !_vm->_awayMission.mudd.muddUnconscious)
+ if (_awayMission->mudd.muddInhaledGas && !_awayMission->mudd.muddUnconscious)
mccoyScan(DIR_W, TX_MUD2_013, false);
}
void Room::mudd2UseMedkitOnMudd() {
- if (!_vm->_awayMission.mudd.muddInhaledGas)
+ if (!_awayMission->mudd.muddInhaledGas)
return;
- else if (_vm->_awayMission.mudd.muddUnconscious) {
- if (!_vm->_awayMission.mudd.translatedAlienLanguage)
+ else if (_awayMission->mudd.muddUnconscious) {
+ if (!_awayMission->mudd.translatedAlienLanguage)
showText(TX_SPEAKER_MCCOY, TX_MUD2_015);
- else if (!_vm->_awayMission.mudd.putCapsuleInMedicalMachine)
+ else if (!_awayMission->mudd.putCapsuleInMedicalMachine)
showText(TX_SPEAKER_MCCOY, TX_MUD2_021);
else
walkCrewmanC(OBJECT_MCCOY, 0xde, 0xaf, &Room::mudd2MccoyReachedMudd);
@@ -306,20 +306,20 @@ void Room::mudd2UseMedkitOnMudd() {
}
void Room::mudd2MccoyReachedMudd() {
- _vm->_awayMission.mudd.missionScore += 2;
+ _awayMission->mudd.missionScore += 2;
loadActorAnimC(OBJECT_MCCOY, "s4sbms", -1, -1, &Room::mudd2MccoyCuredMudd);
}
void Room::mudd2MccoyCuredMudd() {
- _vm->_awayMission.mudd.muddUnavailable = false;
- _vm->_awayMission.mudd.muddInsanityState = 3;
- _vm->_awayMission.mudd.muddCurrentlyInsane = false;
- _vm->_awayMission.mudd.muddInhaledGas = false;
+ _awayMission->mudd.muddUnavailable = false;
+ _awayMission->mudd.muddInsanityState = 3;
+ _awayMission->mudd.muddCurrentlyInsane = false;
+ _awayMission->mudd.muddInhaledGas = false;
showText(TX_SPEAKER_MCCOY, TX_MUD2_033);
showText(TX_SPEAKER_MUDD, TX_MUD2_045);
- _vm->_awayMission.mudd.muddUnconscious = false;
+ _awayMission->mudd.muddUnconscious = false;
}
@@ -354,7 +354,7 @@ void Room::mudd2LookAtBed() {
void Room::mudd2TalkToKirk() {
// BUGFIX: second condition in if statement changed to "must be false" instead of
// "must be true". (Same applies to below talk functions.)
- if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious)
+ if (!_awayMission->mudd.muddCurrentlyInsane || !_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious)
showText(TX_SPEAKER_KIRK, TX_MUD2_010);
else {
showText(TX_SPEAKER_KIRK, TX_MUD2_005);
@@ -364,7 +364,7 @@ void Room::mudd2TalkToKirk() {
}
void Room::mudd2TalkToSpock() {
- if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ if (!_awayMission->mudd.muddCurrentlyInsane || !_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious) {
showText(TX_SPEAKER_SPOCK, TX_MUD2_040);
showText(TX_SPEAKER_KIRK, TX_MUD2_011);
} else {
@@ -373,7 +373,7 @@ void Room::mudd2TalkToSpock() {
}
void Room::mudd2TalkToMccoy() {
- if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ if (!_awayMission->mudd.muddCurrentlyInsane || !_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious) {
showText(TX_SPEAKER_MCCOY, TX_MUD2_025);
showText(TX_SPEAKER_KIRK, TX_MUD2_007);
} else {
@@ -382,7 +382,7 @@ void Room::mudd2TalkToMccoy() {
}
void Room::mudd2TalkToRedshirt() {
- if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious) {
+ if (!_awayMission->mudd.muddCurrentlyInsane || !_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious) {
showText(TX_SPEAKER_BUCHERT, TX_MUD2_054);
showText(TX_SPEAKER_KIRK, TX_MUD2_008);
} else {
@@ -393,9 +393,9 @@ void Room::mudd2TalkToRedshirt() {
}
void Room::mudd2TalkToMudd() {
- if (!_vm->_awayMission.mudd.muddCurrentlyInsane || !_vm->_awayMission.mudd.muddInhaledGas || _vm->_awayMission.mudd.muddUnconscious)
+ if (!_awayMission->mudd.muddCurrentlyInsane || !_awayMission->mudd.muddInhaledGas || _awayMission->mudd.muddUnconscious)
return;
- else if (_vm->_awayMission.mudd.muddInhaledGas) {
+ else if (_awayMission->mudd.muddInhaledGas) {
showText(TX_SPEAKER_MUDD, TX_MUD2_048);
showText(TX_SPEAKER_MCCOY, TX_MUD2_028);
} else { // NOTE: Unused (assumes harry is in a normal state, which doesn't happen here)
diff --git a/engines/startrek/rooms/mudd3.cpp b/engines/startrek/rooms/mudd3.cpp
index 792e749f30..eb02450f9b 100644
--- a/engines/startrek/rooms/mudd3.cpp
+++ b/engines/startrek/rooms/mudd3.cpp
@@ -42,24 +42,24 @@ namespace StarTrek {
void Room::mudd3Tick1() {
playVoc("MUD3LOOP");
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
- if (_vm->_awayMission.mudd.databaseDestroyed) {
+ if (_awayMission->mudd.databaseDestroyed) {
loadActorAnim(OBJECT_9, "s4lbpb", 0xa2, 0x9f);
// FIXME: is this supposed to be in this if statement?
- if (!_vm->_awayMission.mudd.tookRepairTool)
+ if (!_awayMission->mudd.tookRepairTool)
loadActorAnim(OBJECT_REPAIR_TOOL, "s4lbdv", 0xb7, 0xa8);
}
- _vm->_awayMission.mudd.muddInDatabaseRoom = false;
+ _awayMission->mudd.muddInDatabaseRoom = false;
- if (!_vm->_awayMission.mudd.muddVisitedDatabaseRoom && _vm->_awayMission.mudd.translatedAlienLanguage && !_vm->_awayMission.mudd.muddUnavailable) {
- _vm->_awayMission.mudd.muddVisitedDatabaseRoom = true;
+ if (!_awayMission->mudd.muddVisitedDatabaseRoom && _awayMission->mudd.translatedAlienLanguage && !_awayMission->mudd.muddUnavailable) {
+ _awayMission->mudd.muddVisitedDatabaseRoom = true;
loadActorAnim(OBJECT_MUDD, "s4lbhs", 0xa2, 0x9f);
playMidiMusicTracks(3);
- _vm->_awayMission.mudd.muddInDatabaseRoom = true;
- _vm->_awayMission.timers[2] = 10;
+ _awayMission->mudd.muddInDatabaseRoom = true;
+ _awayMission->timers[2] = 10;
}
}
@@ -71,7 +71,7 @@ void Room::mudd3UseCommunicator() {
void Room::mudd3LookAtScreen() {
// BUGFIX: the condition was flipped in the original; the more "vague" description
// should be shown before the alien language is understood.
- if (_vm->_awayMission.mudd.translatedAlienLanguage)
+ if (_awayMission->mudd.translatedAlienLanguage)
showText(TX_SPEAKER_SPOCK, TX_MUD3_038);
else
showText(TX_MUD3N017);
@@ -86,18 +86,18 @@ void Room::mudd3UseSTricorderOnScreen() {
// BUGFIX: Event was actually "use screen on kirk", which makes no sense.
void Room::mudd3UseKirkOnScreen() {
- if (!_vm->_awayMission.mudd.translatedAlienLanguage) {
+ if (!_awayMission->mudd.translatedAlienLanguage) {
showText(TX_MUD3N011);
showText(TX_SPEAKER_SPOCK, TX_MUD3_037);
}
}
void Room::mudd3UseSpockOnSphere() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
loadActorStandAnim(OBJECT_SPOCK);
- if (_vm->_awayMission.mudd.computerDataErasedOrDestroyed) {
- if (!_vm->_awayMission.mudd.databaseDestroyed) {
+ if (_awayMission->mudd.computerDataErasedOrDestroyed) {
+ if (!_awayMission->mudd.databaseDestroyed) {
showText(TX_MUD3N000);
showText(TX_SPEAKER_SPOCK, TX_MUD3_052);
showText(TX_SPEAKER_KIRK, TX_MUD3_012);
@@ -107,11 +107,11 @@ void Room::mudd3UseSpockOnSphere() {
showText(TX_SPEAKER_SPOCK, TX_MUD3_048);
showText(TX_SPEAKER_KIRK, TX_MUD3_008);
showText(TX_SPEAKER_SPOCK, TX_MUD3_051);
- } else if (_vm->_awayMission.mudd.translatedAlienLanguage) {
- if (_vm->_awayMission.mudd.accessedAlienDatabase)
+ } else if (_awayMission->mudd.translatedAlienLanguage) {
+ if (_awayMission->mudd.accessedAlienDatabase)
showText(TX_SPEAKER_SPOCK, TX_MUD3_035);
else {
- _vm->_awayMission.mudd.accessedAlienDatabase = true;
+ _awayMission->mudd.accessedAlienDatabase = true;
showText(TX_SPEAKER_SPOCK, TX_MUD3_054);
showText(TX_SPEAKER_MCCOY, TX_MUD3_032);
@@ -120,23 +120,23 @@ void Room::mudd3UseSpockOnSphere() {
showText(TX_SPEAKER_SPOCK, TX_MUD3_046);
showText(TX_SPEAKER_KIRK, TX_MUD3_007);
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.missionScore++;
playVoc("LSHAIANS");
loadActorAnim(OBJECT_ALIEN_IMAGE, "s4lbap", 0x32, 0x64);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
loadActorStandAnim(OBJECT_KIRK);
loadActorStandAnim(OBJECT_SPOCK);
loadActorStandAnim(OBJECT_MCCOY);
loadActorStandAnim(OBJECT_REDSHIRT);
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.timers[3] = 40;
+ _awayMission->disableInput = true;
+ _awayMission->timers[3] = 40;
}
- } else if (_vm->_awayMission.mudd.discoveredBase3System) {
+ } else if (_awayMission->mudd.discoveredBase3System) {
showText(TX_SPEAKER_SPOCK, TX_MUD3_043);
showText(TX_SPEAKER_MCCOY, TX_MUD3_022);
showText(TX_SPEAKER_SPOCK, TX_MUD3_056);
@@ -145,14 +145,14 @@ void Room::mudd3UseSpockOnSphere() {
_roomVar.mudd.suggestedUsingTricorders = true;
} else {
showText(TX_SPEAKER_SPOCK, TX_MUD3_044);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xcd, 0x87);
}
}
// Finished looking at alien image
void Room::mudd3Timer3Expired() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_MCCOY, TX_MUD3_027);
showText(TX_SPEAKER_SPOCK, TX_MUD3_053);
@@ -162,21 +162,21 @@ void Room::mudd3Timer3Expired() {
void Room::mudd3UseMccoyOnSphere() {
// ENHANCEMENT: Turn to face south
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
loadActorStandAnim(OBJECT_MCCOY);
showText(TX_SPEAKER_MCCOY, TX_MUD3_021);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_MCCOY, 0xec, 0x84);
}
void Room::mudd3UseRedshirtOnSphere() {
// ENHANCEMENT: Turn to face south
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
loadActorStandAnim(OBJECT_REDSHIRT);
showText(TX_SPEAKER_BUCHERT, TX_MUD3_068); // BUGFIX: original played McCoy's audio by mistake
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
walkCrewman(OBJECT_REDSHIRT, 0xec, 0x84);
}
@@ -184,36 +184,36 @@ void Room::mudd3UseMTricorderOnSphere() {
if (_roomVar.mudd.tricordersUnavailable)
showText(TX_SPEAKER_SPOCK, TX_MUD3_039); // BUGFIX: speaker is Spock
else {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
loadActorStandAnim(OBJECT_MCCOY);
- if (!_vm->_awayMission.mudd.translatedAlienLanguage && _roomVar.mudd.suggestedUsingTricorders && _vm->_awayMission.mudd.discoveredBase3System) {
- _vm->_awayMission.disableInput = true;
+ if (!_awayMission->mudd.translatedAlienLanguage && _roomVar.mudd.suggestedUsingTricorders && _awayMission->mudd.discoveredBase3System) {
+ _awayMission->disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
walkCrewman(OBJECT_MCCOY, 0xac, 0x88);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
walkCrewmanC(OBJECT_SPOCK, 0xa5, 0x8c, &Room::mudd3ReadyToHookUpTricorders);
} else {
showText(TX_SPEAKER_MCCOY, TX_MUD3_021);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_MCCOY, 0xec, 0x84);
}
}
}
void Room::mudd3UseSTricorderOnSphere() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
loadActorStandAnim(OBJECT_SPOCK);
if (_roomVar.mudd.tricordersUnavailable)
showText(TX_SPEAKER_SPOCK, TX_MUD3_039); // BUGFIX: speaker is Spock
- else if (_vm->_awayMission.mudd.translatedAlienLanguage || (_vm->_awayMission.mudd.discoveredBase3System && !_roomVar.mudd.suggestedUsingTricorders)) {
+ else if (_awayMission->mudd.translatedAlienLanguage || (_awayMission->mudd.discoveredBase3System && !_roomVar.mudd.suggestedUsingTricorders)) {
showText(TX_SPEAKER_SPOCK, TX_MUD3_041);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xcd, 0x87);
- } else if (_vm->_awayMission.mudd.discoveredBase3System && _roomVar.mudd.suggestedUsingTricorders) { // Hooking up tricorders
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ } else if (_awayMission->mudd.discoveredBase3System && _roomVar.mudd.suggestedUsingTricorders) { // Hooking up tricorders
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
walkCrewmanC(OBJECT_MCCOY, 0xca, 0x88, &Room::mudd3ReadyToHookUpTricorders);
} else { // No idea how to access it
showText(TX_SPEAKER_SPOCK, TX_MUD3_042);
@@ -225,7 +225,7 @@ void Room::mudd3ReadyToHookUpTricorders() {
showText(TX_SPEAKER_SPOCK, TX_MUD3_018);
_roomVar.mudd.tricordersUnavailable = true;
- _vm->_awayMission.timers[1] = 50;
+ _awayMission->timers[1] = 50;
loadActorAnim2(OBJECT_SPOCK, "sscans");
playSoundEffectIndex(SND_TRICORDER);
@@ -235,14 +235,14 @@ void Room::mudd3Timer1Expired() { // Tricorders ready for use again
showText(TX_SPEAKER_SPOCK, TX_MUD3_040);
showText(TX_SPEAKER_SPOCK, TX_MUD3_034);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
_roomVar.mudd.tricordersUnavailable = false;
_roomVar.mudd.suggestedUsingTricorders = false;
- _vm->_awayMission.mudd.translatedAlienLanguage = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.translatedAlienLanguage = true;
+ _awayMission->mudd.missionScore++;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xcd, 0x87);
walkCrewman(OBJECT_MCCOY, 0xec, 0x84);
}
@@ -256,14 +256,14 @@ void Room::mudd3Timer2Expired() {
TX_BLANK
};
- _vm->_awayMission.mudd.computerDataErasedOrDestroyed = true;
+ _awayMission->mudd.computerDataErasedOrDestroyed = true;
showText(TX_SPEAKER_MUDD, TX_MUD3_065);
int choice = showText(choices);
if (choice == 0) { // Allow him to access the database (he ends up erasing it)
showText(TX_SPEAKER_MUDD, TX_MUD3_066);
- _vm->_awayMission.mudd.muddErasedDatabase = true;
+ _awayMission->mudd.muddErasedDatabase = true;
// ENHANCEMENT: Add a few lines to make it clear that Mudd erased the databanks.
// Otherwise, the end of the mission when you confront Mudd doesn't make sense
@@ -274,34 +274,34 @@ void Room::mudd3Timer2Expired() {
} else { // Don't allow it (he destroys it by accident)
showText(TX_SPEAKER_MUDD, TX_MUD3_064);
- _vm->_awayMission.timers[4] = 98;
- _vm->_awayMission.disableInput = 2;
+ _awayMission->timers[4] = 98;
+ _awayMission->disableInput = 2;
playMidiMusicTracks(26);
loadActorAnim(OBJECT_MUDD, "s4lbhb", 0xa2, 0x9f);
}
}
void Room::mudd3Timer4Expired() {
- _vm->_awayMission.mudd.databaseDestroyed = true;
+ _awayMission->mudd.databaseDestroyed = true;
showText(TX_SPEAKER_MUDD, TX_MUD3_063);
showText(TX_SPEAKER_MCCOY, TX_MUD3_031);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::mudd3UseMemoryDiskOnSphere() {
// ENHANCEMENT: Turn to face south
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorStandAnim(OBJECT_KIRK);
- if (_vm->_awayMission.mudd.databaseDestroyed)
+ if (_awayMission->mudd.databaseDestroyed)
showText(TX_MUD3N014);
- else if (_vm->_awayMission.mudd.translatedAlienLanguage && !_vm->_awayMission.mudd.muddErasedDatabase) {
+ else if (_awayMission->mudd.translatedAlienLanguage && !_awayMission->mudd.muddErasedDatabase) {
showText(TX_MUD3N020);
- if (!_vm->_awayMission.mudd.gotPointsForDownloadingData) {
- _vm->_awayMission.mudd.missionScore += 3;
- _vm->_awayMission.mudd.gotPointsForDownloadingData = true;
+ if (!_awayMission->mudd.gotPointsForDownloadingData) {
+ _awayMission->mudd.missionScore += 3;
+ _awayMission->mudd.gotPointsForDownloadingData = true;
}
} else
showText(TX_MUD3N019);
@@ -309,31 +309,31 @@ void Room::mudd3UseMemoryDiskOnSphere() {
void Room::mudd3GetRepairTool() {
- if (_vm->_awayMission.mudd.tookRepairTool)
+ if (_awayMission->mudd.tookRepairTool)
showText(TX_MUD3N018); // NOTE: unused, since the object disappears, can't be selected again
else {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewmanC(OBJECT_KIRK, 0xba, 0xc1, &Room::mudd3ReachedRepairTool);
}
}
void Room::mudd3ReachedRepairTool() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
loadActorAnimC(OBJECT_KIRK, "kusemn", -1, -1, &Room::mudd3PickedUpRepairTool);
}
void Room::mudd3PickedUpRepairTool() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_REPAIR_TOOL);
- _vm->_awayMission.mudd.tookRepairTool = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.tookRepairTool = true;
+ _awayMission->mudd.missionScore++;
giveItem(OBJECT_IDOOVER);
}
void Room::mudd3LookAtSphere() {
// ENHANCEMENT: Turn to face south
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_MUD3N015);
@@ -341,7 +341,7 @@ void Room::mudd3LookAtSphere() {
void Room::mudd3WalkToNorthDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xb8, 0x70);
}
@@ -354,7 +354,7 @@ void Room::mudd3TouchedHotspot0() { // Triggers north door
void Room::mudd3WalkToEastDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x121, 0x81);
}
@@ -365,28 +365,28 @@ void Room::mudd3TouchedHotspot1() {
}
void Room::mudd3LookAtKirk() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ if (!_awayMission->mudd.muddInDatabaseRoom)
showText(TX_MUD3N005);
else
showText(TX_MUD3N004);
}
void Room::mudd3LookAtSpock() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ if (!_awayMission->mudd.muddInDatabaseRoom)
showText(TX_MUD3N012);
else
showText(TX_MUD3N002);
}
void Room::mudd3LookAtMccoy() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ if (!_awayMission->mudd.muddInDatabaseRoom)
showText(TX_MUD3N010);
else
showText(TX_MUD3N009);
}
void Room::mudd3LookAtRedshirt() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ if (!_awayMission->mudd.muddInDatabaseRoom)
showText(TX_MUD3N007);
else
showText(TX_MUD3N006);
@@ -397,7 +397,7 @@ void Room::mudd3LookAtMudd() {
}
void Room::mudd3TalkToKirk() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom) {
+ if (!_awayMission->mudd.muddInDatabaseRoom) {
showText(TX_SPEAKER_KIRK, TX_MUD3_014);
showText(TX_SPEAKER_SPOCK, TX_MUD3_057);
showText(TX_SPEAKER_MCCOY, TX_MUD3_025);
@@ -406,7 +406,7 @@ void Room::mudd3TalkToKirk() {
}
void Room::mudd3TalkToSpock() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom) {
+ if (!_awayMission->mudd.muddInDatabaseRoom) {
showText(TX_SPEAKER_SPOCK, TX_MUD3_055);
showText(TX_SPEAKER_MCCOY, TX_MUD3_033);
showText(TX_SPEAKER_KIRK, TX_MUD3_011);
@@ -415,7 +415,7 @@ void Room::mudd3TalkToSpock() {
}
void Room::mudd3TalkToMccoy() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom)
+ if (!_awayMission->mudd.muddInDatabaseRoom)
showText(TX_SPEAKER_MCCOY, TX_MUD3_023);
else {
showText(TX_SPEAKER_MCCOY, TX_MUD3_030);
@@ -424,7 +424,7 @@ void Room::mudd3TalkToMccoy() {
}
void Room::mudd3TalkToRedshirt() {
- if (!_vm->_awayMission.mudd.muddInDatabaseRoom) {
+ if (!_awayMission->mudd.muddInDatabaseRoom) {
showText(TX_SPEAKER_BUCHERT, TX_MUD3_070);
showText(TX_SPEAKER_KIRK, TX_MUD3_016);
showText(TX_SPEAKER_BUCHERT, TX_MUD3_071);
@@ -435,7 +435,7 @@ void Room::mudd3TalkToRedshirt() {
void Room::mudd3TalkToMudd() {
// ENHANCEMENT: the 2nd part of the if condition is new; whether he physically
// destroys the database or does through software, he should give this reaction.
- if (_vm->_awayMission.mudd.databaseDestroyed || _vm->_awayMission.mudd.muddErasedDatabase) {
+ if (_awayMission->mudd.databaseDestroyed || _awayMission->mudd.muddErasedDatabase) {
showText(TX_SPEAKER_MUDD, TX_MUD3_060);
showText(TX_SPEAKER_MCCOY, TX_MUD3_029);
showText(TX_SPEAKER_MUDD, TX_MUD3_061);
diff --git a/engines/startrek/rooms/mudd4.cpp b/engines/startrek/rooms/mudd4.cpp
index 90bdf1dcee..4a1a1eedb4 100644
--- a/engines/startrek/rooms/mudd4.cpp
+++ b/engines/startrek/rooms/mudd4.cpp
@@ -39,10 +39,10 @@ namespace StarTrek {
void Room::mudd4Tick1() {
playVoc("MUD4LOOP");
- if (!_vm->_awayMission.mudd.tookRepairTool)
+ if (!_awayMission->mudd.tookRepairTool)
loadActorAnim(OBJECT_REPAIR_TOOL, "s4crdv", 0xc9, 0x8e);
- if (_vm->_awayMission.mudd.viewScreenEnabled)
+ if (_awayMission->mudd.viewScreenEnabled)
loadActorAnim(OBJECT_VIEWSCREEN, "s4crvo", 0xa5, 0x76);
}
@@ -70,13 +70,13 @@ void Room::mudd4UseSpockOnRightConsole() {
}
void Room::mudd4UseSpockOnConsole() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
loadActorStandAnim(OBJECT_SPOCK);
- if (_vm->_awayMission.mudd.translatedAlienLanguage) {
+ if (_awayMission->mudd.translatedAlienLanguage) {
if (!_roomVar.mudd.usingLeftConsole)
showText(TX_SPEAKER_SPOCK, TX_MUD4_057);
- } else if (_vm->_awayMission.mudd.discoveredBase3System) {
+ } else if (_awayMission->mudd.discoveredBase3System) {
showText(TX_SPEAKER_SPOCK, TX_MUD4_062);
} else {
showText(TX_SPEAKER_SPOCK, TX_MUD4_061);
@@ -87,22 +87,22 @@ void Room::mudd4UseSpockOnConsole() {
showText(TX_SPEAKER_KIRK, TX_MUD4_031);
showText(TX_SPEAKER_SPOCK, TX_MUD4_060);
- if (!_vm->_awayMission.mudd.discoveredBase3System) {
- _vm->_awayMission.mudd.discoveredBase3System = true;
- _vm->_awayMission.mudd.missionScore++;
+ if (!_awayMission->mudd.discoveredBase3System) {
+ _awayMission->mudd.discoveredBase3System = true;
+ _awayMission->mudd.missionScore++;
}
}
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
walkCrewmanC(OBJECT_SPOCK, 0x6d, 0x9a, &Room::mudd4SpockReachedChair);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
void Room::mudd4SpockReachedChair() {
- if (_roomVar.mudd.usingLeftConsole && _vm->_awayMission.mudd.translatedAlienLanguage)
+ if (_roomVar.mudd.usingLeftConsole && _awayMission->mudd.translatedAlienLanguage)
loadActorAnimC(OBJECT_SPOCK, "s4crss", -1, -1, &Room::mudd4SpockSatInChair);
else
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::mudd4SpockSatInChair() {
@@ -127,47 +127,47 @@ void Room::mudd4ShowLeftConsoleMenu() {
switch (choice) {
case 0: // Sensors
loadActorAnimC(OBJECT_SPOCK, "s4crsr", 0x55, 0x98, &Room::mudd4SpockUsedSensors);
- _vm->_awayMission.timers[2] = 5;
+ _awayMission->timers[2] = 5;
break;
case 1: // Navigation
loadActorAnimC(OBJECT_SPOCK, "s4crsl", 0x55, 0x98, &Room::mudd4SpockUsedNavigation);
- _vm->_awayMission.timers[2] = 5;
+ _awayMission->timers[2] = 5;
break;
case 2: // Engineering
loadActorAnimC(OBJECT_SPOCK, "s4crsr", 0x55, 0x98, &Room::mudd4SpockUsedEngineering);
- _vm->_awayMission.timers[2] = 5;
+ _awayMission->timers[2] = 5;
break;
case 3: // Done
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->disableInput = false;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
walkCrewman(OBJECT_SPOCK, 0x69, 0xb7);
break;
}
}
void Room::mudd4SpockUsedSensors() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_SPOCK, TX_MUD4_053);
mudd4ShowLeftConsoleMenu();
}
void Room::mudd4SpockUsedEngineering() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_SPOCK, TX_MUD4_056);
mudd4ShowLeftConsoleMenu();
}
void Room::mudd4SpockUsedNavigation() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_SPOCK, TX_MUD4_055);
mudd4ShowLeftConsoleMenu();
}
void Room::mudd4FinishedWalking3() { // Spock reaches console after attempting to use Kirk on one
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
mudd4UseSpockOnLeftConsole();
}
@@ -182,34 +182,34 @@ void Room::mudd4UseKirkOnLeftConsole() {
}
void Room::mudd4UseKirkOnConsole() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
loadActorStandAnim(OBJECT_KIRK);
- if (!_vm->_awayMission.mudd.translatedAlienLanguage) {
+ if (!_awayMission->mudd.translatedAlienLanguage) {
showText(TX_SPEAKER_KIRK, TX_MUD4_006);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
walkCrewmanC(OBJECT_SPOCK, 0x6d, 0x9a, &Room::mudd4FinishedWalking3);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
} else {
if (!_roomVar.mudd.kirkUsingRightConsole)
showText(TX_SPEAKER_KIRK, TX_MUD4_049);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewmanC(OBJECT_KIRK, 0x7e, 0x98, &Room::mudd4KirkReachedRightConsole);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
}
}
void Room::mudd4KirkReachedRightConsole() {
- if (_roomVar.mudd.kirkUsingRightConsole && _vm->_awayMission.mudd.translatedAlienLanguage)
+ if (_roomVar.mudd.kirkUsingRightConsole && _awayMission->mudd.translatedAlienLanguage)
loadActorAnimC(OBJECT_KIRK, "s4crks", -1, -1, &Room::mudd4KirkSatInChair);
else
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::mudd4KirkSatInChair() {
loadActorAnim2(OBJECT_KIRK, "s4crkl", 0x94, 0x98);
- _vm->_awayMission.timers[2] = 5;
- _vm->_awayMission.disableInput = false;
+ _awayMission->timers[2] = 5;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_SPOCK, TX_MUD4_052); // NOTE: why is Spock talking here?
@@ -229,60 +229,60 @@ void Room::mudd4ShowRightConsoleMenu() {
switch (choice) {
case 0: // Communications
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "s4crkr", 0x94, 0x98, &Room::mudd4KirkUsedCommunications);
break;
case 1: // View Screen
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "s4crkl", 0x94, 0x98, &Room::mudd4KirkUsedViewScreen);
break;
case 2: // Done
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0x83, 0xb6);
break;
}
}
void Room::mudd4KirkUsedViewScreen() {
- if (!_vm->_awayMission.mudd.viewScreenEnabled) {
- _vm->_awayMission.mudd.viewScreenEnabled = true;
+ if (!_awayMission->mudd.viewScreenEnabled) {
+ _awayMission->mudd.viewScreenEnabled = true;
playVoc("SE2BIGAS");
loadActorAnim(OBJECT_VIEWSCREEN, "s4crvs", 0xa5, 0x76);
- _vm->_awayMission.timers[3] = 5;
- _vm->_awayMission.timers[1] = 50;
- if (!_vm->_awayMission.mudd.gotPointsForEnablingViewscreen) {
- _vm->_awayMission.mudd.gotPointsForEnablingViewscreen = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->timers[3] = 5;
+ _awayMission->timers[1] = 50;
+ if (!_awayMission->mudd.gotPointsForEnablingViewscreen) {
+ _awayMission->mudd.gotPointsForEnablingViewscreen = true;
+ _awayMission->mudd.missionScore++;
}
} else {
- _vm->_awayMission.mudd.viewScreenEnabled = false;
+ _awayMission->mudd.viewScreenEnabled = false;
loadActorAnim(OBJECT_VIEWSCREEN, "s4crvf", 0xa5, 0x76);
- _vm->_awayMission.timers[3] = 5;
- _vm->_awayMission.timers[1] = 30;
+ _awayMission->timers[3] = 5;
+ _awayMission->timers[1] = 30;
}
}
void Room::mudd4Timer1Expired() {
- _vm->_awayMission.disableInput = false;
- if (_vm->_awayMission.mudd.viewScreenEnabled)
+ _awayMission->disableInput = false;
+ if (_awayMission->mudd.viewScreenEnabled)
showText(TX_SPEAKER_KIRK, TX_MUD4_004);
mudd4ShowRightConsoleMenu();
}
void Room::mudd4KirkUsedCommunications() {
- _vm->_awayMission.disableInput = false;
- if (!_vm->_awayMission.mudd.knowAboutTorpedo) {
+ _awayMission->disableInput = false;
+ if (!_awayMission->mudd.knowAboutTorpedo) {
showText(TX_SPEAKER_SPOCK, TX_MUD4_054);
mudd4ShowRightConsoleMenu();
} else {
- if (!_vm->_awayMission.mudd.contactedEnterpriseFirstTime) {
- _vm->_awayMission.mudd.missionScore++;
+ if (!_awayMission->mudd.contactedEnterpriseFirstTime) {
+ _awayMission->mudd.missionScore++;
showText(TX_SPEAKER_KIRK, TX_MUD4_025);
showText(TX_SPEAKER_SCOTT, TX_MUD4_S02);
- if (_vm->_awayMission.mudd.torpedoStatus == 1)
+ if (_awayMission->mudd.torpedoStatus == 1)
showText(TX_SPEAKER_KIRK, TX_MUD4_027);
else
showText(TX_SPEAKER_KIRK, TX_MUD4_028);
@@ -300,9 +300,9 @@ void Room::mudd4KirkUsedCommunications() {
int choice = showText(choices);
if (choice == 1) {
- endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ endMission(_awayMission->mudd.missionScore, 0x1b, _awayMission->mudd.torpedoStatus);
} else if (choice == 0) {
- _vm->_awayMission.mudd.contactedEnterpriseFirstTime = true;
+ _awayMission->mudd.contactedEnterpriseFirstTime = true;
} else { // choice == 2
mudd4TalkWithMuddAtMissionEnd();
}
@@ -320,7 +320,7 @@ void Room::mudd4KirkUsedCommunications() {
int choice = showText(choices);
if (choice == 1) {
- endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ endMission(_awayMission->mudd.missionScore, 0x1b, _awayMission->mudd.torpedoStatus);
} else if (choice == 2) {
mudd4TalkWithMuddAtMissionEnd();
}
@@ -329,20 +329,20 @@ void Room::mudd4KirkUsedCommunications() {
}
void Room::mudd4TalkWithMuddAtMissionEnd() {
- if (_vm->_awayMission.mudd.muddUnavailable)
+ if (_awayMission->mudd.muddUnavailable)
return;
else {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewmanC(OBJECT_KIRK, 0x83, 0xb4, &Room::mudd4KirkReachedPositionToTalkToMudd);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0x69, 0xb7);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
loadActorStandAnim(OBJECT_MCCOY);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
loadActorStandAnim(OBJECT_REDSHIRT);
playMidiMusicTracks(3);
@@ -351,12 +351,12 @@ void Room::mudd4TalkWithMuddAtMissionEnd() {
}
void Room::mudd4KirkReachedPositionToTalkToMudd() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
- if (_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction
- || _vm->_awayMission.mudd.muddErasedDatabase
- || _vm->_awayMission.mudd.databaseDestroyed
- || !_vm->_awayMission.mudd.accessedAlienDatabase) { // NOTE: why this last line? Test this...
+ if (_awayMission->mudd.discoveredLenseAndDegrimerFunction
+ || _awayMission->mudd.muddErasedDatabase
+ || _awayMission->mudd.databaseDestroyed
+ || !_awayMission->mudd.accessedAlienDatabase) { // NOTE: why this last line? Test this...
const int choices[] = {
TX_SPEAKER_KIRK,
TX_MUD4_009,
@@ -376,17 +376,17 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
showText(TX_SPEAKER_MUDD, TX_MUD4_068);
showText(TX_SPEAKER_KIRK, TX_MUD4_032);
- endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ endMission(_awayMission->mudd.missionScore, 0x1b, _awayMission->mudd.torpedoStatus);
} else {
// Threaten to arrest Mudd.
- if (_vm->_awayMission.mudd.muddErasedDatabase || _vm->_awayMission.mudd.databaseDestroyed)
+ if (_awayMission->mudd.muddErasedDatabase || _awayMission->mudd.databaseDestroyed)
showText(TX_SPEAKER_KIRK, TX_MUD4_034);
- if (_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction)
+ if (_awayMission->mudd.discoveredLenseAndDegrimerFunction)
showText(TX_SPEAKER_KIRK, TX_MUD4_037);
showText(TX_SPEAKER_KIRK, TX_MUD4_026);
- if (_vm->_awayMission.mudd.muddErasedDatabase && _vm->_awayMission.mudd.databaseDestroyed) {
+ if (_awayMission->mudd.muddErasedDatabase && _awayMission->mudd.databaseDestroyed) {
// Mudd offers to copy the lost data to the enterprise computer. You don't
// get any points for this outcome.
@@ -406,7 +406,7 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
showText(TX_SPEAKER_MUDD, TX_MUD4_067);
showText(TX_SPEAKER_KIRK, TX_MUD4_011);
- _vm->_awayMission.mudd.missionScore += 4;
+ _awayMission->mudd.missionScore += 4;
playMidiMusicTracks(30);
showText(TX_SPEAKER_MUDD, TX_MUD4_073);
@@ -415,7 +415,7 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
showText(TX_SPEAKER_MUDD, TX_MUD4_069);
showText(TX_SPEAKER_KIRK, TX_MUD4_001);
- endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ endMission(_awayMission->mudd.missionScore, 0x1b, _awayMission->mudd.torpedoStatus);
}
} else {
const int choices[] = {
@@ -437,7 +437,7 @@ void Room::mudd4KirkReachedPositionToTalkToMudd() {
showText(TX_SPEAKER_MUDD, TX_MUD4_068);
showText(TX_SPEAKER_KIRK, TX_MUD4_032);
- endMission(_vm->_awayMission.mudd.missionScore, 0x1b, _vm->_awayMission.mudd.torpedoStatus);
+ endMission(_awayMission->mudd.missionScore, 0x1b, _awayMission->mudd.torpedoStatus);
}
}
@@ -445,19 +445,19 @@ void Room::mudd4UseMccoyOnConsole() {
// NOTE: This audio was recorded twice (TX_MUD4_045, and TX_MUD4_044 which is unused)
showText(TX_SPEAKER_MCCOY, TX_MUD4_045);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
walkCrewman(OBJECT_MCCOY, 0x7d, 0xc3);
}
void Room::mudd4UseRedshirtOnConsole() {
// Floppy version shows two different pieces of text here, but in the CD version,
// there's no difference
- if (!_vm->_awayMission.mudd.translatedAlienLanguage)
+ if (!_awayMission->mudd.translatedAlienLanguage)
showText(TX_SPEAKER_BUCHERT, TX_MUD4_075);
else
showText(TX_SPEAKER_BUCHERT, TX_MUD4_075);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
walkCrewman(OBJECT_REDSHIRT, 0x2a, 0xbb);
}
@@ -478,11 +478,11 @@ void Room::mudd4UseMedkit() {
}
void Room::mudd4GetRepairTool() {
- if (_vm->_awayMission.mudd.tookRepairTool)
+ if (_awayMission->mudd.tookRepairTool)
showText(TX_MUD4N012); // NOTE: unused, since the object disappears, can't be selected again
else {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewmanC(OBJECT_KIRK, 0xcb, 0x9e, &Room::mudd4ReachedRepairTool);
}
}
@@ -492,10 +492,10 @@ void Room::mudd4ReachedRepairTool() {
}
void Room::mudd4PickedUpRepairTool() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_REPAIR_TOOL);
- _vm->_awayMission.mudd.tookRepairTool = true;
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.tookRepairTool = true;
+ _awayMission->mudd.missionScore++;
giveItem(OBJECT_IDOOVER);
}
@@ -504,7 +504,7 @@ void Room::mudd4LookAtConsole() {
}
void Room::mudd4LookAtViewscreen() {
- if (_vm->_awayMission.mudd.viewScreenEnabled)
+ if (_awayMission->mudd.viewScreenEnabled)
showText(TX_MUD4N008);
else
showText(TX_MUD4N013);
@@ -550,13 +550,13 @@ void Room::mudd4TalkToRedshirt() {
void Room::mudd4WalkToEastDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0xf0, 0xc7);
}
void Room::mudd4WalkToWestDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x50, 0xc7);
}
diff --git a/engines/startrek/rooms/mudd5.cpp b/engines/startrek/rooms/mudd5.cpp
index c7e63f35d7..caa18f8dc4 100644
--- a/engines/startrek/rooms/mudd5.cpp
+++ b/engines/startrek/rooms/mudd5.cpp
@@ -40,22 +40,22 @@ namespace StarTrek {
void Room::mudd5Tick1() {
playVoc("MUD5LOOP");
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
- if (_vm->_awayMission.mudd.lifeSupportMalfunctioning) {
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ if (_awayMission->mudd.lifeSupportMalfunctioning) {
playMidiMusicTracks(19);
loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4epls", GENERATOR_X, GENERATOR_Y);
} else {
loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4eplo", GENERATOR_X, GENERATOR_Y);
- _vm->_awayMission.mudd.numTimesEnteredRoom5++;
+ _awayMission->mudd.numTimesEnteredRoom5++;
// BUG: this event can become permanently unavailable? (test)
- if (_vm->_awayMission.mudd.numTimesEnteredRoom5 == 2 && !_vm->_awayMission.mudd.muddUnavailable && !_vm->_awayMission.mudd.repairedLifeSupportGenerator) {
- _vm->_awayMission.mudd.muddUnavailable = true;
- _vm->_awayMission.mudd.numTimesEnteredRoom5 = 1;
- _vm->_awayMission.disableInput = 2;
+ if (_awayMission->mudd.numTimesEnteredRoom5 == 2 && !_awayMission->mudd.muddUnavailable && !_awayMission->mudd.repairedLifeSupportGenerator) {
+ _awayMission->mudd.muddUnavailable = true;
+ _awayMission->mudd.numTimesEnteredRoom5 = 1;
+ _awayMission->disableInput = 2;
playMidiMusicTracks(3);
loadActorAnim(OBJECT_MUDD, "s4ephh", 0x0e, 0xa7);
- _vm->_awayMission.timers[1] = 112;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->timers[1] = 112;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
}
}
}
@@ -73,12 +73,12 @@ void Room::mudd5Timer1Expired() { // Mudd enters room through hatch
showText(TX_SPEAKER_MUDD, TX_MUD5_037);
loadActorAnim2(OBJECT_MUDD, "s4ephc");
- _vm->_awayMission.timers[2] = 140;
+ _awayMission->timers[2] = 140;
}
void Room::mudd5Timer2Expired() { // Life-support generator starts acting up
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.mudd.lifeSupportMalfunctioning = true;
+ _awayMission->disableInput = false;
+ _awayMission->mudd.lifeSupportMalfunctioning = true;
playMidiMusicTracks(19);
loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4epls", GENERATOR_X, GENERATOR_Y);
}
@@ -106,7 +106,7 @@ void Room::mudd5UseSTricorderOnHatch() {
}
void Room::mudd5UseSTricorderOnLifeSupportGenerator() {
- if (_vm->_awayMission.mudd.lifeSupportMalfunctioning)
+ if (_awayMission->mudd.lifeSupportMalfunctioning)
spockScan(DIR_W, TX_MUD5_019, false);
else
spockScan(DIR_W, TX_MUD5_021, false);
@@ -129,9 +129,9 @@ void Room::mudd5UseAnythingOnLifeSupportGenerator() {
void Room::mudd5UseDooverOnLifeSupportGenerator() {
- if (_vm->_awayMission.mudd.lifeSupportMalfunctioning) {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ if (_awayMission->mudd.lifeSupportMalfunctioning) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewmanC(OBJECT_KIRK, 0x57, 0xb4, &Room::mudd5KirkReachedLifeSupportGenerator);
} else
showText(TX_SPEAKER_MCCOY, TX_MUD5_014); // BUGFIX: speaker is McCoy, not none
@@ -139,30 +139,30 @@ void Room::mudd5UseDooverOnLifeSupportGenerator() {
void Room::mudd5KirkReachedLifeSupportGenerator() {
loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::mudd5KirkRepairedLifeSupportGenerator);
- _vm->_awayMission.timers[4] = 20;
+ _awayMission->timers[4] = 20;
}
void Room::mudd5KirkTimer4Expired() {
playMidiMusicTracks(-1);
loadActorAnim2(OBJECT_LIFE_SUPPORT_GENERATOR, "s4eplo");
- _vm->_awayMission.mudd.repairedLifeSupportGenerator = true;
- _vm->_awayMission.mudd.missionScore += 2;
+ _awayMission->mudd.repairedLifeSupportGenerator = true;
+ _awayMission->mudd.missionScore += 2;
}
void Room::mudd5KirkRepairedLifeSupportGenerator() {
showText(TX_SPEAKER_KIRK, TX_MUD5_007);
showText(TX_SPEAKER_SPOCK, TX_MUD5_028);
- _vm->_awayMission.mudd.lifeSupportMalfunctioning = false;
- _vm->_awayMission.mudd.muddUnavailable = false;
+ _awayMission->mudd.lifeSupportMalfunctioning = false;
+ _awayMission->mudd.muddUnavailable = false;
playMidiMusicTracks(3);
loadActorAnim(OBJECT_MUDD, "s4ephh", 0x0e, 0xa7);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.timers[3] = 110;
+ _awayMission->timers[3] = 110;
}
void Room::mudd5KirkTimer3Expired() { // Mudd popped back in after repairing generator
@@ -171,7 +171,7 @@ void Room::mudd5KirkTimer3Expired() { // Mudd popped back in after repairing gen
showText(TX_SPEAKER_MUDD, TX_MUD5_036);
loadActorAnim2(OBJECT_MUDD, "s4ephc");
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::mudd5LookAtHatch() {
@@ -181,7 +181,7 @@ void Room::mudd5LookAtHatch() {
}
void Room::mudd5LookAtLifeSupportGenerator() {
- if (_vm->_awayMission.mudd.lifeSupportMalfunctioning)
+ if (_awayMission->mudd.lifeSupportMalfunctioning)
showText(TX_MUD5N008);
else {
showText(TX_MUD5N012);
@@ -198,7 +198,7 @@ void Room::mudd5TouchedHotspot0() { // Triggers door
void Room::mudd5WalkToDoor() {
_roomVar.mudd.walkingToDoor = true;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x85, 0x74);
}
diff --git a/engines/startrek/rooms/mudda.cpp b/engines/startrek/rooms/mudda.cpp
index 78c562958f..4c92ae03d5 100644
--- a/engines/startrek/rooms/mudda.cpp
+++ b/engines/startrek/rooms/mudda.cpp
@@ -43,7 +43,7 @@ void Room::muddaUseLenseOnDegrimer() {
loseItem(OBJECT_IDEGRIME);
loseItem(OBJECT_ILENSES);
- _vm->_awayMission.mudd.missionScore++;
+ _awayMission->mudd.missionScore++;
showText(text[_roomIndex]);
}
@@ -60,9 +60,9 @@ void Room::muddaUseAlienDevice() {
11 // MUDD5
};
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
loadActorStandAnim(OBJECT_KIRK);
Common::Point pos = getActorPos(OBJECT_KIRK);
loadActorAnimC(deviceObjectIndices[_roomIndex], "s4cbxp", pos.x, 10, &Room::muddaFiredAlienDevice);
@@ -81,10 +81,10 @@ void Room::muddaFiredAlienDevice() {
TX_MUD2_002,
};
- _vm->_awayMission.disableInput = false;
- if (!_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction) {
- _vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction = true;
- _vm->_awayMission.mudd.missionScore += 5; // BUGFIX: didn't happen if done in MUDD5
+ _awayMission->disableInput = false;
+ if (!_awayMission->mudd.discoveredLenseAndDegrimerFunction) {
+ _awayMission->mudd.discoveredLenseAndDegrimerFunction = true;
+ _awayMission->mudd.missionScore += 5; // BUGFIX: didn't happen if done in MUDD5
showText(TX_SPEAKER_KIRK, text[_roomIndex]);
}
}
@@ -141,22 +141,22 @@ void Room::muddaTick() {
const int TIMER_LENGTH = 27000;
- if (_vm->_awayMission.mudd.lifeSupportMalfunctioning) {
- if (!_vm->_awayMission.mudd.startedLifeSupportTimer) {
- _vm->_awayMission.mudd.startedLifeSupportTimer = true;
- _vm->_awayMission.mudd.lifeSupportTimer = TIMER_LENGTH;
+ if (_awayMission->mudd.lifeSupportMalfunctioning) {
+ if (!_awayMission->mudd.startedLifeSupportTimer) {
+ _awayMission->mudd.startedLifeSupportTimer = true;
+ _awayMission->mudd.lifeSupportTimer = TIMER_LENGTH;
}
- _vm->_awayMission.mudd.lifeSupportTimer--;
+ _awayMission->mudd.lifeSupportTimer--;
// BUGFIX: the warnings at 75%, 50%, and 25% were only voiced in MUDD0.
- if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.25))
+ if (_awayMission->mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.25))
showText(TX_SPEAKER_SPOCK, TX_MUD0_018);
- else if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.5))
+ else if (_awayMission->mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.5))
showText(TX_SPEAKER_SPOCK, TX_MUD0_019);
- else if (_vm->_awayMission.mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.75))
+ else if (_awayMission->mudd.lifeSupportTimer == (int)(TIMER_LENGTH * 0.75))
showText(TX_SPEAKER_SPOCK, TX_MUD0_020);
- else if (_vm->_awayMission.mudd.lifeSupportTimer == 1) {
- _vm->_awayMission.disableInput = true;
+ else if (_awayMission->mudd.lifeSupportTimer == 1) {
+ _awayMission->disableInput = true;
// In each room, the crewmen collapse in a different directions.
// NOTE: "kgetdn" (kirk, north) doesn't work properly; files in the animation
@@ -171,7 +171,7 @@ void Room::muddaTick() {
};
for (int i = OBJECT_KIRK; i <= OBJECT_REDSHIRT; i++) {
- Common::String anim = _vm->getCrewmanAnimFilename(i, "getd");
+ Common::String anim = getCrewmanAnimFilename(i, "getd");
anim += directions[i][_roomIndex];
loadActorAnim2(i, anim);
}
diff --git a/engines/startrek/rooms/sins0.cpp b/engines/startrek/rooms/sins0.cpp
index 8dfabdc73e..7fb4f08e32 100644
--- a/engines/startrek/rooms/sins0.cpp
+++ b/engines/startrek/rooms/sins0.cpp
@@ -81,12 +81,12 @@ extern const int sins0NumActions = sizeof(sins0ActionList) / sizeof(RoomAction);
void Room::sins0Tick1() {
playVoc("SIN0LOOP");
- if (!_vm->_awayMission.sins.enteredRoom0FirstTime)
- _vm->_awayMission.disableInput = 2;
+ if (!_awayMission->sins.enteredRoom0FirstTime)
+ _awayMission->disableInput = 2;
- if (_vm->_awayMission.sins.field3e)
+ if (_awayMission->sins.field3e)
loadActorAnim2(OBJECT_DOOR, "s0dr2", 0, 0);
- if (_vm->_awayMission.sins.openedDoor)
+ if (_awayMission->sins.openedDoor)
loadActorAnim2(OBJECT_DOOR, "s0dr1", 0, 0);
playMidiMusicTracks(MIDITRACK_27, -3);
@@ -131,13 +131,13 @@ void Room::sins0LookAtGround() {
}
void Room::sins0GetRock() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "kpickw", -1, -1, &Room::sins0PickedUpRock);
- _vm->_awayMission.sins.field39 |= 1;
+ _awayMission->sins.field39 |= 1;
}
void Room::sins0PickedUpRock() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_SIN0N010);
giveItem(OBJECT_IS8ROCKS);
@@ -149,7 +149,7 @@ void Room::sins0UseSTricorderAnywhere() {
void Room::sins0UseSTricorderOnGround() {
spockScan(DIR_S, TX_SIN0_017);
- _vm->_awayMission.sins.field39 |= 1;
+ _awayMission->sins.field39 |= 1;
}
void Room::sins0UseSTricorderOnPlanet() {
@@ -157,8 +157,8 @@ void Room::sins0UseSTricorderOnPlanet() {
}
void Room::sins0Tick40() {
- if (!_vm->_awayMission.sins.enteredRoom0FirstTime) {
- _vm->_awayMission.disableInput = false;
+ if (!_awayMission->sins.enteredRoom0FirstTime) {
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_UHURA, TX_SIN0U082);
showText(TX_SPEAKER_KIRK, TX_SIN0_003);
showText(TX_SPEAKER_SCOTT, TX_SIN0_S48);
@@ -167,7 +167,7 @@ void Room::sins0Tick40() {
showText(TX_SPEAKER_KIRK, TX_SIN0_005);
showText(TX_SPEAKER_SCOTT, TX_SIN0_S49);
showText(TX_SPEAKER_KIRK, TX_SIN0_001);
- _vm->_awayMission.sins.enteredRoom0FirstTime = true;
+ _awayMission->sins.enteredRoom0FirstTime = true;
}
}
@@ -216,9 +216,9 @@ void Room::sins0UseSTricorderOnStatue() {
showText(TX_SPEAKER_KIRK, TX_SIN0_008);
showText(TX_SPEAKER_SPOCK, TX_SIN0_023);
- if (!_vm->_awayMission.sins.gotPointsForScanningStatue) {
- _vm->_awayMission.sins.gotPointsForScanningStatue = true;
- _vm->_awayMission.sins.missionScore += 1;
+ if (!_awayMission->sins.gotPointsForScanningStatue) {
+ _awayMission->sins.gotPointsForScanningStatue = true;
+ _awayMission->sins.missionScore += 1;
}
}
@@ -231,7 +231,7 @@ void Room::sins0UseMTricorderOnCrewman() {
}
void Room::sins0UseCommunicator() {
- if (!_vm->_awayMission.sins.scottyInformedKirkAboutVirus) {
+ if (!_awayMission->sins.scottyInformedKirkAboutVirus) {
showText(TX_SPEAKER_KIRK, TX_SIN0_004);
showText(TX_SPEAKER_SCOTT, TX_SIN0_S01);
showText(TX_SPEAKER_KIRK, TX_SIN0_002);
diff --git a/engines/startrek/rooms/sins1.cpp b/engines/startrek/rooms/sins1.cpp
index 8f44840667..76a959f513 100644
--- a/engines/startrek/rooms/sins1.cpp
+++ b/engines/startrek/rooms/sins1.cpp
@@ -92,27 +92,27 @@ extern const int sins1NumActions = sizeof(sins1ActionList) / sizeof(RoomAction);
void Room::sins1Tick1() {
playVoc("SIN1LOOP");
- if (!_vm->_awayMission.sins.scottyInformedKirkAboutVirus)
+ if (!_awayMission->sins.scottyInformedKirkAboutVirus)
// BUGFIX: Set this to 2, not 1 (disable input even after walking animation is done)
- _vm->_awayMission.disableInput = 2;
+ _awayMission->disableInput = 2;
- if (_vm->_awayMission.sins.openedDoor) {
+ if (_awayMission->sins.openedDoor) {
loadActorAnim2(OBJECT_DOOR, "s1dro", 0, 0);
loadMapFile("sins12");
} else
loadMapFile("sins1");
- if (_vm->_awayMission.sins.field3e)
+ if (_awayMission->sins.field3e)
loadActorAnim2(OBJECT_DOOR, "s1ndro", 0, 0);
- _vm->_awayMission.sins.field32 = 1;
- _vm->_awayMission.sins.field31 = 1;
+ _awayMission->sins.field32 = 1;
+ _awayMission->sins.field31 = 1;
playMidiMusicTracks(MIDITRACK_27, -3);
- if (!_vm->_awayMission.sins.enteredRoom1FirstTime) {
+ if (!_awayMission->sins.enteredRoom1FirstTime) {
playMidiMusicTracks(MIDITRACK_1, -2);
- _vm->_awayMission.sins.enteredRoom1FirstTime = true;
+ _awayMission->sins.enteredRoom1FirstTime = true;
}
}
@@ -153,7 +153,7 @@ void Room::sins1UseSTricorderOnLock() {
}
void Room::sins1UseSTricorderOnDoor() {
- if (!_vm->_awayMission.sins.openedDoor)
+ if (!_awayMission->sins.openedDoor)
spockScan(DIR_N, TX_SIN1_019);
}
@@ -162,7 +162,7 @@ void Room::sins1UseSTricorderAnywhere() {
}
void Room::sins1UseSTricorderOnLens() {
- if (!_vm->_awayMission.sins.doorLaserFiredOnce)
+ if (!_awayMission->sins.doorLaserFiredOnce)
spockScan(DIR_N, TX_SIN1_022);
else // BUGFIX: Original didn't do the tricorder animation, etc. in this case
spockScan(DIR_N, TX_SIN1_023);
@@ -173,25 +173,25 @@ void Room::sins1UseRockOnDoor() {
}
void Room::sins1UseRedshirtOnKeypad() {
- if (!_vm->_awayMission.sins.openedDoor)
+ if (!_awayMission->sins.openedDoor)
showText(TX_SPEAKER_MOSHER, TX_SIN1_028);
}
void Room::sins1UseMccoyOnKeypad() {
- if (!_vm->_awayMission.sins.openedDoor)
+ if (!_awayMission->sins.openedDoor)
showText(TX_SPEAKER_MCCOY, TX_SIN1_012);
}
void Room::sins1UseKirkOnKeypad() {
- if (!_vm->_awayMission.sins.openedDoor) {
+ if (!_awayMission->sins.openedDoor) {
showText(TX_SPEAKER_KIRK, TX_SIN1_001);
sins1UseSpockOnKeypad();
}
}
void Room::sins1UseSpockOnKeypad() {
- if (!_vm->_awayMission.sins.openedDoor) {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ if (!_awayMission->sins.openedDoor) {
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
walkCrewmanC(OBJECT_SPOCK, 0xfd, 0xad, &Room::sins1SpockReachedKeypad);
}
}
@@ -204,7 +204,7 @@ void Room::sins1SpockReachedKeypad() {
if (ans == -1) {
// ENHANCEMENT: Do nothing if no code was entered.
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
} else if (ans == 1 || ans == 2) {
playVoc("EFX14S");
@@ -219,9 +219,9 @@ void Room::sins1SpockReachedKeypad() {
}
void Room::sins1EnteredCorrectCode() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
- _vm->_awayMission.sins.openedDoor = true;
+ _awayMission->sins.openedDoor = true;
loadMapFile("sins12");
loadActorAnimC(OBJECT_DOOR, "s1door", 0, 0, &Room::sins1DoorDoneOpening);
playVoc("HUGEDOO2");
@@ -232,14 +232,14 @@ void Room::sins1DoorDoneOpening() {
}
void Room::sins1EnteredIncorrectCode() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
showText(TX_SPEAKER_SPOCK, TX_SIN1_017);
}
void Room::sins1EnteredSacredSofNumber() {
// Entered a sacred Sof number, which is wrong since this is a Lucr base
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0xf3, 0xad);
loadActorAnimC(OBJECT_9, "s1ph1", 0, 0, &Room::sins1DoorUsedLaser);
playSoundEffectIndex(SND_PHASSHOT);
@@ -253,12 +253,12 @@ void Room::sins1DoorUsedLaser() {
loadActorStandAnim(OBJECT_9);
showText(TX_SPEAKER_SPOCK, TX_SIN1_018);
- _vm->_awayMission.sins.field33 = true;
- _vm->_awayMission.sins.doorLaserFiredOnce = true;
+ _awayMission->sins.field33 = true;
+ _awayMission->sins.doorLaserFiredOnce = true;
}
void Room::sins1Tick40() {
- if (!_vm->_awayMission.sins.scottyInformedKirkAboutVirus) {
+ if (!_awayMission->sins.scottyInformedKirkAboutVirus) {
showText(TX_SPEAKER_SCOTT, TX_SIN1_S10);
showText(TX_SPEAKER_KIRK, TX_SIN1_007);
showText(TX_SPEAKER_SCOTT, TX_SIN1_S18);
@@ -267,8 +267,8 @@ void Room::sins1Tick40() {
showText(TX_SPEAKER_KIRK, TX_SIN1_003);
showText(TX_SPEAKER_SCOTT, TX_SIN1_S17);
- _vm->_awayMission.sins.scottyInformedKirkAboutVirus = true;
- _vm->_awayMission.disableInput = false;
+ _awayMission->sins.scottyInformedKirkAboutVirus = true;
+ _awayMission->disableInput = false;
}
}
@@ -318,7 +318,7 @@ void Room::sins1LookAtLens() {
}
void Room::sins1UseCommunicator() {
- if (!_vm->_awayMission.sins.field44) {
+ if (!_awayMission->sins.field44) {
showText(TX_SPEAKER_KIRK, TX_SIN1_008);
showText(TX_SPEAKER_SCOTT, TX_SIN1_S51);
showText(TX_SPEAKER_KIRK, TX_SIN1_002);
@@ -337,7 +337,7 @@ void Room::sins1UseMTricorderOnCrewman() {
}
void Room::sins1WalkToDoor() {
- if (_vm->_awayMission.sins.openedDoor)
+ if (_awayMission->sins.openedDoor)
walkCrewman(OBJECT_KIRK, 0x98, 0x9e, 5); // NOTE: Callback 5 not defined
}
diff --git a/engines/startrek/rooms/trial0.cpp b/engines/startrek/rooms/trial0.cpp
index b1ee21179f..0508d181fe 100644
--- a/engines/startrek/rooms/trial0.cpp
+++ b/engines/startrek/rooms/trial0.cpp
@@ -85,8 +85,8 @@ extern const int trial0NumActions = sizeof(trial0ActionList) / sizeof(RoomAction
void Room::trial0Tick1() {
playVoc("TRI0LOOP");
- _vm->_awayMission.timers[0] = getRandomWordInRange(180, 600);
- _vm->_awayMission.trial.field2b = 0x1d;
+ _awayMission->timers[0] = getRandomWordInRange(180, 600);
+ _awayMission->trial.field2b = 0x1d;
loadActorAnim2(OBJECT_VLICT, "vlict1", 0x9f, 0x48);
loadActorAnim2(OBJECT_GUARD, "kgstnd", 0xdc, 0x6a);
loadActorAnim2(OBJECT_QUETZECOATL, "qteleg", 0x10e, 0xaa);
@@ -97,19 +97,19 @@ void Room::trial0Tick40() {
}
void Room::trial0Timer0Expired() { // Doesn't do anything?
- _vm->_awayMission.timers[0] = getRandomWordInRange(180, 600);
+ _awayMission->timers[0] = getRandomWordInRange(180, 600);
}
void Room::trial0WalkToRoomCenter() {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewmanC(OBJECT_KIRK, 0xa0, 0xaa, &Room::trial0ReachedRoomCenter);
}
void Room::trial0ReachedRoomCenter() {
bool gaveUp = false;
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_VLICT, TX_TRI0_053);
const TextRef choices1[] = {
@@ -137,7 +137,7 @@ void Room::trial0ReachedRoomCenter() {
showText(TX_SPEAKER_VLICT, TX_TRI0_061);
showText(TX_SPEAKER_KIRK, TX_TRI0_001);
showText(TX_SPEAKER_VLICT, TX_TRI0_060);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(1, 4);
} else if (choice == 1) { // "This trial is a mockery"
showText(TX_SPEAKER_VLICT, TX_TRI0_048);
@@ -179,11 +179,11 @@ void Room::trial0ReachedRoomCenter() {
if (choice == 0 || choice == 1) {
showText(TX_SPEAKER_VLICT, TX_TRI0_055);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(1, 4);
} else { // choice == 2
showText(TX_SPEAKER_VLICT, TX_TRI0_045);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(1, 4);
}
} else // choice == 2
@@ -197,10 +197,10 @@ void Room::trial0ReachedRoomCenter() {
playMidiMusicTracks(2, -1);
showText(TX_SPEAKER_VLICT, TX_TRI0_049);
showText(TX_SPEAKER_VLICT, TX_TRI0_044);
- _vm->_awayMission.trial.missionEndMethod = 0;
+ _awayMission->trial.missionEndMethod = 0;
// FIXME: Are these parameters in the right order?
- endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 0);
+ endMission(_awayMission->trial.missionScore, _awayMission->trial.field2b, 0);
}
}
diff --git a/engines/startrek/rooms/trial1.cpp b/engines/startrek/rooms/trial1.cpp
index 3fccb3b45f..8ff3784dac 100644
--- a/engines/startrek/rooms/trial1.cpp
+++ b/engines/startrek/rooms/trial1.cpp
@@ -170,20 +170,20 @@ extern const int trial1NumActions = sizeof(trial1ActionList) / sizeof(RoomAction
void Room::trial1Tick1() {
- if (!_vm->_awayMission.trial.doorOpen) {
- _vm->_awayMission.disableInput = 2;
+ if (!_awayMission->trial.doorOpen) {
+ _awayMission->disableInput = 2;
loadActorAnim2(OBJECT_DOOR, "t1drc");
}
- if (!_vm->_awayMission.trial.entityDefeated) {
+ if (!_awayMission->trial.entityDefeated) {
loadActorAnim2(OBJECT_ENTITY, "ec", 0x5f, 0xb1, 3); // No callback defined
playVoc("TRI1LOOP");
}
}
void Room::trial1Tick50() {
- if (!_vm->_awayMission.trial.doorOpen)
- _vm->_awayMission.disableInput = false;
- if (!_vm->_awayMission.trial.entityDefeated) {
+ if (!_awayMission->trial.doorOpen)
+ _awayMission->disableInput = false;
+ if (!_awayMission->trial.entityDefeated) {
showText(TX_SPEAKER_BENNIE, TX_TRI1_056);
showText(TX_SPEAKER_SPOCK, TX_TRI1_047);
showText(TX_SPEAKER_MCCOY, TX_TRI1_032);
@@ -195,14 +195,14 @@ void Room::trial1Tick50() {
}
void Room::trial1DoorOpened() { // Called after Spock opens the door
- _vm->_awayMission.trial.doorOpen = true;
+ _awayMission->trial.doorOpen = true;
loadActorStandAnim(OBJECT_DOOR);
}
void Room::trial1TouchedHotspot0() { // Kirk touched the energy thing
- if (!_vm->_awayMission.trial.entityDefeated) {
+ if (!_awayMission->trial.entityDefeated) {
// BUGFIX: Disable input, otherwise you can cancel the death
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "kkills", -1, -1, &Room::trial1KirkDied);
}
}
@@ -212,29 +212,29 @@ void Room::trial1KirkDied() {
}
void Room::trial1TouchedHotspot1() { // Entered the door
- if (_vm->_awayMission.trial.doorOpen) {
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->trial.doorOpen) {
+ _awayMission->disableInput = true;
loadRoomIndex(2, 2);
}
}
void Room::trial1GetRod() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xe9, 0xa9, &Room::trial1ReachedRod);
}
void Room::trial1ReachedRod() {
loadActorAnimC(OBJECT_KIRK, "t1pkup", 0xe9, 0xa9, &Room::trial1PickedUpRod);
giveItem(OBJECT_IWROD);
- if (!_vm->_awayMission.trial.gotPointsForGettingRod) {
- _vm->_awayMission.trial.gotPointsForGettingRod = true;
- _vm->_awayMission.trial.missionScore += 1;
+ if (!_awayMission->trial.gotPointsForGettingRod) {
+ _awayMission->trial.gotPointsForGettingRod = true;
+ _awayMission->trial.missionScore += 1;
}
}
void Room::trial1PickedUpRod() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::trial1LookAtKirk() {
@@ -316,8 +316,8 @@ void Room::trial1UsePhaserOnWall() {
void Room::trial1UseStunPhaserOnFloor() {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewmanC(OBJECT_KIRK, 0xca, 0xbc, &Room::trial1ReachedFloorToUseStunPhaser);
}
@@ -327,15 +327,15 @@ void Room::trial1ReachedFloorToUseStunPhaser() {
}
void Room::trial1DoneShootingFloorWithStunPhaser() {
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = false;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
loadActorStandAnim(OBJECT_KIRK);
}
void Room::trial1UseKillPhaserOnFloor() {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewmanC(OBJECT_KIRK, 0xca, 0xbc, &Room::trial1ReachedFloorToUseKillPhaser);
}
@@ -348,12 +348,12 @@ void Room::trial1DoneShootingFloorWithKillPhaser() {
showText(TX_TRI1N014);
loadActorAnim2(OBJECT_MOLTEN_ROCK, "t1mltd", 0xca, 0xbc);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
loadActorStandAnim(OBJECT_KIRK);
// BUG: Infinite score mechanism
- _vm->_awayMission.trial.missionScore += 1;
- _vm->_awayMission.disableInput = false;
+ _awayMission->trial.missionScore += 1;
+ _awayMission->disableInput = false;
}
void Room::trial1UsePhaserOnRod() {
@@ -397,7 +397,7 @@ void Room::trial1UseSTricorderOnEntity() {
spockScan(DIR_S, TX_TRI1_012, true);
// BUG: infinite score mechanism
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.missionScore += 1;
}
void Room::trial1UseSTricorderOnRods() {
@@ -408,7 +408,7 @@ void Room::trial1UseSTricorderOnFloor() {
spockScan(DIR_S, TX_TRI1_042, true);
// BUG: infinite score mechanism
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.missionScore += 1;
}
void Room::trial1UseSTricorderOnDoor() {
@@ -418,15 +418,15 @@ void Room::trial1UseSTricorderOnDoor() {
void Room::trial1UseSTricorderOnLock() {
spockScan(DIR_S, TX_TRI1_014, true);
- if (!_vm->_awayMission.trial.scannedLock) {
- _vm->_awayMission.trial.scannedLock = true;
+ if (!_awayMission->trial.scannedLock) {
+ _awayMission->trial.scannedLock = true;
// BUGFIX: Moved this into the if statement (used to be an infinite score mechanism)
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.missionScore += 1;
}
}
void Room::trial1UseCommunicator() {
- if (_vm->_awayMission.trial.forceFieldDown) {
+ if (_awayMission->trial.forceFieldDown) {
showText(TX_SPEAKER_UHURA, TX_TRI1U090);
const TextRef choices[] = {
@@ -437,22 +437,22 @@ void Room::trial1UseCommunicator() {
int choice = showText(choices);
if (choice == 0) { // "Beam us back to the enterprise"
- _vm->_awayMission.trial.missionEndMethod = 1;
+ _awayMission->trial.missionEndMethod = 1;
endMission(1, 1, 1);
} else if (choice == 1) { // "Beam us to Vlict's position"
showText(TX_SPEAKER_UHURA, TX_TRI1U080);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(4, 4);
} // Else don't transport anywhere
} else { // Force field still up
- if (_vm->_awayMission.trial.uhuraAnalyzedCode)
+ if (_awayMission->trial.uhuraAnalyzedCode)
showText(TX_SPEAKER_UHURA, TX_TRI1U068);
else {
showText(TX_SPEAKER_UHURA, TX_TRI1U086);
showText(TX_SPEAKER_UHURA, TX_TRI1U106);
showText(TX_SPEAKER_UHURA, TX_TRI1U098);
- if (_vm->_awayMission.trial.scannedLock) {
+ if (_awayMission->trial.scannedLock) {
showText(TX_SPEAKER_KIRK, TX_TRI1_011);
showText(TX_SPEAKER_UHURA, TX_TRI1U101);
@@ -465,9 +465,9 @@ void Room::trial1UseCommunicator() {
if (choice == 0) { // Don't analyze the anomolous program
showText(TX_SPEAKER_UHURA, TX_TRI1U079);
- _vm->_awayMission.trial.doorCodeBehaviour = 2;
- _vm->_awayMission.trial.uhuraAnalyzedCode = true;
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.doorCodeBehaviour = 2;
+ _awayMission->trial.uhuraAnalyzedCode = true;
+ _awayMission->trial.missionScore += 1;
} else { // Analyze the anomolous program
showText(TX_SPEAKER_UHURA, TX_TRI1U102);
@@ -480,14 +480,14 @@ void Room::trial1UseCommunicator() {
if (choice == 0) { // Activate the program
showText(TX_SPEAKER_UHURA, TX_TRI1U095);
- _vm->_awayMission.trial.doorCodeBehaviour = 5;
- _vm->_awayMission.trial.uhuraAnalyzedCode = true;
- _vm->_awayMission.trial.missionScore += 3;
+ _awayMission->trial.doorCodeBehaviour = 5;
+ _awayMission->trial.uhuraAnalyzedCode = true;
+ _awayMission->trial.missionScore += 3;
} else { // Don't activate, only open the door
showText(TX_SPEAKER_UHURA, TX_TRI1U079);
- _vm->_awayMission.trial.doorCodeBehaviour = 2;
- _vm->_awayMission.trial.uhuraAnalyzedCode = true;
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.doorCodeBehaviour = 2;
+ _awayMission->trial.uhuraAnalyzedCode = true;
+ _awayMission->trial.missionScore += 1;
}
}
}
@@ -500,9 +500,9 @@ void Room::trial1UseMccoyOnEntity() {
}
void Room::trial1UseMccoyOnLock() {
- if (!_vm->_awayMission.trial.entityDefeated)
+ if (!_awayMission->trial.entityDefeated)
showText(TX_SPEAKER_MCCOY, TX_TRI1_018);
- else if (_vm->_awayMission.trial.doorCodeBehaviour == 0)
+ else if (_awayMission->trial.doorCodeBehaviour == 0)
showText(TX_SPEAKER_MCCOY, TX_TRI1_020);
else
showText(TX_SPEAKER_MCCOY, TX_TRI1_029);
@@ -518,13 +518,13 @@ void Room::trial1UseSpockOnEntity() {
void Room::trial1UseSpockOnLock() {
- if (_vm->_awayMission.trial.doorOpen)
+ if (_awayMission->trial.doorOpen)
showText(TX_SPEAKER_SPOCK, TX_TRI1_038);
- else if (!_vm->_awayMission.trial.entityDefeated)
+ else if (!_awayMission->trial.entityDefeated)
showText(TX_SPEAKER_SPOCK, TX_TRI1_036);
- else if (_vm->_awayMission.trial.doorCodeBehaviour == 0)
+ else if (_awayMission->trial.doorCodeBehaviour == 0)
showText(TX_SPEAKER_SPOCK, TX_TRI1_044);
- else if (_vm->_awayMission.trial.doorCodeBehaviour == 2)
+ else if (_awayMission->trial.doorCodeBehaviour == 2)
walkCrewmanC(OBJECT_SPOCK, 0x1f, 0xb8, &Room::trial1SpockReachedKeypad);
else
walkCrewmanC(OBJECT_SPOCK, 0x1f, 0xb8, &Room::trial1SpockReachedKeypadWithExtraProgram);
@@ -536,11 +536,11 @@ void Room::trial1SpockReachedKeypad() { // Spock opens the door
}
void Room::trial1SpockUsedKeypad() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
loadActorStandAnim(OBJECT_SPOCK);
playSoundEffectIndex(SND_DOOR1);
loadActorAnimC(OBJECT_DOOR, "t1drco", -1, -1, &Room::trial1DoorOpened);
- _vm->_awayMission.trial.doorOpen = true;
+ _awayMission->trial.doorOpen = true;
}
void Room::trial1SpockReachedKeypadWithExtraProgram() { // Spock activates the unknown program
@@ -549,10 +549,10 @@ void Room::trial1SpockReachedKeypadWithExtraProgram() { // Spock activates the u
}
void Room::trial1SpockUsedKeypadWithExtraProgram() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
loadActorStandAnim(OBJECT_SPOCK);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(5, 5);
}
@@ -567,13 +567,13 @@ void Room::trial1UseRedshirtOnEntity() {
void Room::trial1UseRedshirtOnLock() {
- if (_vm->_awayMission.trial.doorOpen)
+ if (_awayMission->trial.doorOpen)
return;
- else if (!_vm->_awayMission.trial.entityDefeated)
+ else if (!_awayMission->trial.entityDefeated)
showText(TX_SPEAKER_BENNIE, TX_TRI1_051);
- else if (_vm->_awayMission.trial.doorCodeBehaviour == 0)
+ else if (_awayMission->trial.doorCodeBehaviour == 0)
showText(TX_SPEAKER_BENNIE, TX_TRI1_054);
- else if (_vm->_awayMission.trial.doorCodeBehaviour == 2)
+ else if (_awayMission->trial.doorCodeBehaviour == 2)
walkCrewmanC(OBJECT_REDSHIRT, 0x1f, 0xb8, &Room::trial1RedshirtReachedKeypad);
else
walkCrewmanC(OBJECT_REDSHIRT, 0x1f, 0xb8, &Room::trial1RedshirtReachedKeypadWithExtraProgram);
@@ -585,11 +585,11 @@ void Room::trial1RedshirtReachedKeypad() { // Redshirt opens the lock
}
void Room::trial1RedshirtUsedKeypad() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
loadActorStandAnim(OBJECT_REDSHIRT);
playSoundEffectIndex(SND_DOOR1);
loadActorAnimC(OBJECT_DOOR, "t1drco", -1, -1, &Room::trial1DoorOpened);
- _vm->_awayMission.trial.doorOpen = true;
+ _awayMission->trial.doorOpen = true;
}
void Room::trial1RedshirtReachedKeypadWithExtraProgram() {
@@ -598,10 +598,10 @@ void Room::trial1RedshirtReachedKeypadWithExtraProgram() {
}
void Room::trial1RedshirtUsedKeypadWithExtraProgram() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_W;
loadActorStandAnim(OBJECT_REDSHIRT);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(5, 5);
}
@@ -630,7 +630,7 @@ void Room::trial1UseRodOnFloorOrWall() {
void Room::trial1UseWoodRodOnEntity() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xe9, 0xad, &Room::trial1ReachedPositionToThrowWoodRod);
loseItem(OBJECT_IWROD);
}
@@ -640,7 +640,7 @@ void Room::trial1ReachedPositionToThrowWoodRod() {
}
void Room::trial1DoneThrowingWoodRod() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
@@ -650,7 +650,7 @@ void Room::trial1UseWoodRodOnLock() {
void Room::trial1UseWoodRodOnMoltenRock() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xe4, 0xc4, &Room::trial1ReachedMoltenRock);
}
@@ -659,22 +659,22 @@ void Room::trial1ReachedMoltenRock() {
}
void Room::trial1DoneCoatingWoodRod() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showText(TX_TRI1N013);
loseItem(OBJECT_IWROD);
giveItem(OBJECT_IIROD);
- if (!_vm->_awayMission.trial.gotPointsForCoatingRodWithIron) {
- _vm->_awayMission.trial.gotPointsForCoatingRodWithIron = true;
- _vm->_awayMission.trial.missionScore += 1;
+ if (!_awayMission->trial.gotPointsForCoatingRodWithIron) {
+ _awayMission->trial.gotPointsForCoatingRodWithIron = true;
+ _awayMission->trial.missionScore += 1;
}
}
void Room::trial1UseIronRodOnEntity() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xe9, 0xac, &Room::trial1ReachedPositionToThrowIronRod);
- _vm->_awayMission.trial.entityDefeated = true;
+ _awayMission->trial.entityDefeated = true;
loseItem(OBJECT_IIROD);
}
@@ -686,15 +686,15 @@ void Room::trial1ReachedPositionToThrowIronRod() {
void Room::trial1DoneThrowingIronRod() {
loadActorAnim(OBJECT_THROWN_IRON_ROD, "t1irod", 0xe9, 0xac, 8); // No callback defined
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
stopAllVocSounds();
showText(TX_SPEAKER_SPOCK, TX_TRI1_045);
showText(TX_SPEAKER_MCCOY, TX_TRI1_033);
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.missionScore += 1;
}
@@ -707,7 +707,7 @@ void Room::trial1GetThrownIronRod() {
}
void Room::trial1WalkToDoor() {
- if (_vm->_awayMission.trial.doorOpen)
+ if (_awayMission->trial.doorOpen)
walkCrewman(OBJECT_KIRK, 0x1a, 0xac, 28);
}
diff --git a/engines/startrek/rooms/trial2.cpp b/engines/startrek/rooms/trial2.cpp
index a23be951a3..d9fc5e2f60 100644
--- a/engines/startrek/rooms/trial2.cpp
+++ b/engines/startrek/rooms/trial2.cpp
@@ -126,40 +126,40 @@ extern const int trial2NumActions = sizeof(trial2ActionList) / sizeof(RoomAction
void Room::trial2Tick1() {
playVoc("NOOOLOOP");
- if (!_vm->_awayMission.trial.enteredGlobRoom)
- _vm->_awayMission.disableInput = 2;
+ if (!_awayMission->trial.enteredGlobRoom)
+ _awayMission->disableInput = 2;
- if (!_vm->_awayMission.trial.globDefeated) {
+ if (!_awayMission->trial.globDefeated) {
playMidiMusicTracks(MIDITRACK_24, -1);
loadMapFile("trial22");
- if (!_vm->_awayMission.trial.globSplitInTwo) {
+ if (!_awayMission->trial.globSplitInTwo) {
playVoc("TRI2LOOP");
loadActorAnim2(OBJECT_GLOB, "sglob", 0x46, 0xaf);
- _vm->_awayMission.trial.globEnergyLevels[0] = 1;
+ _awayMission->trial.globEnergyLevels[0] = 1;
} else {
playVoc("TRI2LOOP");
loadActorAnim2(OBJECT_SPLIT_GLOB_1, "sglob", 0x20, 0xaf);
loadActorAnim2(OBJECT_SPLIT_GLOB_2, "sglob", 0x69, 0xaf);
- _vm->_awayMission.trial.globEnergyLevels[1] = 1;
- _vm->_awayMission.trial.globEnergyLevels[2] = 1;
+ _awayMission->trial.globEnergyLevels[1] = 1;
+ _awayMission->trial.globEnergyLevels[2] = 1;
}
}
}
void Room::trial2Tick60() {
- if (!_vm->_awayMission.trial.enteredGlobRoom) {
- _vm->_awayMission.disableInput = false;
+ if (!_awayMission->trial.enteredGlobRoom) {
+ _awayMission->disableInput = false;
showText(TX_SPEAKER_BENNIE, TX_TRI2_034);
showText(TX_SPEAKER_KIRK, TX_TRI2_005);
showText(TX_SPEAKER_SPOCK, TX_TRI2_030);
showText(TX_SPEAKER_KIRK, TX_TRI2_008);
- _vm->_awayMission.trial.enteredGlobRoom = true;
+ _awayMission->trial.enteredGlobRoom = true;
}
}
void Room::trial2TouchedHotspot0() { // This is unused
- if (_vm->_awayMission.trial.globEnergyLevels[1] != 0 || _vm->_awayMission.trial.globEnergyLevels[2] != 0)
+ if (_awayMission->trial.globEnergyLevels[1] != 0 || _awayMission->trial.globEnergyLevels[2] != 0)
showText(TX_SPEAKER_SPOCK, TX_TRI2_024);
}
@@ -224,7 +224,7 @@ void Room::trial2UsePhaserOnGlob(int object, bool phaserOnKill) {
_roomVar.trial.globBeingShot = object;
_roomVar.trial.phaserOnKill = phaserOnKill;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewmanC(OBJECT_KIRK, 0xcd, 0xc5, &Room::trial2ReachedPositionToShootGlob);
}
@@ -246,7 +246,7 @@ void Room::trial2DrewPhaserToShootGlob() {
int index = _roomVar.trial.globBeingShot - OBJECT_GLOB;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
playSoundEffectIndex(SND_PHASSHOT);
if (_roomVar.trial.phaserOnKill)
showBitmapFor5Ticks(killPhaserAnims[index], 5);
@@ -254,12 +254,12 @@ void Room::trial2DrewPhaserToShootGlob() {
showBitmapFor5Ticks(stunPhaserAnims[index], 5);
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
if (_roomVar.trial.phaserOnKill)
- _vm->_awayMission.trial.globEnergyLevels[index] += 2;
+ _awayMission->trial.globEnergyLevels[index] += 2;
else
- _vm->_awayMission.trial.globEnergyLevels[index] += 1;
+ _awayMission->trial.globEnergyLevels[index] += 1;
if (!(_roomVar.trial.globBeingShot == OBJECT_GLOB && _roomVar.trial.phaserOnKill == true)) {
if (_roomVar.trial.phaserOnKill)
@@ -275,10 +275,10 @@ void Room::trial2DrewPhaserToShootGlob() {
Common::Point(SPLIT_GLOB_2_X, SPLIT_GLOB_2_Y)
};
- if (_vm->_awayMission.trial.globEnergyLevels[index] == 3) {
+ if (_awayMission->trial.globEnergyLevels[index] == 3) {
playVoc("GLOBEDIV");
loadActorAnimC(_roomVar.trial.globBeingShot, "globsp", globPositions[index].x, globPositions[index].y, &Room::trial2GlobDoneSplitting);
- } else if (_vm->_awayMission.trial.globEnergyLevels[index] >= 4) {
+ } else if (_awayMission->trial.globEnergyLevels[index] >= 4) {
playSoundEffectIndex(SND_BLANK_14);
playVoc("REDBALL");
loadActorAnimC(_roomVar.trial.globBeingShot, "globex", globPositions[index].x, globPositions[index].y, &Room::trial2GlobDoneExploding);
@@ -289,9 +289,9 @@ void Room::trial2GlobDoneExploding() {
stopAllVocSounds();
playVoc("Noooloop");
showText(TX_SPEAKER_SPOCK, TX_TRI2_020);
- _vm->_awayMission.trial.globDefeated = true;
+ _awayMission->trial.globDefeated = true;
playMidiMusicTracks(MIDITRACK_28, -1);
- _vm->_awayMission.trial.missionScore += 1;
+ _awayMission->trial.missionScore += 1;
loadMapFile("trial2");
}
@@ -302,10 +302,10 @@ void Room::trial2GlobDoneSplitting() {
else {
// Unused code block: instead of killing the crew right away, the crew can
// interact with the split globs.
- _vm->_awayMission.trial.globEnergyLevels[0] = 0;
- _vm->_awayMission.trial.globEnergyLevels[1] = 1;
- _vm->_awayMission.trial.globEnergyLevels[2] = 1;
- _vm->_awayMission.trial.globSplitInTwo = true;
+ _awayMission->trial.globEnergyLevels[0] = 0;
+ _awayMission->trial.globEnergyLevels[1] = 1;
+ _awayMission->trial.globEnergyLevels[2] = 1;
+ _awayMission->trial.globSplitInTwo = true;
loadActorAnim2(OBJECT_SPLIT_GLOB_1, "sglob", SPLIT_GLOB_1_X, SPLIT_GLOB_1_Y);
loadActorAnim2(OBJECT_SPLIT_GLOB_2, "sglob", SPLIT_GLOB_2_X, SPLIT_GLOB_2_Y);
loadActorStandAnim(OBJECT_GLOB);
@@ -322,7 +322,7 @@ void Room::trial2GlobDoneSplitting() {
// Everyone gets vaporized
playVoc("V7ALLGET");
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
playMidiMusicTracks(MIDITRACK_26, -1);
loadActorAnimC(OBJECT_KIRK, "kkills", -1, -1, &Room::trial2KirkDied);
loadActorAnim2(OBJECT_SPOCK, "skills");
@@ -331,7 +331,7 @@ void Room::trial2GlobDoneSplitting() {
}
void Room::trial2KirkDied() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
showGameOverMenu();
}
@@ -378,9 +378,9 @@ void Room::trial2UseMTricorderOnRedshirt() {
void Room::trial2UseMTricorderOnGlob() {
mccoyScan(DIR_S, TX_TRI2_011, true);
- if (!_vm->_awayMission.trial.gotPointsForScanningGlob) {
- _vm->_awayMission.trial.gotPointsForScanningGlob = true;
- _vm->_awayMission.trial.missionScore += 1;
+ if (!_awayMission->trial.gotPointsForScanningGlob) {
+ _awayMission->trial.gotPointsForScanningGlob = true;
+ _awayMission->trial.missionScore += 1;
}
}
@@ -395,14 +395,14 @@ void Room::trial2UseSTricorderAnywhere() {
void Room::trial2UseSTricorderOnGlob() {
spockScan(DIR_S, TX_TRI2_026, true);
- if (!_vm->_awayMission.trial.gotPointsForScanningGlob) {
- _vm->_awayMission.trial.gotPointsForScanningGlob = true;
- _vm->_awayMission.trial.missionScore += 1;
+ if (!_awayMission->trial.gotPointsForScanningGlob) {
+ _awayMission->trial.gotPointsForScanningGlob = true;
+ _awayMission->trial.missionScore += 1;
}
}
void Room::trial2UseCommunicator() {
- if (_vm->_awayMission.trial.forceFieldDown) { // TODO: Refactor this between rooms?
+ if (_awayMission->trial.forceFieldDown) { // TODO: Refactor this between rooms?
showText(TX_SPEAKER_UHURA, TX_TRI2U091);
const TextRef choices[] = {
@@ -413,18 +413,18 @@ void Room::trial2UseCommunicator() {
int choice = showText(choices);
if (choice == 0) { // "Beam us back to the enterprise"
- _vm->_awayMission.trial.missionEndMethod = 1;
- endMission(_vm->_awayMission.trial.missionScore, 1, 1); // FIXME: Inconsistent with TRIAL1
+ _awayMission->trial.missionEndMethod = 1;
+ endMission(_awayMission->trial.missionScore, 1, 1); // FIXME: Inconsistent with TRIAL1
} else if (choice == 1) { // "Beam us to Vlict's position"
showText(TX_SPEAKER_UHURA, TX_TRI1U080); // NOTE: Original didn't show text here
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadRoomIndex(4, 4);
} // Else don't transport anywhere
} else { // Force field still up
showText(TX_SPEAKER_UHURA, TX_TRI2U087);
showText(TX_SPEAKER_KIRK, TX_TRI2_006);
showText(TX_SPEAKER_UHURA, TX_TRI2U104);
- if (!_vm->_awayMission.trial.globDefeated) {
+ if (!_awayMission->trial.globDefeated) {
showText(TX_SPEAKER_UHURA, TX_TRI2U081);
showText(TX_SPEAKER_KIRK, TX_TRI2_002);
}
diff --git a/engines/startrek/rooms/trial3.cpp b/engines/startrek/rooms/trial3.cpp
index a37bd625f2..49ac5bd09c 100644
--- a/engines/startrek/rooms/trial3.cpp
+++ b/engines/startrek/rooms/trial3.cpp
@@ -97,17 +97,17 @@ extern const int trial3NumActions = sizeof(trial3ActionList) / sizeof(RoomAction
void Room::trial3Tick1() {
playVoc("TRI3LOOP");
- if (!_vm->_awayMission.trial.enteredTrial3FirstTime) {
- _vm->_awayMission.disableWalking = true;
- _vm->_awayMission.disableInput = 2;
+ if (!_awayMission->trial.enteredTrial3FirstTime) {
+ _awayMission->disableWalking = true;
+ _awayMission->disableInput = 2;
}
playMidiMusicTracks(MIDITRACK_33, -1);
}
void Room::trial3Tick30() {
- if (!_vm->_awayMission.trial.enteredTrial3FirstTime) {
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.trial.enteredTrial3FirstTime = true;
+ if (!_awayMission->trial.enteredTrial3FirstTime) {
+ _awayMission->disableInput = false;
+ _awayMission->trial.enteredTrial3FirstTime = true;
showText(TX_SPEAKER_BENNIE, TX_TRI3_030);
showText(TX_SPEAKER_KIRK, TX_TRI3_005);
@@ -134,13 +134,13 @@ void Room::trial3Klingon3BeamedIn() {
}
void Room::trial3KlingonShootsSomeone1() {
- _vm->_awayMission.trial.klingonShootIndex++;
- if (_vm->_awayMission.trial.klingonShootIndex == 1) {
+ _awayMission->trial.klingonShootIndex++;
+ if (_awayMission->trial.klingonShootIndex == 1) {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3phas04", 5);
loadActorAnimC(OBJECT_REDSHIRT, "rkillw", -1, -1, &Room::trial3RedshirtDoneDying);
- _vm->_awayMission.redshirtDead = true;
- } else if (_vm->_awayMission.trial.klingonShootIndex == 2) {
+ _awayMission->redshirtDead = true;
+ } else if (_awayMission->trial.klingonShootIndex == 2) {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3phas05", 5);
playMidiMusicTracks(MIDITRACK_2, -1);
@@ -166,13 +166,13 @@ void Room::trial3Klingon3DoneShooting() {
void Room::trial3KlingonShootsSomeone2() {
// This function is almost exactly identical to "trial3KlingonShootsSomeone1(), just
// one line differs...
- _vm->_awayMission.trial.klingonShootIndex++;
- if (_vm->_awayMission.trial.klingonShootIndex == 1) {
+ _awayMission->trial.klingonShootIndex++;
+ if (_awayMission->trial.klingonShootIndex == 1) {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3phas04", 5);
loadActorAnimC(OBJECT_REDSHIRT, "rkillw", -1, -1, &Room::trial3RedshirtDoneDying);
- _vm->_awayMission.redshirtDead = true;
- } else if (_vm->_awayMission.trial.klingonShootIndex == 2) {
+ _awayMission->redshirtDead = true;
+ } else if (_awayMission->trial.klingonShootIndex == 2) {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3phas05", 5);
// NOTE: Only difference to "trial3KlingonShootsSomeone1" is this doesn't play a midi track?
@@ -181,7 +181,7 @@ void Room::trial3KlingonShootsSomeone2() {
}
void Room::trial3RedshirtDoneDying() {
- _vm->_awayMission.redshirtDead = true;
+ _awayMission->redshirtDead = true;
}
void Room::trial3KirkDoneDying() {
@@ -189,31 +189,31 @@ void Room::trial3KirkDoneDying() {
}
void Room::trial3Klingon1Shot() {
- _vm->_awayMission.trial.shotKlingons |= 1;
+ _awayMission->trial.shotKlingons |= 1;
trial3CheckShowUhuraText();
}
void Room::trial3Klingon2Shot() {
- _vm->_awayMission.trial.shotKlingons |= 2;
+ _awayMission->trial.shotKlingons |= 2;
trial3CheckShowUhuraText();
}
void Room::trial3Klingon3Shot() {
- _vm->_awayMission.trial.shotKlingons |= 4;
+ _awayMission->trial.shotKlingons |= 4;
trial3CheckShowUhuraText();
}
void Room::trial3CheckShowUhuraText() {
- if (_vm->_awayMission.trial.shotKlingons == 1) {
- _vm->_awayMission.trial.shotKlingons |= 8;
- _vm->_awayMission.disableWalking = false;
+ if (_awayMission->trial.shotKlingons == 1) {
+ _awayMission->trial.shotKlingons |= 8;
+ _awayMission->disableWalking = false;
loadActorStandAnim(OBJECT_KIRK);
showText(TX_SPEAKER_UHURA, TX_TRI3U084);
showText(TX_SPEAKER_KIRK, TX_TRI3_007);
showText(TX_SPEAKER_UHURA, TX_TRI3U099);
- _vm->_awayMission.trial.forceFieldDown = true;
+ _awayMission->trial.forceFieldDown = true;
const TextRef choices[] = {
TX_SPEAKER_KIRK,
@@ -224,7 +224,7 @@ void Room::trial3CheckShowUhuraText() {
if (choice == 0) { // Don't beam out
} else if (choice == 1) { // Beam to enterprise
- endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 1); // FIXME: inconsistent
+ endMission(_awayMission->trial.missionScore, _awayMission->trial.field2b, 1); // FIXME: inconsistent
} else if (choice == 2) { // Beam to Vlict
trial3BeamToVlict();
}
@@ -232,19 +232,19 @@ void Room::trial3CheckShowUhuraText() {
}
void Room::trial3CrewmanBeamedOut() {
- if (!_vm->_awayMission.trial.gotPointsForBeamingOut) {
- _vm->_awayMission.trial.gotPointsForBeamingOut = true;
- _vm->_awayMission.trial.missionScore += 2; // BUG: Doesn't happen when done in other rooms
+ if (!_awayMission->trial.gotPointsForBeamingOut) {
+ _awayMission->trial.gotPointsForBeamingOut = true;
+ _awayMission->trial.missionScore += 2; // BUG: Doesn't happen when done in other rooms
}
loadRoomIndex(4, 4);
}
void Room::trial3Tick90() {
- if ((!(_vm->_awayMission.trial.shotKlingons & 8) && _vm->_awayMission.trial.shotKlingonState != 20)) {
+ if ((!(_awayMission->trial.shotKlingons & 8) && _awayMission->trial.shotKlingonState != 20)) {
playSoundEffectIndex(SND_TRANSMAT);
playMidiMusicTracks(MIDITRACK_32, -1);
loadActorAnimC(OBJECT_KLINGON_1, "t3ktel", 0x57, 0xb1, &Room::trial3Klingon1BeamedIn);
- _vm->_awayMission.trial.shotKlingonState = 21;
+ _awayMission->trial.shotKlingonState = 21;
}
}
@@ -308,19 +308,19 @@ void Room::trial3UseStunPhaserOnKlingon1() {
// he's conscious (21).
// There's also the "dead" state (23) to consider. This prevents a softlock if
// a phaser is used on him just as he's being vaporized.
- if (_vm->_awayMission.trial.shotKlingonState == 21) {
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->trial.shotKlingonState == 21) {
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "kdraww", -1, -1, &Room::trial3ReadyToShootKlingon1OnStun);
}
}
void Room::trial3ReadyToShootKlingon1OnStun() {
- if (_vm->_awayMission.trial.shotKlingonState == 21) {
+ if (_awayMission->trial.shotKlingonState == 21) {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3phas00", 5);
loadActorAnimC(OBJECT_KLINGON_1, "t3kstn", -1, -1, &Room::trial3Klingon1Shot);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.trial.shotKlingonState = 22;
+ _awayMission->disableInput = false;
+ _awayMission->trial.shotKlingonState = 22;
}
}
@@ -328,20 +328,20 @@ void Room::trial3UseKillPhaserOnKlingon1() {
// BUGFIX: Prevent softlock by checking that he's conscious (shotKlingonState == 21)
// In addition to preventing the softlock mentioned above, this also prevents
// a softlock where a kill phaser is used on the unconscious klingon.
- if (_vm->_awayMission.trial.shotKlingonState == 21) {
- _vm->_awayMission.disableInput = true;
+ if (_awayMission->trial.shotKlingonState == 21) {
+ _awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "kdraww", -1, -1, &Room::trial3ReadyToShootKlingon1OnKill);
}
}
void Room::trial3ReadyToShootKlingon1OnKill() {
- if (_vm->_awayMission.trial.shotKlingonState == 21) {
+ if (_awayMission->trial.shotKlingonState == 21) {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3phas02", 5);
loadActorAnimC(OBJECT_KLINGON_1, "t3kdie", -1, -1, &Room::trial3Klingon1Shot);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.trial.shotKlingonState = 23;
- _vm->_awayMission.trial.missionScore -= 3; // Penalty for killing klingon
+ _awayMission->disableInput = false;
+ _awayMission->trial.shotKlingonState = 23;
+ _awayMission->trial.missionScore -= 3; // Penalty for killing klingon
}
}
@@ -379,15 +379,15 @@ void Room::trial3UseSTricorderOnExit() {
}
void Room::trial3UseMTricorderOnKlingon() {
- if (_vm->_awayMission.trial.shotKlingonState == 22) { // Unconscious
+ if (_awayMission->trial.shotKlingonState == 22) { // Unconscious
mccoyScan(DIR_S, TX_TRI3_011);
- if (!_vm->_awayMission.redshirtDead) // BUGFIX: Check if redshirt is dead
+ if (!_awayMission->redshirtDead) // BUGFIX: Check if redshirt is dead
showText(TX_SPEAKER_BENNIE, TX_TRI3_028);
}
}
void Room::trial3UseCommunicator() {
- if (_vm->_awayMission.trial.forceFieldDown) {
+ if (_awayMission->trial.forceFieldDown) {
showText(TX_SPEAKER_UHURA, TX_TRI3U089);
const TextRef choices[] = {
@@ -398,8 +398,8 @@ void Room::trial3UseCommunicator() {
int choice = showText(choices);
if (choice == 0) { // "Beam us back to the enterprise"
- _vm->_awayMission.trial.missionEndMethod = 1;
- endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 1); // FIXME: inconsistent
+ _awayMission->trial.missionEndMethod = 1;
+ endMission(_awayMission->trial.missionScore, _awayMission->trial.field2b, 1); // FIXME: inconsistent
} else if (choice == 1) { // "Beam us to Vlict's position"
trial3BeamToVlict();
} // Else don't transport anywhere
@@ -414,13 +414,13 @@ void Room::trial3BeamToVlict() {
// text from TRIAL1 instead.
showText(TX_SPEAKER_UHURA, TX_TRI1U080);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
playSoundEffectIndex(SND_TRANSDEM);
loadActorAnimC(OBJECT_KIRK, "kteled", -1, -1, &Room::trial3CrewmanBeamedOut);
loadActorAnimC(OBJECT_SPOCK, "steled", -1, -1, &Room::trial3CrewmanBeamedOut);
loadActorAnimC(OBJECT_MCCOY, "mteled", -1, -1, &Room::trial3CrewmanBeamedOut);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
loadActorAnimC(OBJECT_REDSHIRT, "rteled", -1, -1, &Room::trial3CrewmanBeamedOut);
}
diff --git a/engines/startrek/rooms/trial4.cpp b/engines/startrek/rooms/trial4.cpp
index 29e4fcf92e..b6de4d768e 100644
--- a/engines/startrek/rooms/trial4.cpp
+++ b/engines/startrek/rooms/trial4.cpp
@@ -180,8 +180,8 @@ void Room::trial4Tick60() {
}
showText(TX_SPEAKER_KIRK, TX_TRI4_012);
- _vm->_awayMission.trial.missionEndMethod = 2;
- endMission(_vm->_awayMission.trial.missionScore, _vm->_awayMission.trial.field2b, 2);
+ _awayMission->trial.missionEndMethod = 2;
+ endMission(_awayMission->trial.missionScore, _awayMission->trial.field2b, 2);
}
}
diff --git a/engines/startrek/rooms/trial5.cpp b/engines/startrek/rooms/trial5.cpp
index ecc3c64c2e..ec1111da3c 100644
--- a/engines/startrek/rooms/trial5.cpp
+++ b/engines/startrek/rooms/trial5.cpp
@@ -220,14 +220,14 @@ void Room::trial5VlictAppeared() {
if (choice == 1) { // "Now you can rot as you deserve"
showText(TX_SPEAKER_BIALBI, TX_TRI5_034);
- _vm->_awayMission.trial.missionEndMethod = 4;
- endMission(_vm->_awayMission.trial.missionScore, 1, 4);
+ _awayMission->trial.missionEndMethod = 4;
+ endMission(_awayMission->trial.missionScore, 1, 4);
} else if (choice == 2) { // "I'll intervene if Quetzecoatl goes free"
showText(TX_SPEAKER_VLICT, TX_TRI5_019);
playMidiMusicTracks(MIDITRACK_28, -1);
showText(TX_SPEAKER_BIALBI, TX_TRI5_025);
- _vm->_awayMission.trial.missionScore += 4;
+ _awayMission->trial.missionScore += 4;
showText(TX_SPEAKER_KIRK, TX_TRI5_004);
showText(TX_SPEAKER_BIALBI, TX_TRI5_030);
showText(TX_SPEAKER_BIALBI, TX_TRI5_026);
@@ -237,7 +237,7 @@ void Room::trial5VlictAppeared() {
showText(TX_SPEAKER_BIALBI, TX_TRI5_033);
showText(TX_SPEAKER_BIALBI, TX_TRI5_032);
- _vm->_awayMission.trial.missionEndMethod = 3;
+ _awayMission->trial.missionEndMethod = 3;
endMission(1, 1, 3); // FIXME: Are these parameters correct?
}
}
@@ -247,12 +247,12 @@ void Room::trial5WalkToInterface() {
}
void Room::trial5ReachedInterface() {
- if (!_vm->_awayMission.trial.neuralInterfaceActive)
+ if (!_awayMission->trial.neuralInterfaceActive)
showText(TX_SPEAKER_VOICE, TX_TRI5_035);
else {
showText(TX_SPEAKER_BIALBI, TX_TRI5_024);
loadActorAnimC(OBJECT_VLICT, "vlict1", 0xbe, 0x91, &Room::trial5VlictAppeared);
- _vm->_awayMission.trial.missionScore += 5;
+ _awayMission->trial.missionScore += 5;
playMidiMusicTracks(MIDITRACK_1, -1);
}
}
@@ -261,20 +261,20 @@ void Room::trial5GetGem(int16 item, int16 object) {
_roomVar.trial.itemToUse = item;
_roomVar.trial.objectToUse = object;
- _vm->_awayMission.disableInput = true;
- if (object == _vm->_awayMission.trial.holeContents[0]) {
- _vm->_awayMission.trial.holeContents[0] = 0;
- _vm->_awayMission.trial.neuralInterfaceActive = false;
+ _awayMission->disableInput = true;
+ if (object == _awayMission->trial.holeContents[0]) {
+ _awayMission->trial.holeContents[0] = 0;
+ _awayMission->trial.neuralInterfaceActive = false;
loadActorStandAnim(OBJECT_BEAM);
walkCrewmanC(OBJECT_KIRK, 0x2c, 0x9f, &Room::trial5ReachedGem);
- } else if (object == _vm->_awayMission.trial.holeContents[1]) {
- _vm->_awayMission.trial.holeContents[1] = 0;
- _vm->_awayMission.trial.neuralInterfaceActive = false;
+ } else if (object == _awayMission->trial.holeContents[1]) {
+ _awayMission->trial.holeContents[1] = 0;
+ _awayMission->trial.neuralInterfaceActive = false;
loadActorStandAnim(OBJECT_BEAM);
walkCrewmanC(OBJECT_KIRK, 0x22, 0x9f, &Room::trial5ReachedGem);
- } else if (object == _vm->_awayMission.trial.holeContents[2]) {
- _vm->_awayMission.trial.holeContents[2] = 0;
- _vm->_awayMission.trial.neuralInterfaceActive = false;
+ } else if (object == _awayMission->trial.holeContents[2]) {
+ _awayMission->trial.holeContents[2] = 0;
+ _awayMission->trial.neuralInterfaceActive = false;
loadActorStandAnim(OBJECT_BEAM);
walkCrewmanC(OBJECT_KIRK, 0x3c, 0x9f, &Room::trial5ReachedGem);
} else if (object == OBJECT_REDGEM1 || object == OBJECT_REDGEM2 || object == OBJECT_REDGEM3)
@@ -292,7 +292,7 @@ void Room::trial5ReachedGem() {
void Room::trial5PickedUpGem() {
giveItem(_roomVar.trial.itemToUse);
loadActorStandAnim(_roomVar.trial.objectToUse);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::trial5GetRedGem1() {
@@ -451,7 +451,7 @@ void Room::trial5UseGemOnHole(int16 item, int16 object, int16 hole) {
_roomVar.trial.objectToUse = object;
_roomVar.trial.hole = hole;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewmanC(OBJECT_KIRK, positions[hole].x, positions[hole].y, &Room::trial5ReachedHoleToPutGem);
}
@@ -473,8 +473,8 @@ void Room::trial5ReachedHoleToPutGem() {
loadActorAnim2(OBJECT_KIRK, "kusehn");
- if (_vm->_awayMission.trial.holeContents[hole] == 0) {
- _vm->_awayMission.trial.holeContents[hole] = _roomVar.trial.objectToUse;
+ if (_awayMission->trial.holeContents[hole] == 0) {
+ _awayMission->trial.holeContents[hole] = _roomVar.trial.objectToUse;
loadActorAnim2(_roomVar.trial.objectToUse, anim, pos.x, pos.y);
loseItem(_roomVar.trial.itemToUse);
@@ -490,7 +490,7 @@ void Room::trial5ReachedHoleToPutGem() {
holes[2] = 0;
for (int i = 0; i < 3; i++) {
- int16 c = _vm->_awayMission.trial.holeContents[i];
+ int16 c = _awayMission->trial.holeContents[i];
if (c >= OBJECT_REDGEM1 && c <= OBJECT_REDGEM3)
holes[i] = RED;
else if (c >= OBJECT_GRNGEM1 && c <= OBJECT_GRNGEM3)
@@ -537,11 +537,11 @@ void Room::trial5ReachedHoleToPutGem() {
playVoc("EFX12B");
showText(TX_SPEAKER_LIGHT_OF_KNOWLEDGE, TX_TRI5_040);
showText(TX_SPEAKER_LIGHT_OF_KNOWLEDGE, TX_TRI5_037);
- _vm->_awayMission.trial.neuralInterfaceActive = true;
+ _awayMission->trial.neuralInterfaceActive = true;
- if (!_vm->_awayMission.trial.gotPointsForActivatingInterface) {
- _vm->_awayMission.trial.gotPointsForActivatingInterface = true;
- _vm->_awayMission.trial.missionScore += 3;
+ if (!_awayMission->trial.gotPointsForActivatingInterface) {
+ _awayMission->trial.gotPointsForActivatingInterface = true;
+ _awayMission->trial.missionScore += 3;
}
} else if COMBO(GREEN, GREEN, BLUE) {
trial5RestrictedCombination1();
@@ -576,13 +576,13 @@ void Room::trial5ReachedHoleToPutGem() {
trial5ActivateLightOfTravel();
showText(TX_SPEAKER_LIGHT_OF_TRAVEL, TX_TRI5_046);
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
playSoundEffectIndex(SND_TRANSDEM);
loadActorAnimC(OBJECT_KIRK, "kteled", -1, -1, &Room::trial5CrewmanBeamedOut);
loadActorAnimC(OBJECT_SPOCK, "steled", -1, -1, &Room::trial5CrewmanBeamedOut);
loadActorAnimC(OBJECT_MCCOY, "mteled", -1, -1, &Room::trial5CrewmanBeamedOut);
- if (!_vm->_awayMission.redshirtDead)
+ if (!_awayMission->redshirtDead)
loadActorAnimC(OBJECT_REDSHIRT, "rteled", -1, -1, &Room::trial5CrewmanBeamedOut);
} else {
// Some holes are empty
@@ -626,9 +626,9 @@ void Room::trial5DestinationNoLongerExists() {
}
void Room::trial5CrewmanBeamedOut() {
- if (!_vm->_awayMission.trial.gotPointsForBeamingOut) {
- _vm->_awayMission.trial.gotPointsForBeamingOut = true;
- _vm->_awayMission.trial.missionScore += 1;
+ if (!_awayMission->trial.gotPointsForBeamingOut) {
+ _awayMission->trial.gotPointsForBeamingOut = true;
+ _awayMission->trial.missionScore += 1;
}
loadRoomIndex(4, 4);
}
diff --git a/engines/startrek/rooms/tug0.cpp b/engines/startrek/rooms/tug0.cpp
index 4461b226d5..640ecef6b4 100644
--- a/engines/startrek/rooms/tug0.cpp
+++ b/engines/startrek/rooms/tug0.cpp
@@ -28,16 +28,16 @@ void Room::tug0Tick1() {
playVoc("TUG0LOOP");
playMidiMusicTracks(0, -1);
- _vm->_awayMission.tug.field2b = 0x23;
- if (_vm->_awayMission.tug.transporterRepaired)
+ _awayMission->tug.field2b = 0x23;
+ if (_awayMission->tug.transporterRepaired)
loadActorAnim2(11, "t0con2", 0x105, 0xc2, 0);
- if (!_vm->_awayMission.tug.engineerConscious)
+ if (!_awayMission->tug.engineerConscious)
loadActorAnim2(8, "tcdown", 0x27, 0xa8, 0);
else {
loadActorAnim2(8, "tcupd", 0x27, 0xa8, 0);
- if (_vm->_awayMission.tug.gotTransmogrifier)
+ if (_awayMission->tug.gotTransmogrifier)
loadActorAnim2(9, "pempty", 0x27, 0xa9, 0);
else {
loadActorAnim2(9, "popend", 0x27, 0xa9, 0);
@@ -47,7 +47,7 @@ void Room::tug0Tick1() {
}
void Room::tug0LookAtEngineer() {
- if (_vm->_awayMission.tug.engineerConscious)
+ if (_awayMission->tug.engineerConscious)
showText(TX_TUG0N002);
else
showText(TX_TUG0N014);
@@ -58,15 +58,15 @@ void Room::tug0GetEngineer() {
}
void Room::tug0LookAtControls() {
- if (_vm->_awayMission.tug.transporterRepaired)
+ if (_awayMission->tug.transporterRepaired)
showText(TX_TUG0N012);
else
showText(TX_TUG0N001);
}
void Room::tug0UseSpockOnControls() {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0xdb, 0xc5, 16);
}
@@ -82,8 +82,8 @@ void Room::tug0SpockExaminedControls() {
showText(TX_SPEAKER_KIRK, TX_TUG0_013);
showText(TX_SPEAKER_SPOCK, TX_TUG0_038);
showText(TX_SPEAKER_KIRK, TX_TUG0_008);
- _vm->_awayMission.tug.spockExaminedTransporter = true;
- _vm->_awayMission.disableInput = false;
+ _awayMission->tug.spockExaminedTransporter = true;
+ _awayMission->disableInput = false;
}
void Room::tug0UseTransmogrifierWithoutBitOnControls() {
@@ -91,8 +91,8 @@ void Room::tug0UseTransmogrifierWithoutBitOnControls() {
}
void Room::tug0UseTransmogrifierWithBitOnControls() {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0xdb, 0xc5, 6);
}
@@ -104,9 +104,9 @@ void Room::tug0SpockReachedControlsWithTransmogrifier() {
void Room::tug0SpockFinishedUsingTransmogrifier() {
loseItem(OBJECT_IRTWB);
- _vm->_awayMission.tug.usedTransmogrifierOnTransporter = true;
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore++;
+ _awayMission->tug.usedTransmogrifierOnTransporter = true;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore++;
}
void Room::tug0TransporterScreenFullyLit() {
@@ -114,14 +114,14 @@ void Room::tug0TransporterScreenFullyLit() {
}
void Room::tug0UseWireScrapsOnControls() {
- if (_vm->_awayMission.tug.usedTransmogrifierOnTransporter)
+ if (_awayMission->tug.usedTransmogrifierOnTransporter)
showText(TX_SPEAKER_SPOCK, TX_TUG0_034);
}
void Room::tug0UseWireOnControls() {
- if (_vm->_awayMission.tug.usedTransmogrifierOnTransporter) {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ if (_awayMission->tug.usedTransmogrifierOnTransporter) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0xdb, 0xc5, 8);
}
}
@@ -131,26 +131,26 @@ void Room::tug0SpockReachedControlsWithWire() {
}
void Room::tug0SpockFinishedUsingWire() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loseItem(OBJECT_IWIRING);
- _vm->_awayMission.tug.missionScore++;
+ _awayMission->tug.missionScore++;
loadActorAnim2(11, "t0con1", 0x105, 0xc2, 22);
showText(TX_SPEAKER_SPOCK, TX_TUG0_039);
- _vm->_awayMission.tug.transporterRepaired = true;
+ _awayMission->tug.transporterRepaired = true;
showText(TX_SPEAKER_KIRK, TX_TUG0_010);
showText(TX_SPEAKER_MCCOY, TX_TUG0_022);
// BUGFIX: check if the redshirt is dead.
- if (!_vm->_awayMission.redshirtDead) {
+ if (!_awayMission->redshirtDead) {
showText(TX_SPEAKER_KIRK, TX_TUG0_002);
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L009);
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L008);
- if (_vm->_awayMission.tug.haveBomb) {
+ if (_awayMission->tug.haveBomb) {
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG0L010);
showText(TX_SPEAKER_MCCOY, TX_TUG0_021);
showText(TX_SPEAKER_SPOCK, TX_TUG0_041);
@@ -159,10 +159,10 @@ void Room::tug0SpockFinishedUsingWire() {
}
void Room::tug0UseMedkitOnEngineer() {
- if (_vm->_awayMission.tug.engineerConscious)
+ if (_awayMission->tug.engineerConscious)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
walkCrewman(OBJECT_MCCOY, 0x2d, 0xaf, 2);
}
@@ -172,24 +172,24 @@ void Room::tug0MccoyReachedEngineer() {
void Room::tug0MccoyHealedEngineer() {
loadActorAnim2(8, "tcup", 0x27, 0xa8, 1);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
walkCrewman(OBJECT_MCCOY, 0x41, 0xaf, 0);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore++;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore++;
}
void Room::tug0EngineerGotUp() {
showText(TX_SPEAKER_SIMPSON, TX_TUG0_F31);
- _vm->_awayMission.tug.engineerConscious = true;
+ _awayMission->tug.engineerConscious = true;
loadActorAnim2(8, "tcshow", 0x27, 0xa8, 0);
loadActorAnim2(9, "popen", 0x27, 0xa9, 0);
playVoc("MUR4E6S");
}
void Room::tug0GetTransmogrifier() {
- if (_vm->_awayMission.tug.gotTransmogrifier)
+ if (_awayMission->tug.gotTransmogrifier)
return;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x1e, 0xb1, 3);
}
@@ -198,16 +198,16 @@ void Room::tug0KirkReachedToolbox() {
}
void Room::tug0KirkGotTransmogrifier() {
- _vm->_awayMission.tug.gotTransmogrifier = true;
+ _awayMission->tug.gotTransmogrifier = true;
giveItem(OBJECT_IRT);
loadActorAnim2(9, "pempty", 0x27, 0xa9, 0);
loadActorStandAnim(OBJECT_KIRK);
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore++;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore++;
}
void Room::tug0LookAtToolbox() {
- if (_vm->_awayMission.tug.gotTransmogrifier)
+ if (_awayMission->tug.gotTransmogrifier)
showText(TX_TUG0N008);
else
showText(TX_TUG0N000);
@@ -220,7 +220,7 @@ void Room::tug0UsePhaserOnWelder() {
// BUGFIX: this following line didn't exist, despite it existing in TUG1; meaning this
// was supposed to give points, but it only did in a specific room.
- _vm->_awayMission.tug.missionScore += 3;
+ _awayMission->tug.missionScore += 3;
}
void Room::tug0UseWelderOnWireScraps() {
@@ -242,17 +242,17 @@ void Room::tug0UseCombBitOnTransmogrifier() {
}
void Room::tug0UseTransporter() {
- if (!_vm->_awayMission.tug.transporterRepaired)
+ if (!_awayMission->tug.transporterRepaired)
return;
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_S;
walkCrewman(OBJECT_KIRK, 0x62, 0x7f, 0);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0x11e, 0xc7, 14);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
walkCrewman(OBJECT_MCCOY, 0x7b, 0x7a, 0);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_S;
walkCrewman(OBJECT_REDSHIRT, 0x4a, 0x7b, 0);
}
@@ -264,7 +264,7 @@ void Room::tug0SpockReachedControlsToTransport() {
void Room::tug0SpockPreparedTransporter() {
showText(TX_SPEAKER_KIRK, TX_TUG0_001);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
walkCrewman(OBJECT_SPOCK, 0x9a, 0x7e, 20);
}
@@ -277,18 +277,18 @@ void Room::tug0SpockReachedTransporter() {
}
void Room::tug0FinishedTransporting() {
- _vm->_awayMission.tug.missionScore += 3;
- _vm->_awayMission.disableInput = true;
+ _awayMission->tug.missionScore += 3;
+ _awayMission->disableInput = true;
loadRoomIndex(3, 4);
}
void Room::tug0UseBombOnTransporter() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_KIRK, 0x62, 0x7f, 5);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
walkCrewman(OBJECT_MCCOY, 0x46, 0xbe, 0);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
walkCrewman(OBJECT_REDSHIRT, 0x78, 0xbe, 0);
}
@@ -300,9 +300,9 @@ void Room::tug0KirkPlacedBomb() {
loseItem(OBJECT_IBOMB);
loadActorAnim2(10, "bomb1", 0x5a, 0x7f, 0);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xc8, 0xbe, 11);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_W;
walkCrewman(OBJECT_SPOCK, 0x11e, 0xc7, 15);
}
@@ -319,8 +319,8 @@ void Room::tug0SpockBeginsBeamingBomb() {
void Room::tug0SpockFinishesBeamingBomb() {
playSoundEffectIndex(SND_BLANK_14);
- _vm->_awayMission.tug.missionScore = 0;
- _vm->_awayMission.timers[0] = 64;
+ _awayMission->tug.missionScore = 0;
+ _awayMission->timers[0] = 64;
}
void Room::tug0BombExploded() {
@@ -333,15 +333,15 @@ void Room::tug0BombExploded() {
showText(TX_SPEAKER_KIRK, TX_TUG0_003);
showText(TX_SPEAKER_SCOTT, TX_TUG0_S06);
- _vm->_awayMission.tug.field2d = 1;
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.missionScore < 0)
- _vm->_awayMission.tug.missionScore = 0;
- endMission(_vm->_awayMission.tug.missionScore, _vm->_awayMission.tug.field2b, _vm->_awayMission.tug.field2d);
+ _awayMission->tug.field2d = 1;
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.missionScore < 0)
+ _awayMission->tug.missionScore = 0;
+ endMission(_awayMission->tug.missionScore, _awayMission->tug.field2b, _awayMission->tug.field2d);
}
void Room::tug0UseMTricorderOnControls() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_MCCOY, TX_TUG0_016);
@@ -354,8 +354,8 @@ void Room::tug0UseSTricorderOnControls() {
}
void Room::tug0UseMTricorderOnEngineer() {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
walkCrewman(OBJECT_MCCOY, 0x2d, 0xaf, 24);
}
@@ -365,18 +365,18 @@ void Room::tug0MccoyReachedEngineerToScan() {
}
void Room::tug0MccoyFinishedScanningEngineer() {
- if (_vm->_awayMission.tug.engineerConscious)
+ if (_awayMission->tug.engineerConscious)
showText(TX_SPEAKER_MCCOY, TX_TUG0_017);
else
showText(TX_SPEAKER_MCCOY, TX_TUG0_018);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_W;
walkCrewman(OBJECT_MCCOY, 0x41, 0xaf, 26);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::tug0UseSTricorderOnEngineer() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, TX_TUG0_030);
@@ -432,7 +432,7 @@ void Room::tug0TalkToRedshirt() {
}
void Room::tug0TalkToEngineer() {
- if (_vm->_awayMission.tug.engineerConscious) {
+ if (_awayMission->tug.engineerConscious) {
showText(TX_SPEAKER_SIMPSON, TX_TUG0_F30);
showText(TX_SPEAKER_MCCOY, TX_TUG0_026);
showText(TX_SPEAKER_KIRK, TX_TUG0_012);
@@ -448,14 +448,14 @@ void Room::tug0LookAnywhere() {
}
void Room::tug0UseSTricorderAnywhere() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S;
loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, TX_TUG0_028);
}
void Room::tug0UseMTricorderAnywhere() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_S;
loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_MCCOY, TX_TUG0_020); // BUG: typo
diff --git a/engines/startrek/rooms/tug1.cpp b/engines/startrek/rooms/tug1.cpp
index f2b1daeee5..c91387cfc5 100644
--- a/engines/startrek/rooms/tug1.cpp
+++ b/engines/startrek/rooms/tug1.cpp
@@ -36,12 +36,12 @@ namespace StarTrek {
void Room::tug1Tick1() {
playVoc("TUG1LOOP");
- if (!_vm->_awayMission.tug.gotJunkPile)
+ if (!_awayMission->tug.gotJunkPile)
loadActorAnim2(OBJECT_JUNKPILE, "jnkpil", 0xfd, 0xa0, 0);
}
void Room::tug1UseSTricorderOnAnything() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, TX_TUG1_014);
@@ -51,27 +51,27 @@ void Room::tug1UseSTricorderOnAnything() {
}
void Room::tug1LookAtBridgeDoor() {
- if (_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (_awayMission->tug.bridgeForceFieldDown)
return;
showText(TX_TUG1N005);
}
void Room::tug1UseSTricorderOnBridgeDoor() {
- if (_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (_awayMission->tug.bridgeForceFieldDown)
return;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, TX_TUG1_002);
}
void Room::tug1UsePhaserOnBridgeDoor() {
- if (_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (_awayMission->tug.bridgeForceFieldDown)
showText(TX_TUG1N007);
else {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xbe, 0x78, 3);
}
}
@@ -86,18 +86,18 @@ void Room::tug1KirkPulledOutPhaser() {
}
void Room::tug1KirkFinishedFiringPhaser() {
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
loadActorStandAnim(OBJECT_KIRK);
loadActorStandAnim(OBJECT_PHASERSHOT);
}
void Room::tug1TalkToSpock() {
- if (!_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (!_awayMission->tug.bridgeForceFieldDown)
showText(TX_SPEAKER_SPOCK, TX_TUG1_010);
}
void Room::tug1UseSTricorderOnJunkPile() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, TX_TUG1_009);
@@ -116,10 +116,10 @@ void Room::tug1KirkReachedJunkPile() {
}
void Room::tug1KirkFinishedTakingJunkPile() {
- _vm->_awayMission.tug.gotJunkPile = true;
+ _awayMission->tug.gotJunkPile = true;
giveItem(OBJECT_IDEADPH);
giveItem(OBJECT_IPWE);
- _vm->_awayMission.tug.missionScore++;
+ _awayMission->tug.missionScore++;
giveItem(OBJECT_IWIRSCRP);
giveItem(OBJECT_IJNKMETL);
@@ -132,7 +132,7 @@ void Room::tug1UsePhaserOnWelder() {
giveItem(OBJECT_IPWF);
showText(TX_TUG1N004);
- _vm->_awayMission.tug.missionScore += 3;
+ _awayMission->tug.missionScore += 3;
}
void Room::tug1UseWelderOnWireScraps() {
@@ -154,21 +154,21 @@ void Room::tug1UseCombBitOnTransmogrifier() {
}
void Room::tug1UsePhaserWelderOnBridgeDoor() {
- if (_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (_awayMission->tug.bridgeForceFieldDown)
showText(TX_TUG1N008);
else {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xc2, 0x6a, 6);
}
}
void Room::tug1UsePhaserWelderOnBridgeDoorInLeftSpot() {
- if (_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (_awayMission->tug.bridgeForceFieldDown)
showText(TX_TUG1N007);
else {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xb1, 0x6a, 8);
}
}
@@ -182,7 +182,7 @@ void Room::tug1KirkReachedBridgeDoorWithWelder() {
void Room::tug1KirkFinishedUsingWelder() {
loadActorStandAnim(OBJECT_PHASERSHOT);
showText(TX_SPEAKER_SPOCK, TX_TUG1_016);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::tug1KirkReachedBridgeDoorWithWelderInLeftSpot() {
@@ -194,9 +194,9 @@ void Room::tug1KirkReachedBridgeDoorWithWelderInLeftSpot() {
void Room::tug1KirkFinishedUsingWelderInLeftSpot() {
loadActorStandAnim(OBJECT_PHASERSHOT);
showText(TX_SPEAKER_SPOCK, TX_TUG1_015);
- _vm->_awayMission.tug.bridgeForceFieldDown = true;
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore++;
+ _awayMission->tug.bridgeForceFieldDown = true;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore++;
}
void Room::tug1LookAnywhere() {
@@ -236,7 +236,7 @@ void Room::tug1LookAtBrigDoor() {
}
void Room::tug1UseSTricorderOnBrigDoor() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_N;
loadActorAnim2(OBJECT_SPOCK, "sscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_SPOCK, TX_TUG1_018);
@@ -253,14 +253,14 @@ void Room::tug1UseCommunicator() {
}
void Room::tug1WalkToBridgeDoor() {
- if (!_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (!_awayMission->tug.bridgeForceFieldDown)
return;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xc2, 0x6e, 10);
}
void Room::tug1KirkReachedBridgeDoor() {
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
loadActorAnim2(OBJECT_PHASERSHOT, "h1do", 0, 0, 11);
}
@@ -273,38 +273,38 @@ void Room::tug1WalkToBrigDoor() {
}
void Room::tug1UseMTricorderAnywhere() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_MCCOY, TX_TUG1_003);
}
void Room::tug1UseMTricorderOnBridgeDoor() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_MCCOY, TX_TUG1_007);
}
void Room::tug1UseMTricorderOnBrigDoor() {
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_N;
loadActorAnim2(OBJECT_MCCOY, "mscann", -1, -1, 0);
playSoundEffectIndex(SND_TRICORDER);
showText(TX_SPEAKER_MCCOY, TX_TUG1_005);
}
void Room::tug1UseSpockOnBridgeDoor() {
- if (!_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (!_awayMission->tug.bridgeForceFieldDown)
showText(TX_SPEAKER_SPOCK, TX_TUG1_013);
}
void Room::tug1UseRedshirtOnBridgeDoor() {
- if (!_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (!_awayMission->tug.bridgeForceFieldDown)
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG1L000);
}
void Room::tug1UseMedkitOnBridgeDoor() {
- if (!_vm->_awayMission.tug.bridgeForceFieldDown)
+ if (!_awayMission->tug.bridgeForceFieldDown)
showText(TX_SPEAKER_MCCOY, TX_TUG1_004);
}
diff --git a/engines/startrek/rooms/tug2.cpp b/engines/startrek/rooms/tug2.cpp
index 2e8a9e61a2..04b2aaef71 100644
--- a/engines/startrek/rooms/tug2.cpp
+++ b/engines/startrek/rooms/tug2.cpp
@@ -43,76 +43,76 @@ namespace StarTrek {
void Room::tug2Tick1() {
playVoc("TUG2LOOP");
- if (!_vm->_awayMission.tug.haveBomb)
+ if (!_awayMission->tug.haveBomb)
loadActorAnim2(OBJECT_BOMB, "t2bomb", -3, 1, 0);
- if (!_vm->_awayMission.tug.gotWires)
+ if (!_awayMission->tug.gotWires)
loadActorAnim2(OBJECT_WIRE, "t2wire", 0, 1, 0);
- if (!_vm->_awayMission.tug.brigForceFieldDown)
+ if (!_awayMission->tug.brigForceFieldDown)
loadActorAnim2(OBJECT_BRIG, "fld01", 0, 0, 0);
else
loadActorAnim2(OBJECT_BRIG, "fld10d", 0, 0, 0);
- if (_vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.field35 == 6)
loadActorAnim2(OBJECT_BRIG, "zapdon", 0, 0, 0);
// Security guy 1
- if (_vm->_awayMission.tug.guard1Status == 8)
+ if (_awayMission->tug.guard1Status == 8)
loadActorAnim2(OBJECT_GUARD_1, "p5tied", 0xe0, 0xb1, 0);
- else if (_vm->_awayMission.tug.guard1Status == 1 && _vm->_awayMission.tug.brigForceFieldDown) {
+ else if (_awayMission->tug.guard1Status == 1 && _awayMission->tug.brigForceFieldDown) {
loadActorAnim2(OBJECT_GUARD_1, "p5tied", 0xe0, 0xb1, 0);
- _vm->_awayMission.tug.guard1Status = 8;
+ _awayMission->tug.guard1Status = 8;
}
- if (_vm->_awayMission.tug.guard1Status == 1 && !_vm->_awayMission.tug.brigForceFieldDown) {
- _vm->_awayMission.tug.guard1Status = 0;
- _vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] = false;
- _vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK] = false;
- _vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY] = false;
- if (!_vm->_awayMission.redshirtDead)
- _vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT] = false;
- _vm->_awayMission.tug.field5b = 0;
+ if (_awayMission->tug.guard1Status == 1 && !_awayMission->tug.brigForceFieldDown) {
+ _awayMission->tug.guard1Status = 0;
+ _awayMission->tug.crewmanKilled[OBJECT_KIRK] = false;
+ _awayMission->tug.crewmanKilled[OBJECT_SPOCK] = false;
+ _awayMission->tug.crewmanKilled[OBJECT_MCCOY] = false;
+ if (!_awayMission->redshirtDead)
+ _awayMission->tug.crewmanKilled[OBJECT_REDSHIRT] = false;
+ _awayMission->tug.field5b = 0;
}
- if (_vm->_awayMission.tug.guard1Status == 0)
+ if (_awayMission->tug.guard1Status == 0)
loadActorAnim2(OBJECT_GUARD_1, "p5redy", 0xe0, 0xb1, 0);
- if (_vm->_awayMission.tug.guard1Status == 2)
+ if (_awayMission->tug.guard1Status == 2)
loadActorAnim2(OBJECT_GUARD_1, "p5hat", 0xe0, 0xb1, 0);
// Security guy 2
- if (_vm->_awayMission.tug.guard2Status == 8)
+ if (_awayMission->tug.guard2Status == 8)
loadActorAnim2(OBJECT_GUARD_2, "p6tied", 0xfb, 0xc5, 0);
- else if (_vm->_awayMission.tug.guard2Status == 1 && _vm->_awayMission.tug.brigForceFieldDown) {
+ else if (_awayMission->tug.guard2Status == 1 && _awayMission->tug.brigForceFieldDown) {
loadActorAnim2(OBJECT_GUARD_2, "p6tied", 0xfb, 0xc5, 0);
- _vm->_awayMission.tug.guard2Status = 8;
+ _awayMission->tug.guard2Status = 8;
}
- if (_vm->_awayMission.tug.guard2Status == 1 && !_vm->_awayMission.tug.brigForceFieldDown) {
- _vm->_awayMission.tug.guard2Status = 0;
- _vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] = false;
- _vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK] = false;
- _vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY] = false;
- if (!_vm->_awayMission.redshirtDead)
- _vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT] = false;
- _vm->_awayMission.tug.field5b = 0;
+ if (_awayMission->tug.guard2Status == 1 && !_awayMission->tug.brigForceFieldDown) {
+ _awayMission->tug.guard2Status = 0;
+ _awayMission->tug.crewmanKilled[OBJECT_KIRK] = false;
+ _awayMission->tug.crewmanKilled[OBJECT_SPOCK] = false;
+ _awayMission->tug.crewmanKilled[OBJECT_MCCOY] = false;
+ if (!_awayMission->redshirtDead)
+ _awayMission->tug.crewmanKilled[OBJECT_REDSHIRT] = false;
+ _awayMission->tug.field5b = 0;
}
- if (_vm->_awayMission.tug.guard2Status == 0)
+ if (_awayMission->tug.guard2Status == 0)
loadActorAnim2(OBJECT_GUARD_2, "p6draw", 0xfb, 0xc5, 0);
- if (_vm->_awayMission.tug.guard2Status == 2)
+ if (_awayMission->tug.guard2Status == 2)
loadActorAnim2(OBJECT_GUARD_2, "p5hat", 0xfb, 0xc5, 0); // FIXME
- if (_vm->_awayMission.tug.field4e == 0)
+ if (_awayMission->tug.field4e == 0)
loadActorAnim2(OBJECT_13, "wallht", 0, 0, 0);
- if (_vm->_awayMission.tug.field5b == 0) {
- _vm->_awayMission.disableWalking = true;
+ if (_awayMission->tug.field5b == 0) {
+ _awayMission->disableWalking = true;
playMidiMusicTracks(32, -1);
}
- _vm->_awayMission.tug.field5b = 1;
- _vm->_awayMission.tug.kirkPhaserDrawn = 0;
+ _awayMission->tug.field5b = 1;
+ _awayMission->tug.kirkPhaserDrawn = 0;
}
void Room::tug2Tick60() {
- if (!_vm->_awayMission.tug.guard1Status || !_vm->_awayMission.tug.guard2Status) {
- _vm->_awayMission.timers[0] = 60;
+ if (!_awayMission->tug.guard1Status || !_awayMission->tug.guard2Status) {
+ _awayMission->timers[0] = 60;
showText(TX_SPEAKER_ELASI_GUARD, TX_TUG2L085);
tug2ElasiReadyPhaser();
}
@@ -135,9 +135,9 @@ void Room::tug2LookAtRedshirt() {
}
void Room::tug2GetBomb() {
- if (_vm->_awayMission.tug.brigForceFieldDown) {
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+ if (_awayMission->tug.brigForceFieldDown) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 12);
} else
showText(TX_TUG2N024);
@@ -150,8 +150,8 @@ void Room::tug2KirkReachedBomb() {
void Room::tug2KirkGotBomb() {
loadActorStandAnim(OBJECT_BOMB);
giveItem(OBJECT_IBOMB);
- _vm->_awayMission.tug.haveBomb = true;
- _vm->_awayMission.disableInput = false;
+ _awayMission->tug.haveBomb = true;
+ _awayMission->disableInput = false;
}
void Room::tug2LookAtBomb() {
@@ -159,24 +159,24 @@ void Room::tug2LookAtBomb() {
}
void Room::tug2LookAtGuard1() {
- if (_vm->_awayMission.tug.guard1Status == 0)
+ if (_awayMission->tug.guard1Status == 0)
showText(TX_TUG2N001);
- else if (_vm->_awayMission.tug.guard1Status == 1)
+ else if (_awayMission->tug.guard1Status == 1)
showText(TX_TUG2N013);
- else if (_vm->_awayMission.tug.guard1Status == 8)
+ else if (_awayMission->tug.guard1Status == 8)
showText(TX_TUG2N015);
- else if (_vm->_awayMission.tug.guard1Status == 2)
+ else if (_awayMission->tug.guard1Status == 2)
showText(TX_TUG2N106);
}
void Room::tug2LookAtGuard2() {
- if (_vm->_awayMission.tug.guard2Status == 0)
+ if (_awayMission->tug.guard2Status == 0)
showText(TX_TUG2N037);
- else if (_vm->_awayMission.tug.guard2Status == 1)
+ else if (_awayMission->tug.guard2Status == 1)
showText(TX_TUG2N014);
- else if (_vm->_awayMission.tug.guard2Status == 8)
+ else if (_awayMission->tug.guard2Status == 8)
showText(TX_TUG2N016);
- else if (_vm->_awayMission.tug.guard2Status == 2)
+ else if (_awayMission->tug.guard2Status == 2)
showText(TX_TUG2N106);
}
@@ -185,13 +185,13 @@ void Room::tug2LookAtWires() {
}
void Room::tug2UseSTricorderOnButton() {
- if (_vm->_awayMission.tug.field35 != 0)
+ if (_awayMission->tug.field35 != 0)
return;
spockScan(DIR_E, TX_TUG2_007, true);
}
void Room::tug2UseMccoyOnWires() {
- if (_vm->_awayMission.tug.field35 != 0)
+ if (_awayMission->tug.field35 != 0)
return;
showText(TX_SPEAKER_MCCOY, TX_TUG2_009);
}
@@ -201,11 +201,11 @@ void Room::tug2UseMccoyOnBomb() {
}
void Room::tug2UseRedshirtOnWires() {
- if (_vm->_awayMission.disableWalking || _vm->_awayMission.tug.field35 != 0)
+ if (_awayMission->disableWalking || _awayMission->tug.field35 != 0)
return;
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2L007);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
- _vm->_awayMission.disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_N;
+ _awayMission->disableInput = true;
walkCrewman(OBJECT_REDSHIRT, 0xc9, 0xa0, 6);
}
@@ -216,21 +216,21 @@ void Room::tug2RedshirtReachedWires() {
void Room::tug2RedshirtDefusedBomb() {
showText(TX_TUG2C001);
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2L011);
- _vm->_awayMission.tug.field35 = 4;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ _awayMission->tug.field35 = 4;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
walkCrewman(OBJECT_REDSHIRT, 0x44, 0xc2, 8);
}
void Room::tug2RedshirtReturnedToPosition() {
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore += 2;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore += 2;
}
void Room::tug2UseKirkOnWires() {
- if (_vm->_awayMission.disableWalking || _vm->_awayMission.tug.field35 != 0)
+ if (_awayMission->disableWalking || _awayMission->tug.field35 != 0)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 5);
}
@@ -238,17 +238,17 @@ void Room::tug2KirkReachedWires() {
showText(TX_SPEAKER_KIRK, TX_TUG2_003);
showText(TX_SPEAKER_SPOCK, TX_TUG2_023);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 0x66, 0xb8, 0);
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
tug2UseSpockOnWires();
}
void Room::tug2UseSpockOnWires() {
- if (_vm->_awayMission.disableWalking || _vm->_awayMission.tug.field35 != 0)
+ if (_awayMission->disableWalking || _awayMission->tug.field35 != 0)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0xc9, 0xa0, 9);
}
@@ -256,25 +256,25 @@ void Room::tug2SpockReachedWires() {
loadActorAnim2(OBJECT_SPOCK, "suseme", -1, -1, 0);
playVoc("WIRESNIP");
showText(TX_SPEAKER_SPOCK, TX_TUG2_024);
- _vm->_awayMission.tug.field35 = 4;
+ _awayMission->tug.field35 = 4;
- if (_vm->_awayMission.tug.spockExaminedTransporter)
+ if (_awayMission->tug.spockExaminedTransporter)
showText(TX_SPEAKER_SPOCK, TX_TUG2_008);
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0x56, 0xa9, 11);
}
void Room::tug2SpockReturnedToPosition() {
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore += 2;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore += 2;
}
void Room::tug2GetWires() {
- if (_vm->_awayMission.disableWalking)
+ if (_awayMission->disableWalking)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 28);
}
@@ -283,33 +283,33 @@ void Room::tug2KirkReachedWiresToGet() {
}
void Room::tug2KirkGotWires() {
- if (_vm->_awayMission.tug.field35 == 0) {
+ if (_awayMission->tug.field35 == 0) {
playMidiMusicTracks(2, -1);
loadActorAnim2(OBJECT_BRIG, "zap", 0, 0, 1);
playVoc("NM8EXPLO");
loadActorAnim2(OBJECT_BOMB, "t2bbo", -3, 1, 0);
playSoundEffectIndex(SND_PHASSHOT);
playSoundEffectIndex(SND_BLANK_16);
- _vm->_awayMission.tug.field35 = 6;
+ _awayMission->tug.field35 = 6;
loadActorStandAnim(OBJECT_WIRE);
giveItem(OBJECT_IWIRING);
- _vm->_awayMission.tug.gotWires = true;
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore += 3;
+ _awayMission->tug.gotWires = true;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore += 3;
} else {
loadActorStandAnim(OBJECT_WIRE);
giveItem(OBJECT_IWIRING);
- _vm->_awayMission.tug.gotWires = true;
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.missionScore += 3;
+ _awayMission->tug.gotWires = true;
+ _awayMission->disableInput = false;
+ _awayMission->tug.missionScore += 3;
}
}
void Room::tug2UseKirkOnButton() {
- if (_vm->_awayMission.disableWalking)
+ if (_awayMission->disableWalking)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 0xc9, 0xa0, 14);
}
@@ -319,10 +319,10 @@ void Room::tug2KirkReachedButton() {
}
void Room::tug2UseSpockOnButton() {
- if (_vm->_awayMission.disableWalking)
+ if (_awayMission->disableWalking)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
walkCrewman(OBJECT_SPOCK, 0xc9, 0xa0, 16);
}
@@ -332,10 +332,10 @@ void Room::tug2SpockReachedButton() {
}
void Room::tug2UseMccoyOnButton() {
- if (_vm->_awayMission.disableWalking)
+ if (_awayMission->disableWalking)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
walkCrewman(OBJECT_MCCOY, 0xc9, 0xa0, 18);
}
@@ -345,10 +345,10 @@ void Room::tug2MccoyReachedButton() {
}
void Room::tug2UseRedshirtOnButton() {
- if (_vm->_awayMission.disableWalking)
+ if (_awayMission->disableWalking)
return;
- _vm->_awayMission.disableInput = true;
- _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
walkCrewman(OBJECT_REDSHIRT, 0xc9, 0xa0, 20);
}
@@ -358,18 +358,18 @@ void Room::tug2RedshirtReachedButton() {
}
void Room::tug2TurnedOffForceField() {
- _vm->_awayMission.disableInput = false;
- if (_vm->_awayMission.tug.field35 == 0) {
+ _awayMission->disableInput = false;
+ if (_awayMission->tug.field35 == 0) {
playMidiMusicTracks(2, -1);
loadActorAnim2(OBJECT_BRIG, "zap", 0, 0, 1);
playVoc("NM8EXPLO");
loadActorAnim2(OBJECT_BOMB, "t2bbo", -3, 1, 0);
// FIXME: doesn't play "PHASSHOT" sound effect like when kirk removes wires?
- _vm->_awayMission.tug.field35 = 6;
- } else if (_vm->_awayMission.tug.field35 == 4 && !_vm->_awayMission.tug.brigForceFieldDown) {
- _vm->_awayMission.tug.brigForceFieldDown = true;
+ _awayMission->tug.field35 = 6;
+ } else if (_awayMission->tug.field35 == 4 && !_awayMission->tug.brigForceFieldDown) {
+ _awayMission->tug.brigForceFieldDown = true;
loadActorAnim2(OBJECT_BRIG, "fld10", 0, 0, 2);
- _vm->_awayMission.tug.missionScore += 6;
+ _awayMission->tug.missionScore += 6;
playVoc("EFX15");
}
}
@@ -384,13 +384,13 @@ void Room::tug2PrisonersReleased() {
showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_029);
showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_030);
showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_028);
- _vm->_awayMission.tug.savedPrisoners = true;
+ _awayMission->tug.savedPrisoners = true;
}
void Room::tug2UsePhaserOnBrig() {
- if (_vm->_awayMission.tug.field35 == 0)
+ if (_awayMission->tug.field35 == 0)
showText(TX_SPEAKER_SPOCK, TX_TUG2_006);
- else if (_vm->_awayMission.tug.brigForceFieldDown) {
+ else if (_awayMission->tug.brigForceFieldDown) {
// BUGFIX: this function had two implementations; one for firing on the brig, and
// one for firing on the masada crewman (who replaces the brig object). The first
// took priority, meaning the latter code never ran. That's fixed here.
@@ -399,128 +399,128 @@ void Room::tug2UsePhaserOnBrig() {
}
void Room::tug2ElasiReadyPhaser() {
- if (_vm->_awayMission.tug.guard1Status == 0 && _vm->_awayMission.tug.field59 == 0) {
+ if (_awayMission->tug.guard1Status == 0 && _awayMission->tug.field59 == 0) {
loadActorAnim2(OBJECT_GUARD_1, "p5draw", -1, -1, 0);
- _vm->_awayMission.tug.field59++;
+ _awayMission->tug.field59++;
}
}
void Room::tug2CheckEndFirefight() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP || _vm->_awayMission.tug.guard2Status == GUARDSTAT_UP)
+ if (_awayMission->tug.guard1Status == GUARDSTAT_UP || _awayMission->tug.guard2Status == GUARDSTAT_UP)
return;
- _vm->_awayMission.disableWalking = false;
- if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ _awayMission->disableWalking = false;
+ if (_awayMission->tug.kirkPhaserDrawn)
loadActorStandAnim(OBJECT_KIRK);
}
void Room::tug2UseStunPhaserOnGuard1() {
- if (_vm->_awayMission.tug.guard1Status != GUARDSTAT_UP)
+ if (_awayMission->tug.guard1Status != GUARDSTAT_UP)
tug2KirkShootGuard1();
else {
tug2ElasiReadyPhaser();
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.kirkPhaserDrawn)
tug2KirkShootGuard1();
else {
loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 22);
- _vm->_awayMission.tug.kirkPhaserDrawn = true;
+ _awayMission->tug.kirkPhaserDrawn = true;
}
}
}
void Room::tug2KirkShootGuard1() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.guard1Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_GUARD_1, "p5stun", -1, -1, 0);
- _vm->_awayMission.tug.guard1Status = GUARDSTAT_STUNNED;
+ _awayMission->tug.guard1Status = GUARDSTAT_STUNNED;
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t2beem03", 5);
tug2CheckEndFirefight();
}
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::tug2UseStunPhaserOnGuard2() {
- if (_vm->_awayMission.tug.guard2Status != GUARDSTAT_UP)
+ if (_awayMission->tug.guard2Status != GUARDSTAT_UP)
tug2KirkShootGuard2();
else {
tug2ElasiReadyPhaser();
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.kirkPhaserDrawn)
tug2KirkShootGuard2();
else {
loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 23);
- _vm->_awayMission.tug.kirkPhaserDrawn = true;
+ _awayMission->tug.kirkPhaserDrawn = true;
}
}
}
void Room::tug2KirkShootGuard2() {
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.guard2Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_GUARD_2, "p6stun", -1, -1, 0);
- _vm->_awayMission.tug.guard2Status = GUARDSTAT_STUNNED;
+ _awayMission->tug.guard2Status = GUARDSTAT_STUNNED;
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t2beem02", 5);
tug2CheckEndFirefight();
}
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::tug2UseKillPhaserOnGuard1() {
- if (_vm->_awayMission.tug.guard1Status != GUARDSTAT_UP)
+ if (_awayMission->tug.guard1Status != GUARDSTAT_UP)
tug2KirkKillGuard1();
else {
tug2ElasiReadyPhaser();
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.kirkPhaserDrawn)
tug2KirkKillGuard1();
else {
loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 24);
- _vm->_awayMission.tug.kirkPhaserDrawn = true;
- _vm->_awayMission.tug.brigElasiPhasersOnKill = true;
+ _awayMission->tug.kirkPhaserDrawn = true;
+ _awayMission->tug.brigElasiPhasersOnKill = true;
}
}
}
void Room::tug2KirkKillGuard1() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.guard1Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_GUARD_1, "p5kill", -1, -1, 0);
- _vm->_awayMission.tug.guard1Status = GUARDSTAT_DEAD;
+ _awayMission->tug.guard1Status = GUARDSTAT_DEAD;
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t2beem05", 5);
tug2CheckEndFirefight();
}
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::tug2UseKillPhaserOnGuard2() {
- if (_vm->_awayMission.tug.guard2Status != GUARDSTAT_UP)
+ if (_awayMission->tug.guard2Status != GUARDSTAT_UP)
tug2KirkKillGuard2();
else {
tug2ElasiReadyPhaser();
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.kirkPhaserDrawn)
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.kirkPhaserDrawn)
tug2KirkKillGuard2();
else {
loadActorAnim2(OBJECT_KIRK, "kdrawe", -1, -1, 25);
- _vm->_awayMission.tug.kirkPhaserDrawn = true;
- _vm->_awayMission.tug.brigElasiPhasersOnKill = true;
+ _awayMission->tug.kirkPhaserDrawn = true;
+ _awayMission->tug.brigElasiPhasersOnKill = true;
}
}
}
void Room::tug2KirkKillGuard2() {
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.guard2Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_GUARD_2, "p6kill", -1, -1, 0);
- _vm->_awayMission.tug.guard2Status = GUARDSTAT_DEAD;
+ _awayMission->tug.guard2Status = GUARDSTAT_DEAD;
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t2beem04", 5);
tug2CheckEndFirefight();
}
- _vm->_awayMission.disableInput = false;
+ _awayMission->disableInput = false;
}
void Room::tug2UsePhaserOnWelder() {
@@ -530,7 +530,7 @@ void Room::tug2UsePhaserOnWelder() {
// BUGFIX: this following line didn't exist, despite it existing in TUG1; meaning this
// was supposed to give points, but it only did in a specific room.
- _vm->_awayMission.tug.missionScore += 3;
+ _awayMission->tug.missionScore += 3;
}
void Room::tug2UseWelderOnWireScraps() {
@@ -571,14 +571,14 @@ void Room::tug2LookAtKirk() {
}
void Room::tug2TalkToKirk() {
- if (_vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.field35 == 6)
showText(TX_SPEAKER_KIRK, TX_TUG2_001);
else
showText(TX_SPEAKER_KIRK, TX_TUG2_002);
}
void Room::tug2TalkToMccoy() {
- if (_vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.field35 == 6)
showText(TX_SPEAKER_MCCOY, TX_TUG2_018);
else
showText(TX_SPEAKER_MCCOY, TX_TUG2_010);
@@ -588,7 +588,7 @@ void Room::tug2TalkToRedshirt() {
// BUGFIX: the original game has two implementations of this function; the first takes
// precedence, however, it's just generic, unhelpful text. The second implementation
// is more interesting, so that one is used instead.
- if (_vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.field35 == 6)
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2L004);
else
showText(TX_SPEAKER_CHRISTENSEN, TX_TUG2J003);
@@ -598,7 +598,7 @@ void Room::tug2TalkToRedshirt() {
}
void Room::tug2TalkToSpock() {
- if (_vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.field35 == 6)
showText(TX_SPEAKER_SPOCK, TX_TUG2_005);
else
showText(TX_SPEAKER_SPOCK, TX_TUG2_020);
@@ -609,27 +609,27 @@ void Room::tug2UseCommunicator() {
}
void Room::tug2DetermineElasiShooter() {
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_UP)
+ if (_awayMission->tug.guard2Status == GUARDSTAT_UP)
_roomVar.tug.shootingObject = OBJECT_GUARD_2;
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_UP)
+ if (_awayMission->tug.guard1Status == GUARDSTAT_UP)
_roomVar.tug.shootingObject = OBJECT_GUARD_1;
}
// Elasi shoots someone
void Room::tug2Timer0Expired() {
- if (_vm->_awayMission.tug.guard1Status != GUARDSTAT_UP && _vm->_awayMission.tug.guard2Status != GUARDSTAT_UP)
+ if (_awayMission->tug.guard1Status != GUARDSTAT_UP && _awayMission->tug.guard2Status != GUARDSTAT_UP)
return;
_roomVar.tug.elasiPhaserOnKill = 0;
- if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
+ if (_awayMission->tug.brigElasiPhasersOnKill)
_roomVar.tug.elasiPhaserOnKill = 1;
- switch (_vm->_awayMission.tug.elasiTargetIndex) {
+ switch (_awayMission->tug.elasiTargetIndex) {
case 0:
- _vm->_awayMission.tug.elasiTargetIndex++;
- if (_vm->_awayMission.tug.guard2Status != GUARDSTAT_UP) {
+ _awayMission->tug.elasiTargetIndex++;
+ if (_awayMission->tug.guard2Status != GUARDSTAT_UP) {
// BUGFIX: reset the timer to allow guard 1 to continue if guard 2 is down
- _vm->_awayMission.timers[0] = 60;
+ _awayMission->timers[0] = 60;
return;
}
@@ -638,59 +638,59 @@ void Room::tug2Timer0Expired() {
showBitmapFor5Ticks("t2beem00", 5);
playSoundEffectIndex(SND_PHASSHOT);
loadActorAnim2(OBJECT_GUARD_2, "p6fire", -1, -1, 0);
- _vm->_awayMission.tug.field4e = _roomVar.tug.elasiPhaserOnKill;
- _vm->_awayMission.timers[0] = 60;
+ _awayMission->tug.field4e = _roomVar.tug.elasiPhaserOnKill;
+ _awayMission->timers[0] = 60;
break;
case 1:
// Guard shoots redshirt
- _vm->_awayMission.tug.elasiTargetIndex++;
- if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT]) {
+ _awayMission->tug.elasiTargetIndex++;
+ if (!_awayMission->tug.crewmanKilled[OBJECT_REDSHIRT]) {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_REDSHIRT;
- _vm->_awayMission.timers[0] = 60;
+ _awayMission->timers[0] = 60;
tug2GuardShootsCrewman();
}
break;
case 2:
// Guard shoots spock (or kirk)
- _vm->_awayMission.tug.elasiTargetIndex++;
+ _awayMission->tug.elasiTargetIndex++;
_roomVar.tug.shootKirkOverride = false;
- if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
+ if (_awayMission->tug.brigElasiPhasersOnKill)
_roomVar.tug.shootKirkOverride = true;
tug2DetermineElasiShooter();
if (_roomVar.tug.shootKirkOverride)
_roomVar.tug.shootingTarget = OBJECT_KIRK;
else
_roomVar.tug.shootingTarget = OBJECT_SPOCK;
- _vm->_awayMission.timers[0] = 60;
+ _awayMission->timers[0] = 60;
tug2GuardShootsCrewman();
break;
case 3:
// Guard shoots Mccoy
- _vm->_awayMission.tug.elasiTargetIndex++;
- if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY]) {
+ _awayMission->tug.elasiTargetIndex++;
+ if (!_awayMission->tug.crewmanKilled[OBJECT_MCCOY]) {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_MCCOY;
- _vm->_awayMission.timers[0] = 80;
+ _awayMission->timers[0] = 80;
tug2GuardShootsCrewman();
}
break;
case 4:
// Guard shoots kirk (or Spock)
- _vm->_awayMission.tug.elasiTargetIndex++;
+ _awayMission->tug.elasiTargetIndex++;
if (_roomVar.tug.shootKirkOverride) {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_SPOCK;
- _vm->_awayMission.timers[2] = 40;
+ _awayMission->timers[2] = 40;
tug2GuardShootsCrewman();
} else {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_KIRK;
- _vm->_awayMission.timers[2] = 40;
+ _awayMission->timers[2] = 40;
tug2GuardShootsCrewman();
}
break;
@@ -726,7 +726,7 @@ void Room::tug2GuardShootsCrewman() {
const char *crewPrefixes = "ksmr";
if (!_roomVar.tug.elasiPhaserOnKill)
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.tug.shootingTarget] = DIR_W;
+ _awayMission->crewDirectionsAfterWalk[_roomVar.tug.shootingTarget] = DIR_W;
Common::String anim;
const char **bitmapArray;
@@ -760,17 +760,17 @@ void Room::tug2GuardShootsCrewman() {
else
loadActorAnim2(OBJECT_GUARD_2, "p6fire", -1, -1, 0);
- _vm->_awayMission.tug.crewmanKilled[_roomVar.tug.shootingTarget] = _roomVar.tug.elasiPhaserOnKill;
+ _awayMission->tug.crewmanKilled[_roomVar.tug.shootingTarget] = _roomVar.tug.elasiPhaserOnKill;
if (!_roomVar.tug.elasiPhaserOnKill) {
// BUG: crew goes down for 120 frames, but they start to get up before the fight
// is over. Perhaps this number should be increased.
- _vm->_awayMission.crewDirectionsAfterWalk[_roomVar.tug.shootingTarget] = DIR_W;
- _vm->_awayMission.crewGetupTimers[_roomVar.tug.shootingTarget] = 120;
- _vm->_awayMission.crewDownBitset |= (1 << _roomVar.tug.shootingTarget);
+ _awayMission->crewDirectionsAfterWalk[_roomVar.tug.shootingTarget] = DIR_W;
+ _awayMission->crewGetupTimers[_roomVar.tug.shootingTarget] = 120;
+ _awayMission->crewDownBitset |= (1 << _roomVar.tug.shootingTarget);
}
if (_roomVar.tug.elasiPhaserOnKill && _roomVar.tug.shootingTarget == OBJECT_REDSHIRT)
- _vm->_awayMission.redshirtDead = true;
+ _awayMission->redshirtDead = true;
}
void Room::tug2Timer2Expired() {
@@ -784,27 +784,27 @@ void Room::tug2UseSTricorderOnBomb() {
}
void Room::tug2UseMTricorderOnGuard1() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.guard1Status == GUARDSTAT_STUNNED)
mccoyScan(DIR_E, TX_TUG2_016, true);
}
void Room::tug2UseMTricorderOnGuard2() {
// BUGFIX: original didn't play audio for this (despite being the same as above).
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.guard2Status == GUARDSTAT_STUNNED)
mccoyScan(DIR_E, TX_TUG2_016, true);
}
void Room::tug2TalkToGuard1() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_TIED)
+ if (_awayMission->tug.guard1Status == GUARDSTAT_TIED)
showText(TX_SPEAKER_ELASI_GUARD, TX_TUG2L086);
- else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED)
+ else if (_awayMission->tug.guard1Status == GUARDSTAT_STUNNED)
showText(TX_SPEAKER_MCCOY, TX_TUG2_012);
}
void Room::tug2TalkToGuard2() {
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_TIED)
+ if (_awayMission->tug.guard2Status == GUARDSTAT_TIED)
showText(TX_SPEAKER_ELASI_GUARD, TX_TUG2L086);
- else if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED)
+ else if (_awayMission->tug.guard2Status == GUARDSTAT_STUNNED)
showText(TX_SPEAKER_MCCOY, TX_TUG2_013);
}
@@ -813,27 +813,27 @@ void Room::tug2UseMedkitOnBomb() {
}
void Room::tug2UseMedkitOnGuard1() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.guard1Status == GUARDSTAT_STUNNED)
showText(TX_SPEAKER_MCCOY, TX_TUG2_014);
}
void Room::tug2UseMedkitOnGuard2() {
- if (_vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.guard2Status == GUARDSTAT_STUNNED)
showText(TX_SPEAKER_MCCOY, TX_TUG2_014);
}
void Room::tug2LookAnywhere() {
- if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.guard2Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.guard1Status == GUARDSTAT_DEAD && _awayMission->tug.guard2Status == GUARDSTAT_DEAD && _awayMission->tug.field35 == 6)
showText(TX_TUG2N019);
- else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.guard2Status == GUARDSTAT_DEAD && !_vm->_awayMission.tug.brigForceFieldDown)
+ else if (_awayMission->tug.guard1Status == GUARDSTAT_DEAD && _awayMission->tug.guard2Status == GUARDSTAT_DEAD && !_awayMission->tug.brigForceFieldDown)
showText(TX_TUG2N017);
- else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.field35 == 6)
+ else if (_awayMission->tug.guard1Status == GUARDSTAT_STUNNED && _awayMission->tug.guard2Status == GUARDSTAT_STUNNED && _awayMission->tug.field35 == 6)
showText(TX_TUG2N020);
- else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED && !_vm->_awayMission.tug.brigForceFieldDown)
+ else if (_awayMission->tug.guard1Status == GUARDSTAT_STUNNED && _awayMission->tug.guard2Status == GUARDSTAT_STUNNED && !_awayMission->tug.brigForceFieldDown)
showText(TX_TUG2N018);
- else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.guard2Status == GUARDSTAT_STUNNED && _vm->_awayMission.tug.brigForceFieldDown)
+ else if (_awayMission->tug.guard1Status == GUARDSTAT_STUNNED && _awayMission->tug.guard2Status == GUARDSTAT_STUNNED && _awayMission->tug.brigForceFieldDown)
showText(TX_TUG2N021);
- else if (_vm->_awayMission.tug.guard1Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.guard2Status == GUARDSTAT_DEAD && _vm->_awayMission.tug.brigForceFieldDown)
+ else if (_awayMission->tug.guard1Status == GUARDSTAT_DEAD && _awayMission->tug.guard2Status == GUARDSTAT_DEAD && _awayMission->tug.brigForceFieldDown)
showText(TX_TUG2N022);
else
showText(TX_TUG2N023);
@@ -843,27 +843,27 @@ void Room::tug2TalkToBrig() {
// The "brig" can also be a masada crewman, when the force field is down, so there are
// at least two cases here.
- if (_vm->_awayMission.tug.brigForceFieldDown && !_vm->_awayMission.tug.talkedToBrigCrewman) {
+ if (_awayMission->tug.brigForceFieldDown && !_awayMission->tug.talkedToBrigCrewman) {
loadActorAnim2(OBJECT_BRIG, "fld10d", 0, 0, 0);
showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_026);
- _vm->_awayMission.tug.talkedToBrigCrewman = true;
+ _awayMission->tug.talkedToBrigCrewman = true;
}
- if (_vm->_awayMission.tug.brigForceFieldDown && _vm->_awayMission.tug.talkedToBrigCrewman)
+ if (_awayMission->tug.brigForceFieldDown && _awayMission->tug.talkedToBrigCrewman)
showText(TX_SPEAKER_MASADA_CREWMAN, TX_TUG2_027);
- else if (!_vm->_awayMission.tug.brigForceFieldDown)
+ else if (!_awayMission->tug.brigForceFieldDown)
mccoyScan(DIR_E, TX_TUG2_015, true);
}
void Room::tug2UseMTricorderOnBrig() {
- if (_vm->_awayMission.tug.field35 == 6)
+ if (_awayMission->tug.field35 == 6)
mccoyScan(DIR_E, TX_TUG2_019, true);
- else if (!_vm->_awayMission.tug.brigForceFieldDown)
+ else if (!_awayMission->tug.brigForceFieldDown)
mccoyScan(DIR_E, TX_TUG2_015, true);
}
void Room::tug2UseMTricorderOnOpenBrig() {
- if (_vm->_awayMission.tug.brigForceFieldDown)
+ if (_awayMission->tug.brigForceFieldDown)
mccoyScan(DIR_E, TX_TUG2_015, true);
}
diff --git a/engines/startrek/rooms/tug3.cpp b/engines/startrek/rooms/tug3.cpp
index c0a0b97263..0d7537cea9 100644
--- a/engines/startrek/rooms/tug3.cpp
+++ b/engines/startrek/rooms/tug3.cpp
@@ -42,7 +42,7 @@ namespace StarTrek {
void Room::tug3Tick1() {
playVoc("TUG3LOOP");
- _vm->_awayMission.disableWalking = true;
+ _awayMission->disableWalking = true;
loadActorAnim2(OBJECT_ELASI_1, "p1turn", 0xa4, 0x98, 0);
loadActorAnim2(OBJECT_ELASI_2, "p2turn", 0xd1, 0x88, 0);
loadActorAnim2(OBJECT_ELASI_3, "p3turn", 0xfb, 0xc4, 0);
@@ -63,31 +63,31 @@ void Room::tug3ElasiSurrendered() {
// they could shoot Kirk as he's beaming out and the mission is "successful". To
// prevent that, the below condition is removed in ScummVM.
/*
- if (_vm->_awayMission.tug.bridgeElasiDrewPhasers)
+ if (_awayMission->tug.bridgeElasiDrewPhasers)
return;
*/
// Also part of the bugfix (stop shooting)
- _vm->_awayMission.timers[0] = 0;
+ _awayMission->timers[0] = 0;
- _vm->_awayMission.tug.elasiSurrendered = true;
+ _awayMission->tug.elasiSurrendered = true;
loadActorAnim2(OBJECT_ELASI_1, "p1surr", -1, -1, 0);
- _vm->_awayMission.tug.bridgeElasi1Status = GUARDSTAT_SURRENDERED;
+ _awayMission->tug.bridgeElasi1Status = GUARDSTAT_SURRENDERED;
- if (_vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.bridgeElasi2Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_ELASI_2, "p2surr", -1, -1, 0);
- _vm->_awayMission.tug.bridgeElasi2Status = GUARDSTAT_SURRENDERED;
+ _awayMission->tug.bridgeElasi2Status = GUARDSTAT_SURRENDERED;
}
- if (_vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.bridgeElasi3Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_ELASI_3, "p3surr", -1, -1, 0);
- _vm->_awayMission.tug.bridgeElasi3Status = GUARDSTAT_SURRENDERED;
+ _awayMission->tug.bridgeElasi3Status = GUARDSTAT_SURRENDERED;
}
- if (_vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP) {
+ if (_awayMission->tug.bridgeElasi4Status == GUARDSTAT_UP) {
loadActorAnim2(OBJECT_ELASI_4, "p4surr", -1, -1, 0);
- _vm->_awayMission.tug.bridgeElasi4Status = GUARDSTAT_SURRENDERED;
+ _awayMission->tug.bridgeElasi4Status = GUARDSTAT_SURRENDERED;
}
- _vm->_awayMission.tug.missionScore += 4;
+ _awayMission->tug.missionScore += 4;
}
void Room::tug3UsePhaserAnywhere() {
@@ -95,134 +95,134 @@ void Room::tug3UsePhaserAnywhere() {
}
void Room::tug3ElasiDrawPhasers() {
- if (_vm->_awayMission.tug.bridgeElasiDrewPhasers)
+ if (_awayMission->tug.bridgeElasiDrewPhasers)
return;
- _vm->_awayMission.tug.bridgeElasiDrewPhasers = true;
+ _awayMission->tug.bridgeElasiDrewPhasers = true;
// If brig guards are alive & untied, kill the hostages
- if (_vm->_awayMission.tug.guard1Status == 0 || _vm->_awayMission.tug.guard2Status == 0) {
+ if (_awayMission->tug.guard1Status == 0 || _awayMission->tug.guard2Status == 0) {
showText(TX_SPEAKER_ELASI_CLANSMAN, TX_TUG3L081);
- _vm->_awayMission.tug.missionScore = 0;
+ _awayMission->tug.missionScore = 0;
}
- if (_vm->_awayMission.timers[0] == 0)
- _vm->_awayMission.timers[0] = 10;
+ if (_awayMission->timers[0] == 0)
+ _awayMission->timers[0] = 10;
// Make all elasi draw their phasers
- if (_vm->_awayMission.tug.bridgeElasi1Status == 0)
+ if (_awayMission->tug.bridgeElasi1Status == 0)
loadActorAnim2(OBJECT_ELASI_1, "p1draw", -1, -1, 0);
- if (_vm->_awayMission.tug.bridgeElasi2Status == 0)
+ if (_awayMission->tug.bridgeElasi2Status == 0)
loadActorAnim2(OBJECT_ELASI_2, "p2draw", -1, -1, 0);
- if (_vm->_awayMission.tug.bridgeElasi3Status == 0)
+ if (_awayMission->tug.bridgeElasi3Status == 0)
loadActorAnim2(OBJECT_ELASI_3, "p3draw", -1, -1, 0);
- if (_vm->_awayMission.tug.bridgeElasi4Status == 0)
+ if (_awayMission->tug.bridgeElasi4Status == 0)
loadActorAnim2(OBJECT_ELASI_4, "p4draw", -1, -1, 0);
}
void Room::tug3UseStunPhaserOnElasi1() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi1Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi1Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_1, "p1stun", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem05", 5);
- _vm->_awayMission.tug.bridgeElasi1Status = GUARDSTAT_STUNNED;
+ _awayMission->tug.bridgeElasi1Status = GUARDSTAT_STUNNED;
tug3ElasiDrawPhasers();
}
void Room::tug3UseStunPhaserOnElasi2() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi2Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi2Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_2, "p2stun", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem06", 5);
- _vm->_awayMission.tug.bridgeElasi2Status = GUARDSTAT_STUNNED;
+ _awayMission->tug.bridgeElasi2Status = GUARDSTAT_STUNNED;
tug3ElasiDrawPhasers();
}
void Room::tug3UseStunPhaserOnElasi3() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi3Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi3Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_3, "p3stun", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem07", 5);
- _vm->_awayMission.tug.bridgeElasi3Status = GUARDSTAT_STUNNED;
+ _awayMission->tug.bridgeElasi3Status = GUARDSTAT_STUNNED;
tug3ElasiDrawPhasers();
}
void Room::tug3UseStunPhaserOnElasi4() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi4Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi4Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_4, "p4stun", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem04", 5);
- _vm->_awayMission.tug.bridgeElasi4Status = GUARDSTAT_STUNNED;
+ _awayMission->tug.bridgeElasi4Status = GUARDSTAT_STUNNED;
tug3ElasiDrawPhasers();
}
void Room::tug3UseKillPhaserOnElasi1() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi1Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi1Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_1, "p1Kill", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem25", 5);
- _vm->_awayMission.tug.bridgeElasi1Status = GUARDSTAT_DEAD;
- _vm->_awayMission.tug.missionScore -= 2;
+ _awayMission->tug.bridgeElasi1Status = GUARDSTAT_DEAD;
+ _awayMission->tug.missionScore -= 2;
tug3ElasiDrawPhasers();
}
void Room::tug3UseKillPhaserOnElasi2() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi2Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi2Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_2, "p2Kill", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem27", 5);
- _vm->_awayMission.tug.bridgeElasi2Status = GUARDSTAT_DEAD;
- _vm->_awayMission.tug.missionScore -= 2;
+ _awayMission->tug.bridgeElasi2Status = GUARDSTAT_DEAD;
+ _awayMission->tug.missionScore -= 2;
tug3ElasiDrawPhasers();
}
void Room::tug3UseKillPhaserOnElasi3() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi3Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi3Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_3, "p3Kill", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem26", 5);
- _vm->_awayMission.tug.bridgeElasi3Status = GUARDSTAT_DEAD;
- _vm->_awayMission.tug.missionScore -= 2;
+ _awayMission->tug.bridgeElasi3Status = GUARDSTAT_DEAD;
+ _awayMission->tug.missionScore -= 2;
tug3ElasiDrawPhasers();
}
void Room::tug3UseKillPhaserOnElasi4() {
- if (_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] || _vm->_awayMission.tug.bridgeElasi4Status != GUARDSTAT_UP)
+ if (_awayMission->tug.crewmanKilled[OBJECT_KIRK] || _awayMission->tug.bridgeElasi4Status != GUARDSTAT_UP)
return;
loadActorAnim2(OBJECT_ELASI_4, "p4Kill", -1, -1, 12);
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks("t3beem24", 5);
- _vm->_awayMission.tug.bridgeElasi4Status = GUARDSTAT_DEAD;
- _vm->_awayMission.tug.missionScore -= 2;
+ _awayMission->tug.bridgeElasi4Status = GUARDSTAT_DEAD;
+ _awayMission->tug.missionScore -= 2;
tug3ElasiDrawPhasers();
}
void Room::tug3ElasiStunnedOrKilled() {
- if (_vm->_awayMission.tug.bridgeWinMethod == 1)
+ if (_awayMission->tug.bridgeWinMethod == 1)
return;
- if (_vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_UP || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP
- || _vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP || _vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP)
+ if (_awayMission->tug.bridgeElasi1Status == GUARDSTAT_UP || _awayMission->tug.bridgeElasi2Status == GUARDSTAT_UP
+ || _awayMission->tug.bridgeElasi3Status == GUARDSTAT_UP || _awayMission->tug.bridgeElasi4Status == GUARDSTAT_UP)
return;
// BUGFIX: if the ship is deorbiting, the mission isn't won yet.
- if (_vm->_awayMission.tug.orbitalDecayCounter != 0)
+ if (_awayMission->tug.orbitalDecayCounter != 0)
return;
- _vm->_awayMission.tug.bridgeWinMethod = 1;
+ _awayMission->tug.bridgeWinMethod = 1;
tug3EndMission();
}
void Room::tug3TalkToElasi1() {
- if (_vm->_awayMission.tug.bridgeElasi1Status != GUARDSTAT_UP || _vm->_awayMission.tug.talkedToCereth)
+ if (_awayMission->tug.bridgeElasi1Status != GUARDSTAT_UP || _awayMission->tug.talkedToCereth)
return;
- _vm->_awayMission.tug.talkedToCereth = true;
+ _awayMission->tug.talkedToCereth = true;
const int choices[] = {
TX_SPEAKER_KIRK,
@@ -236,27 +236,27 @@ void Room::tug3TalkToElasi1() {
switch (choice) {
case 0: // They surrender
showText(TX_SPEAKER_ELASI_CERETH, TX_TUG3L084);
- _vm->_awayMission.tug.bridgeElasi1Status = GUARDSTAT_SURRENDERED;
+ _awayMission->tug.bridgeElasi1Status = GUARDSTAT_SURRENDERED;
loadActorAnim2(OBJECT_ELASI_1, "p1surr", -1, -1, 0);
tug3ElasiSurrendered();
- _vm->_awayMission.tug.bridgeWinMethod = 2;
- _vm->_awayMission.tug.missionScore += 8;
+ _awayMission->tug.bridgeWinMethod = 2;
+ _awayMission->tug.missionScore += 8;
tug3EndMission();
break;
case 1: // Cereth shoots console, doesn't surrender
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
showText(TX_SPEAKER_ELASI_CERETH, TX_TUG3_F27);
loadActorAnim2(OBJECT_ELASI_1, "p1draw", -1, -1, 3);
break;
case 2: // Cereth shoots console and surrenders
- _vm->_awayMission.disableInput = true;
+ _awayMission->disableInput = true;
showText(TX_SPEAKER_ELASI_CERETH, TX_TUG3L083);
loadActorAnim2(OBJECT_ELASI_1, "p1draw", -1, -1, 5);
// BUGFIX: they're going to surrender, so stop the firefight.
- _vm->_awayMission.timers[0] = 0;
+ _awayMission->timers[0] = 0;
break;
}
}
@@ -270,9 +270,9 @@ void Room::tug3Elasi1DrewPhaser() {
void Room::tug3Elasi1ShotConsole() {
tug3ElasiDrawPhasers();
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.bridgeWinMethod = 3;
- _vm->_awayMission.timers[1] = 10;
+ _awayMission->disableInput = false;
+ _awayMission->tug.bridgeWinMethod = 3;
+ _awayMission->timers[1] = 10;
}
void Room::tug3Elasi1DrewPhaser2() {
@@ -284,9 +284,9 @@ void Room::tug3Elasi1DrewPhaser2() {
void Room::tug3Elasi1ShotConsoleAndSurrenders() {
showText(TX_SPEAKER_ELASI_CERETH, TX_TUG3L080);
tug3ElasiSurrendered();
- _vm->_awayMission.disableInput = false;
- _vm->_awayMission.tug.bridgeWinMethod = 3;
- _vm->_awayMission.timers[1] = 10;
+ _awayMission->disableInput = false;
+ _awayMission->tug.bridgeWinMethod = 3;
+ _awayMission->timers[1] = 10;
}
void Room::tug3LookAtMccoy() {
@@ -308,7 +308,7 @@ void Room::tug3LookAtElasi1() {
// The function itself is changed by checking both if he's stunned or if he's dead,
// instead of just checking if he's stunned.
- if (_vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_STUNNED || _vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_DEAD)
+ if (_awayMission->tug.bridgeElasi1Status == GUARDSTAT_STUNNED || _awayMission->tug.bridgeElasi1Status == GUARDSTAT_DEAD)
showText(TX_TUG3N003);
else
showText(TX_TUG3N008);
@@ -317,32 +317,32 @@ void Room::tug3LookAtElasi1() {
void Room::tug3LookAtElasi2() {
// BUGFIX: also check if stunned. They can't "glare at the crewmembers" if they're
// unconscious. (applies to below functions too.)
- if (_vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_DEAD || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.bridgeElasi2Status == GUARDSTAT_DEAD || _awayMission->tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
showText(TX_TUG3N004);
else
showText(TX_TUG3N005);
}
void Room::tug3LookAtElasi3() {
- if (_vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_DEAD || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.bridgeElasi3Status == GUARDSTAT_DEAD || _awayMission->tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
showText(TX_TUG3N004);
else
showText(TX_TUG3N005);
}
void Room::tug3LookAtElasi4() {
- if (_vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_DEAD || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
+ if (_awayMission->tug.bridgeElasi4Status == GUARDSTAT_DEAD || _awayMission->tug.bridgeElasi2Status == GUARDSTAT_STUNNED)
showText(TX_TUG3N004);
else
showText(TX_TUG3N005);
}
void Room::tug3TalkToMccoy() {
- if (_vm->_awayMission.tug.orbitalDecayCounter != 0 || _vm->_awayMission.tug.bridgeElasi1Status != GUARDSTAT_UP) {
- if (_vm->_awayMission.tug.orbitalDecayCounter >= 10) {
- if (_vm->_awayMission.tug.orbitalDecayCounter < 16)
+ if (_awayMission->tug.orbitalDecayCounter != 0 || _awayMission->tug.bridgeElasi1Status != GUARDSTAT_UP) {
+ if (_awayMission->tug.orbitalDecayCounter >= 10) {
+ if (_awayMission->tug.orbitalDecayCounter < 16)
showText(TX_SPEAKER_MCCOY, TX_TUG3_011);
- } else if (_vm->_awayMission.tug.orbitalDecayCounter != 0) {
+ } else if (_awayMission->tug.orbitalDecayCounter != 0) {
// BUGFIX: original game displays a blank textbox. An appropriate audio file
// exists, but the corresponding text was written from scratch for ScummVM.
// TODO: check if original floppy version has text for this.
@@ -353,9 +353,9 @@ void Room::tug3TalkToMccoy() {
}
void Room::tug3TalkToSpock() {
- if (_vm->_awayMission.tug.orbitalDecayCounter != 0) {
- if (_vm->_awayMission.tug.orbitalDecayCounter >= 10) {
- if (_vm->_awayMission.tug.orbitalDecayCounter < 16)
+ if (_awayMission->tug.orbitalDecayCounter != 0) {
+ if (_awayMission->tug.orbitalDecayCounter >= 10) {
+ if (_awayMission->tug.orbitalDecayCounter < 16)
showText(TX_SPEAKER_SPOCK, TX_TUG3_008);
} else
showText(TX_SPEAKER_SPOCK, TX_TUG3_009);
@@ -367,36 +367,36 @@ void Room::tug3TalkToRedshirt() {
}
void Room::tug3UseCommunicator() {
- if (_vm->_awayMission.tug.orbitalDecayCounter == 0)
+ if (_awayMission->tug.orbitalDecayCounter == 0)
return;
- if (_vm->_awayMission.tug.orbitalDecayCounter < 10) {
+ if (_awayMission->tug.orbitalDecayCounter < 10) {
showText(TX_SPEAKER_KIRK, TX_TUG3_007);
showText(TX_SPEAKER_SULU, TX_TUG3_015);
showText(TX_SPEAKER_SHIPS_COMPUTER, TX_COMPA180);
- _vm->_awayMission.timers[1] = 0;
+ _awayMission->timers[1] = 0;
// BUGFIX: if still fighting the elasi, the mission isn't done yet.
- _vm->_awayMission.tug.orbitalDecayCounter = 0;
- if (!_vm->_awayMission.tug.elasiSurrendered &&
- (_vm->_awayMission.tug.bridgeElasi1Status == GUARDSTAT_UP
- || _vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP
- || _vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP
- || _vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP))
+ _awayMission->tug.orbitalDecayCounter = 0;
+ if (!_awayMission->tug.elasiSurrendered &&
+ (_awayMission->tug.bridgeElasi1Status == GUARDSTAT_UP
+ || _awayMission->tug.bridgeElasi2Status == GUARDSTAT_UP
+ || _awayMission->tug.bridgeElasi3Status == GUARDSTAT_UP
+ || _awayMission->tug.bridgeElasi4Status == GUARDSTAT_UP))
return;
tug3EndMission();
} else {
- if (_vm->_awayMission.tug.orbitalDecayCounter < 16) {
+ if (_awayMission->tug.orbitalDecayCounter < 16) {
showText(TX_SPEAKER_KIRK, TX_TUG3_006);
showText(TX_SPEAKER_SCOTT, TX_TUG3_S07);
playMidiMusicTracks(-1, -1);
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.missionScore < 0)
- _vm->_awayMission.tug.missionScore = 0;
- endMission(_vm->_awayMission.tug.missionScore, _vm->_awayMission.tug.field2b, _vm->_awayMission.tug.field2d);
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.missionScore < 0)
+ _awayMission->tug.missionScore = 0;
+ endMission(_awayMission->tug.missionScore, _awayMission->tug.field2b, _awayMission->tug.field2d);
}
}
}
@@ -411,31 +411,31 @@ void Room::tug3Timer0Expired() {
int elasiShooter, elasiTarget;
- if (_vm->_awayMission.tug.bridgeElasi2Status == GUARDSTAT_UP)
+ if (_awayMission->tug.bridgeElasi2Status == GUARDSTAT_UP)
elasiShooter = 0;
- else if (_vm->_awayMission.tug.bridgeElasi3Status == GUARDSTAT_UP)
+ else if (_awayMission->tug.bridgeElasi3Status == GUARDSTAT_UP)
elasiShooter = 1;
- else if (_vm->_awayMission.tug.bridgeElasi4Status == GUARDSTAT_UP)
+ else if (_awayMission->tug.bridgeElasi4Status == GUARDSTAT_UP)
elasiShooter = 2;
else
return;
- if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT]) {
- _vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT] = 2;
- _vm->_awayMission.redshirtDead = true;
+ if (!_awayMission->tug.crewmanKilled[OBJECT_REDSHIRT]) {
+ _awayMission->tug.crewmanKilled[OBJECT_REDSHIRT] = 2;
+ _awayMission->redshirtDead = true;
loadActorAnim2(OBJECT_REDSHIRT, "rkills", -1, -1, 0);
elasiTarget = OBJECT_REDSHIRT;
- } else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK]) {
- _vm->_awayMission.tug.crewmanKilled[OBJECT_KIRK] = 2;
- _vm->_awayMission.disableInput = true;
+ } else if (!_awayMission->tug.crewmanKilled[OBJECT_KIRK]) {
+ _awayMission->tug.crewmanKilled[OBJECT_KIRK] = 2;
+ _awayMission->disableInput = true;
loadActorAnim2(OBJECT_KIRK, "kkills", -1, -1, 0);
elasiTarget = OBJECT_KIRK;
- } else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK]) {
- _vm->_awayMission.tug.crewmanKilled[OBJECT_SPOCK] = 2;
+ } else if (!_awayMission->tug.crewmanKilled[OBJECT_SPOCK]) {
+ _awayMission->tug.crewmanKilled[OBJECT_SPOCK] = 2;
loadActorAnim2(OBJECT_SPOCK, "skills", -1, -1, 0);
elasiTarget = OBJECT_SPOCK;
- } else if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY]) {
- _vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY] = 2;
+ } else if (!_awayMission->tug.crewmanKilled[OBJECT_MCCOY]) {
+ _awayMission->tug.crewmanKilled[OBJECT_MCCOY] = 2;
loadActorAnim2(OBJECT_MCCOY, "mkills", -1, -1, 13);
elasiTarget = OBJECT_MCCOY;
} else
@@ -443,7 +443,7 @@ void Room::tug3Timer0Expired() {
playSoundEffectIndex(SND_PHASSHOT);
showBitmapFor5Ticks(beamAnims[elasiShooter][elasiTarget], 5);
- _vm->_awayMission.timers[0] = 50;
+ _awayMission->timers[0] = 50;
}
void Room::tug3AllCrewmenDead() {
@@ -453,14 +453,14 @@ void Room::tug3AllCrewmenDead() {
// "Orbital decay" countdown timer
void Room::tug3Timer1Expired() {
- if (_vm->_awayMission.tug.orbitalDecayCounter < 10) { // Decay still preventable
+ if (_awayMission->tug.orbitalDecayCounter < 10) { // Decay still preventable
showText(TX_SPEAKER_SHIPS_COMPUTER, TX_COMPU182);
- _vm->_awayMission.timers[1] = 100;
- _vm->_awayMission.tug.orbitalDecayCounter++;
- } else if (_vm->_awayMission.tug.orbitalDecayCounter < 16) { // Decay now unavoidable
+ _awayMission->timers[1] = 100;
+ _awayMission->tug.orbitalDecayCounter++;
+ } else if (_awayMission->tug.orbitalDecayCounter < 16) { // Decay now unavoidable
showText(TX_SPEAKER_SHIPS_COMPUTER, TX_COMPU181);
- _vm->_awayMission.timers[1] = 100;
- _vm->_awayMission.tug.orbitalDecayCounter++;
+ _awayMission->timers[1] = 100;
+ _awayMission->tug.orbitalDecayCounter++;
} else { // Game over
showText(TX_TUG3N006);
showGameOverMenu();
@@ -485,10 +485,10 @@ void Room::tug3SecurityTeamBeamedIn() {
showText(TX_SPEAKER_SCOTT, TX_TUG3_S08);
playMidiMusicTracks(-1, -1);
- _vm->_awayMission.disableInput = true;
- if (_vm->_awayMission.tug.missionScore < 0)
- _vm->_awayMission.tug.missionScore = 0;
- endMission(_vm->_awayMission.tug.missionScore, _vm->_awayMission.tug.field2b, _vm->_awayMission.tug.field2d);
+ _awayMission->disableInput = true;
+ if (_awayMission->tug.missionScore < 0)
+ _awayMission->tug.missionScore = 0;
+ endMission(_awayMission->tug.missionScore, _awayMission->tug.field2b, _awayMission->tug.field2d);
}
}
diff --git a/engines/startrek/sound.h b/engines/startrek/sound.h
index 5354d92fd9..1b7021a30c 100644
--- a/engines/startrek/sound.h
+++ b/engines/startrek/sound.h
@@ -23,6 +23,7 @@
#ifndef STARTREK_SOUND_H
#define STARTREK_SOUND_H
+#include "startrek/soundeffects.h"
#include "startrek/startrek.h"
#include "audio/midiparser.h"
@@ -38,66 +39,6 @@ namespace StarTrek {
class StarTrekEngine;
-// Sound effects for "playSoundEffectIndex" function
-enum SoundEffects {
- SND_TRICORDER = 4,
- SND_DOOR1 = 5,
- SND_PHASSHOT = 6,
- SND_07 = 7,
- SND_TRANSDEM = 8,
- SND_TRANSMAT = 9,
- SND_TRANSENE = 0x0a,
- SND_BLANK_0b = 0x0b,
- SND_SELECTION = 0x10,
- SND_BLANK_14 = 0x14,
- SND_BLANK_16 = 0x16,
- SND_HAILING = 0x22,
- SND_PHASSHOT_2 = 0x24,
- SND_PHOTSHOT = 0x25,
- SND_HITSHIEL = 0x26,
- SND_27 = 0x27,
- SND_REDALERT = 0x28,
- SND_WARP = 0x29
-};
-
-
-enum MidiTracks {
- MIDITRACK_0,
- MIDITRACK_1,
- MIDITRACK_2,
- MIDITRACK_3,
- MIDITRACK_4,
- MIDITRACK_5,
- MIDITRACK_6,
- MIDITRACK_7,
- MIDITRACK_8,
- MIDITRACK_9,
- MIDITRACK_10,
- MIDITRACK_11,
- MIDITRACK_12,
- MIDITRACK_13,
- MIDITRACK_14,
- MIDITRACK_15,
- MIDITRACK_16,
- MIDITRACK_17,
- MIDITRACK_18,
- MIDITRACK_19,
- MIDITRACK_20,
- MIDITRACK_21,
- MIDITRACK_22,
- MIDITRACK_23,
- MIDITRACK_24,
- MIDITRACK_25,
- MIDITRACK_26,
- MIDITRACK_27,
- MIDITRACK_28,
- MIDITRACK_29,
- MIDITRACK_30,
- MIDITRACK_31,
- MIDITRACK_32,
- MIDITRACK_33
-};
-
// Max # of VOC files that can play at once
const int MAX_SFX_PLAYING = 4;
diff --git a/engines/startrek/soundeffects.h b/engines/startrek/soundeffects.h
new file mode 100644
index 0000000000..357c36eb08
--- /dev/null
+++ b/engines/startrek/soundeffects.h
@@ -0,0 +1,87 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef STARTREK_SOUNDEFFECTS_H
+#define STARTREK_SOUNDEFFECTS_H
+
+
+// Sound effects for "playSoundEffectIndex" function
+enum SoundEffects {
+ SND_TRICORDER = 4,
+ SND_DOOR1 = 5,
+ SND_PHASSHOT = 6,
+ SND_07 = 7,
+ SND_TRANSDEM = 8,
+ SND_TRANSMAT = 9,
+ SND_TRANSENE = 0x0a,
+ SND_BLANK_0b = 0x0b,
+ SND_SELECTION = 0x10,
+ SND_BLANK_14 = 0x14,
+ SND_BLANK_16 = 0x16,
+ SND_HAILING = 0x22,
+ SND_PHASSHOT_2 = 0x24,
+ SND_PHOTSHOT = 0x25,
+ SND_HITSHIEL = 0x26,
+ SND_27 = 0x27,
+ SND_REDALERT = 0x28,
+ SND_WARP = 0x29
+};
+
+
+enum MidiTracks {
+ MIDITRACK_0,
+ MIDITRACK_1,
+ MIDITRACK_2,
+ MIDITRACK_3,
+ MIDITRACK_4,
+ MIDITRACK_5,
+ MIDITRACK_6,
+ MIDITRACK_7,
+ MIDITRACK_8,
+ MIDITRACK_9,
+ MIDITRACK_10,
+ MIDITRACK_11,
+ MIDITRACK_12,
+ MIDITRACK_13,
+ MIDITRACK_14,
+ MIDITRACK_15,
+ MIDITRACK_16,
+ MIDITRACK_17,
+ MIDITRACK_18,
+ MIDITRACK_19,
+ MIDITRACK_20,
+ MIDITRACK_21,
+ MIDITRACK_22,
+ MIDITRACK_23,
+ MIDITRACK_24,
+ MIDITRACK_25,
+ MIDITRACK_26,
+ MIDITRACK_27,
+ MIDITRACK_28,
+ MIDITRACK_29,
+ MIDITRACK_30,
+ MIDITRACK_31,
+ MIDITRACK_32,
+ MIDITRACK_33
+};
+
+#endif