aboutsummaryrefslogtreecommitdiff
path: root/engines/startrek/rooms
diff options
context:
space:
mode:
authorFilippos Karapetis2019-10-07 01:08:18 +0300
committerFilippos Karapetis2019-10-07 01:08:51 +0300
commit95f8cfff1602d92178eea875794f83da548566c5 (patch)
treedbd74cc846b66ad9349e7dbaa9e093679f2daaa8 /engines/startrek/rooms
parent7caf897ee2e94a0c90601f55e476a1849b8c353b (diff)
downloadscummvm-rg350-95f8cfff1602d92178eea875794f83da548566c5.tar.gz
scummvm-rg350-95f8cfff1602d92178eea875794f83da548566c5.tar.bz2
scummvm-rg350-95f8cfff1602d92178eea875794f83da548566c5.zip
STARTREK: Handle shared messages
Also, start moving message patches inside patchRoomMessage(), and remove some redundant state variables
Diffstat (limited to 'engines/startrek/rooms')
-rw-r--r--engines/startrek/rooms/feather3.cpp8
-rw-r--r--engines/startrek/rooms/love0.cpp11
-rw-r--r--engines/startrek/rooms/love2.cpp4
-rw-r--r--engines/startrek/rooms/lovea.cpp77
-rw-r--r--engines/startrek/rooms/mudd0.cpp2
-rw-r--r--engines/startrek/rooms/tug2.cpp2
6 files changed, 26 insertions, 78 deletions
diff --git a/engines/startrek/rooms/feather3.cpp b/engines/startrek/rooms/feather3.cpp
index 69bf6f50b9..95680727ee 100644
--- a/engines/startrek/rooms/feather3.cpp
+++ b/engines/startrek/rooms/feather3.cpp
@@ -334,12 +334,8 @@ void Room::feather3UseMedkitOnTlaoxac() {
}
void Room::feather3UseMedkitOnRedshirt() {
- if (_awayMission->redshirtDead) {
- // BUGFIX: Original voice clip (TX_FEA3_030) is someone who's clearly not Kelley
- // saying "he's dead, Jim". He recorded the line a few other times, so use one of
- // those instead.
- mccoyScan(DIR_N, TX_LOVA_100);
- }
+ if (_awayMission->redshirtDead)
+ mccoyScan(DIR_N, 30, true);
}
void Room::feather3UseMedkitAnywhere() {
diff --git a/engines/startrek/rooms/love0.cpp b/engines/startrek/rooms/love0.cpp
index 323cc68452..40ba48455a 100644
--- a/engines/startrek/rooms/love0.cpp
+++ b/engines/startrek/rooms/love0.cpp
@@ -174,12 +174,7 @@ void Room::love0UseRedshirtOnConsole() {
}
void Room::love0UseSpockOnConsole() {
- _roomVar.love.consoleCrewman = OBJECT_SPOCK;
- _roomVar.love.consoleSpeaker = TX_SPEAKER_SPOCK;
- _roomVar.love.consoleText = TX_LOV0_005;
- strcpy(_roomVar.love.consoleAnimation, "susemn");
-
- walkCrewman(_roomVar.love.consoleCrewman, 0x9a, 0x9a, 2);
+ walkCrewman(OBJECT_SPOCK, 0x9a, 0x9a, 2);
if (!_awayMission->love.spockAccessedConsole) {
_awayMission->love.spockAccessedConsole = true;
_awayMission->love.missionScore += 4;
@@ -187,7 +182,7 @@ void Room::love0UseSpockOnConsole() {
}
void Room::love0SpockReachedConsole() {
- loadActorAnim2(_roomVar.love.consoleCrewman, _roomVar.love.consoleAnimation, -1, -1, 5);
+ loadActorAnim2(OBJECT_SPOCK, "susemn", -1, -1, 5);
}
void Room::love0SpockAccessedConsole() {
@@ -196,7 +191,7 @@ void Room::love0SpockAccessedConsole() {
love0InteractWithConsole();
else {
showText(TX_SPEAKER_COMPUTER, TX_COMPU188);
- showText(_roomVar.love.consoleSpeaker, _roomVar.love.consoleText);
+ showText(TX_SPEAKER_SPOCK, 5, true);
_roomVar.love.heardSummaryOfVirus = true;
}
}
diff --git a/engines/startrek/rooms/love2.cpp b/engines/startrek/rooms/love2.cpp
index 8419db5c9c..369f4035de 100644
--- a/engines/startrek/rooms/love2.cpp
+++ b/engines/startrek/rooms/love2.cpp
@@ -293,9 +293,7 @@ void Room::love2UseMTricorderAnywhere() {
if (_awayMission->love.knowAboutVirus)
mccoyScan(DIR_S, 8, false, true);
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);
+ mccoyScan(DIR_S, 12, false);
}
void Room::love2UseSTricorderAnywhere() {
diff --git a/engines/startrek/rooms/lovea.cpp b/engines/startrek/rooms/lovea.cpp
index 00c2a1f361..12dc564916 100644
--- a/engines/startrek/rooms/lovea.cpp
+++ b/engines/startrek/rooms/lovea.cpp
@@ -29,33 +29,8 @@ namespace StarTrek {
// Mccoy or Ferris say something under effects of laughing gas
void Room::loveaTimer0Expired() {
- const TextRef ferrisText[] = {
- TX_LOV0_039,
- TX_LOV0_048,
- TX_LOV0_045,
- TX_LOV0_040,
- TX_LOV0_042,
- TX_LOV0_050,
- TX_LOV0_043,
- TX_LOV0_041,
- TX_LOV0_047,
- TX_LOV0_046,
- TX_LOV0_039
- };
-
- const TextRef mccoyText[] = {
- TX_LOV0_011,
- TX_LOV0_020,
- TX_LOV0_016,
- TX_LOV0_012,
- TX_LOV0_014,
- TX_LOV0_022,
- TX_LOV0_015,
- TX_LOV0_021,
- TX_LOV0_013,
- TX_LOV0_019,
- TX_LOV0_017
- };
+ const TextRef ferrisText[] = { 39, 48, 45, 40, 42, 50, 43, 41, 47, 46, 39 };
+ const TextRef mccoyText[] = { 11, 20, 16, 12, 14, 22, 15, 21, 13, 19, 17 };
// BUGFIX: should range from 0-1, not 0-2. Original had "get name errors" when it
// rolled a 2.
@@ -74,16 +49,11 @@ void Room::loveaTimer0Expired() {
randomVal = getRandomWordInRange(0, 10);
- showText(speaker, textTable[randomVal]);
+ showText(speaker, COMMON_MESSAGE_OFFSET + textTable[randomVal], true);
if (!_awayMission->love.releasedRomulanLaughingGas) {
- const int spockText[] = {
- TX_LOV0_029,
- TX_LOV0_033,
- TX_LOV0_026,
- TX_LOV0_124
- };
- showText(TX_SPEAKER_SPOCK, spockText[getRandomWordInRange(0, 3)]);
+ const int spockText[] = { 29, 33, 26, 124 };
+ showText(TX_SPEAKER_SPOCK, COMMON_MESSAGE_OFFSET + spockText[getRandomWordInRange(0, 3)], true);
// BUG(?): This is in an if statement, meaning the human crewmen stop talking from
// laughing gas if Spock is under laughing gas effects. Might be intentional, to
@@ -94,27 +64,16 @@ void Room::loveaTimer0Expired() {
// Spock says something under effects of laughing gas
void Room::loveaTimer1Expired() {
- const int spockText[] = {
- TX_LOV0_025,
- TX_LOV0_101,
- TX_LOV0_102,
- TX_LOV0_103,
- TX_LOV0_104,
- TX_LOV0_105,
- TX_LOV0_106,
- TX_LOV0_107
- };
-
- showText(TX_SPEAKER_SPOCK, spockText[getRandomWordInRange(0, 7)]);
-
+ const int spockText[] = { 25, 101, 102, 103, 104, 105, 106, 107 };
+ showText(TX_SPEAKER_SPOCK, COMMON_MESSAGE_OFFSET + spockText[getRandomWordInRange(0, 7)], true);
_awayMission->timers[1] = getRandomWordInRange(200, 400);
}
void Room::loveaUseMedkitOnSpock() {
if (_awayMission->love.spockCured)
- showText(TX_SPEAKER_MCCOY, TX_LOV5_015);
+ showText(TX_SPEAKER_MCCOY, COMMON_MESSAGE_OFFSET + 15, true);
else
- showText(TX_SPEAKER_MCCOY, TX_LOV5_019);
+ showText(TX_SPEAKER_MCCOY, COMMON_MESSAGE_OFFSET + 19, true);
}
void Room::loveaUseCureSampleOnSpock() {
@@ -128,7 +87,7 @@ void Room::loveaUseCureSampleOnSpock() {
void Room::loveaUseCureOnSpock() {
if (_awayMission->love.spockCured)
- showText(TX_SPEAKER_MCCOY, TX_LOV5_015);
+ showText(TX_SPEAKER_MCCOY, COMMON_MESSAGE_OFFSET + 15, true);
else {
walkCrewman(OBJECT_SPOCK, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock, 99);
walkCrewman(OBJECT_MCCOY, _roomVar.love.cmnXPosToCureSpock, _roomVar.love.cmnYPosToCureSpock + 10, 99);
@@ -142,9 +101,9 @@ void Room::loveaSpockOrMccoyInPositionToUseCure() {
}
void Room::loveaFinishedCuringSpock() {
- showText(TX_SPEAKER_MCCOY, TX_LOV5_030);
- showText(TX_SPEAKER_SPOCK, TX_LOV5_038);
- showText(TX_SPEAKER_MCCOY, TX_LOV5_027);
+ showText(TX_SPEAKER_MCCOY, COMMON_MESSAGE_OFFSET + 30, true);
+ showText(TX_SPEAKER_SPOCK, COMMON_MESSAGE_OFFSET + 38, true);
+ showText(TX_SPEAKER_MCCOY, COMMON_MESSAGE_OFFSET + 27, true);
showText(TX_SPEAKER_SPOCK, TX_LOV5C001);
_awayMission->love.spockCured = true;
}
@@ -195,11 +154,11 @@ void Room::loveaUseMTricorderOnSpock() {
else if (_awayMission->love.spockInfectionCounter < 50)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F08);
else if (_awayMission->love.spockInfectionCounter < 70) // BUGFIX: < 70 instead of == 70
- showText(TX_SPEAKER_MCCOY, TX_TUG2_010);
+ showText(TX_SPEAKER_MCCOY, COMMON_MESSAGE_OFFSET + 10, true); // TX_TUG2_010
else if (_awayMission->love.spockInfectionCounter < 100)
showText(TX_SPEAKER_MCCOY, TX_LOVA_F10);
else
- showText(TX_SPEAKER_MCCOY, TX_LOVA_100);
+ showText(TX_SPEAKER_MCCOY, COMMON_MESSAGE_OFFSET + 100);
}
void Room::loveaUseMTricorderOnHuman() {
@@ -208,7 +167,7 @@ void Room::loveaUseMTricorderOnHuman() {
}
void Room::loveaUseRomulanLaughingGas() {
- showDescription(TX_LOV2N005);
+ showDescription(COMMON_MESSAGE_OFFSET + 2, true);
_awayMission->love.releasedRomulanLaughingGas = true;
loseItem(OBJECT_IRLG);
@@ -217,7 +176,7 @@ void Room::loveaUseRomulanLaughingGas() {
}
void Room::loveaUseHumanLaughingGas() {
- showDescription(TX_LOV2N005);
+ showDescription(COMMON_MESSAGE_OFFSET + 5, true);
showText(TX_SPEAKER_SPOCK, TX_MUD2_040);
_awayMission->love.releasedHumanLaughingGas = true;
loseItem(OBJECT_IN2O);
@@ -228,7 +187,7 @@ void Room::loveaUseHumanLaughingGas() {
}
void Room::loveaUseAmmonia() {
- showDescription(TX_LOV2N005);
+ showDescription(COMMON_MESSAGE_OFFSET + 5, true);
// TODO: redshirt says something in floppy edition only
loseItem(OBJECT_INH3);
}
diff --git a/engines/startrek/rooms/mudd0.cpp b/engines/startrek/rooms/mudd0.cpp
index 9e540d60c9..fca2584f16 100644
--- a/engines/startrek/rooms/mudd0.cpp
+++ b/engines/startrek/rooms/mudd0.cpp
@@ -203,7 +203,7 @@ void Room::mudd0PickedUpLense() {
void Room::mudd0PickedUpItem() {
_awayMission->disableInput = false; // NOTE: this was never set to true
- showDescription(TX_LOV1N007);
+ showDescription(COMMON_MESSAGE_OFFSET + 7, true); // TX_LOV1N007
}
diff --git a/engines/startrek/rooms/tug2.cpp b/engines/startrek/rooms/tug2.cpp
index 3f6241f177..06c5011683 100644
--- a/engines/startrek/rooms/tug2.cpp
+++ b/engines/startrek/rooms/tug2.cpp
@@ -605,7 +605,7 @@ void Room::tug2TalkToSpock() {
}
void Room::tug2UseCommunicator() {
- showText(TX_SPEAKER_SPOCK, TX_TUG1_011);
+ showText(TX_SPEAKER_SPOCK, COMMON_MESSAGE_OFFSET + 11, true);
}
void Room::tug2DetermineElasiShooter() {