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/demon0.cpp | |
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/demon0.cpp')
-rw-r--r-- | engines/startrek/rooms/demon0.cpp | 112 |
1 files changed, 56 insertions, 56 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); } } |