aboutsummaryrefslogtreecommitdiff
path: root/engines/startrek/rooms
diff options
context:
space:
mode:
authorMatthew Stewart2018-06-29 16:46:54 -0400
committerEugene Sandulenko2018-08-09 08:37:30 +0200
commitb3c317410232a6b5896237018874f8c5ecc3b5eb (patch)
treef144bad9d1b5a7689bbd267ba6db468f4067a24c /engines/startrek/rooms
parent296bad07b8dcd8de3fd5316d70cf66ed646fcb42 (diff)
downloadscummvm-rg350-b3c317410232a6b5896237018874f8c5ecc3b5eb.tar.gz
scummvm-rg350-b3c317410232a6b5896237018874f8c5ecc3b5eb.tar.bz2
scummvm-rg350-b3c317410232a6b5896237018874f8c5ecc3b5eb.zip
STARTREK: MUDD5
Diffstat (limited to 'engines/startrek/rooms')
-rw-r--r--engines/startrek/rooms/function_map.h49
-rw-r--r--engines/startrek/rooms/mudd0.cpp7
-rw-r--r--engines/startrek/rooms/mudd5.cpp227
3 files changed, 273 insertions, 10 deletions
diff --git a/engines/startrek/rooms/function_map.h b/engines/startrek/rooms/function_map.h
index 2f729b5d39..a6930ea69d 100644
--- a/engines/startrek/rooms/function_map.h
+++ b/engines/startrek/rooms/function_map.h
@@ -1414,7 +1414,7 @@ RoomAction mudd0ActionList[] = {
{ Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd0UseSTricorderOnDegrimerBox },
{ Action(ACTION_USE, OBJECT_IMTRICOR, 0x21, 0), &Room::mudd0UseMTricorderOnLense },
- // TODO: move these to common code
+ // Common code (next 4 lines)
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
{ Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
@@ -1459,7 +1459,7 @@ RoomAction mudd1ActionList[] = {
{ Action(ACTION_FINISHED_WALKING, 3, 0, 0), &Room::mudd1SpockReachedRedButton },
{ Action(ACTION_FINISHED_ANIMATION, 4, 0, 0), &Room::mudd1SpockPressedRedButton },
- // Common code
+ // Common code (next 4 lines)
{ Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
@@ -1517,7 +1517,7 @@ RoomAction mudd2ActionList[] = {
{ Action(ACTION_FINISHED_ANIMATION, 13, 0, 0), &Room::mudd2MccoyPickedUpCapsules },
{ Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd2UseCommunicator },
- // Common code
+ // Common code (next 4 lines)
{ Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
@@ -1585,7 +1585,7 @@ RoomAction mudd3ActionList[] = {
{ Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::mudd3Timer4Expired },
{ Action(ACTION_USE, OBJECT_IDISKS, 0x21, 0), &Room::mudd3UseMemoryDiskOnSphere },
- // Common code
+ // Common code (next 4 lines)
{ Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
@@ -1655,7 +1655,7 @@ RoomAction mudd4ActionList[] = {
// ENHANCEMENT: Allow scanning the viewscreen when it's on, not just when off
{ Action(ACTION_USE, OBJECT_ISTRICOR, 8, 0), &Room::mudd4UseSTricorderOnViewscreen },
- // Common code
+ // Common code (next 4 lines)
{ Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
{ Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
{ Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
@@ -1692,6 +1692,45 @@ RoomAction mudd4ActionList[] = {
RoomAction mudd5ActionList[] = {
{ Action(ACTION_TICK, 1, 0, 0), &Room::mudd5Tick1 },
+ { Action(ACTION_TIMER_EXPIRED, 1, 0, 0), &Room::mudd5Timer1Expired },
+ { Action(ACTION_TIMER_EXPIRED, 2, 0, 0), &Room::mudd5Timer2Expired },
+ { Action(ACTION_USE, OBJECT_ICOMM, -1, 0), &Room::mudd5UseCommunicator },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, -1, 0), &Room::mudd5UseSTricorderAnywhere },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x21, 0), &Room::mudd5UseSTricorderOnEngine },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x22, 0), &Room::mudd5UseSTricorderOnCrane },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 0x20, 0), &Room::mudd5UseSTricorderOnHatch },
+ { Action(ACTION_USE, OBJECT_ISTRICOR, 9, 0), &Room::mudd5UseSTricorderOnLifeSupportGenerator },
+ { Action(ACTION_USE, OBJECT_IPHASERS, 0x20, 0), &Room::mudd5UseStunPhaserOnHatch },
+ { Action(ACTION_USE, OBJECT_IPHASERK, 0x20, 0), &Room::mudd5UseKillPhaserOnHatch },
+ { Action(ACTION_USE, -1, 9, 0), &Room::mudd5UseAnythingOnLifeSupportGenerator },
+ { Action(ACTION_USE, OBJECT_IDOOVER, 9, 0), &Room::mudd5UseDooverOnLifeSupportGenerator },
+ { Action(ACTION_FINISHED_WALKING, 2, 0, 0), &Room::mudd5KirkReachedLifeSupportGenerator },
+ { Action(ACTION_TIMER_EXPIRED, 4, 0, 0), &Room::mudd5KirkTimer4Expired },
+ { Action(ACTION_FINISHED_ANIMATION, 2, 0, 0), &Room::mudd5KirkRepairedLifeSupportGenerator },
+ { Action(ACTION_TIMER_EXPIRED, 3, 0, 0), &Room::mudd5KirkTimer3Expired },
+
+ // Common code (next 4 lines)
+ { Action(ACTION_USE, OBJECT_ILENSES, OBJECT_IDEGRIME, 0), &Room::mudd0UseLenseOnDegrimer },
+ { Action(ACTION_USE, OBJECT_IALIENDV, -1, 0), &Room::mudd0UseAlienDevice },
+ { Action(ACTION_FINISHED_ANIMATION, 9, 0, 0), &Room::mudd0FiredAlienDevice },
+ { Action(ACTION_USE, OBJECT_IDEGRIME, -1, 0), &Room::mudd0UseDegrimer },
+
+ { Action(ACTION_LOOK, 0x20, 0, 0), &Room::mudd5LookAtHatch },
+ { Action(ACTION_LOOK, 9, 0, 0), &Room::mudd5LookAtLifeSupportGenerator },
+ { Action(ACTION_TOUCHED_HOTSPOT, 0, 0, 0), &Room::mudd5TouchedHotspot0 },
+ { Action(ACTION_WALK, 0x22, 0, 0), &Room::mudd5WalkToDoor },
+ { Action(ACTION_LOOK, OBJECT_KIRK, 0, 0), &Room::mudd5LookAtKirk },
+ { Action(ACTION_LOOK, OBJECT_SPOCK, 0, 0), &Room::mudd5LookAtSpock },
+ { Action(ACTION_LOOK, OBJECT_MCCOY, 0, 0), &Room::mudd5LookAtMccoy },
+ { Action(ACTION_LOOK, OBJECT_REDSHIRT, 0, 0), &Room::mudd5LookAtRedshirt },
+ { Action(ACTION_LOOK, 0x22, 0, 0), &Room::mudd5LookAtDoor },
+ { Action(ACTION_LOOK, 0x23, 0, 0), &Room::mudd5LookAtCrane },
+ { Action(ACTION_LOOK, 0x21, 0, 0), &Room::mudd5LookAtEngine },
+ { Action(ACTION_TALK, OBJECT_KIRK, 0, 0), &Room::mudd5TalkToKirk },
+ { Action(ACTION_TALK, OBJECT_SPOCK, 0, 0), &Room::mudd5TalkToSpock },
+ { Action(ACTION_TALK, OBJECT_MCCOY, 0, 0), &Room::mudd5TalkToMccoy },
+ { Action(ACTION_TALK, OBJECT_REDSHIRT, 0, 0), &Room::mudd5TalkToRedshirt },
+ { Action(ACTION_USE, OBJECT_IMEDKIT, -1, 0), &Room::mudd5UseMedkit },
};
}
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
index dbb1c999f6..c4960312f2 100644
--- a/engines/startrek/rooms/mudd0.cpp
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -166,7 +166,7 @@ void Room::mudd0UseLenseOnDegrimer() {
_vm->_awayMission.mudd.missionScore++;
showText(TX_MUD0N011);
// TODO: Identical (?) audio files: TX_MUD0N011, TX_MUD1N013, TX_MUD2N010, TX_MUD3N016,
- // TX_MUD4009
+ // TX_MUD4009, TX_MUD5N009
}
@@ -177,6 +177,7 @@ void Room::mudd0UseAlienDevice() {
11, // MUDD2
11, // MUDD3
9, // MUDD4
+ 11 // MUDD5
};
_vm->_awayMission.disableInput = true;
@@ -192,7 +193,7 @@ void Room::mudd0FiredAlienDevice() {
_vm->_awayMission.disableInput = false;
if (!_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction) {
_vm->_awayMission.mudd.discoveredLenseAndDegrimerFunction = true;
- _vm->_awayMission.mudd.missionScore += 5;
+ _vm->_awayMission.mudd.missionScore += 5; // BUGFIX: didn't happen if done in MUDD5
showText(TX_SPEAKER_KIRK, TX_MUD0_002);
// TODO: Identical (?) audio files: TX_MUD0_002, TX_MUD1_002, TX_MUD2_002
}
@@ -201,7 +202,7 @@ void Room::mudd0FiredAlienDevice() {
void Room::mudd0UseDegrimer() {
// TODO: Identical (?) audio files: TX_MUD0N002, TX_MUD1N004, TX_MUD2N001,
- // TX_MUD3N001, TX_MUD4N002
+ // TX_MUD3N001, TX_MUD4N002, TX_MUD5_001
showText(TX_MUD0N002);
}
diff --git a/engines/startrek/rooms/mudd5.cpp b/engines/startrek/rooms/mudd5.cpp
index 30ddc9879c..f5b6bf90b2 100644
--- a/engines/startrek/rooms/mudd5.cpp
+++ b/engines/startrek/rooms/mudd5.cpp
@@ -22,13 +22,236 @@
#include "startrek/room.h"
-#define OBJECT_DOOR1 8
+#define OBJECT_MUDD 8
+#define OBJECT_LIFE_SUPPORT_GENERATOR 9
+#define OBJECT_DOOR 10
+#define OBJECT_ALIENDV 11
-#define HOTSPOT_CONSOLE 0x20
+#define HOTSPOT_HATCH 0x20
+#define HOTSPOT_ENGINE 0x21
+#define HOTSPOT_DOOR 0x22
+#define HOTSPOT_CRANE 0x23
+
+const int16 GENERATOR_X = 0x54;
+const int16 GENERATOR_Y = 0xb0;
namespace StarTrek {
void Room::mudd5Tick1() {
+ playVoc("MUD5LOOP");
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ if (_vm->_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++;
+ // BUG: this event can become permanently unavailable? (test)
+ if (_vm->_awayMission.mudd.numTimesEnteredRoom5 == 2 && !_vm->_awayMission.mudd.muddCurrentlyInsane && !_vm->_awayMission.mudd.repairedLifeSupportGenerator) {
+ _vm->_awayMission.mudd.muddCurrentlyInsane = true;
+ _vm->_awayMission.mudd.numTimesEnteredRoom5 = 1;
+ _vm->_awayMission.disableInput = 2;
+ playMidiMusicTracks(3);
+ loadActorAnim(OBJECT_MUDD, "s4ephh", 0x0e, 0xa7);
+ _vm->_awayMission.timers[1] = 112;
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ }
+ }
+}
+
+void Room::mudd5Timer1Expired() { // Mudd enters room through hatch
+ const int choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_MUD5_006,
+ TX_MUD5_010,
+ TX_BLANK
+ };
+
+ showText(TX_SPEAKER_MUDD, TX_MUD5_034);
+ showText(choices);
+ showText(TX_SPEAKER_MUDD, TX_MUD5_037);
+
+ loadActorAnim2(OBJECT_MUDD, "s4ephc");
+ _vm->_awayMission.timers[2] = 140;
+}
+
+void Room::mudd5Timer2Expired() { // Life-support generator starts acting up
+ _vm->_awayMission.disableInput = false;
+ _vm->_awayMission.mudd.lifeSupportMalfunctioning = true;
+ playMidiMusicTracks(19);
+ loadActorAnim(OBJECT_LIFE_SUPPORT_GENERATOR, "s4epls", GENERATOR_X, GENERATOR_Y);
+}
+
+void Room::mudd5UseCommunicator() {
+ showText(TX_SPEAKER_KIRK, TX_MUD5_003);
+ showText(TX_SPEAKER_UHURA, TX_STATICU1);
+}
+
+void Room::mudd5UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_MUD5_022, false);
+}
+
+void Room::mudd5UseSTricorderOnEngine() {
+ spockScan(DIR_E, TX_MUD5_011, false);
+}
+
+void Room::mudd5UseSTricorderOnCrane() {
+ spockScan(DIR_S, TX_MUD5_023, false);
+}
+
+void Room::mudd5UseSTricorderOnHatch() {
+ spockScan(DIR_W, TX_MUD5_024, false);
+ showText(TX_SPEAKER_KIRK, TX_MUD5_001);
+}
+
+void Room::mudd5UseSTricorderOnLifeSupportGenerator() {
+ if (_vm->_awayMission.mudd.lifeSupportMalfunctioning)
+ spockScan(DIR_W, TX_MUD5_019, false);
+ else
+ spockScan(DIR_W, TX_MUD5_021, false);
+}
+
+void Room::mudd5UseStunPhaserOnHatch() {
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_025);
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_015);
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_030);
+}
+
+void Room::mudd5UseKillPhaserOnHatch() {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD5_039);
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_027);
+}
+
+void Room::mudd5UseAnythingOnLifeSupportGenerator() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_014); // BUGFIX: speaker is McCoy, not none
+}
+
+
+void Room::mudd5UseDooverOnLifeSupportGenerator() {
+ if (_vm->_awayMission.mudd.lifeSupportMalfunctioning) {
+ _vm->_awayMission.disableInput = true;
+ _vm->_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
+}
+
+void Room::mudd5KirkReachedLifeSupportGenerator() {
+ loadActorAnimC(OBJECT_KIRK, "kuseln", -1, -1, &Room::mudd5KirkRepairedLifeSupportGenerator);
+ _vm->_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;
+}
+
+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.muddCurrentlyInsane = false;
+ playMidiMusicTracks(3);
+ loadActorAnim(OBJECT_MUDD, "s4ephh", 0x0e, 0xa7);
+ _vm->_awayMission.disableInput = true;
+
+ _vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W;
+ loadActorStandAnim(OBJECT_KIRK);
+
+ _vm->_awayMission.timers[3] = 110;
+}
+
+void Room::mudd5KirkTimer3Expired() { // Mudd popped back in after repairing generator
+ showText(TX_SPEAKER_MUDD, TX_MUD5_035);
+ showText(TX_SPEAKER_KIRK, TX_MUD5_005);
+ showText(TX_SPEAKER_MUDD, TX_MUD5_036);
+
+ loadActorAnim2(OBJECT_MUDD, "s4ephc");
+ _vm->_awayMission.disableInput = false;
+}
+
+void Room::mudd5LookAtHatch() {
+ showText(TX_MUD5N011);
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_031);
+ showText(TX_SPEAKER_KIRK, TX_MUD5_009);
+}
+
+void Room::mudd5LookAtLifeSupportGenerator() {
+ if (_vm->_awayMission.mudd.lifeSupportMalfunctioning)
+ showText(TX_MUD5N008);
+ else {
+ showText(TX_MUD5N012);
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_026);
+ }
+}
+
+void Room::mudd5TouchedHotspot0() { // Triggers door
+ if (_roomVar.mudd.walkingToDoor) {
+ playVoc("SMADOOR3");
+ loadActorAnim(OBJECT_DOOR, "s4epdo", 0x85, 0x74);
+ }
+}
+
+void Room::mudd5WalkToDoor() {
+ _roomVar.mudd.walkingToDoor = true;
+ _vm->_awayMission.disableInput = true;
+ walkCrewman(OBJECT_KIRK, 0x85, 0x74);
+}
+
+void Room::mudd5LookAtKirk() {
+ showText(TX_MUD5N002);
+}
+
+void Room::mudd5LookAtSpock() {
+ showText(TX_MUD5N005);
+}
+
+void Room::mudd5LookAtMccoy() {
+ showText(TX_MUD5N004);
+}
+
+void Room::mudd5LookAtRedshirt() {
+ showText(TX_MUD5N003);
+}
+
+void Room::mudd5LookAtDoor() {
+ showText(TX_MUD5N010);
+}
+
+void Room::mudd5LookAtCrane() {
+ showText(TX_MUD5N000);
+}
+
+void Room::mudd5LookAtEngine() {
+ showText(TX_MUD5N006);
+}
+
+void Room::mudd5TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_MUD5_002);
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_032);
+}
+
+void Room::mudd5TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_MUD5_033);
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_016);
+}
+
+void Room::mudd5TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_017);
+ showText(TX_SPEAKER_KIRK, TX_MUD5_004);
+}
+
+void Room::mudd5TalkToRedshirt() {
+ showText(TX_SPEAKER_BUCHERT, TX_MUD5_040);
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_018);
+}
+
+void Room::mudd5UseMedkit() {
+ showText(TX_SPEAKER_MCCOY, TX_MUD5_012);
}
}