diff options
author | Matthew Stewart | 2018-07-29 01:29:57 -0400 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-09 08:37:30 +0200 |
commit | 1c89c065082d47a56cd972984887d238ea6d03e8 (patch) | |
tree | 2b964f26ea6596bcb339c2bb4bde4f192ea909b6 | |
parent | 06d7656d42ec5e4ba540dc613b6f6793c9979cfc (diff) | |
download | scummvm-rg350-1c89c065082d47a56cd972984887d238ea6d03e8.tar.gz scummvm-rg350-1c89c065082d47a56cd972984887d238ea6d03e8.tar.bz2 scummvm-rg350-1c89c065082d47a56cd972984887d238ea6d03e8.zip |
STARTREK: SINS5
-rw-r--r-- | engines/startrek/awaymission.h | 16 | ||||
-rw-r--r-- | engines/startrek/room.h | 62 | ||||
-rw-r--r-- | engines/startrek/rooms/sins5.cpp | 467 | ||||
-rw-r--r-- | engines/startrek/text.cpp | 63 | ||||
-rw-r--r-- | engines/startrek/text.h | 63 |
5 files changed, 668 insertions, 3 deletions
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h index 3791a24a30..0c6f3386fb 100644 --- a/engines/startrek/awaymission.h +++ b/engines/startrek/awaymission.h @@ -540,6 +540,14 @@ struct AwayMission { // the keycard byte gatheredClues; // 0x39 + // bit 0: scanned left computer + // bit 1: scanned right computer + // bit 2: accessed left computer + // bit 3: accessed right computer + byte scannedAndUsedComputers; // 0x3a + + bool wireConnected1; // 0x3b + bool wireConnected2; // 0x3c bool openedOuterDoor; // 0x3d bool openedInnerDoor; // 0x3e bool unlockedIDCardDoor; // 0x3f @@ -560,9 +568,17 @@ struct AwayMission { bool enteredRoom2FirstTime; // 0x44 bool enteredRoom3FirstTime; // 0x45 bool enteredRoom4FirstTime; // 0x46 + bool enteredRoom5FirstTime; // 0x47 bool gotPointsForScanningStatue; // 0x48 bool gotPointsForScanningRoom4; // 0x49 + bool gotPointsForScanningRoom5; // 0x4a + bool gotPointsForScanningRightComputer; // 0x4b + bool gotPointsForScanningLeftComputer; // 0x4c + bool gotPointsForUsingRightComputer; // 0x4d + bool gotPointsForUsingLeftComputer; // 0x4e + bool discoveredComputersOutOfSync; // 0x4f bool enteredRoom1FirstTime; // 0x50 + bool gotPointsForEnteringRoom5; // 0x51 int16 missionScore; // 0x52 } sins; }; diff --git a/engines/startrek/room.h b/engines/startrek/room.h index 8b76a5707f..8781dfa2a0 100644 --- a/engines/startrek/room.h +++ b/engines/startrek/room.h @@ -2373,6 +2373,63 @@ public: // SINS5 void sins5Tick1(); + void sins5UseSTricorderAnywhere(); + void sins5UseSTricorderOnRightComputer(); + void sins5UseSTricorderOnLeftComputer(); + void sins5UseSTricorderOnMiddleComputer(); + void sins5UseKirkOnRightComputer(); + void sins5UseKirkOnLeftComputer(); + void sins5UseKirkOnMiddleComputer(); + void sins5UseMccoyOnComputer(); + void sins5UseRedshirtOnComputer(); + void sins5UseSpockOnMiddleComputer(); + void sins5UseSpockOnRightComputer(); + void sins5SpockReachedRightComputer(); + void sins5SpockUsedRightComputer(); + void sins5UseSpockOnLeftComputer(); + void sins5SpockReachedLeftComputer(); + void sins5SpockUsedLeftComputer(); + void sins5CrewmanReadyToBeamOut(); + void sins5Tick20(); + void sins5CheckGatheredAllClues(); + void sins5UseWireOnComputer(); + void sins5KirkOrSpockInPositionToUseWire(); + void sins5WireConnected(); + void sins5UseStunPhaserOnComputer(); + void sins5UseKillPhaserOnLeftComputer(); + void sins5ReachedPositionToShootLeftComputer(); + void sins5DrewPhaserToShootLeftComputer(); + void sins5Timer0Expired(); + void sins5UseKillPhaserOnMiddleComputer(); + void sins5ReachedPositionToShootMiddleComputer(); + void sins5DrewPhaserToShootMiddleComputer(); + void sins5Timer1Expired(); + void sins5UseKillPhaserOnRightComputer(); + void sins5ReachedPositionToShootRightComputer(); + void sins5DrewPhaserToShootRightComputer(); + void sins5Timer2Expired(); + void sins5ComputerLaunchesMissiles(); + void sins5Timer3Expired(); + void sins5LookAnywhere(); + void sins5LookAtKirk(); + void sins5LookAtSpock(); + void sins5LookAtMccoy(); + void sins5LookAtRedshirt(); + void sins5LookAtLight(); + void sins5LookAtLeftComputer(); + void sins5LookAtMiddleComputer(); + void sins5LookAtRightComputer(); + void sins5LookAtMissile(); + void sins5LookAtNorthDoor(); + void sins5UseMedkitOnCrewman(); + void sins5UseMTricorderAnywhere(); + void sins5TalkToKirk(); + void sins5TalkToSpock(); + void sins5TalkToMccoy(); + void sins5TalkToRedshirt(); + void sins5UseSTricorderOnMissile(); + void sins5UseSTricorderOnNorthDoor(); + void sins5UseMTricorderOnCrewman(); public: // Room-specific variables. This is memset'ed to 0 when the room is initialized. @@ -2676,6 +2733,11 @@ public: } } trial; + struct { + byte numCrewmenInPositionForWire; // 0xca + byte numCrewmenReadyToBeamOut; // 0xcb + } sins; + } _roomVar; }; diff --git a/engines/startrek/rooms/sins5.cpp b/engines/startrek/rooms/sins5.cpp index 49f9784b62..f725fa6135 100644 --- a/engines/startrek/rooms/sins5.cpp +++ b/engines/startrek/rooms/sins5.cpp @@ -22,20 +22,481 @@ #include "startrek/room.h" -#define OBJECT_8 8 +#define OBJECT_LEFT_COMPUTER_EXPLOSION 8 +#define OBJECT_RIGHT_COMPUTER_EXPLOSION 9 +#define OBJECT_MIDDLE_COMPUTER_EXPLOSION 10 +#define OBJECT_CABLE 11 -#define HOTSPOT_20 0x20 +#define HOTSPOT_RIGHT_COMPUTER 0x20 +#define HOTSPOT_LEFT_COMPUTER 0x21 +#define HOTSPOT_MIDDLE_COMPUTER 0x22 +#define HOTSPOT_NORTH_DOOR 0x23 +#define HOTSPOT_LIGHT 0x24 +#define HOTSPOT_MISSILE_1 0x25 +#define HOTSPOT_MISSILE_2 0x26 +#define HOTSPOT_MISSILE_3 0x27 +#define HOTSPOT_MISSILE_4 0x28 namespace StarTrek { extern const RoomAction sins5ActionList[] = { - { {ACTION_TICK, 1, 0, 0}, &Room::sins5Tick1 }, + { {ACTION_TICK, 1, 0, 0}, &Room::sins5Tick1 }, + + { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::sins5UseSTricorderAnywhere }, + { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseSTricorderOnRightComputer }, + { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseSTricorderOnLeftComputer }, + { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseSTricorderOnMiddleComputer }, + { {ACTION_USE, OBJECT_KIRK, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseKirkOnRightComputer }, + { {ACTION_USE, OBJECT_KIRK, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseKirkOnLeftComputer }, + { {ACTION_USE, OBJECT_KIRK, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseKirkOnMiddleComputer }, + { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseMccoyOnComputer }, + { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseMccoyOnComputer }, + { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseMccoyOnComputer }, + { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseRedshirtOnComputer }, + { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseRedshirtOnComputer }, + { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseRedshirtOnComputer }, + { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseSpockOnMiddleComputer }, + { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseSpockOnRightComputer }, + { {ACTION_DONE_WALK, 11, 0, 0}, &Room::sins5SpockReachedRightComputer }, + { {ACTION_DONE_ANIM, 13, 0, 0}, &Room::sins5SpockUsedRightComputer }, + { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseSpockOnLeftComputer }, + { {ACTION_DONE_WALK, 10, 0, 0}, &Room::sins5SpockReachedLeftComputer }, + { {ACTION_DONE_ANIM, 12, 0, 0}, &Room::sins5SpockUsedLeftComputer }, + { {ACTION_DONE_WALK, 16, 0, 0}, &Room::sins5CrewmanReadyToBeamOut }, + + { {ACTION_TICK, 20, 0, 0}, &Room::sins5Tick20 }, + + { {ACTION_USE, OBJECT_ICONECT, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseWireOnComputer }, + { {ACTION_USE, OBJECT_ICONECT, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseWireOnComputer }, + { {ACTION_DONE_WALK, 14, 0, 0}, &Room::sins5KirkOrSpockInPositionToUseWire }, + { {ACTION_DONE_ANIM, 15, 0, 0}, &Room::sins5WireConnected }, + { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseStunPhaserOnComputer }, + { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseStunPhaserOnComputer }, + { {ACTION_USE, OBJECT_IPHASERS, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseStunPhaserOnComputer }, + + { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_LEFT_COMPUTER, 0}, &Room::sins5UseKillPhaserOnLeftComputer }, + { {ACTION_DONE_WALK, 2, 0, 0}, &Room::sins5ReachedPositionToShootLeftComputer }, + { {ACTION_DONE_ANIM, 3, 0, 0}, &Room::sins5DrewPhaserToShootLeftComputer }, + { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::sins5Timer0Expired }, + + { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_MIDDLE_COMPUTER, 0}, &Room::sins5UseKillPhaserOnMiddleComputer }, + { {ACTION_DONE_WALK, 6, 0, 0}, &Room::sins5ReachedPositionToShootMiddleComputer }, + { {ACTION_DONE_ANIM, 7, 0, 0}, &Room::sins5DrewPhaserToShootMiddleComputer }, + { {ACTION_TIMER_EXPIRED, 1, 0, 0}, &Room::sins5Timer1Expired }, + + { {ACTION_USE, OBJECT_IPHASERK, HOTSPOT_RIGHT_COMPUTER, 0}, &Room::sins5UseKillPhaserOnRightComputer }, + { {ACTION_DONE_WALK, 4, 0, 0}, &Room::sins5ReachedPositionToShootRightComputer }, + { {ACTION_DONE_ANIM, 5, 0, 0}, &Room::sins5DrewPhaserToShootRightComputer }, + { {ACTION_TIMER_EXPIRED, 2, 0, 0}, &Room::sins5Timer2Expired }, + { {ACTION_DONE_ANIM, 1, 0, 0}, &Room::sins5ComputerLaunchesMissiles }, + { {ACTION_TIMER_EXPIRED, 3, 0, 0}, &Room::sins5Timer3Expired }, + + { {ACTION_LOOK, 0xff, 0, 0}, &Room::sins5LookAnywhere }, + { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::sins5LookAtKirk }, + { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::sins5LookAtSpock }, + { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::sins5LookAtMccoy }, + { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::sins5LookAtRedshirt }, + { {ACTION_LOOK, HOTSPOT_LIGHT, 0, 0}, &Room::sins5LookAtLight }, + { {ACTION_LOOK, HOTSPOT_LEFT_COMPUTER, 0, 0}, &Room::sins5LookAtLeftComputer }, + { {ACTION_LOOK, HOTSPOT_MIDDLE_COMPUTER, 0, 0}, &Room::sins5LookAtMiddleComputer }, + { {ACTION_LOOK, HOTSPOT_RIGHT_COMPUTER, 0, 0}, &Room::sins5LookAtRightComputer }, + { {ACTION_LOOK, HOTSPOT_MISSILE_1, 0, 0}, &Room::sins5LookAtMissile }, + { {ACTION_LOOK, HOTSPOT_MISSILE_2, 0, 0}, &Room::sins5LookAtMissile }, + { {ACTION_LOOK, HOTSPOT_MISSILE_3, 0, 0}, &Room::sins5LookAtMissile }, + { {ACTION_LOOK, HOTSPOT_MISSILE_4, 0, 0}, &Room::sins5LookAtMissile }, + { {ACTION_LOOK, HOTSPOT_NORTH_DOOR, 0, 0}, &Room::sins5LookAtNorthDoor }, + + { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_KIRK, 0}, &Room::sins5UseMedkitOnCrewman }, + { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::sins5UseMedkitOnCrewman }, + { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_MCCOY, 0}, &Room::sins5UseMedkitOnCrewman }, + { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_REDSHIRT, 0}, &Room::sins5UseMedkitOnCrewman }, + { {ACTION_USE, OBJECT_IMTRICOR, 0xff, 0}, &Room::sins5UseMTricorderAnywhere }, + + { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::sins5TalkToKirk }, + { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::sins5TalkToSpock }, + { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::sins5TalkToMccoy }, + { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::sins5TalkToRedshirt }, + + { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MISSILE_1, 0}, &Room::sins5UseSTricorderOnMissile }, + { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MISSILE_2, 0}, &Room::sins5UseSTricorderOnMissile }, + { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MISSILE_3, 0}, &Room::sins5UseSTricorderOnMissile }, + { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_MISSILE_4, 0}, &Room::sins5UseSTricorderOnMissile }, + { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_NORTH_DOOR, 0}, &Room::sins5UseSTricorderOnNorthDoor }, + + { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::sins5UseMTricorderOnCrewman }, + { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::sins5UseMTricorderOnCrewman }, + { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::sins5UseMTricorderOnCrewman }, + { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::sins5UseMTricorderOnCrewman }, }; extern const int sins5NumActions = sizeof(sins5ActionList) / sizeof(RoomAction); void Room::sins5Tick1() { + playVoc("SIN5LOOP"); + + if (!_awayMission->sins.enteredRoom5FirstTime) + _awayMission->disableInput = 2; + + if (_awayMission->sins.wireConnected1 && _awayMission->sins.wireConnected2) + loadActorAnim2(OBJECT_CABLE, "s5cabl", 0, 0); + + if (!_awayMission->sins.gotPointsForEnteringRoom5) { + playMidiMusicTracks(MIDITRACK_0, -1); + _awayMission->sins.gotPointsForEnteringRoom5 = true; + } + + playMidiMusicTracks(MIDITRACK_27, -3); +} + +void Room::sins5UseSTricorderAnywhere() { + spockScan(DIR_S, TX_SIN5_013); +} + +void Room::sins5UseSTricorderOnRightComputer() { + if (!_awayMission->sins.gotPointsForScanningRightComputer) { + _awayMission->sins.missionScore += 1; + _awayMission->sins.gotPointsForScanningRightComputer = true; // BUGFIX: add this line to prevent infinite score mechanism + } + spockScan(DIR_S, TX_SIN5_030); + _awayMission->sins.scannedAndUsedComputers |= 2; + sins5CheckGatheredAllClues(); +} + +void Room::sins5UseSTricorderOnLeftComputer() { + if (!_awayMission->sins.gotPointsForScanningLeftComputer) { + _awayMission->sins.missionScore += 1; + _awayMission->sins.gotPointsForScanningLeftComputer = true; // BUGFIX: add this line to prevent infinite score mechanism + } + spockScan(DIR_S, TX_SIN5_029); + _awayMission->sins.scannedAndUsedComputers |= 1; + sins5CheckGatheredAllClues(); +} + +void Room::sins5UseSTricorderOnMiddleComputer() { + spockScan(DIR_S, TX_SIN5_028); +} + +void Room::sins5UseKirkOnRightComputer() { + showText(TX_SPEAKER_KIRK, TX_SIN5_003); + sins5UseSpockOnRightComputer(); +} + +void Room::sins5UseKirkOnLeftComputer() { + showText(TX_SPEAKER_KIRK, TX_SIN5_004); + sins5UseSpockOnLeftComputer(); +} + +void Room::sins5UseKirkOnMiddleComputer() { + showText(TX_SPEAKER_KIRK, TX_SIN5_001); +} + +void Room::sins5UseMccoyOnComputer() { + showText(TX_SPEAKER_MCCOY, TX_SIN5_015); +} + +void Room::sins5UseRedshirtOnComputer() { + showText(TX_SPEAKER_MOSHER, TX_SIN5_042); +} + +void Room::sins5UseSpockOnMiddleComputer() { + showText(TX_SPEAKER_SPOCK, TX_SIN5_027); +} + +void Room::sins5UseSpockOnRightComputer() { + if (!_awayMission->sins.gotPointsForUsingRightComputer) { + _awayMission->sins.missionScore += 1; + _awayMission->sins.gotPointsForUsingRightComputer = true; // BUGFIX: add this line to prevent infinite score mechanism + } + + _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S; + _awayMission->disableInput = true; + walkCrewmanC(OBJECT_SPOCK, 0xe1, 0xb3, &Room::sins5SpockReachedRightComputer); +} + +void Room::sins5SpockReachedRightComputer() { + loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::sins5SpockUsedRightComputer); +} + +void Room::sins5SpockUsedRightComputer() { + _awayMission->disableInput = false; + showText(TX_SPEAKER_COMPUTER, TX_SIN5_039); + _awayMission->sins.scannedAndUsedComputers |= 8; + sins5CheckGatheredAllClues(); +} + +void Room::sins5UseSpockOnLeftComputer() { + if (!_awayMission->sins.gotPointsForUsingLeftComputer) { + _awayMission->sins.missionScore += 1; + _awayMission->sins.gotPointsForUsingLeftComputer = true; // BUGFIX: add this line to prevent infinite score mechanism + } + + _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_S; + _awayMission->disableInput = true; + walkCrewmanC(OBJECT_SPOCK, 0x40, 0xb3, &Room::sins5SpockReachedLeftComputer); +} + +void Room::sins5SpockReachedLeftComputer() { + loadActorAnimC(OBJECT_SPOCK, "susemn", -1, -1, &Room::sins5SpockUsedLeftComputer); +} + +void Room::sins5SpockUsedLeftComputer() { + if (_awayMission->sins.wireConnected1 && _awayMission->sins.wireConnected2) { + showText(TX_SPEAKER_COMPUTER, TX_SIN5_041); + showText(TX_SPEAKER_SPOCK, TX_SIN5_025); + + walkCrewmanC(OBJECT_KIRK, 0x8c, 0xb5, &Room::sins5CrewmanReadyToBeamOut); + walkCrewmanC(OBJECT_SPOCK, 0x82, 0xab, &Room::sins5CrewmanReadyToBeamOut); + walkCrewmanC(OBJECT_MCCOY, 0x96, 0xab, &Room::sins5CrewmanReadyToBeamOut); + walkCrewmanC(OBJECT_REDSHIRT, 0x91, 0xa1, &Room::sins5CrewmanReadyToBeamOut); + } else { + _awayMission->disableInput = false; + showText(TX_SPEAKER_COMPUTER, TX_SIN5_040); + _awayMission->sins.scannedAndUsedComputers |= 4; + sins5CheckGatheredAllClues(); + } +} + +void Room::sins5CrewmanReadyToBeamOut() { + if (++_roomVar.sins.numCrewmenReadyToBeamOut == 4) { + showText(TX_SPEAKER_KIRK, TX_SIN5_008); + showText(TX_SPEAKER_SCOTT, TX_SIN5_S19); + showText(TX_SPEAKER_KIRK, TX_SIN5_005); + _awayMission->sins.missionScore += 19; + endMission(_awayMission->sins.missionScore, 28, 0); + } +} + +void Room::sins5Tick20() { + if (!_awayMission->sins.enteredRoom5FirstTime) { + _awayMission->disableInput = false; + showText(TX_SPEAKER_SPOCK, TX_SIN5_026); + _awayMission->sins.enteredRoom5FirstTime = true; + } +} + +// Checks whether both computers have been scanned and interacted with +void Room::sins5CheckGatheredAllClues() { + if (_awayMission->sins.scannedAndUsedComputers == 0xf && !_awayMission->sins.discoveredComputersOutOfSync) { + _awayMission->sins.discoveredComputersOutOfSync = true; + showText(TX_SPEAKER_MOSHER, TX_SIN5_044); + showText(TX_SPEAKER_SPOCK, TX_SIN5_036); + showText(TX_SPEAKER_MCCOY, TX_SIN5_020); + showText(TX_SPEAKER_SPOCK, TX_SIN5_035); + showText(TX_SPEAKER_KIRK, TX_SIN5_006); + showText(TX_SPEAKER_SPOCK, TX_SIN5_037); + showText(TX_SPEAKER_MCCOY, TX_SIN5_021); + showText(TX_SPEAKER_SPOCK, TX_SIN5_032); + showText(TX_SPEAKER_KIRK, TX_SIN5_007); + } +} + +void Room::sins5UseWireOnComputer() { + walkCrewmanC(OBJECT_SPOCK, 0x60, 0xab, &Room::sins5KirkOrSpockInPositionToUseWire); + walkCrewmanC(OBJECT_KIRK, 0xbc, 0xab, &Room::sins5KirkOrSpockInPositionToUseWire); + _awayMission->disableInput = true; +} + +void Room::sins5KirkOrSpockInPositionToUseWire() { + if (++_roomVar.sins.numCrewmenInPositionForWire == 2) { + loadActorAnimC(OBJECT_SPOCK, "suselw", -1, -1, &Room::sins5WireConnected); + loadActorAnim2(OBJECT_KIRK, "kusele"); + } +} + +void Room::sins5WireConnected() { + if (!_awayMission->sins.wireConnected1) { + _awayMission->sins.wireConnected1 = true; + _awayMission->sins.wireConnected2 = true; + loadActorAnim2(OBJECT_CABLE, "s5cabl", 0, 0); + showText(TX_SIN5N004); + loseItem(OBJECT_ICONECT); + playMidiMusicTracks(MIDITRACK_30, -1); + } + _awayMission->disableInput = false; +} + +void Room::sins5UseStunPhaserOnComputer() { + showText(TX_SPEAKER_MOSHER, TX_SIN5_043); +} + + +void Room::sins5UseKillPhaserOnLeftComputer() { + _awayMission->disableInput = true; + walkCrewmanC(OBJECT_KIRK, 0x84, 0xbc, &Room::sins5ReachedPositionToShootLeftComputer); +} + +void Room::sins5ReachedPositionToShootLeftComputer() { + loadActorAnimC(OBJECT_KIRK, "kdraww", -1, -1, &Room::sins5DrewPhaserToShootLeftComputer); +} + +void Room::sins5DrewPhaserToShootLeftComputer() { + loadActorAnimC(OBJECT_LEFT_COMPUTER_EXPLOSION, "s5phal", 0, 0xaf, &Room::sins5ComputerLaunchesMissiles); + playSoundEffectIndex(SND_PHASSHOT); + _awayMission->timers[3] = 10; + _awayMission->timers[0] = 24; +} + +void Room::sins5Timer0Expired() { + _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_W; + loadActorStandAnim(OBJECT_KIRK); + _awayMission->disableInput = false; +} + + +void Room::sins5UseKillPhaserOnMiddleComputer() { + _awayMission->disableInput = true; + walkCrewmanC(OBJECT_KIRK, 0x8b, 0xbc, &Room::sins5ReachedPositionToShootMiddleComputer); +} + +void Room::sins5ReachedPositionToShootMiddleComputer() { + loadActorAnimC(OBJECT_KIRK, "kfiren", -1, -1, &Room::sins5DrewPhaserToShootMiddleComputer); +} + +void Room::sins5DrewPhaserToShootMiddleComputer() { + loadActorAnimC(OBJECT_MIDDLE_COMPUTER_EXPLOSION, "s5phac", 0, 0x8c, &Room::sins5ComputerLaunchesMissiles); + playSoundEffectIndex(SND_PHASSHOT); + _awayMission->timers[3] = 10; + _awayMission->timers[1] = 24; +} + +void Room::sins5Timer1Expired() { + _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_N; + loadActorStandAnim(OBJECT_KIRK); + _awayMission->disableInput = false; +} + + +void Room::sins5UseKillPhaserOnRightComputer() { + _awayMission->disableInput = true; + walkCrewmanC(OBJECT_KIRK, 0x9e, 0xbc, &Room::sins5ReachedPositionToShootRightComputer); +} + +void Room::sins5ReachedPositionToShootRightComputer() { + loadActorAnimC(OBJECT_KIRK, "kdrawe", -1, -1, &Room::sins5DrewPhaserToShootRightComputer); +} + +void Room::sins5DrewPhaserToShootRightComputer() { + loadActorAnimC(OBJECT_RIGHT_COMPUTER_EXPLOSION, "s5phar", 0, 0xaf, &Room::sins5ComputerLaunchesMissiles); + playSoundEffectIndex(SND_PHASSHOT); + _awayMission->timers[3] = 10; + _awayMission->timers[2] = 24; +} + +void Room::sins5Timer2Expired() { + _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E; + loadActorStandAnim(OBJECT_KIRK); + _awayMission->disableInput = false; +} + +void Room::sins5ComputerLaunchesMissiles() { + playMidiMusicTracks(MIDITRACK_2, -1); + showText(TX_SIN5N012); + showText(TX_SIN5N013); + showGameOverMenu(); +} + +void Room::sins5Timer3Expired() { + playSoundEffectIndex(SND_BLANK_14); +} + +void Room::sins5LookAnywhere() { + showText(TX_SIN5N005); +} + +void Room::sins5LookAtKirk() { + showText(TX_SIN5N000); +} + +void Room::sins5LookAtSpock() { + showText(TX_SIN5N006); +} + +void Room::sins5LookAtMccoy() { + showText(TX_SIN5N001); +} + +void Room::sins5LookAtRedshirt() { + showText(TX_SIN5N002); +} + +void Room::sins5LookAtLight() { + showText(TX_SIN5N007); +} + +void Room::sins5LookAtLeftComputer() { + showText(TX_SIN5N010); +} + +void Room::sins5LookAtMiddleComputer() { + showText(TX_SIN5N008); +} + +void Room::sins5LookAtRightComputer() { + showText(TX_SIN5N009); +} + +void Room::sins5LookAtMissile() { + showText(TX_SIN5N003); +} + +void Room::sins5LookAtNorthDoor() { + showText(TX_SIN5N011); +} + +void Room::sins5UseMedkitOnCrewman() { + showText(TX_SPEAKER_MCCOY, TX_SIN5_017); +} + +void Room::sins5UseMTricorderAnywhere() { + mccoyScan(DIR_S, TX_SIN5_016); + if (!_awayMission->sins.gotPointsForScanningRoom5) { + _awayMission->sins.missionScore += 1; + _awayMission->sins.gotPointsForScanningRoom5 = true; // BUGFIX: add this line to prevent infinite score mechanism + } +} + +void Room::sins5TalkToKirk() { + showText(TX_SPEAKER_KIRK, TX_SIN5_002); +} + +void Room::sins5TalkToSpock() { + showText(TX_SPEAKER_SPOCK, TX_SIN5_038); + showText(TX_SPEAKER_MCCOY, TX_SIN5_023); + showText(TX_SPEAKER_SPOCK, TX_SIN5_033); + showText(TX_SPEAKER_MCCOY, TX_SIN5_019); +} + +void Room::sins5TalkToMccoy() { + showText(TX_SPEAKER_MCCOY, TX_SIN5_018); + showText(TX_SPEAKER_KIRK, TX_SIN5_010); + + // The following code block is unused. It doesn't belong to any function, but would + // fit best as an alternative to this one. + if (false) { + showText(TX_SPEAKER_MCCOY, TX_SIN5_022); + showText(TX_SPEAKER_SPOCK, TX_SIN5_031); + showText(TX_SPEAKER_KIRK, TX_SIN5_009); + } +} + +void Room::sins5TalkToRedshirt() { + showText(TX_SPEAKER_MOSHER, TX_SIN5_046); + showText(TX_SPEAKER_SPOCK, TX_SIN5_034); + showText(TX_SPEAKER_MOSHER, TX_SIN5_045); + showText(TX_SPEAKER_KIRK, TX_SIN5_011); +} + +void Room::sins5UseSTricorderOnMissile() { + spockScan(DIR_S, TX_SIN5_012); +} + +void Room::sins5UseSTricorderOnNorthDoor() { + spockScan(DIR_S, TX_SIN5_024); +} + +void Room::sins5UseMTricorderOnCrewman() { + mccoyScan(DIR_S, TX_SIN5_014); } } diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp index 0f3b3e63c7..fc188b2d75 100644 --- a/engines/startrek/text.cpp +++ b/engines/startrek/text.cpp @@ -2602,6 +2602,69 @@ extern const char *const g_gameStrings[] = { "#SIN4\\SIN4U83B#Captain, we'll help you all we can.", + "#SIN5\\SIN5_001#Hmmmm... This computer doesn't have a keyboard.", + "#SIN5\\SIN5_002#I don't have anything to say right now, Bones.", + "#SIN5\\SIN5_003#Mr. Spock, why don't you take a look at those computers.", + "#SIN5\\SIN5_004#Mr. Spock, why don't you take a look at those computers.", + "#SIN5\\SIN5_005#Bring us home.", + "#SIN5\\SIN5_006#Can you reprogram the Lucrs computer to give us that time, Mr. Spock?", + "#SIN5\\SIN5_007#If we could only bridge them...", + "#SIN5\\SIN5_008#Kirk to Enterprise. how are the transporters, Scotty?", + "#SIN5\\SIN5_009#Let's just find a way to stop this from happening again.", + "#SIN5\\SIN5_010#Sometimes it's useful to confront the dark side of our nature, that which we might become.", + "#SIN5\\SIN5_011#Well, gentlemen. Here's one fire we can put out. Let's go to work.", + "#SIN5\\SIN5_012#A crude Uranium 235 nuclear device with Lithium - Beryllium shells to increase heavy particle fallout.", + "#SIN5\\SIN5_013#All three of the computers in this room are fully operational.", + "#SIN5\\SIN5_014#All readings are normal. The structure seems to be protecting us from the cosmic rays.", + "#SIN5\\SIN5_015#Jim, I don't know anything about these things! Why don't you ask your science officer.", + "#SIN5\\SIN5_016#Thank goodness. I was worried that there might be a radiation leak, but there's no sign of any.", + "#SIN5\\SIN5_017#We're safe from the cosmic radiation, Jim.", + "#SIN5\\SIN5_018#I wish I hadn't seen any of this.", + "#SIN5\\SIN5_019#There's nothing constructive about this place, Spock! It's an obscenity!", + "#SIN5\\SIN5_020#They report different optimum launch times. Which is right?", + "#SIN5\\SIN5_021#Too bad old Omega here couldn't just take a sick day and miss the firing.", + "#SIN5\\SIN5_022#Unbelievable, isn't it? Putting this much time and effort into building devices to kill people.", + "#SIN5\\SIN5_023#Who needs efficiency, when the end of the world is everywhere around here!", + "#SIN5\\SIN5_024#Readings indicate an extremely high radiation level beyond those doors. It would be fatal to proceed beyond them.", + "#SIN5\\SIN5_025#The launched missiles will run out of fuel before they reach Proxtrey. They will drift into the sun and burn up.", + "#SIN5\\SIN5_026#This appears to be the brain of Scythe. There are two identical but isolated computers that communicate with a third which controls the launch of missiles.", + "#SIN5\\SIN5_027#This computer cannot be accessed directly. It is controlled by the other two computers.", + "#SIN5\\SIN5_028#This computer directly controls the missile launch system. There is no way to interface with it directly, but the other two computers are accessible.", + "#SIN5\\SIN5_029#This computer is functional and performing an average .75 million operations per second.", + "#SIN5\\SIN5_030#This computer is functional and performing an average 1.2 million operations per second.", + "#SIN5\\SIN5_031#A great waste, doctor. A technologically advanced society, an advanced culture...", + "#SIN5\\SIN5_032#Because the two machines are isolated, the virus did not spread from one to the other.", + "#SIN5\\SIN5_033#Curb your emotions, doctor. They serve no constructive purpose here. ", + "#SIN5\\SIN5_034#For people with emotions, Ensign, there are many things that can cause hatreds. And each new hatred breeds more hatred, and makes the path of peace harder to find.", + "#SIN5\\SIN5_035#Given the elliptical orbit and the range at which they will pass Proxtrey, the Omega unit is correct, but the window is very narrow. A variation of minutes will mean the missiles run out of fuel and fall harmlessly into the sun.", + "#SIN5\\SIN5_036#It appears they are out of sync, Captain. I have to assume the Alpha Unit has a virus which is using up an incredible amount of computing time.", + "#SIN5\\SIN5_037#Reprogramming an old Alien computer is not simple, Captain. The odds against success are 10221 to 1 against.", + "#SIN5\\SIN5_038#These warheads are not a very efficient delivery system, Captain.", + "#SIN5\\SIN5_039#Welcome to Scythe Operations Center, Alpha Unit. Estimated time to optimal launch range is 3.21 hours adjusted.", + "#SIN5\\SIN5_040#Welcome to Scythe Operations Center, Omega Unit. Estimated time to optimal launch range is 1.31 hours adjusted.", + "#SIN5\\SIN5_041#Welcome to Scythe Operations Center, Omega Unit. Estimated time to optimal launch range is 1.54 hours adjusted.", + "#SIN5\\SIN5_042#Sir, I don't think I'm qualified for that assignment. Mr. Spock would be a better choice, I think.", + "#SIN5\\SIN5_043#The stun setting won't work, Sir!", + "#SIN5\\SIN5_044#Captain, something is wrong with the computers. They may be twins, but they are not identical.", + "#SIN5\\SIN5_045#It's easy to say when you're not involved personally, Mr. Spock. But when people have treated you like a second class being because you are different, hate can become the only thing they can't take away from you. That is what started most of the firestorms of history.", + "#SIN5\\SIN5_046#No intruders, Captain. I think everyone died a long, long time ago. I wonder what caused it.", + "#SIN5\\SIN5_S19#They're operational again, Captain. We're ready to bring you back at any time.", + "#SIN5\\SIN5N000#Captain James T. Kirk, fingering his communicator, wonders if anything else is happening aboard his ship.", + "#SIN5\\SIN5N001#Dr. McCoy takes several deep sighs and closes his eyes.", + "#SIN5\\SIN5N002#Ensign Mosher awaits orders.", + "#SIN5\\SIN5N003#Missiles of death and destruction. The Lucr believed that you could never have enough of them.", + "#SIN5\\SIN5N004#The connector snaps into place.", + "#SIN5\\SIN5N005#The control center for the base. Computers and nuclear missiles fill the room.", + "#SIN5\\SIN5N006#These instruments of war make Spock uncomfortable, but he says nothing.", + "#SIN5\\SIN5N007#These lights are still operational after centuries.", + "#SIN5\\SIN5N008#This computer controls the launch of missiles. It is directly controlled by the other computers.", + "#SIN5\\SIN5N009#This computer is marked with the first letter of the Lucr alphabet.", + "#SIN5\\SIN5N010#This computer is marked with the last letter of the Lucr alphabet.", + "#SIN5\\SIN5N011#This door is marked with a radiation hazard symbol.", + "#SIN5\\SIN5N012#Computer consoles do not take well to phasering. Sparks explode and, in a defensive maneuver prompted by this attack from within, the base launches a full spread of nuclear missiles at the Enterprise.", + "#SIN5\\SIN5N013#History will not be kind to you. Better luck next time.", + + "#VENA\\VENA_F41#Kirk out.", diff --git a/engines/startrek/text.h b/engines/startrek/text.h index e56327a79f..fd361146af 100644 --- a/engines/startrek/text.h +++ b/engines/startrek/text.h @@ -2707,6 +2707,69 @@ enum GameStringIDs { TX_SIN4U83B, + TX_SIN5_001, + TX_SIN5_002, + TX_SIN5_003, + TX_SIN5_004, + TX_SIN5_005, + TX_SIN5_006, + TX_SIN5_007, + TX_SIN5_008, + TX_SIN5_009, + TX_SIN5_010, + TX_SIN5_011, + TX_SIN5_012, + TX_SIN5_013, + TX_SIN5_014, + TX_SIN5_015, + TX_SIN5_016, + TX_SIN5_017, + TX_SIN5_018, + TX_SIN5_019, + TX_SIN5_020, + TX_SIN5_021, + TX_SIN5_022, + TX_SIN5_023, + TX_SIN5_024, + TX_SIN5_025, + TX_SIN5_026, + TX_SIN5_027, + TX_SIN5_028, + TX_SIN5_029, + TX_SIN5_030, + TX_SIN5_031, + TX_SIN5_032, + TX_SIN5_033, + TX_SIN5_034, + TX_SIN5_035, + TX_SIN5_036, + TX_SIN5_037, + TX_SIN5_038, + TX_SIN5_039, + TX_SIN5_040, + TX_SIN5_041, + TX_SIN5_042, + TX_SIN5_043, + TX_SIN5_044, + TX_SIN5_045, + TX_SIN5_046, + TX_SIN5_S19, + TX_SIN5N000, + TX_SIN5N001, + TX_SIN5N002, + TX_SIN5N003, + TX_SIN5N004, + TX_SIN5N005, + TX_SIN5N006, + TX_SIN5N007, + TX_SIN5N008, + TX_SIN5N009, + TX_SIN5N010, + TX_SIN5N011, + TX_SIN5N012, + TX_SIN5N013, + + TX_VENA_F41, |