diff options
author | Filippos Karapetis | 2019-05-28 21:41:58 +0300 |
---|---|---|
committer | Filippos Karapetis | 2019-05-28 21:41:58 +0300 |
commit | 42ac19e8042d12949d21a2b9650f8f12ca76493d (patch) | |
tree | 3e0762b27142aa682973967526e792fcc95cfffb /engines/startrek/rooms | |
parent | 310377033f334779dc39261c9cd20a295bb1cc04 (diff) | |
download | scummvm-rg350-42ac19e8042d12949d21a2b9650f8f12ca76493d.tar.gz scummvm-rg350-42ac19e8042d12949d21a2b9650f8f12ca76493d.tar.bz2 scummvm-rg350-42ac19e8042d12949d21a2b9650f8f12ca76493d.zip |
STARTREK: Start reading text from RDF files, instead of hardcoding it
Rooms DEMON0 and DEMON5 have been partially adapted to the new logic.
This isn't yet fully functional, for the following reasons:
- We only read the main text block. There are also some others which
are not handled yet. The unhandled blocks have been kept in text.cpp
- We load text in dictionaries, splitting the strings in look and talk.
However, there's a third category (look with a talker), which isn't
handled yet
- Text is loaded per-room, but there are enhancements where text and
samples are loaded from other rooms. These need to be refactored
Diffstat (limited to 'engines/startrek/rooms')
-rw-r--r-- | engines/startrek/rooms/demon0.cpp | 112 | ||||
-rw-r--r-- | engines/startrek/rooms/demon5.cpp | 84 | ||||
-rw-r--r-- | engines/startrek/rooms/mudd1.cpp | 1 |
3 files changed, 99 insertions, 98 deletions
diff --git a/engines/startrek/rooms/demon0.cpp b/engines/startrek/rooms/demon0.cpp index 6a51186d74..869bb9259f 100644 --- a/engines/startrek/rooms/demon0.cpp +++ b/engines/startrek/rooms/demon0.cpp @@ -46,7 +46,7 @@ void Room::demon0Tick100() { if (_awayMission->demon.talkedToPrelate || _awayMission->demon.prelateWelcomedCrew) return; _awayMission->demon.prelateWelcomedCrew = true; - showText(TX_SPEAKER_ANGIVEN, TX_DEM0_036); + showText(TX_SPEAKER_ANGIVEN, 36, true); } void Room::demon0Tick140() { @@ -106,51 +106,51 @@ void Room::demon0ReachedTopDoor() { void Room::demon0TalkToPrelate() { const TextRef options1[] = { TX_SPEAKER_KIRK, - TX_DEM0_006, - TX_DEM0_008, - TX_DEM0_003, + 6, + 8, + 3, TX_BLANK }; const TextRef firstResponse0[] = { TX_SPEAKER_ANGIVEN, - TX_DEM0_038, + 38, TX_BLANK }; const TextRef firstResponse1[] = { TX_SPEAKER_ANGIVEN, - TX_DEM0_032, + 32, TX_BLANK }; const TextRef options2[] = { TX_SPEAKER_KIRK, - TX_DEM0_002, - TX_DEM0_005, + 2, + 5, TX_BLANK }; const TextRef secondResponse[] = { TX_SPEAKER_ANGIVEN, - TX_DEM0_031, + 31, TX_BLANK }; const TextRef options3[] = { TX_SPEAKER_KIRK, - TX_DEM0_010, - TX_DEM0_012, + 10, + 12, TX_BLANK }; const TextRef thirdResponse[] = { TX_SPEAKER_ANGIVEN, - TX_DEM0_035, + 35, TX_BLANK }; const TextRef badConclusion[] = { TX_SPEAKER_ANGIVEN, - TX_DEM0_037, + 37, TX_BLANK }; const TextRef goodConclusion[] = { TX_SPEAKER_ANGIVEN, - TX_DEM0_034, + 34, TX_BLANK }; @@ -162,7 +162,7 @@ void Room::demon0TalkToPrelate() { const TextRef *response = nullptr; - switch (showText(options1)) { + switch (showText(options1, true)) { case 0: response = firstResponse0; break; @@ -175,26 +175,26 @@ void Room::demon0TalkToPrelate() { } if (response != nullptr) - showText(response); + showText(response, true); - if (showText(options2) == 1) + if (showText(options2, true) == 1) demon0BadResponse(); - showText(secondResponse); + showText(secondResponse, true); - if (showText(options3) == 1) + if (showText(options3, true) == 1) demon0BadResponse(); - showText(thirdResponse); + showText(thirdResponse, true); if (_awayMission->demon.wasRudeToPrelate) - showText(badConclusion); + showText(badConclusion, true); else - showText(goodConclusion); + showText(goodConclusion, true); } void Room::demon0LookAtPrelate() { - showText(TX_DEM0N004); + showText(4, true); } void Room::demon0UsePhaserOnSnow() { @@ -214,7 +214,7 @@ void Room::demon0UsePhaserOnShelter() { } void Room::demon0UsePhaserOnPrelate() { - showText(TX_SPEAKER_MCCOY, TX_DEM0_020); + showText(TX_SPEAKER_MCCOY, 20, true); } void Room::demon0LookAtSign() { @@ -222,66 +222,66 @@ void Room::demon0LookAtSign() { } void Room::demon0LookAtTrees() { - showText(TX_DEM0N006); + showText(6, true); } void Room::demon0LookAtSnow() { - showText(TX_DEM0N007); + showText(7, true); } void Room::demon0LookAnywhere() { - showText(TX_DEM0N000); + showText(0, true); } void Room::demon0LookAtBushes() { - showText(TX_DEM0N010); + showText(10, true); } void Room::demon0LookAtKirk() { - showText(TX_DEM0N005); + showText(5, true); } void Room::demon0LookAtMcCoy() { - showText(TX_DEM0N002); + showText(2, true); } void Room::demon0LookAtRedShirt() { - showText(TX_DEM0N003); + showText(3, true); } void Room::demon0LookAtSpock() { - showText(TX_DEM0N009); + showText(9, true); } void Room::demon0LookAtShelter() { - showText(TX_DEM0N001); + showText(1, true); } void Room::demon0TalkToKirk() { - showText(TX_SPEAKER_KIRK, TX_DEM0_009); - showText(TX_SPEAKER_MCCOY, TX_DEM0_027); - showText(TX_SPEAKER_KIRK, TX_DEM0_004); - showText(TX_SPEAKER_MCCOY, TX_DEM0_024); + showText(TX_SPEAKER_KIRK, 9, true); + showText(TX_SPEAKER_MCCOY, 27, true); + showText(TX_SPEAKER_KIRK, 4, true); + showText(TX_SPEAKER_MCCOY, 24, true); } void Room::demon0TalkToRedshirt() { - showText(TX_SPEAKER_EVERTS, TX_DEM0_043); - showText(TX_SPEAKER_MCCOY, TX_DEM0_026); - showText(TX_SPEAKER_EVERTS, TX_DEM0_042); - showText(TX_SPEAKER_MCCOY, TX_DEM0_025); - showText(TX_SPEAKER_KIRK, TX_DEM0_007); - showText(TX_SPEAKER_EVERTS, TX_DEM0_044); + showText(TX_SPEAKER_EVERTS, 43, true); + showText(TX_SPEAKER_MCCOY, 26, true); + showText(TX_SPEAKER_EVERTS, 42, true); + showText(TX_SPEAKER_MCCOY, 25, true); + showText(TX_SPEAKER_KIRK, 7, true); + showText(TX_SPEAKER_EVERTS, 44, true); } void Room::demon0TalkToMcCoy() { if (_awayMission->demon.talkedToPrelate) { - showText(TX_SPEAKER_KIRK, TX_DEM0_011); - showText(TX_SPEAKER_MCCOY, TX_DEM0_023); - showText(TX_SPEAKER_SPOCK, TX_DEM0_029); + showText(TX_SPEAKER_KIRK, 11, true); + showText(TX_SPEAKER_MCCOY, 23, true); + showText(TX_SPEAKER_SPOCK, 29, true); if (!_awayMission->redshirtDead) - showText(TX_SPEAKER_EVERTS, TX_DEM0_041); + showText(TX_SPEAKER_EVERTS, 41, true); } else { - showText(TX_SPEAKER_MCCOY, TX_DEM0_019); + showText(TX_SPEAKER_MCCOY, 19, true); if (!_awayMission->demon.askedPrelateAboutSightings) { demon0AskPrelateAboutSightings(); } @@ -289,15 +289,15 @@ void Room::demon0TalkToMcCoy() { } void Room::demon0TalkToSpock() { - showText(TX_SPEAKER_SPOCK, TX_DEM0_014); + showText(TX_SPEAKER_SPOCK, 14, true); if (!_awayMission->demon.talkedToPrelate && !_awayMission->demon.askedPrelateAboutSightings) demon0AskPrelateAboutSightings(); } void Room::demon0AskPrelateAboutSightings() { - showText(TX_SPEAKER_KIRK, TX_DEM0_001); - showText(TX_SPEAKER_ANGIVEN, TX_DEM0_030); + showText(TX_SPEAKER_KIRK, 1, true); + showText(TX_SPEAKER_ANGIVEN, 30, true); _awayMission->demon.askedPrelateAboutSightings = true; } @@ -305,13 +305,13 @@ void Room::demon0AskPrelateAboutSightings() { void Room::demon0UseSTricorderAnywhere() { loadActorAnim2(OBJECT_SPOCK, "sscans", -1, -1, 0); playSoundEffectIndex(0x04); - showText(TX_SPEAKER_SPOCK, TX_DEM0_028); + showText(TX_SPEAKER_SPOCK, 28, true); } void Room::demon0UseMTricorderAnywhere() { loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0); playSoundEffectIndex(0x04); - showText(TX_SPEAKER_MCCOY, TX_DEM0_021); + showText(TX_SPEAKER_MCCOY, 21, true); } void Room::demon0UseMTricorderOnPrelate() { @@ -319,9 +319,9 @@ void Room::demon0UseMTricorderOnPrelate() { playSoundEffectIndex(0x04); if (_awayMission->demon.talkedToPrelate) - showText(TX_SPEAKER_MCCOY, TX_DEM0_018); + showText(TX_SPEAKER_MCCOY, 18, true); else - showText(TX_SPEAKER_MCCOY, TX_DEM0_022); + showText(TX_SPEAKER_MCCOY, 22, true); } // Helper functions @@ -332,7 +332,7 @@ void Room::demon0BadResponse() { _awayMission->demon.missionScore -= 3; _awayMission->demon.wasRudeToPrelate = true; - showText(TX_SPEAKER_ANGIVEN, TX_DEM0_033); + showText(TX_SPEAKER_ANGIVEN, 33, true); } } diff --git a/engines/startrek/rooms/demon5.cpp b/engines/startrek/rooms/demon5.cpp index 5a3738c9f1..03a9c89f4d 100644 --- a/engines/startrek/rooms/demon5.cpp +++ b/engines/startrek/rooms/demon5.cpp @@ -107,43 +107,43 @@ void Room::demon5UseBerryOnChub() { } void Room::demon5LookAtRoberts() { - showText(TX_DEM5N001); + showText(1, true); } void Room::demon5LookAtGrisnash() { - showText(TX_DEM5N009); + showText(9, true); } void Room::demon5LookAtStephen() { - showText(TX_DEM5N003); + showText(3, true); } void Room::demon5LookAtKirk() { - showText(TX_DEM5N006); + showText(6, true); } void Room::demon5LookAtSpock() { - showText(TX_DEM5N008); + showText(8, true); } void Room::demon5LookAtMccoy() { - showText(TX_DEM5N007); + showText(7, true); } void Room::demon5LookAtRedshirt() { - showText(TX_DEM5N005); + showText(5, true); } void Room::demon5LookAtMountain() { - showText(TX_DEM5N002); + showText(2, true); } void Room::demon5LookAtCrate() { - showText(TX_DEM5N004); + showText(4, true); } void Room::demon5LookAnywhere() { - showText(TX_DEM5N000); + showText(0, true); } void Room::demon5LookAtChub() { @@ -152,7 +152,7 @@ void Room::demon5LookAtChub() { void Room::demon5TalkToRoberts() { if (_awayMission->demon.curedChub) { - showText(TX_SPEAKER_ROBERTS, TX_DEM5_030); + showText(TX_SPEAKER_ROBERTS, 30, true); if (!_roomVar.demon.talkedToRoberts) { _roomVar.demon.talkedToRoberts = true; _roomVar.demon.numTalkedTo++; @@ -166,9 +166,9 @@ void Room::demon5TalkToRoberts() { void Room::demon5TalkToChub() { if (_awayMission->demon.curedChub) { showText(TX_SPEAKER_CHUB, TX_DEM5L029); - showText(TX_SPEAKER_KIRK, TX_DEM5_002); + showText(TX_SPEAKER_KIRK, 2, true); showText(TX_SPEAKER_CHUB, TX_DEM5L030); - showText(TX_SPEAKER_KIRK, TX_DEM5_005); + showText(TX_SPEAKER_KIRK, 5, true); showText(TX_SPEAKER_CHUB, TX_DEM5L031); if (!_roomVar.demon.talkedToChub) { @@ -183,10 +183,10 @@ void Room::demon5TalkToChub() { void Room::demon5TalkToGrisnash() { if (_awayMission->demon.curedChub) { - showText(TX_SPEAKER_GRISNASH, TX_DEM5_028); - showText(TX_SPEAKER_SPOCK, TX_DEM5_024); - showText(TX_SPEAKER_GRISNASH, TX_DEM5_029); - showText(TX_SPEAKER_SPOCK, TX_DEM5_025); + showText(TX_SPEAKER_GRISNASH, 28, true); + showText(TX_SPEAKER_SPOCK, 24, true); + showText(TX_SPEAKER_GRISNASH, 29, true); + showText(TX_SPEAKER_SPOCK, 25, true); if (!_roomVar.demon.talkedToGrisnash) { _roomVar.demon.talkedToGrisnash = true; @@ -200,11 +200,11 @@ void Room::demon5TalkToGrisnash() { void Room::demon5TalkToStephen() { if (_awayMission->demon.curedChub) { - showText(TX_SPEAKER_STEPHEN, TX_DEM5_041); - showText(TX_SPEAKER_MCCOY, TX_DEM5_022); - showText(TX_SPEAKER_STEPHEN, TX_DEM5_043); - showText(TX_SPEAKER_ROBERTS, TX_DEM5_031); - showText(TX_SPEAKER_STEPHEN, TX_DEM5_042); + showText(TX_SPEAKER_STEPHEN, 41, true); + showText(TX_SPEAKER_MCCOY, 22, true); + showText(TX_SPEAKER_STEPHEN, 43, true); + showText(TX_SPEAKER_ROBERTS, 31, true); + showText(TX_SPEAKER_STEPHEN, 42, true); if (!_roomVar.demon.talkedToStephen) { _roomVar.demon.talkedToStephen = true; @@ -226,32 +226,32 @@ void Room::demon5TalkToStephen() { } void Room::demon5TalkToKirk() { - showText(TX_SPEAKER_KIRK, TX_DEM5_001); + showText(TX_SPEAKER_KIRK, 1, true); } void Room::demon5TalkToSpock() { - showText(TX_SPEAKER_SPOCK, TX_DEM5_027); - showText(TX_SPEAKER_MCCOY, TX_DEM5_018); + showText(TX_SPEAKER_SPOCK, 27, true); + showText(TX_SPEAKER_MCCOY, 18, true); } void Room::demon5TalkToRedshirt() { - showText(TX_SPEAKER_EVERTS, TX_DEM5_045); - showText(TX_SPEAKER_MCCOY, TX_DEM5_021); - showText(TX_SPEAKER_KIRK, TX_DEM5_003); + showText(TX_SPEAKER_EVERTS, 45, true); + showText(TX_SPEAKER_MCCOY, 21, true); + showText(TX_SPEAKER_KIRK, 3, true); } void Room::demon5TalkToMccoy() { if (_awayMission->demon.curedChub) { - showText(TX_SPEAKER_MCCOY, TX_DEM5_023); - showText(TX_SPEAKER_KIRK, TX_DEM5_004); + showText(TX_SPEAKER_MCCOY, 23, true); + showText(TX_SPEAKER_KIRK, 4, true); if (!_awayMission->redshirtDead) { - showText(TX_SPEAKER_EVERTS, TX_DEM5_044); - showText(TX_SPEAKER_MCCOY, TX_DEM5_020); - showText(TX_SPEAKER_SPOCK, TX_DEM5_026); - showText(TX_SPEAKER_MCCOY, TX_DEM5_019); + showText(TX_SPEAKER_EVERTS, 44, true); + showText(TX_SPEAKER_MCCOY, 20, true); + showText(TX_SPEAKER_SPOCK, 26, true); + showText(TX_SPEAKER_MCCOY, 19, true); } } else { - showText(TX_SPEAKER_MCCOY, TX_DEM5_017); + showText(TX_SPEAKER_MCCOY, 17, true); } } @@ -260,7 +260,7 @@ void Room::demon5UseMTricorderOnRoberts() { return; loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0); playSoundEffectIndex(0x04); - showText(TX_SPEAKER_MCCOY, TX_DEM5_015); + showText(TX_SPEAKER_MCCOY, 15, true); _roomVar.demon.scannedRoberts = true; _roomVar.demon.numScanned++; @@ -274,7 +274,7 @@ void Room::demon5UseMTricorderOnChub() { if (_awayMission->demon.curedChub) { if (_roomVar.demon.scannedChub) return; - showText(TX_SPEAKER_MCCOY, TX_DEM5_016); + showText(TX_SPEAKER_MCCOY, 16, true); _roomVar.demon.scannedChub = true; _roomVar.demon.numScanned++; demon5CheckCompletedStudy(); @@ -282,8 +282,8 @@ void Room::demon5UseMTricorderOnChub() { if (_awayMission->demon.field3e) showText(TX_SPEAKER_MCCOY, TX_DEM5_010); else { - showText(TX_SPEAKER_MCCOY, TX_DEM5_012); - showText(TX_SPEAKER_STEPHEN, TX_DEM5_040); + showText(TX_SPEAKER_MCCOY, 12, true); + showText(TX_SPEAKER_STEPHEN, 40, true); _awayMission->demon.knowAboutHypoDytoxin = true; _awayMission->demon.field3e = true; } @@ -296,7 +296,7 @@ void Room::demon5UseMTricorderOnGrisnash() { return; loadActorAnim2(OBJECT_MCCOY, "mscane", -1, -1, 0); playSoundEffectIndex(0x04); - showText(TX_SPEAKER_MCCOY, TX_DEM5_013); + showText(TX_SPEAKER_MCCOY, 13, true); _roomVar.demon.scannedGrisnash = true; _roomVar.demon.numScanned++; @@ -308,7 +308,7 @@ void Room::demon5UseMTricorderOnStephen() { return; loadActorAnim2(OBJECT_MCCOY, "mscanw", -1, -1, 0); playSoundEffectIndex(0x04); - showText(TX_SPEAKER_MCCOY, TX_DEM5_014); + showText(TX_SPEAKER_MCCOY, 14, true); _roomVar.demon.scannedStephen = true; _roomVar.demon.numScanned++; @@ -317,7 +317,7 @@ void Room::demon5UseMTricorderOnStephen() { void Room::demon5CheckCompletedStudy() { if (_roomVar.demon.numScanned == 4 && _roomVar.demon.numTalkedTo == 4) { - showText(TX_SPEAKER_MCCOY, TX_DEM5_011); + showText(TX_SPEAKER_MCCOY, 11, true); _roomVar.demon.numTalkedTo = 5; } } diff --git a/engines/startrek/rooms/mudd1.cpp b/engines/startrek/rooms/mudd1.cpp index 0da6f7660d..de7a09fa4a 100644 --- a/engines/startrek/rooms/mudd1.cpp +++ b/engines/startrek/rooms/mudd1.cpp @@ -169,6 +169,7 @@ void Room::mudd1SpockPressedRedButton() { // ENHANCEMENT: Original text was just "(Spock raises eyebrow)" without any audio. // This changes it to a narration to make it flow better. + // TODO: This needs to be refactored showText(TX_DEM0N009); break; |