aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Stewart2018-07-28 03:35:43 -0400
committerEugene Sandulenko2018-08-09 08:37:30 +0200
commitfe805de2efc393b9b0d249b483bac2425408a670 (patch)
tree7a869a99368413c9040039b9658a29aba29a1df9 /engines
parent4424515ccef65d3504fe78ea4c71d9171c0b4e7d (diff)
downloadscummvm-rg350-fe805de2efc393b9b0d249b483bac2425408a670.tar.gz
scummvm-rg350-fe805de2efc393b9b0d249b483bac2425408a670.tar.bz2
scummvm-rg350-fe805de2efc393b9b0d249b483bac2425408a670.zip
STARTREK: SINS3
Diffstat (limited to 'engines')
-rw-r--r--engines/startrek/awaymission.h29
-rw-r--r--engines/startrek/room.h58
-rw-r--r--engines/startrek/rooms/sins0.cpp4
-rw-r--r--engines/startrek/rooms/sins3.cpp489
-rw-r--r--engines/startrek/rooms/sins4.cpp16
-rw-r--r--engines/startrek/soundeffects.h1
-rw-r--r--engines/startrek/text.cpp4
-rw-r--r--engines/startrek/text.h4
8 files changed, 590 insertions, 15 deletions
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index dba20a179d..3791a24a30 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -526,14 +526,39 @@ struct AwayMission {
bool doorLaserFiredOnce; // 0x34
bool gotPointsForAccessingTerminal; // 0x35
bool scannedKeycardLock; // 0x36
- byte field39; // 0x39
+ byte laserSetting; // 0x37
+
+ // 0 if the laser hasn't been programmed with the keycard template;
+ // 1 if it has been programmed with the template;
+ // 2 if the rock has been placed on the wall.
+ byte laserPattern; // 0x38
+
+ // bit 0: got a rock, or at least scanned the ground outside
+ // bit 1: entered mineshaft room
+ // bit 2: scanned the ID card panel
+ // bit 3: set after all 3 clues are obtained and Spock explains how to make
+ // the keycard
+ byte gatheredClues; // 0x39
+
bool openedOuterDoor; // 0x3d
bool openedInnerDoor; // 0x3e
bool unlockedIDCardDoor; // 0x3f
+
+ // 0: mold hasn't been created
+ // 2: mold for the keycard has been etched into the rock
+ // 3: rock placed top of the mold
+ // 4: a keycard is there
+ int8 moldState; // 0x40
+
+ // 0: box closed
+ // 1: box open
+ // 2: box empty
+ byte boxState; // 0x41
+
bool enteredRoom0FirstTime; // 0x42
bool scottyInformedKirkAboutVirus; // 0x43
bool enteredRoom2FirstTime; // 0x44
- bool field45; // 0x45
+ bool enteredRoom3FirstTime; // 0x45
bool enteredRoom4FirstTime; // 0x46
bool gotPointsForScanningStatue; // 0x48
bool gotPointsForScanningRoom4; // 0x49
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index ab0f5003a1..272dd617b3 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2269,6 +2269,64 @@ public:
// SINS3
void sins3Tick1();
+ void sins3UseSTricorderOnBox();
+ void sins3UseSTricorderOnMonitor();
+ void sins3UseSTricorderAnywhere();
+ void sins3UseSTricorderOnDrill();
+ void sins3UseSTricorderOnPanel();
+ void sins3LookAtDrill();
+ void sins3LookAtPanel();
+ void sins3LookAtMonitor();
+ void sins3LookAnywhere();
+ void sins3UseSTricorderOnWall();
+ void sins3LookAtBox();
+ void sins3UseKirkOnBox();
+ void sins3KirkReachedBox();
+ void sins3Timer0Expired();
+ void sins3UseSpockOnBox();
+ void sins3SpockReachedBox();
+ void sins3UseMccoyOnBox();
+ void sins3MccoyReachedBox();
+ void sins3UseRedshirtOnBox();
+ void sins3RedshirtReachedBox();
+ void sins3BoxOpened();
+ void sins3GetBox();
+ void sins3KirkReachedBoxToGet();
+ void sins3KirkGotBoxContents();
+ void sins3Tick30();
+ void sins3Tick60();
+ void sins3UseKirkOnPanel();
+ void sins3UseSpockOnPanel();
+ void sins3SpockReachedPanel();
+ void sins3UseRockOnWall();
+ void sins3KirkReachedWall();
+ void sins3KirkPutRockOnWall();
+ void sins3KirkBackedAwayFromWall();
+ void sins3UsedLowPowerLaserOnRock();
+ void sins3MadeHoleInRock();
+ void sins3CreatedTemplateInRock();
+ void sins3RockTurnedIntoIDCard();
+ void sins3RockVaporized();
+ void sins3UseDrillAnywhere();
+ void sins3GetIDCard();
+ void sins3ReachedIDCard();
+ void sins3PickedUpIDCard();
+ void sins3LookAtItemBeingDrilled();
+ void sins3LookAtKirk();
+ void sins3LookAtSpock();
+ void sins3LookAtMccoy();
+ void sins3LookAtRedshirt();
+ void sins3TalkToKirk();
+ void sins3TalkToSpock();
+ void sins3TalkToMccoy();
+ void sins3TalkToRedshirt();
+ void sins3UseCommunicator();
+ void sins3UseSpockOnDrill();
+ void sins3UseMccoyOnDrill();
+ void sins3UseRedshirtOnDrill();
+ void sins3WalkToDoor();
+ void sins3UseMedkitOnCrewman();
+ void sins3UseMTricorderOnCrewman();
// SINS4
void sins4Tick1();
diff --git a/engines/startrek/rooms/sins0.cpp b/engines/startrek/rooms/sins0.cpp
index 04a931d562..fa0c3fa20d 100644
--- a/engines/startrek/rooms/sins0.cpp
+++ b/engines/startrek/rooms/sins0.cpp
@@ -133,7 +133,7 @@ void Room::sins0LookAtGround() {
void Room::sins0GetRock() {
_awayMission->disableInput = true;
loadActorAnimC(OBJECT_KIRK, "kpickw", -1, -1, &Room::sins0PickedUpRock);
- _awayMission->sins.field39 |= 1;
+ _awayMission->sins.gatheredClues |= 1;
}
void Room::sins0PickedUpRock() {
@@ -149,7 +149,7 @@ void Room::sins0UseSTricorderAnywhere() {
void Room::sins0UseSTricorderOnGround() {
spockScan(DIR_S, TX_SIN0_017);
- _awayMission->sins.field39 |= 1;
+ _awayMission->sins.gatheredClues |= 1;
}
void Room::sins0UseSTricorderOnPlanet() {
diff --git a/engines/startrek/rooms/sins3.cpp b/engines/startrek/rooms/sins3.cpp
index 81795e4c29..a88838d46f 100644
--- a/engines/startrek/rooms/sins3.cpp
+++ b/engines/startrek/rooms/sins3.cpp
@@ -22,20 +22,503 @@
#include "startrek/room.h"
-#define OBJECT_8 8
+#define OBJECT_ITEM 8 // The item being "operated" on by the drill
+#define OBJECT_9 9
+#define OBJECT_10 10
+#define OBJECT_BOX 11
-#define HOTSPOT_20 0x20
+#define HOTSPOT_DRILL 0x20
+#define HOTSPOT_PANEL 0x21
+#define HOTSPOT_BOX 0x22
+#define HOTSPOT_WALL 0x23
+#define HOTSPOT_DOOR 0x24
+#define HOTSPOT_LEFT_MONITOR 0x25
+#define HOTSPOT_RIGHT_MONITOR 0x26
namespace StarTrek {
extern const RoomAction sins3ActionList[] = {
- { {ACTION_TICK, 1, 0, 0}, &Room::sins3Tick1 },
+ { {ACTION_TICK, 1, 0, 0}, &Room::sins3Tick1 },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_BOX, 0}, &Room::sins3UseSTricorderOnBox },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_LEFT_MONITOR, 0}, &Room::sins3UseSTricorderOnMonitor },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_RIGHT_MONITOR, 0}, &Room::sins3UseSTricorderOnMonitor },
+ { {ACTION_USE, OBJECT_ISTRICOR, 0xff, 0}, &Room::sins3UseSTricorderAnywhere },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_DRILL, 0}, &Room::sins3UseSTricorderOnDrill },
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_PANEL, 0}, &Room::sins3UseSTricorderOnPanel },
+
+ { {ACTION_LOOK, HOTSPOT_DRILL, 0, 0}, &Room::sins3LookAtDrill },
+ { {ACTION_LOOK, HOTSPOT_PANEL, 0, 0}, &Room::sins3LookAtPanel },
+ { {ACTION_LOOK, HOTSPOT_LEFT_MONITOR, 0, 0}, &Room::sins3LookAtMonitor },
+ { {ACTION_LOOK, HOTSPOT_RIGHT_MONITOR, 0, 0}, &Room::sins3LookAtMonitor },
+ { {ACTION_LOOK, 0xff, 0, 0}, &Room::sins3LookAnywhere },
+
+ { {ACTION_USE, OBJECT_ISTRICOR, HOTSPOT_WALL, 0}, &Room::sins3UseSTricorderOnWall },
+
+ { {ACTION_LOOK, OBJECT_BOX, 0, 0}, &Room::sins3LookAtBox },
+ { {ACTION_LOOK, HOTSPOT_BOX, 0, 0}, &Room::sins3LookAtBox },
+
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_BOX, 0}, &Room::sins3UseKirkOnBox },
+ { {ACTION_DONE_WALK, 4, 0, 0}, &Room::sins3KirkReachedBox },
+ { {ACTION_TIMER_EXPIRED, 0, 0, 0}, &Room::sins3Timer0Expired },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_BOX, 0}, &Room::sins3UseSpockOnBox },
+ { {ACTION_DONE_WALK, 5, 0, 0}, &Room::sins3SpockReachedBox },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_BOX, 0}, &Room::sins3UseMccoyOnBox },
+ { {ACTION_DONE_WALK, 6, 0, 0}, &Room::sins3MccoyReachedBox },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_BOX, 0}, &Room::sins3UseRedshirtOnBox },
+ { {ACTION_DONE_WALK, 7, 0, 0}, &Room::sins3RedshirtReachedBox },
+ { {ACTION_DONE_ANIM, 8, 0, 0}, &Room::sins3BoxOpened },
+
+ { {ACTION_GET, OBJECT_BOX, 0, 0}, &Room::sins3GetBox },
+ { {ACTION_GET, HOTSPOT_BOX, 0, 0}, &Room::sins3GetBox },
+ { {ACTION_DONE_WALK, 3, 0, 0}, &Room::sins3KirkReachedBoxToGet },
+ { {ACTION_DONE_ANIM, 17, 0, 0}, &Room::sins3KirkGotBoxContents },
+
+ { {ACTION_TICK, 30, 0, 0}, &Room::sins3Tick30 },
+ { {ACTION_TICK, 60, 0, 0}, &Room::sins3Tick60 },
+
+ { {ACTION_USE, OBJECT_KIRK, HOTSPOT_PANEL, 0}, &Room::sins3UseKirkOnPanel },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_PANEL, 0}, &Room::sins3UseSpockOnPanel },
+ { {ACTION_DONE_WALK, 10, 0, 0}, &Room::sins3SpockReachedPanel },
+ { {ACTION_USE, OBJECT_IS8ROCKS, OBJECT_ITEM, 0}, &Room::sins3UseRockOnWall },
+ { {ACTION_USE, OBJECT_IS8ROCKS, HOTSPOT_WALL, 0}, &Room::sins3UseRockOnWall },
+ { {ACTION_DONE_WALK, 1, 0, 0}, &Room::sins3KirkReachedWall },
+ { {ACTION_DONE_ANIM, 18, 0, 0}, &Room::sins3KirkPutRockOnWall },
+ { {ACTION_DONE_WALK, 2, 0, 0}, &Room::sins3KirkBackedAwayFromWall },
+ { {ACTION_DONE_ANIM, 11, 0, 0}, &Room::sins3UsedLowPowerLaserOnRock },
+ { {ACTION_DONE_ANIM, 12, 0, 0}, &Room::sins3MadeHoleInRock },
+ { {ACTION_DONE_ANIM, 13, 0, 0}, &Room::sins3CreatedTemplateInRock },
+ { {ACTION_DONE_ANIM, 14, 0, 0}, &Room::sins3RockTurnedIntoIDCard },
+ { {ACTION_DONE_ANIM, 19, 0, 0}, &Room::sins3RockVaporized },
+ { {ACTION_USE, HOTSPOT_DRILL, 0xff, 0}, &Room::sins3UseDrillAnywhere },
+
+ { {ACTION_GET, OBJECT_ITEM, 0, 0}, &Room::sins3GetIDCard },
+ { {ACTION_DONE_WALK, 15, 0, 0}, &Room::sins3ReachedIDCard },
+ { {ACTION_DONE_ANIM, 16, 0, 0}, &Room::sins3PickedUpIDCard },
+ { {ACTION_LOOK, OBJECT_ITEM, 0, 0}, &Room::sins3LookAtItemBeingDrilled },
+ { {ACTION_LOOK, OBJECT_KIRK, 0, 0}, &Room::sins3LookAtKirk },
+ { {ACTION_LOOK, OBJECT_SPOCK, 0, 0}, &Room::sins3LookAtSpock },
+ { {ACTION_LOOK, OBJECT_MCCOY, 0, 0}, &Room::sins3LookAtMccoy },
+ { {ACTION_LOOK, OBJECT_REDSHIRT, 0, 0}, &Room::sins3LookAtRedshirt },
+ { {ACTION_TALK, OBJECT_KIRK, 0, 0}, &Room::sins3TalkToKirk },
+ { {ACTION_TALK, OBJECT_SPOCK, 0, 0}, &Room::sins3TalkToSpock },
+ { {ACTION_TALK, OBJECT_MCCOY, 0, 0}, &Room::sins3TalkToMccoy },
+ { {ACTION_TALK, OBJECT_REDSHIRT, 0, 0}, &Room::sins3TalkToRedshirt },
+
+ { {ACTION_USE, OBJECT_ICOMM, 0xff, 0}, &Room::sins3UseCommunicator },
+ { {ACTION_USE, OBJECT_SPOCK, HOTSPOT_DRILL, 0}, &Room::sins3UseSpockOnDrill },
+ { {ACTION_USE, OBJECT_MCCOY, HOTSPOT_DRILL, 0}, &Room::sins3UseMccoyOnDrill },
+ { {ACTION_USE, OBJECT_REDSHIRT, HOTSPOT_DRILL, 0}, &Room::sins3UseRedshirtOnDrill },
+
+ { {ACTION_WALK, HOTSPOT_DOOR, 0, 0}, &Room::sins3WalkToDoor },
+
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_KIRK, 0}, &Room::sins3UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_SPOCK, 0}, &Room::sins3UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_MCCOY, 0}, &Room::sins3UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMEDKIT, OBJECT_REDSHIRT, 0}, &Room::sins3UseMedkitOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_KIRK, 0}, &Room::sins3UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_SPOCK, 0}, &Room::sins3UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_MCCOY, 0}, &Room::sins3UseMTricorderOnCrewman },
+ { {ACTION_USE, OBJECT_IMTRICOR, OBJECT_REDSHIRT, 0}, &Room::sins3UseMTricorderOnCrewman },
};
extern const int sins3NumActions = sizeof(sins3ActionList) / sizeof(RoomAction);
void Room::sins3Tick1() {
+ playVoc("SIN3LOOP");
+
+ if (!_awayMission->sins.enteredRoom3FirstTime)
+ _awayMission->disableInput = 2;
+
+ if (_awayMission->sins.boxState == 1)
+ loadActorAnim2(OBJECT_BOX, "s3bxo", 0xaf, 0xb8);
+ else if (_awayMission->sins.boxState == 2)
+ loadActorAnim2(OBJECT_BOX, "s3bxe", 0xaf, 0xb8);
+
+ if (_awayMission->sins.moldState == 2)
+ loadActorAnim2(OBJECT_ITEM, "s3mold", 0, 0);
+ if (_awayMission->sins.moldState == 3)
+ loadActorAnim2(OBJECT_ITEM, "s3rock", 0, 0);
+ if (_awayMission->sins.moldState == 4)
+ loadActorAnim2(OBJECT_ITEM, "s3card", 0, 0);
+
+ _awayMission->sins.gatheredClues |= 2;
+ playMidiMusicTracks(MIDITRACK_27, -3);
+}
+
+void Room::sins3UseSTricorderOnBox() {
+ spockScan(DIR_S, TX_SIN3_003);
+}
+
+void Room::sins3UseSTricorderOnMonitor() {
+ spockScan(DIR_N, TX_SIN3_018);
+}
+
+void Room::sins3UseSTricorderAnywhere() {
+ spockScan(DIR_S, TX_SIN3_017);
+}
+
+void Room::sins3UseSTricorderOnDrill() {
+ spockScan(DIR_E, TX_SIN3_016);
+}
+
+void Room::sins3UseSTricorderOnPanel() {
+ if (_awayMission->sins.scannedKeycardLock) {
+ spockScan(DIR_E, TX_SIN3_015);
+ _awayMission->sins.laserPattern = 1;
+ } else
+ spockScan(DIR_E, TX_SIN3_019);
+}
+
+void Room::sins3LookAtDrill() {
+ showText(TX_SIN3N012);
+}
+
+void Room::sins3LookAtPanel() {
+ showText(TX_SIN3N011);
+}
+
+void Room::sins3LookAtMonitor() {
+ showText(TX_SIN3N007);
+}
+
+void Room::sins3LookAnywhere() {
+ showText(TX_SIN3N013);
+}
+
+void Room::sins3UseSTricorderOnWall() {
+ // NOTE: this event has two implementations, one unused.
+ if (true)
+ spockScan(DIR_E, TX_SIN3_023);
+ else
+ spockScan(DIR_S, TX_SIN3_022);
+}
+
+void Room::sins3LookAtBox() {
+ if (_awayMission->sins.boxState == 0)
+ showText(TX_SIN3N000);
+ else if (_awayMission->sins.boxState == 1)
+ showText(TX_SIN3N008);
+ else if (_awayMission->sins.boxState == 2)
+ showText(TX_SIN3N005);
+}
+
+void Room::sins3UseKirkOnBox() {
+ if (_awayMission->sins.boxState == 0) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewmanC(OBJECT_KIRK, 0x8f, 0xa9, &Room::sins3KirkReachedBox);
+ }
+}
+
+void Room::sins3KirkReachedBox() {
+ loadActorAnim2(OBJECT_KIRK, "kusele");
+ loadActorAnimC(OBJECT_BOX, "s3bxop", 0xaf, 0xb8, &Room::sins3BoxOpened);
+ _awayMission->timers[0] = 10; // play sound in 10 ticks
+ _awayMission->sins.boxState = 1;
+}
+
+// Plays a sound effect at a specific time while opening the box
+void Room::sins3Timer0Expired() {
+ playSoundEffectIndex(SND_0c);
+}
+
+void Room::sins3UseSpockOnBox() {
+ if (_awayMission->sins.boxState == 0) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_SPOCK] = DIR_E;
+ walkCrewmanC(OBJECT_SPOCK, 0x8f, 0xa9, &Room::sins3SpockReachedBox);
+ }
+}
+
+void Room::sins3SpockReachedBox() {
+ loadActorAnim2(OBJECT_SPOCK, "susele");
+ loadActorAnimC(OBJECT_BOX, "s3bxop", 0xaf, 0xb8, &Room::sins3BoxOpened);
+ _awayMission->timers[0] = 10; // ENHANCEMENT (play sound in 10 ticks)
+ _awayMission->sins.boxState = 1;
+}
+
+void Room::sins3UseMccoyOnBox() {
+ if (_awayMission->sins.boxState == 0) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_MCCOY] = DIR_E;
+ walkCrewmanC(OBJECT_MCCOY, 0x8f, 0xa9, &Room::sins3MccoyReachedBox);
+ }
+}
+
+void Room::sins3MccoyReachedBox() {
+ loadActorAnim2(OBJECT_MCCOY, "musele");
+ loadActorAnimC(OBJECT_BOX, "s3bxop", 0xaf, 0xb8, &Room::sins3BoxOpened);
+ _awayMission->timers[0] = 10; // ENHANCEMENT (play sound in 10 ticks)
+ _awayMission->sins.boxState = 1;
+}
+
+void Room::sins3UseRedshirtOnBox() {
+ if (_awayMission->sins.boxState == 0) {
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_REDSHIRT] = DIR_E;
+ walkCrewmanC(OBJECT_REDSHIRT, 0x8f, 0xa9, &Room::sins3RedshirtReachedBox);
+ }
+}
+
+void Room::sins3RedshirtReachedBox() {
+ loadActorAnim2(OBJECT_REDSHIRT, "rusele");
+ loadActorAnimC(OBJECT_BOX, "s3bxop", 0xaf, 0xb8, &Room::sins3BoxOpened);
+ _awayMission->timers[0] = 10; // ENHANCEMENT (play sound in 10 ticks)
+ _awayMission->sins.boxState = 1;
+}
+
+void Room::sins3BoxOpened() {
+ loadActorAnim2(OBJECT_BOX, "s3bxo", 0xaf, 0xb8);
+ _awayMission->disableInput = false;
+}
+
+void Room::sins3GetBox() {
+ if (_awayMission->sins.boxState == 1) { // Box is open, not empty
+ _awayMission->disableInput = true;
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewmanC(OBJECT_KIRK, 0x91, 0xab, &Room::sins3KirkReachedBoxToGet);
+ }
+}
+
+void Room::sins3KirkReachedBoxToGet() {
+ giveItem(OBJECT_ICONECT);
+ loadActorAnimC(OBJECT_KIRK, "kusele", -1, -1, &Room::sins3KirkGotBoxContents);
+}
+
+void Room::sins3KirkGotBoxContents() {
+ loadActorAnim2(OBJECT_BOX, "s3bxe", 0xaf, 0xb8);
+ _awayMission->sins.boxState = 2;
+ _awayMission->disableInput = false;
+}
+
+void Room::sins3Tick30() {
+ if (!_awayMission->sins.enteredRoom3FirstTime) {
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_012);
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_024);
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_013);
+ _awayMission->sins.enteredRoom3FirstTime = true;
+ _awayMission->disableInput = false;
+ }
+}
+
+void Room::sins3Tick60() {
+ if (_awayMission->sins.gatheredClues == 7) {
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_007);
+ _awayMission->sins.gatheredClues |= 8;
+ }
+}
+
+void Room::sins3UseKirkOnPanel() {
+ showText(TX_SPEAKER_KIRK, TX_SIN3_001);
+ sins3UseSpockOnPanel();
+}
+
+void Room::sins3UseSpockOnPanel() {
+ walkCrewmanC(OBJECT_SPOCK, 0x96, 0x78, &Room::sins3SpockReachedPanel);
+}
+
+void Room::sins3SpockReachedPanel() {
+ const TextRef choices[] = {
+ TX_SPEAKER_KIRK,
+ TX_SIN3_LASERSETTING001, TX_SIN3_LASERSETTING010, TX_SIN3_LASERSETTING100, TX_SIN3_LASERCANCEL,
+ TX_BLANK
+ };
+
+ int choice = showText(choices);
+
+ if (choice == 3) // cancel
+ return;
+ else {
+ _awayMission->sins.laserSetting = choice + 1;
+
+ if (_awayMission->sins.laserPattern == 0 && _awayMission->sins.laserSetting == 3)
+ // High setting can't be used until the template pattern has been uploaded to
+ // the machine
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_005);
+ else if (_awayMission->sins.moldState != -1) {
+ if (_awayMission->sins.moldState == 0) { // Mold not yet created
+ loadActorAnim2(OBJECT_SPOCK, "susemn");
+ playVoc("LAZERD2");
+
+ if (_awayMission->sins.laserPattern == 0 && _awayMission->sins.laserSetting == 3) {
+ // This code is unreachable, as the same condition was checked above
+ loadActorAnimC(OBJECT_ITEM, "s3las2", 0, 0, &Room::sins3MadeHoleInRock);
+ playSoundEffectIndex(SND_PHASSHOT);
+ _awayMission->sins.moldState = -1;
+ } else if (_awayMission->sins.laserPattern == 1 && _awayMission->sins.laserSetting == 3) {
+ // Strong laser creates the needed mold
+ loadActorAnimC(OBJECT_ITEM, "s3las3", 0, 0, &Room::sins3CreatedTemplateInRock);
+ playSoundEffectIndex(SND_PHASSHOT);
+ _awayMission->sins.moldState = 2;
+ } else {
+ // Weak laser does nothing to the rock
+ loadActorAnimC(OBJECT_ITEM, "s3las1", 0, 0, &Room::sins3UsedLowPowerLaserOnRock);
+ playSoundEffectIndex(SND_PHASSHOT);
+ }
+ } else if (_awayMission->sins.moldState == 3) { // There's a rock sitting on the mold
+ loadActorAnim2(OBJECT_SPOCK, "susemn");
+ playVoc("LAZERD2");
+
+ if (_awayMission->sins.laserSetting == 1 || _awayMission->sins.laserSetting == 2) {
+ // Weak-setting lasers create the keycard properly
+ loadActorAnimC(OBJECT_ITEM, "s3las4", 0, 0, &Room::sins3RockTurnedIntoIDCard);
+ playSoundEffectIndex(SND_PHASSHOT);
+ _awayMission->sins.moldState = 4;
+ } else if (_awayMission->sins.laserSetting == 3) {
+ // High-setting laser vaporizes the rocks
+ loadActorAnimC(OBJECT_ITEM, "s3las5", 0, 0, &Room::sins3RockVaporized);
+ playSoundEffectIndex(SND_PHASSHOT);
+ _awayMission->sins.moldState = 2;
+ _awayMission->sins.laserPattern = 1;
+ }
+ } else { // moldState == 2 or 4 (mold created; either keycard is in it, or nothing)
+ // "Template would be damaged from direct fire"
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_006);
+ }
+ }
+ }
+}
+
+void Room::sins3UseRockOnWall() {
+ if (_awayMission->sins.moldState == 2) {
+ _awayMission->sins.moldState = 3;
+ _awayMission->sins.laserPattern = 2;
+ _awayMission->disableInput = true;
+ walkCrewmanC(OBJECT_KIRK, 0x10f, 0xa7, &Room::sins3KirkReachedWall);
+ }
+}
+
+void Room::sins3KirkReachedWall() {
+ loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::sins3KirkPutRockOnWall);
+}
+
+void Room::sins3KirkPutRockOnWall() {
+ loseItem(OBJECT_IS8ROCKS);
+ loadActorAnim2(OBJECT_ITEM, "s3rock", 0, 0);
+ _awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
+ walkCrewmanC(OBJECT_KIRK, 0xfa, 0xaa, &Room::sins3KirkBackedAwayFromWall);
+}
+
+void Room::sins3KirkBackedAwayFromWall() {
+ _awayMission->disableInput = false;
+}
+
+void Room::sins3UsedLowPowerLaserOnRock() {
+ loadActorStandAnim(OBJECT_ITEM);
+}
+
+void Room::sins3MadeHoleInRock() {
+ // Unused
+ loadActorAnim2(OBJECT_ITEM, "s3hole", 0, 0);
+}
+
+void Room::sins3CreatedTemplateInRock() {
+ loadActorAnim2(OBJECT_ITEM, "s3mold", 0, 0);
+}
+
+void Room::sins3RockTurnedIntoIDCard() {
+ loadActorAnim2(OBJECT_ITEM, "s3card", 0, 0);
+}
+
+void Room::sins3RockVaporized() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_021);
+}
+
+void Room::sins3UseDrillAnywhere() {
+ // It isn't possible to "use" a hotspot on something else, so this is never called?
+ showText(TX_SIN3N009);
+}
+
+void Room::sins3GetIDCard() {
+ if (_awayMission->sins.moldState == 4) {
+ walkCrewmanC(OBJECT_KIRK, 0x10f, 0xa7, &Room::sins3ReachedIDCard);
+ _awayMission->disableInput = true;
+ }
+}
+
+void Room::sins3ReachedIDCard() {
+ loadActorAnimC(OBJECT_KIRK, "kuseme", -1, -1, &Room::sins3PickedUpIDCard);
+}
+
+void Room::sins3PickedUpIDCard() {
+ giveItem(OBJECT_IIDCARD);
+ loadActorAnim(OBJECT_ITEM, "s3mold", 0, 0);
+ _awayMission->sins.moldState = 2;
+ _awayMission->sins.laserPattern = 1;
+ _awayMission->disableInput = false;
+}
+
+void Room::sins3LookAtItemBeingDrilled() {
+ if (_awayMission->sins.moldState == 2)
+ showText(TX_SIN3N006);
+ else if (_awayMission->sins.moldState == 3)
+ showText(TX_SIN3N014);
+ else if (_awayMission->sins.moldState == 4)
+ showText(TX_SIN3N010);
+}
+
+void Room::sins3LookAtKirk() {
+ showText(TX_SIN3N003);
+}
+
+void Room::sins3LookAtSpock() {
+ showText(TX_SIN3N004);
+}
+
+void Room::sins3LookAtMccoy() {
+ showText(TX_SIN3N001); // BUGFIX: Speaker is "nobody", not Dr. McCoy
+}
+
+void Room::sins3LookAtRedshirt() {
+ showText(TX_SIN3N002);
+}
+
+void Room::sins3TalkToKirk() {
+ showText(TX_SPEAKER_KIRK, TX_SIN3_002);
+}
+
+void Room::sins3TalkToSpock() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_020);
+}
+
+void Room::sins3TalkToMccoy() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_011);
+}
+
+void Room::sins3TalkToRedshirt() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN3_026);
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_014);
+ showText(TX_SPEAKER_MOSHER, TX_SIN3_027);
+}
+
+void Room::sins3UseCommunicator() {
+ showText(TX_SPEAKER_UHURA, TX_SIN3U072);
+}
+
+void Room::sins3UseSpockOnDrill() {
+ showText(TX_SPEAKER_SPOCK, TX_SIN3_004);
+}
+
+void Room::sins3UseMccoyOnDrill() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_009);
+}
+
+void Room::sins3UseRedshirtOnDrill() {
+ showText(TX_SPEAKER_MOSHER, TX_SIN3_025);
+}
+
+void Room::sins3WalkToDoor() {
+ walkCrewman(OBJECT_KIRK, 0x2b, 0x86);
+}
+
+void Room::sins3UseMedkitOnCrewman() {
+ showText(TX_SPEAKER_MCCOY, TX_SIN3_010);
+}
+
+void Room::sins3UseMTricorderOnCrewman() {
+ mccoyScan(DIR_S, TX_SIN3_008);
}
}
diff --git a/engines/startrek/rooms/sins4.cpp b/engines/startrek/rooms/sins4.cpp
index 1400e66601..1278e6d756 100644
--- a/engines/startrek/rooms/sins4.cpp
+++ b/engines/startrek/rooms/sins4.cpp
@@ -110,11 +110,11 @@ void Room::sins4Tick1() {
void Room::sins4UseSTricorderOnPanel() {
spockScan(DIR_N, TX_SIN4_020);
_awayMission->sins.scannedKeycardLock = true;
- _awayMission->sins.field39 |= 4;
+ _awayMission->sins.gatheredClues |= 4;
- if (_awayMission->sins.field39 == 7) {
+ if (_awayMission->sins.gatheredClues == 7) {
showText(TX_SPEAKER_SPOCK, TX_SIN4_010);
- _awayMission->sins.field39 |= 8;
+ _awayMission->sins.gatheredClues |= 8;
}
}
@@ -125,9 +125,9 @@ void Room::sins4UseSpockOnPanel() {
else {
showText(TX_SPEAKER_SPOCK, TX_SIN4_021);
- if (_awayMission->sins.field39 == 7) {
+ if (_awayMission->sins.gatheredClues == 7) {
showText(TX_SPEAKER_SPOCK, TX_SIN4_010);
- _awayMission->sins.field39 |= 8;
+ _awayMission->sins.gatheredClues |= 8;
}
}
}
@@ -173,9 +173,9 @@ void Room::sins4KirkUsedRockOnPanel() {
showText(TX_SIN4N012);
showText(TX_SPEAKER_SPOCK, TX_SIN4_022);
- if (_awayMission->sins.field39 == 7) {
+ if (_awayMission->sins.gatheredClues == 7) {
showText(TX_SPEAKER_SPOCK, TX_SIN4_010);
- _awayMission->sins.field39 |= 8;
+ _awayMission->sins.gatheredClues |= 8;
}
}
@@ -278,7 +278,7 @@ void Room::sins4UseSTricorderAnywhere() {
}
void Room::sins4UseCommunicator() {
- if (!_awayMission->sins.field45) {
+ if (!_awayMission->sins.enteredRoom3FirstTime) {
showText(TX_SPEAKER_UHURA, TX_SIN4U100);
showText(TX_SPEAKER_KIRK, TX_SIN4_006);
showText(TX_SPEAKER_UHURA, TX_SIN4U83B);
diff --git a/engines/startrek/soundeffects.h b/engines/startrek/soundeffects.h
index 357c36eb08..adfb4eb737 100644
--- a/engines/startrek/soundeffects.h
+++ b/engines/startrek/soundeffects.h
@@ -34,6 +34,7 @@ enum SoundEffects {
SND_TRANSMAT = 9,
SND_TRANSENE = 0x0a,
SND_BLANK_0b = 0x0b,
+ SND_0c = 0x0c,
SND_SELECTION = 0x10,
SND_BLANK_14 = 0x14,
SND_BLANK_16 = 0x16,
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 1ec9b8337d..cf164668db 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -2541,6 +2541,10 @@ extern const char *const g_gameStrings[] = {
"#SIN3\\SIN3N013#This room looks like it was once used for some type of mining operation.",
"#SIN3\\SIN3N014#You have placed the rocks onto the pattern.",
"#SIN3\\SIN3U072#Nothing new to report Captain.",
+ "Laser Setting: 001",
+ "Laser Setting: 010",
+ "Laser Setting: 100",
+ "cancel",
"#SIN4\\SIN4_001#At least the Enterprise is safe.",
diff --git a/engines/startrek/text.h b/engines/startrek/text.h
index 90eb63f06a..594eede2b5 100644
--- a/engines/startrek/text.h
+++ b/engines/startrek/text.h
@@ -2643,6 +2643,10 @@ enum GameStringIDs {
TX_SIN3N013,
TX_SIN3N014,
TX_SIN3U072,
+ TX_SIN3_LASERSETTING001, // Custom named text
+ TX_SIN3_LASERSETTING010,
+ TX_SIN3_LASERSETTING100,
+ TX_SIN3_LASERCANCEL,
TX_SIN4_001,