aboutsummaryrefslogtreecommitdiff
path: root/engines/startrek/rooms
diff options
context:
space:
mode:
authorMatthew Stewart2018-06-20 05:51:54 -0400
committerEugene Sandulenko2018-08-09 08:37:30 +0200
commitdc1e44efb9863333300482bcb4c352cf8de66bf8 (patch)
tree992f54cc51c16e6ff0d4a1700dcf1cf22d7c5ebe /engines/startrek/rooms
parent44b0a4c7bb4615933a7e9f6124a7fffbd309da8d (diff)
downloadscummvm-rg350-dc1e44efb9863333300482bcb4c352cf8de66bf8.tar.gz
scummvm-rg350-dc1e44efb9863333300482bcb4c352cf8de66bf8.tar.bz2
scummvm-rg350-dc1e44efb9863333300482bcb4c352cf8de66bf8.zip
STARTREK: Most of LOVE2 done
Diffstat (limited to 'engines/startrek/rooms')
-rw-r--r--engines/startrek/rooms/function_map.h113
-rw-r--r--engines/startrek/rooms/love0.cpp4
-rw-r--r--engines/startrek/rooms/love2.cpp825
3 files changed, 938 insertions, 4 deletions
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index a1cb9286cb..b16dbff5f8 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -946,6 +946,119 @@ RoomAction love1ActionList[] = {
RoomAction love2ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::love2Tick1 },
+ { Action(ACTION_TOUCHED_WARP, 1, 0, 0), &Room::love2TouchedWarp1 },
+ { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::love2Timer3Expired },
+ { Action(ACTION_WALK, 10, 0, 0), &Room::love2WalkToDoor },
+ { Action(ACTION_WALK, 0x22, 0, 0), &Room::love2WalkToDoor },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::love2TouchedHotspot0 },
+ { Action(ACTION_FINISHED_WALKING, 14, 0, 0), &Room::love2DoorReachedOrOpened },
+ { Action(ACTION_FINISHED_ANIMATION, 1, 0, 0), &Room::love2DoorReachedOrOpened },
+ { Action(ACTION_LOOK, 8, 0, 0), &Room::love2LookAtCabinet },
+ { Action(ACTION_LOOK, 10, 0, 0), &Room::love2LookAtDoor },
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::love2LookAtSynthesizer },
+ { Action(ACTION_LOOK, -1, 0, 0), &Room::love2LookAtAnywhere },
+ { Action(ACTION_LOOK, 14, 0, 0), &Room::love2LookAtAntigrav },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::love2LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::love2LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::love2LookAtRedshirt },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::love2LookAtKirk },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::love2LookAtArdak },
+ { Action(ACTION_LOOK, 15, 0, 0), &Room::love2LookAtChamber },
+ { Action(ACTION_LOOK, 16, 0, 0), &Room::love2LookAtChamber },
+ { Action(ACTION_LOOK, 18, 0, 0), &Room::love2LookAtChamber },
+ { Action(ACTION_LOOK, 19, 0, 0), &Room::love2LookAtChamber },
+ { Action(ACTION_LOOK, 17, 0, 0), &Room::love2LookAtChamber },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::love2LookAtChamber },
+ { Action(ACTION_LOOK, 12, 0, 0), &Room::love2LookAtCan1 },
+ { Action(ACTION_LOOK, 13, 0, 0), &Room::love2LookAtCan2 },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::love2TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::love2TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::love2TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::love2TalkToRedshirt },
+ { Action(ACTION_USE, OBJECT_IMTRICOR, -1, 0), &Room::love2UseMTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::love2UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_KIRK, 8, 0), &Room::love2UseKirkOnCabinet },
+ { Action(ACTION_USE, OBJECT_SPOCK, 8, 0), &Room::love2UseSpockOnCabinet },
+ { Action(ACTION_USE, OBJECT_MCCOY, 8, 0), &Room::love2UseMccoyOnCabinet },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 8, 0), &Room::love2UseRedshirtOnCabinet },
+ { Action(ACTION_FINISHED_WALKING, 12, 0, 0), &Room::love2CrewmanReachedCabinet },
+ { Action(ACTION_FINISHED_ANIMATION, 11, 0, 0), &Room::love2CrewmanAccessedCabinet },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::love2CrewmanOpenedOrClosedCabinet },
+ { Action(ACTION_USE, OBJECT_IWRENCH, 11, 0), &Room::love2UseWrenchOnGasFeed },
+ { Action(ACTION_FINISHED_WALKING, 1, 0, 0), &Room::love2ReachedGasFeed },
+ { Action(ACTION_FINISHED_ANIMATION, 12, 0, 0), &Room::love2ChangedGasFeed },
+ { Action(ACTION_USE, OBJECT_IO2GAS, 0x23, 0), &Room::love2UseO2GasOnCanisterSlot },
+ { Action(ACTION_USE, OBJECT_IH2GAS, 0x23, 0), &Room::love2UseH2GasOnCanisterSlot },
+ { Action(ACTION_USE, OBJECT_IN2GAS, 0x23, 0), &Room::love2UseN2GasOnCanisterSlot },
+ { Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::love2ReachedCanisterSlot },
+ { Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::love2PutCanisterInSlot1 },
+ { Action(ACTION_FINISHED_ANIMATION, 14, 0, 0), &Room::love2PutCanisterInSlot2 },
+ { Action(ACTION_USE, OBJECT_IANTIGRA, 12, 0), &Room::love2UseAntigravOnCanister1 },
+ { Action(ACTION_FINISHED_WALKING, 4, 0, 0), &Room::love2ReachedCanisterSlot1ToGet },
+ { Action(ACTION_FINISHED_ANIMATION, 15, 0, 0), &Room::love2TookCanister1 },
+ { Action(ACTION_USE, OBJECT_IANTIGRA, 13, 0), &Room::love2UseAntigravOnCanister2 },
+ { Action(ACTION_FINISHED_WALKING, 5, 0, 0), &Room::love2ReachedCanisterSlot2ToGet },
+ { Action(ACTION_FINISHED_ANIMATION, 16, 0, 0), &Room::love2TookCanister2 },
+ { Action(ACTION_USE, OBJECT_KIRK, 0x20, 0), &Room::love2UseKirkOnSynthesizer },
+ { Action(ACTION_USE, OBJECT_SPOCK, 0x20, 0), &Room::love2UseSpockOnSynthesizer },
+ { Action(ACTION_USE, OBJECT_MCCOY, 0x20, 0), &Room::love2UseMccoyOnSynthesizer },
+ { Action(ACTION_USE, OBJECT_REDSHIRT, 0x20, 0), &Room::love2UseRedshirtOnSynthesizer },
+ { Action(ACTION_FINISHED_WALKING, 13, 0, 0), &Room::love2CrewmanReachedSynthesizer },
+ { Action(ACTION_FINISHED_ANIMATION, 17, 0, 0), &Room::love2CrewmanUsedSynthesizer },
+ { Action(ACTION_FINISHED_WALKING, 16, 0, 0), &Room::love2SpockReachedGasFeeds },
+ { Action(ACTION_FINISHED_ANIMATION, 18, 0, 0), &Room::love2SpockEnabledGasFeeds },
+ { Action(ACTION_FINISHED_ANIMATION, 3, 0, 0), &Room::love2SynthesizerDoorClosed },
+ { Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::love2SynthesizerFinished },
+ { Action(ACTION_FINISHED_ANIMATION, 27, 0, 0), &Room::love2FinishedAnimation27 },
+
+ // TODO: more
+
+ { Action(ACTION_USE, OBJECT_IPBC, 9, 0), &Room::love2UsePolyberylcarbonateOnSynthesizerDoor },
+ { Action(ACTION_FINISHED_WALKING, 6, 0, 0), &Room::love2KirkReachedSynthesizerWithPolyberylcarbonate },
+ { Action(ACTION_FINISHED_ANIMATION, 5, 0, 0), &Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate },
+ { Action(ACTION_FINISHED_ANIMATION, 19, 0, 0), &Room::love2PutPolyberylcarbonateInSynthesizer },
+
+ { Action(ACTION_USE, OBJECT_IDISHES, 9, 0), &Room::love2UseDishesOnSynthesizerDoor },
+ { Action(ACTION_FINISHED_WALKING, 7, 0, 0), &Room::love2KirkReachedSynthesizerWithDishes },
+ { Action(ACTION_FINISHED_ANIMATION, 6, 0, 0), &Room::love2SynthesizerDoorOpenedWithDishes },
+ { Action(ACTION_FINISHED_ANIMATION, 20, 0, 0), &Room::love2PutDishesInSynthesizer },
+
+ { Action(ACTION_USE, OBJECT_ISAMPLE, 9, 0), &Room::love2UseSampleOnSynthesizerDoor },
+ { Action(ACTION_FINISHED_WALKING, 8, 0, 0), &Room::love2KirkReachedSynthesizerWithSample },
+ { Action(ACTION_FINISHED_ANIMATION, 7, 0, 0), &Room::love2SynthesizerDoorOpenedWithSample },
+ { Action(ACTION_FINISHED_ANIMATION, 21, 0, 0), &Room::love2PutSampleInSynthesizer },
+
+ { Action(ACTION_USE, -1, 9, 0), &Room::love2UseAnythingOnSynthesizerDoor },
+ { Action(ACTION_USE, -1, 0x20, 0), &Room::love2UseAnythingOnSynthesizer },
+ { Action(ACTION_GET, 13, 0, 0), &Room::love2GetCanister },
+ { Action(ACTION_GET, 12, 0, 0), &Room::love2GetCanister },
+
+ { Action(ACTION_GET, 14, 0, 0), &Room::love2GetAntigrav },
+ { Action(ACTION_FINISHED_WALKING, 9, 0, 0), &Room::love2ReachedAntigrav },
+ { Action(ACTION_FINISHED_ANIMATION, 22, 0, 0), &Room::love2GotAntigrav },
+
+ { Action(ACTION_GET, 16, 0, 0), &Room::love2GetPolyberylcarbonate },
+ { Action(ACTION_FINISHED_WALKING, 18, 0, 0), &Room::love2ReachedPolyberylcarbonate },
+ { Action(ACTION_FINISHED_ANIMATION, 26, 0, 0), &Room::love2GotPolyberylcarbonate },
+
+ { Action(ACTION_GET, 17, 0, 0), &Room::love2GetDishes },
+ { Action(ACTION_FINISHED_WALKING, 17, 0, 0), &Room::love2ReachedDishes },
+ { Action(ACTION_FINISHED_ANIMATION, 25, 0, 0), &Room::love2GotDishes },
+
+ { Action(ACTION_GET, 18, 0, 0), &Room::love2GetSample },
+ { Action(ACTION_FINISHED_WALKING, 19, 0, 0), &Room::love2ReachedSample },
+ { Action(ACTION_FINISHED_ANIMATION, 28, 0, 0), &Room::love2GotSample },
+
+ { Action(ACTION_GET, 15, 0, 0), &Room::love2GetSynthesizerOutput },
+ { Action(ACTION_FINISHED_WALKING, 10, 0, 0), &Room::love2ReachedSynthesizerOutput },
+ { Action(ACTION_FINISHED_ANIMATION, 23, 0, 0), &Room::love2GotSynthesizerOutput },
+
+ // TODO: test these
+ { Action(ACTION_GET, 19, 0, 0), &Room::love2GetCure },
+ { Action(ACTION_FINISHED_WALKING, 11, 0, 0), &Room::love2ReachedCure },
+ { Action(ACTION_FINISHED_ANIMATION, 24, 0, 0), &Room::love2GotCure },
+
+ // TODO: common code
};
RoomAction love3ActionList[] = {
diff --git a/engines/startrek/rooms/love0.cpp b/engines/startrek/rooms/love0.cpp
index e4e3932944..d43f35d7a5 100644
--- a/engines/startrek/rooms/love0.cpp
+++ b/engines/startrek/rooms/love0.cpp
@@ -34,8 +34,8 @@ namespace StarTrek {
void Room::love0Tick1() {
if (!_vm->_awayMission.love.alreadyStartedMission) {
- _vm->_awayMission.love.field36 = 1;
- _vm->_awayMission.love.field37 = 2;
+ _vm->_awayMission.love.canister1 = CANTYPE_O2;
+ _vm->_awayMission.love.canister2 = CANTYPE_H2;
_vm->_awayMission.love.alreadyStartedMission = true;
playVoc("LOV0LOOP"); // FIXME: no audio after first entry?
}
diff --git a/engines/startrek/rooms/love2.cpp b/engines/startrek/rooms/love2.cpp
index 43cdd64ecf..1744b108ba 100644
--- a/engines/startrek/rooms/love2.cpp
+++ b/engines/startrek/rooms/love2.cpp
@@ -20,16 +20,837 @@
*
*/
+// BUGFIX: some of the audio filenames in the text were incorrect? (see text.h)
+
#include "startrek/room.h"
-#define OBJECT_DOOR1 8
+#define OBJECT_CABINET 8
+#define OBJECT_SYNTHESIZER_DOOR 9
+#define OBJECT_DOOR 10
+#define OBJECT_GAS_FEED 11
+#define OBJECT_CAN1 12
+#define OBJECT_CAN2 13
+#define OBJECT_ANTIGRAV 14
+#define OBJECT_SYNTHESIZER_OUTPUT 15
+#define OBJECT_POLYBERYLCARBONATE 16
+#define OBJECT_DISHES 17
+#define OBJECT_CURESAMPLE 18
+#define OBJECT_CURE 19
-#define HOTSPOT_CONSOLE 0x20
+#define HOTSPOT_SYNTHESIZER 0x20
+#define HOTSPOT_ARDAK 0x21
+#define HOTSPOT_DOOR 0x22
+#define HOTSPOT_CANISTER_SLOT 0x23
namespace StarTrek {
void Room::love2Tick1() {
+ playVoc("LOV2LOOP");
+
+ char canName[10];
+
+ switch (_vm->_awayMission.love.canister1) {
+ case CANTYPE_O2:
+ strcpy(canName, "o2can");
+ break;
+ case CANTYPE_H2:
+ strcpy(canName, "h2can");
+ break;
+ case CANTYPE_N2:
+ strcpy(canName, "n2can");
+ break;
+ default:
+ break;
+ }
+
+ if (_vm->_awayMission.love.canister1 >= 1 && _vm->_awayMission.love.canister1 <= 3)
+ loadActorAnim(OBJECT_CAN1, canName, 0xa7, 0xae, 0);
+
+ switch (_vm->_awayMission.love.canister2) {
+ case CANTYPE_O2:
+ strcpy(canName, "o2can");
+ break;
+ case CANTYPE_H2:
+ strcpy(canName, "h2can");
+ break;
+ case CANTYPE_N2:
+ strcpy(canName, "n2can");
+ break;
+ default:
+ break;
+ }
+
+ if (_vm->_awayMission.love.canister2 >= 1 && _vm->_awayMission.love.canister2 <= 3)
+ loadActorAnim(OBJECT_CAN2, canName, 0xb1, 0xaf, 0);
+
+ if (_vm->_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)
+ loadActorAnim(OBJECT_CABINET, "s3r3d1o", 0x1e, 0xaf, 0);
+ else
+ loadActorAnim(OBJECT_CABINET, "s3r3d1c", 0x1e, 0xaf, 0);
+
+ if (_vm->_awayMission.love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
+ loadActorAnim(OBJECT_ANTIGRAV, "antigr", 0x1f, 0xa7, 0);
+
+ if (_vm->_awayMission.love.field35 != 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.field35) {
+ case 1:
+ strcpy(_roomVar.love2.d6, "pbcanm");
+ _roomVar.love2.d2 = 0x10;
+ break;
+ case 2:
+ strcpy(_roomVar.love2.d6, "dishes");
+ _roomVar.love2.d2 = 0x11;
+ break;
+ case 3:
+ strcpy(_roomVar.love2.d6, "dishes");
+ _roomVar.love2.d2 = 0x12;
+ break;
+ case 9:
+ switch (_vm->_awayMission.love.synthesizerProduct) {
+ case 1:
+ strcpy(_roomVar.love2.d8, "btle1");
+ _roomVar.love2.d2 = 0x0f;
+ break;
+ case 2:
+ strcpy(_roomVar.love2.d8, "btle2");
+ _roomVar.love2.d2 = 0x0f;
+ break;
+ case 3:
+ strcpy(_roomVar.love2.d8, "btle3");
+ _roomVar.love2.d2 = 0x0f;
+ break;
+ case 4:
+ strcpy(_roomVar.love2.d8, "btle4");
+ _roomVar.love2.d2 = 0x0f;
+ break;
+ default:
+ strcpy(_roomVar.love2.d8, "cure");
+ _roomVar.love2.d2 = 0x13;
+ break;
+ }
+ break;
+ default:
+ valid = false;
+ break;
+ }
+
+ if (valid) {
+ if (_vm->_awayMission.love.field35 == 9)
+ loadActorAnim2(_roomVar.love2.d2, _roomVar.love2.d8, 0x8a, 0x8b, 0);
+ else
+ loadActorAnim2(_roomVar.love2.d2, _roomVar.love2.d6, 0x8a, 0x8b, 0);
+ }
+
+ if (_vm->_awayMission.love.field2c)
+ _vm->_awayMission.timers[0] = getRandomWordInRange(200, 400);
+ if (_vm->_awayMission.love.field2d)
+ _vm->_awayMission.timers[1] = getRandomWordInRange(200, 400);
+ _vm->_awayMission.timers[2] = 200;
+
+ loadActorAnim(OBJECT_DOOR, "s3r3d3a", 0x12a, 0xb5, 0);
+
+ _roomVar.love2._2966 = 0xc9;
+ _roomVar.love2._2967 = 0xb7;
+}
+
+void Room::love2TouchedWarp1() {
+ _vm->_awayMission.disableInput = true;
+ playSoundEffectIndex(SND_DOOR1);
+ _vm->_awayMission.timers[3] = 10;
+}
+
+void Room::love2Timer3Expired() {
+ loadRoomIndex(0, 0);
+}
+
+void Room::love2WalkToDoor() {
+ _vm->_awayMission.disableInput = true;
+ _roomVar.love2.walkingToDoor = true;
+ walkCrewman(OBJECT_KIRK, 0x127, 0xba, 14);
+}
+
+// Triggers door opening
+void Room::love2TouchedHotspot0() {
+ if (_roomVar.love2.walkingToDoor) {
+ loadActorAnim(OBJECT_DOOR, "s3r3d3", 0x12a, 0xb5, 1);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::love2DoorReachedOrOpened() {
+ _roomVar.love2.doorOpenCounter++;
+ if (_roomVar.love2.doorOpenCounter == 2)
+ loadRoomIndex(1, 1);
+}
+
+void Room::love2LookAtCabinet() {
+ showText(TX_LOV2N027);
+}
+
+void Room::love2LookAtDoor() {
+ showText(TX_LOV2N001);
+}
+
+void Room::love2LookAtSynthesizer() {
+ showText(TX_LOV2N028);
+}
+
+void Room::love2LookAtAnywhere() {
+ showText(TX_LOV2N026);
+}
+
+void Room::love2LookAtAntigrav() {
+ showText(TX_LOV2N006);
+}
+
+void Room::love2LookAtMccoy() {
+ showText(TX_LOV2N011);
+}
+
+void Room::love2LookAtSpock() {
+ showText(TX_LOV2N014);
+}
+
+void Room::love2LookAtRedshirt() {
+ showText(TX_LOV2N010);
+}
+
+void Room::love2LookAtKirk() {
+ showText(TX_LOV2N009);
+}
+
+void Room::love2LookAtArdak() {
+ showText(TX_LOV2N045);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_037);
+}
+
+void Room::love2LookAtChamber() {
+ showText(TX_LOV2N029);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_035);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_019);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_033);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_016);
+}
+
+void Room::love2LookAtCan1() {
+ switch (_vm->_awayMission.love.canister1) {
+ case CANTYPE_O2:
+ showText(TX_LOV2N004);
+ break;
+ case CANTYPE_H2:
+ showText(TX_LOV2N002);
+ break;
+ case CANTYPE_N2:
+ default:
+ showText(TX_LOV2N003);
+ break;
+ }
+}
+
+void Room::love2LookAtCan2() {
+ switch (_vm->_awayMission.love.canister2) {
+ case CANTYPE_O2:
+ showText(TX_LOV2N004);
+ break;
+ case CANTYPE_H2:
+ showText(TX_LOV2N002);
+ break;
+ case CANTYPE_N2:
+ default:
+ showText(TX_LOV2N003);
+ break;
+ }
+}
+
+void Room::love2TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_LOV2_001);
+}
+
+void Room::love2TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_029);
+}
+
+void Room::love2TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_009);
+}
+
+void Room::love2TalkToRedshirt() {
+ showText(TX_SPEAKER_FERRIS, TX_LOV2_041);
+}
+
+void Room::love2UseMTricorderAnywhere() {
+ if (_vm->_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
+ // audio from another room.
+ mccoyScan(DIR_S, TX_LOV1_010, false);
+}
+
+void Room::love2UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_LOV2_027, false);
+}
+
+void Room::love2UseKirkOnCabinet() {
+ _roomVar.love2.d2 = OBJECT_KIRK;
+ walkCrewman(OBJECT_KIRK, 0x2b, 0xbb, 12);
+}
+
+void Room::love2UseSpockOnCabinet() {
+ _roomVar.love2.d2 = OBJECT_SPOCK;
+ walkCrewman(OBJECT_SPOCK, 0x2b, 0xbb, 12);
+}
+
+void Room::love2UseMccoyOnCabinet() {
+ _roomVar.love2.d2 = OBJECT_MCCOY;
+ walkCrewman(OBJECT_MCCOY, 0x2b, 0xbb, 12);
+}
+
+void Room::love2UseRedshirtOnCabinet() {
+ _roomVar.love2.d2 = OBJECT_REDSHIRT;
+ walkCrewman(OBJECT_REDSHIRT, 0x2b, 0xbb, 12);
+}
+
+void Room::love2CrewmanReachedCabinet() {
+ Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love2.d2, "usehw");
+ loadActorAnim2(_roomVar.love2.d2, anim, -1, -1, 11);
+}
+
+void Room::love2CrewmanAccessedCabinet() {
+ if (_vm->_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)
+ loadActorStandAnim(OBJECT_ANTIGRAV);
+
+ _vm->_awayMission.love.cabinetOpen = !_vm->_awayMission.love.cabinetOpen;
+}
+
+void Room::love2CrewmanOpenedOrClosedCabinet() {
+ if (_vm->_awayMission.love.cabinetOpen && !haveItem(OBJECT_IANTIGRA))
+ loadActorAnim(OBJECT_ANTIGRAV, "antigr", 0x1f, 0xa7, 0);
+}
+
+void Room::love2UseWrenchOnGasFeed() {
+ walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 1);
+}
+
+void Room::love2ReachedGasFeed() {
+ loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 12);
+ playVoc("MUR3E1S");
+}
+
+void Room::love2ChangedGasFeed() {
+ if (_vm->_awayMission.love.gasFeedOn) {
+ _vm->_awayMission.love.gasFeedOn = false;
+ loadActorAnim2(OBJECT_GAS_FEED, "s3r3v2", 0xac, 0x75, 0);
+ showText(TX_LOV2N007);
+ }
+ else {
+ _vm->_awayMission.love.gasFeedOn = true;
+ loadActorAnim2(OBJECT_GAS_FEED, "s3r3v1", 0xac, 0x75, 0);
+ showText(TX_LOV2N008);
+ }
+}
+
+void Room::love2UseO2GasOnCanisterSlot() {
+ _roomVar.love2.canisterType = CANTYPE_O2;
+ strcpy(_roomVar.love2.canisterAnim, "o2can");
+ _roomVar.love2.canisterItem = OBJECT_IO2GAS;
+ walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 3);
+}
+
+void Room::love2UseH2GasOnCanisterSlot() {
+ _roomVar.love2.canisterType = CANTYPE_H2;
+ strcpy(_roomVar.love2.canisterAnim, "h2can");
+ _roomVar.love2.canisterItem = OBJECT_IH2GAS;
+ walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 3);
+}
+
+void Room::love2UseN2GasOnCanisterSlot() {
+ _roomVar.love2.canisterType = CANTYPE_N2;
+ strcpy(_roomVar.love2.canisterAnim, "n2can");
+ _roomVar.love2.canisterItem = OBJECT_IN2GAS;
+ walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 3);
+}
+
+void Room::love2ReachedCanisterSlot() {
+ if (_vm->_awayMission.love.gasFeedOn)
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_026);
+ else {
+ if (_vm->_awayMission.love.canister1 == CANTYPE_NONE)
+ loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 13);
+ else if (_vm->_awayMission.love.canister2 == CANTYPE_NONE)
+ loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 14);
+ else
+ showText(TX_LOV2N024);
+ }
+}
+
+void Room::love2PutCanisterInSlot1() {
+ playVoc("SE6FOOD");
+ loadActorAnim(OBJECT_CAN1, _roomVar.love2.canisterAnim, 0xa7, 0xae, 0);
+ _vm->_awayMission.love.canister1 = _roomVar.love2.canisterType;
+ showText(TX_LOV2N034);
+ loseItem(_roomVar.love2.canisterItem);
+}
+
+void Room::love2PutCanisterInSlot2() {
+ playVoc("SE6FOOD");
+ loadActorAnim(OBJECT_CAN2, _roomVar.love2.canisterAnim, 0xb1, 0xaf, 0);
+ _vm->_awayMission.love.canister2 = _roomVar.love2.canisterType;
+ showText(TX_LOV2N035);
+ loseItem(_roomVar.love2.canisterItem);
+}
+
+void Room::love2UseAntigravOnCanister1() {
+ walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 4);
+}
+
+void Room::love2ReachedCanisterSlot1ToGet() {
+ if (_vm->_awayMission.love.gasFeedOn)
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_025);
+ else {
+ loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 15);
+ // BUGFIX: original game only played this for canister 2
+ playVoc("SEPLBAT");
+ }
+}
+
+void Room::love2TookCanister1() {
+ showText(TX_LOV2N030);
+ loadActorStandAnim(OBJECT_CAN1);
+
+ switch (_vm->_awayMission.love.canister1) {
+ case CANTYPE_O2:
+ giveItem(OBJECT_IO2GAS);
+ break;
+ case CANTYPE_H2:
+ giveItem(OBJECT_IH2GAS);
+ break;
+ case CANTYPE_N2:
+ default:
+ giveItem(OBJECT_IN2GAS);
+ break;
+ }
+}
+
+void Room::love2UseAntigravOnCanister2() {
+ walkCrewman(OBJECT_KIRK, 0xa8, 0xb7, 5);
+}
+
+void Room::love2ReachedCanisterSlot2ToGet() {
+ if (_vm->_awayMission.love.gasFeedOn)
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_025);
+ else {
+ loadActorAnim2(OBJECT_KIRK, "kusehn", -1, -1, 16);
+ playVoc("SEPLBAT");
+ }
+}
+
+void Room::love2TookCanister2() {
+ showText(TX_LOV2N031);
+ loadActorStandAnim(OBJECT_CAN2);
+
+ switch (_vm->_awayMission.love.canister2) {
+ case CANTYPE_O2:
+ giveItem(OBJECT_IO2GAS);
+ break;
+ case CANTYPE_H2:
+ giveItem(OBJECT_IH2GAS);
+ break;
+ case CANTYPE_N2:
+ default:
+ giveItem(OBJECT_IN2GAS);
+ break;
+ }
+}
+
+void Room::love2UseKirkOnSynthesizer() {
+ _roomVar.love2.d2 = OBJECT_KIRK;
+ walkCrewman(_roomVar.love2.d2, 0x46, 0xae, 13);
+}
+
+void Room::love2UseSpockOnSynthesizer() {
+ _roomVar.love2.d2 = OBJECT_SPOCK;
+ walkCrewman(_roomVar.love2.d2, 0x46, 0xae, 13);
+}
+
+void Room::love2UseMccoyOnSynthesizer() {
+ _roomVar.love2.d2 = OBJECT_MCCOY;
+ walkCrewman(_roomVar.love2.d2, 0x46, 0xae, 13);
+}
+
+void Room::love2UseRedshirtOnSynthesizer() {
+ _roomVar.love2.d2 = OBJECT_REDSHIRT;
+ walkCrewman(_roomVar.love2.d2, 0x46, 0xae, 13);
+}
+
+void Room::love2CrewmanReachedSynthesizer() {
+ Common::String anim = _vm->getCrewmanAnimFilename(_roomVar.love2.d2, "usemn");
+ loadActorAnim2(_roomVar.love2.d2, anim, -1, -1, 17);
+}
+
+void Room::love2CrewmanUsedSynthesizer() {
+ if (_vm->_awayMission.love.gasFeedOn) {
+ love2UseSynthesizer();
+ }
+ else {
+ if (_roomVar.love2.cb == 3) {
+ if (haveItem(OBJECT_IWRENCH)) {
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_005);
+ walkCrewman(OBJECT_SPOCK, 0xa8, 0xb7, 16);
+ }
+ else
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_006);
+ }
+ else {
+ _roomVar.love2.cb++;
+ showText(TX_LOV2N012);
+ }
+ }
+}
+
+
+void Room::love2SpockReachedGasFeeds() {
+ loadActorAnim2(OBJECT_SPOCK, "susehn", -1, -1, 18);
+}
+
+void Room::love2SpockEnabledGasFeeds() {
+ _vm->_awayMission.love.gasFeedOn = true;
+
+ loadActorAnim2(OBJECT_GAS_FEED, "s3r3v1", 0xac, 0x75, 0);
+ showText(TX_LOV2N008);
+ walkCrewman(OBJECT_SPOCK, 0xc6, 0xbb, 0);
+
+ love2UseSynthesizer();
+}
+
+void Room::love2UseSynthesizer() {
+ if (_vm->_awayMission.love.canister1 != 0) {
+ if (_vm->_awayMission.love.canister2 != 0) {
+ // TODO
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+ else {
+ playVoc("EFX24");
+ showText(TX_LOV2N005);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_010);
+ }
+ }
+ else {
+ playVoc("EFX24");
+ showText(TX_SPEAKER_SPOCK, TX_LOV2N005);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_024);
+ }
+}
+
+void Room::love2SynthesizerDoorClosed() {
+ playVoc("LD1SCAN");
+ loadActorAnim(OBJECT_SYNTHESIZER_OUTPUT, _roomVar.love2.d8, 0x8a, 0x8d, 4);
+ _vm->_awayMission.love.field35 = 9;
+}
+
+// Final product of synthesizer is produced
+void Room::love2SynthesizerFinished() {
+ switch (_vm->_awayMission.love.synthesizerProduct) {
+ case BOTTLETYPE_N2O:
+ showText(TX_LOV2N017);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_032);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_015);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_036);
+ break;
+
+ case BOTTLETYPE_NH3:
+ showText(TX_LOV2N016);
+ if (!_vm->_awayMission.redshirtDead) {
+ showText(TX_SPEAKER_FERRIS, TX_LOV2_043);
+ showText(TX_SPEAKER_KIRK, TX_LOV2_003);
+ }
+ break;
+
+ case BOTTLETYPE_H2O:
+ showText(TX_LOV2N018);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_004);
+ break;
+
+ case BOTTLETYPE_RLG:
+ default:
+ showText(TX_LOV2N019);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_031);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_018);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_030);
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_022);
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_038);
+ break;
+ }
+}
+
+void Room::love2FinishedAnimation27() {
+ // TODO: better name
+ _vm->_awayMission.love.synthesizerProduct = BOTTLETYPE_RLG;
+ strcpy(_roomVar.love2.d8, "btle4");
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 3);
+ playSoundEffectIndex(SND_DOOR1);
+}
+
+
+// Put polycarbonate in synthesizer
+void Room::love2UsePolyberylcarbonateOnSynthesizerDoor() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 6);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2KirkReachedSynthesizerWithPolyberylcarbonate() {
+ if (_vm->_awayMission.love.field35 != 0)
+ showText(TX_LOV2N025);
+ else {
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 5);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::love2SynthesizerDoorOpenedWithPolyberylcarbonate() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 19);
+}
+
+void Room::love2PutPolyberylcarbonateInSynthesizer() {
+ loadActorAnim(OBJECT_POLYBERYLCARBONATE, "pbcanm", 0x8a, 0x8b, 0);
+ loseItem(OBJECT_IPBC);
+ _vm->_awayMission.love.field35 = 1;
+}
+
+
+// Put dish (virus sample) in synthesizer
+void Room::love2UseDishesOnSynthesizerDoor() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 7);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2KirkReachedSynthesizerWithDishes() {
+ if (_vm->_awayMission.love.field35 != 0)
+ showText(TX_LOV2N025);
+ else {
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 6);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::love2SynthesizerDoorOpenedWithDishes() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 20);
+}
+
+void Room::love2PutDishesInSynthesizer() {
+ loadActorAnim(OBJECT_DISHES, "dishes", 0x8a, 0x8b, 0);
+ loseItem(OBJECT_IDISHES);
+ _vm->_awayMission.love.field35 = 2;
+}
+
+
+// Put cure sample in synthesizer
+void Room::love2UseSampleOnSynthesizerDoor() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 8);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2KirkReachedSynthesizerWithSample() {
+ if (_vm->_awayMission.love.field35 != 0)
+ showText(TX_LOV2N025); // BUGFIX: original didn't play audio
+ else {
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d2", 0x8a, 0x8d, 7);
+ playSoundEffectIndex(SND_DOOR1);
+ }
+}
+
+void Room::love2SynthesizerDoorOpenedWithSample() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 21);
+}
+
+void Room::love2PutSampleInSynthesizer() {
+ loadActorAnim(OBJECT_CURESAMPLE, "dishes", 0x8a, 0x8b, 0);
+ loseItem(OBJECT_ISAMPLE);
+ _vm->_awayMission.love.field35 = 3;
+}
+
+
+
+void Room::love2UseAnythingOnSynthesizerDoor() {
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_014);
+}
+
+void Room::love2UseAnythingOnSynthesizer() {
+ showText(TX_SPEAKER_SPOCK, TX_LOV2_007);
+}
+
+void Room::love2GetCanister() {
+ if (_vm->_awayMission.redshirtDead)
+ showText(TX_SPEAKER_MCCOY, TX_LOV2_011);
+ else
+ showText(TX_SPEAKER_FERRIS, TX_LOV2_040);
+}
+
+
+// Get antigrav from cabinet
+void Room::love2GetAntigrav() {
+ walkCrewman(OBJECT_KIRK, 0x37, 0xb4, 9);
+}
+
+void Room::love2ReachedAntigrav() {
+ loadActorAnim2(OBJECT_KIRK, "kusehw", -1, -1, 22);
+}
+
+void Room::love2GotAntigrav() {
+ loadActorStandAnim(OBJECT_ANTIGRAV);
+ giveItem(OBJECT_IANTIGRA);
+ showText(TX_LOV2N042);
+}
+
+
+// Get polyberylcarbonate from synthesizer
+void Room::love2GetPolyberylcarbonate() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 18);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2ReachedPolyberylcarbonate() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 26);
+}
+
+void Room::love2GotPolyberylcarbonate() {
+ loadActorStandAnim(OBJECT_POLYBERYLCARBONATE);
+ showText(TX_LOV2N044);
+ giveItem(OBJECT_IPBC);
+ _vm->_awayMission.love.field35 = 0;
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
+ playSoundEffectIndex(SND_DOOR1);
+}
+
+
+// Get virus sample from synthesizer
+void Room::love2GetDishes() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 17);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2ReachedDishes() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 25);
+}
+
+void Room::love2GotDishes() {
+ loadActorStandAnim(OBJECT_DISHES);
+ showText(TX_LOV2N036);
+ giveItem(OBJECT_IDISHES);
+ _vm->_awayMission.love.field35 = 0;
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
+ playSoundEffectIndex(SND_DOOR1);
+}
+
+
+// Get cure sample from synthesizer
+void Room::love2GetSample() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 19);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2ReachedSample() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 28);
+}
+
+void Room::love2GotSample() {
+ loadActorStandAnim(OBJECT_CURESAMPLE);
+ showText(TX_LOV2N037);
+ giveItem(OBJECT_ISAMPLE);
+ _vm->_awayMission.love.field35 = 0;
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
+ playSoundEffectIndex(SND_DOOR1);
+}
+
+
+// Get synthesizer output
+void Room::love2GetSynthesizerOutput() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 10);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2ReachedSynthesizerOutput() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 23);
+}
+
+void Room::love2GotSynthesizerOutput() {
+ switch (_vm->_awayMission.love.synthesizerProduct) {
+ case BOTTLETYPE_N2O:
+ showText(TX_LOV2N040);
+ giveItem(OBJECT_IN2O);
+ break;
+
+ case BOTTLETYPE_NH3:
+ showText(TX_LOV2N039);
+ giveItem(OBJECT_INH3);
+ break;
+
+ case BOTTLETYPE_H2O:
+ showText(TX_LOV2N041);
+ giveItem(OBJECT_IH2O);
+ break;
+
+ case BOTTLETYPE_RLG:
+ default:
+ showText(TX_LOV2N038);
+ if (!_vm->_awayMission.love.gotTLDH) {
+ _vm->_awayMission.love.gotTLDH = true;
+ _vm->_awayMission.love.missionScore += 4;
+ }
+ giveItem(OBJECT_IRLG);
+ break;
+ }
+
+ loadActorStandAnim(OBJECT_SYNTHESIZER_OUTPUT);
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
+ playSoundEffectIndex(SND_DOOR1);
+
+ _vm->_awayMission.love.field35 = 0;
+ _vm->_awayMission.love.synthesizerProduct = 0;
+}
+
+// Get the cure
+void Room::love2GetCure() {
+ walkCrewman(OBJECT_KIRK, 0x85, 0xad, 11);
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N;
+}
+
+void Room::love2ReachedCure() {
+ loadActorAnim2(OBJECT_KIRK, "kusemn", -1, -1, 24);
+}
+
+void Room::love2GotCure() {
+ if (!_vm->_awayMission.love.gotCure) {
+ _vm->_awayMission.love.gotCure = true;
+ _vm->_awayMission.love.missionScore += 5;
+ }
+
+ giveItem(OBJECT_ICURE);
+ loadActorStandAnim(OBJECT_CURE);
+ showText(TX_LOV2N043);
+ loadActorAnim(OBJECT_SYNTHESIZER_DOOR, "s3r3d5", 0x8a, 0x8d, 0);
+ playSoundEffectIndex(SND_DOOR1);
+ _vm->_awayMission.love.field35 = 0;
}
}