diff options
Diffstat (limited to 'engines/startrek/rooms/mudd5.cpp')
-rw-r--r-- | engines/startrek/rooms/mudd5.cpp | 227 |
1 files changed, 225 insertions, 2 deletions
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); } } |