diff options
Diffstat (limited to 'engines/startrek')
-rw-r--r-- | engines/startrek/room.cpp | 66 | ||||
-rw-r--r-- | engines/startrek/room.h | 12 | ||||
-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 | ||||
-rw-r--r-- | engines/startrek/text.cpp | 182 | ||||
-rw-r--r-- | engines/startrek/text.h | 195 | ||||
-rw-r--r-- | engines/startrek/textbox.cpp | 2 |
8 files changed, 355 insertions, 299 deletions
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp index 667b3b4496..faf27eb4ce 100644 --- a/engines/startrek/room.cpp +++ b/engines/startrek/room.cpp @@ -114,13 +114,55 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm), _awayMissi _numRoomActions = 0; } + loadRoomMessages(); memset(&_roomVar, 0, sizeof(_roomVar)); } Room::~Room() { + _lookMessages.clear(); + _talkMessages.clear(); delete[] _rdfData; } +void Room::loadRoomMessages() { + // TODO: There are some more messages which are not stored in that offset + uint16 messagesOffset = readRdfWord(32); + byte *text = _rdfData + messagesOffset; + int messageNum; + bool isTalkMessage; + + do { + while (*text != '#') + text++; + + if (text[5] != '\\') + error("loadRoomMessages: Invalid message"); + + isTalkMessage = (text[10] == '_'); + + // TODO: There are also 'L' messages (look at something, but has a talker). + // These clash with the normal talk ones (with underscores) + if (text[10] == 'L') { + while (*text != '\0') + text++; + + continue; + } + + sscanf((const char *)(text + 11), "%3d", &messageNum); + if (text[14] != '#') + error("loadRoomMessages: Invalid message"); + + if (isTalkMessage) + _talkMessages[messageNum] = Common::String((const char *)text); + else + _lookMessages[messageNum] = Common::String((const char *)text); + + while (*text != '\0') + text++; + } while (*(text + 1) == '#'); +} + uint16 Room::readRdfWord(int offset) { return READ_LE_UINT16((_rdfData + offset)); } @@ -298,30 +340,38 @@ int Room::showRoomSpecificText(const char **array) { return _vm->showText(&StarTrekEngine::readTextFromArrayWithChoices, (uintptr)array, 20, 20, textColor, true, false, false); } -int Room::showText(const TextRef *textIDs) { +int Room::showText(const TextRef *textIDs, bool fromRDF) { int numIDs = 0; + int retval; while (textIDs[numIDs] != TX_BLANK) numIDs++; const char **text = (const char **)malloc(sizeof(const char *) * (numIDs + 1)); - for (int i = 0; i <= numIDs; i++) - text[i] = g_gameStrings[textIDs[i]]; - int retval = showRoomSpecificText(text); + + for (int i = 0; i <= numIDs; i++) { + // TODO: This isn't nice, but it's temporary till we migrate to reading text from RDF files + if (i > 0 && fromRDF) + text[i] = (textIDs[0] == TX_NULL) ? _lookMessages[textIDs[i]].c_str() : _talkMessages[textIDs[i]].c_str(); + else + text[i] = g_gameStrings[textIDs[i]]; + } + + retval = showRoomSpecificText(text); free(text); return retval; } -int Room::showText(TextRef speaker, TextRef text) { +int Room::showText(TextRef speaker, TextRef text, bool fromRDF) { TextRef textIDs[3]; textIDs[0] = speaker; textIDs[1] = text; textIDs[2] = TX_BLANK; - return showText(textIDs); + return showText(textIDs, fromRDF); } -int Room::showText(TextRef text) { - return showText(TX_NULL, text); +int Room::showText(TextRef text, bool fromRDF) { + return showText(TX_NULL, text, fromRDF); } void Room::giveItem(int item) { diff --git a/engines/startrek/room.h b/engines/startrek/room.h index 33c46ce7d6..8f39b6b33e 100644 --- a/engines/startrek/room.h +++ b/engines/startrek/room.h @@ -26,6 +26,7 @@ #include "common/rect.h" #include "common/ptr.h" #include "common/str.h" +#include "common/hashmap.h" #include "startrek/action.h" #include "startrek/awaymission.h" @@ -36,7 +37,6 @@ using Common::SharedPtr; - namespace StarTrek { class StarTrekEngine; @@ -143,6 +143,8 @@ public: */ Common::Point getSpawnPosition(int crewmanIndex); + int showText(TextRef speaker, TextRef text, bool fromRDF = false); + public: byte *_rdfData; @@ -154,7 +156,10 @@ private: int _numRoomActions; int _roomIndex; // ie. for DEMON2, this is 2 + Common::HashMap<int, Common::String> _lookMessages; + Common::HashMap<int, Common::String> _talkMessages; + void loadRoomMessages(); int findFunctionPointer(int action, void (Room::*funcPtr)()); @@ -181,9 +186,8 @@ private: * Cmd 0x03 */ int showRoomSpecificText(const char **textAddr); - int showText(const TextRef *text); - int showText(TextRef speaker, TextRef text); - int showText(TextRef text); + int showText(const TextRef *text, bool fromRDF = false); + int showText(TextRef text, bool fromRDF = false); /** * Cmd 0x04 */ 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; diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp index 5ec0d31ff0..67f5e0e647 100644 --- a/engines/startrek/text.cpp +++ b/engines/startrek/text.cpp @@ -98,61 +98,61 @@ extern const char *const g_gameStrings[] = { "#COMP\\COMPU193#TLTDH gas: The chemical compound tantalum bi-lithium thalo-dihydroxide. Colorless, odorless, nonflammable gaseous at 1 atm and temperatures within the human norm. Early anesthetic among Vulcans and Romulans, in whom it produces laughter, feelings of exhiliration, euphoria; sometimes leading to unconsciousness. In post-industrial/pre-spaceflight era, a social problem evolved when crude TLTDH became popular to \"cook up\" from non-conductive tantalo-lithial compounds commonly used as electrical insulation.", - "#DEM0\\DEM0_001#Doctor, you need to investigate the possibility of disease, mental or physical, among these people, before we go chasing up the mountains. Prelate Angiven, may we see those who have encountered the demons?", - "#DEM0\\DEM0_002#Aside from seeing demons, has any hard data been collected? Any evidence I could see?", - "#DEM0\\DEM0_003#Been seeing ghosts and bogeymen eh? I find that a little hard to believe.", - "#DEM0\\DEM0_004#C'mon Bones, the cold will improve your circulation.", - "#DEM0\\DEM0_005#Demons? Gates of Hell? This is the 23rd Century!", - "#DEM0\\DEM0_006#I'm Captain James T. Kirk of the U.S.S. Enterprise. We have received word that alien lifeforms are creating problems at your mining facilities at Idyll Mountain. Tell me more.", - "#DEM0\\DEM0_007#Later Ensign. We have work to do.", - "#DEM0\\DEM0_008#Most High Prelate Angiven, I am honored to meet you. I consider it my divine duty to assist you in any possible way with the spawn of the devil.", - "#DEM0\\DEM0_009#This planet's as beautiful as everyone says it is.", - "#DEM0\\DEM0_010#What can you tell me about the mine itself?", - "#DEM0\\DEM0_011#You look rather cold, Bones.", - "#DEM0\\DEM0_012#You're wasting the time of a starship capable of destroying this planet with campfire stories? No wonder you were dumped out here in the middle of nowhere.", + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF "#DEM0\\DEM0_013#Captain, Doctor McCoy is correct.", - "#DEM0\\DEM0_014#Captain, demons and supernatural creatures are, almost by definition, illogical. Yet it is evident these people believe what they have seen. Barring illness or mass hysteria, I agree that a real problem seems to exist.", + "", // RDF "#DEM0\\DEM0_015#Burning down their house is not the best way to gain their confidence Jim!", "#DEM0\\DEM0_016#Captain, the flora on this planet is very interesting. I wonder how useful it may be for medicinal purposes.", "#DEM0\\DEM0_017#Quite the vandal aren't we, Jim?", - "#DEM0\\DEM0_018#His blood pressure's up a bit, but he believes he's telling the truth.", - "#DEM0\\DEM0_019#I don't know if the problem is real, the result of a new illness, or mass hysteria. But at the very least, there's an injured miner who needs my help.", - "#DEM0\\DEM0_020#Jim! Are you out of your mind?", - "#DEM0\\DEM0_021#Jim, I am not picking up any unusual life here, just native lifeforms and the settlers. The colonists are all human, except for the one Tellarite. If there are demons here, they don't register on my tricorder.", - "#DEM0\\DEM0_022#The man's in perfect health.", - "#DEM0\\DEM0_023#I'm not cold, I'm freezing! And that damn transporter just had to set me down in the middle of a snow drift!", - "#DEM0\\DEM0_024#Some people get too much circulation!", - "#DEM0\\DEM0_025#Well...", - "#DEM0\\DEM0_026#You mean you've never built a snowman, ensign?", - "#DEM0\\DEM0_027#The trees. The fresh air. The freezing cold...", - "#DEM0\\DEM0_028#Captain, reading the rocks in this area, I find that this locality may have been disturbed in the distant past. Recent disturbances created by the colonists' construction and mining prevent me from discovering anything further.", - "#DEM0\\DEM0_029#A centimeter of snow does not technically constitute a drift, Doctor.", - "#DEM0\\DEM0_030#They are already gathered in the chapel, and will cooperate in any way with you. First door on my right.", - "#DEM0\\DEM0_031#A skeptic would consider everything merely anecdotal or unproven. My people will gladly tell you their own stories, so you need not hear it secondhand through me.", - "#DEM0\\DEM0_032#Captain Kirk. I had no idea we were blessed with one of our order in the ranks of Starfleet. We believe we have located the very Gates of Hell below Idyll Mountain.", - "#DEM0\\DEM0_033#Starfleet recognizes our freedom to worship and believe as we see fit, Captain. I am surprised that you do not share that feeling. Rest assured that Starfleet Command will be informed of your rudeness.", - "#DEM0\\DEM0_034#Thank you for your courtesy, Kirk. May you receive the guidance and protection of our God as you complete this divine mission.", - "#DEM0\\DEM0_035#The area is exceptionally stable tectonically, and easy for our machinery to work in, praise God. We've mined for hafnium and a variety of useful trace elements. The deeper we dig, however, the more anomalous the variety of minerals seems to be. Our Ignaciate, Brother Stephen, has his own theories about why this might be. Either way, the anomalies inspired Brother Kandrey to conduct studies inside the mine. Yesterday, he reported discovering a strange door -- a gate to Hell, surely, for the demons caused a cave-in immediately. Kandrey was trapped, unconscious, and the demons prevent us from rescuing him. We can only hope he is still alive.", - "#DEM0\\DEM0_036#This is so much better, gentlefolk. We are honored at your presence and hope you will find peace here in our haven.", - "#DEM0\\DEM0_037#We need your help, Kirk. You may have no respect for our beliefs, but I hope you will look beyond that. Godspeed.", - "#DEM0\\DEM0_038#Certainly, Captain Kirk. Not aliens, per se -- we have encountered what we believe are demons at Idyll Mountain, creatures surely emerging from the very gates of Hell. Our God would not test us thus without reason, so we believe your might and insight are our God's method to help us discover what is going on.", + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF "#DEM0\\DEM0_039#Aw, Captain, please don't melt the snow. I've never seen it before.", "#DEM0\\DEM0_040#Is he always this trigger happy on ground missions?", - "#DEM0\\DEM0_041#And doctors say that patients complain too much!", - "#DEM0\\DEM0_042#I've never even thrown a snowball. Do you think anyone would mind?", - "#DEM0\\DEM0_043#I've never seen snow like this before. This is great!", - "#DEM0\\DEM0_044#Of course, sir.", - "#DEM0\\DEM0N000#A beautiful, snow covered scene with a path leading off to Mount Idyll.", - "#DEM0\\DEM0N001#A quickly constructed spartan shelter, primarily used by fledgling colonies.", - "#DEM0\\DEM0N002#Dr. Leonard McCoy, the finest doctor in Starfleet, wishes that he were on a warmer planet.", - "#DEM0\\DEM0N003#Ensign Everts, who has never been this close to snow before in his life, gazes with child-like fascination at the ground.", - "#DEM0\\DEM0N004#High Prelate Angiven waits patiently for you to decide what you will do next.", - "#DEM0\\DEM0N005#James Tiberius Kirk, Captain of the Enterprise. He's always happy to run an errand of mercy.", - "#DEM0\\DEM0N006#On the other side of the trees is Idyll Mountain. A tall, forbidding place. You have a vague feeling of danger.", - "#DEM0\\DEM0N007#Remnants of a recent snowfall cover the ground.", - "#DEM0\\DEM0N008#Some colonists.", - "#DEM0\\DEM0N009#Spock raises an eyebrow.", - "#DEM0\\DEM0N010#Various bushes and shrubs grow along the edge of the forest.", + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "#DEM0\\DEM0N009#Spock raises an eyebrow.", // kept because it's used as an enhancement in mudd1 + "", // RDF "All mining equipment use this road.", @@ -367,37 +367,37 @@ extern const char *const g_gameStrings[] = { "#DEM4\\DEM4N014#You fit the key into the slot, but you cannot find a way to turn it.", - "#DEM5\\DEM5_001#Just thinking to myself. Don't mind me.", - "#DEM5\\DEM5_002#Can you tell us what they looked like?", - "#DEM5\\DEM5_003#It will be good to help them for a change.", - "#DEM5\\DEM5_004#Not the good ones, that's for sure.", - "#DEM5\\DEM5_005#The demons didn't follow you?", + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF "#DEM5\\DEM5_006#I detect various pieces of mining equipment but nothing of note.", "#DEM5\\DEM5_007#May I suggest using a more diplomatic approach to questioning the colonists. Force will gain us little, if anything.", "#DEM5\\DEM5_008#Jim, that wouldn't be wise.", "#DEM5\\DEM5_009#Jim, these need to be processed first!", "#DEM5\\DEM5_010#This man is getting worse. We've got to find those berries before he dies.", - "#DEM5\\DEM5_011#Jim, I've completed my study. I find no evidence for physical or mental disturbances among the colonists, causing them to see hallucinations. There must be other reasons for what these people are seeing.", - "#DEM5\\DEM5_012#Jim, this man has suffered severe physical injuries to his head and arm. The wounds have been adequately cared for; however, he has developed the Nugaireyn infection. If not treated swiftly, the effects can be fatal. The infection can normally be treated with Hypo-Dytoxin, but there's none on the Enterprise.", - "#DEM5\\DEM5_013#The alien's lifesigns seem stress-elevated. Otherwise he appears fundamentally healthy.", - "#DEM5\\DEM5_014#The man is suffering moderately from the effects of his age, but seems healthy, alert, and in fine spirits.", - "#DEM5\\DEM5_015#The man seems worried and stressed, but all body functions appear within normal limits.", - "#DEM5\\DEM5_016#This man has recently suffered a nasty but non-life-threatening wound. The damage has been adequately cared for. The man's vital effects are attributable to shock and stress.", - "#DEM5\\DEM5_017#This man needs help, Jim, and I wouldn't want to put it off for too long.", - "#DEM5\\DEM5_018#By our standards yes. Here the Acolytes prefer a simpler life style; unfortunately, this is one of the consequences.", - "#DEM5\\DEM5_019#Neither were some of my professors.", - "#DEM5\\DEM5_020#So did I, but I became one anyway.", - "#DEM5\\DEM5_021#The Acolytes did a lot of good work for the needy in this quadrant.", - "#DEM5\\DEM5_022#Why, Spock, you two should get along fine, he sounds just like you.", - "#DEM5\\DEM5_023#You know Jim, they can take a captain out of a starship, and a science officer out of his lab, but you can never retire a doctor.", - "#DEM5\\DEM5_024#Captain, a Krognik-demon has a decidedly wolfish appearance. Brother Grisnash, is this not the traditional shape of the Evil One and his minions among Tellarites?", - "#DEM5\\DEM5_025#I believe this may be significant, Captain.", - "#DEM5\\DEM5_026#That is not logical, doctor.", - "#DEM5\\DEM5_027#The medical methods of these people seem primitive to me, doctor.", - "#DEM5\\DEM5_028#I am Brother Grisnash. I went up the mountainside in solitary prayer, seeking to face my fears. Indeed I found them. A bellowing Krognik-demon with sharp teeth and a long snout descended upon me in a rush of wind.", - "#DEM5\\DEM5_029#It is.", - "#DEM5\\DEM5_030#Brother Kandrey was -- is -- my partner. I was on the communications link when the demons caused the rockfall and silenced him. He said he'd found a strange door with devilish writing. Truly he came upon the Gate of Hell itself.", - "#DEM5\\DEM5_031#You tread close to unholy knowledge, Brother Stephen!", + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF "#DEM5\\DEM5_032#Ahh, I see you found the berries. Meet me in my lab.", "#DEM5\\DEM5_033#Good, you have found the berries. Bring them to my lab quickly.", "#DEM5\\DEM5_034#I am worried about Brother Chub. Can you examine him, Doctor?", @@ -406,27 +406,27 @@ extern const char *const g_gameStrings[] = { "#DEM5\\DEM5_037#Those are Laraxian berries. They grow wild by the mine entrance.", "#DEM5\\DEM5_038#Time is of the essence, you must hurry and retrieve the berry.", "#DEM5\\DEM5_039#What an interesting artifact. Hmmm... It appears to have been damaged. When you have a chance, take it to my lab and we'll see if it can be repaired.", - "#DEM5\\DEM5_040#I may be of some assistance. The Laraxian Berry grows near the mouth of the cave. If I could acquire it, I would be able to synthesize the Hypo-Dytoxin from the berry. Unfortunately, the demons prevent us from approaching the cave entrance. perhaps you could retrieve it for me.", - "#DEM5\\DEM5_041#I am Brother Stephen, an Ignaciate, following the holy teachings with mind and soul alike. I believe the anomalous mineral readings, in combination with evidence of ancient disturbances in this otherwise highly stable geologic location indicates previous habitation of the region, eons ago.", - "#DEM5\\DEM5_042#I appreciate your prayers, Brother Roberts. Captain, if you and your people go up the mountain, I hope afterward you will visit me in my study, which is next door. I am too old to make the trek myself, but I am eager for knowledge. In return, I will offer you what insights our God grants these old eyes.", - "#DEM5\\DEM5_043#I would be equally honored to discuss medicine with you, Doctor, as science with your Vulcan associate. Let me continue. I believe our God made humans, aliens -- and demons all. If I could get a real demon into my study, I would bless our God for the opportunity, as I thank Him for everything in this life.", - "#DEM5\\DEM5_044#My mom wanted me to become a doctor. Honest. But I hated my biology classes.", - "#DEM5\\DEM5_045#My uncle John lived with the Acolytes a long time ago. He died in their service, helping plague victims on New Ontario VI twenty years ago.", + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF "#DEM5\\DEM5L027#Thank you. You are most kind.", "#DEM5\\DEM5L028#You'll understand if I don't stand up, I hope. I am not well.", "#DEM5\\DEM5L029#I headed up the party that sought to rescue Brother Kandrey. Without warning, the demons appeared and attacked us as we approached the mine!", "#DEM5\\DEM5L030#Like the demons that have plagued devout folk since before our people left the Earth. Huge muscular demons, with ruddy skin. Truly the manifestation of Evil, with batwings, horns and talons, and a pointed tail. God preserve us all. One tore open my arm and I surely would have perished -- but for my companions who bore me back down the mountain.", "#DEM5\\DEM5L031#No.", - "#DEM5\\DEM5N000#A chapel typical of the Acolytes of the Stars.", - "#DEM5\\DEM5N001#A grim-faced miner-colonist nods curtly at you.", - "#DEM5\\DEM5N002#A majestic view of Mt. Idyll can be seen through the skylight.", - "#DEM5\\DEM5N003#A sturdy man of advanced years, whose blue eyes meet yours with clarity, curiosity, and directness.", - "#DEM5\\DEM5N004#Boxes of supplies and mining equipment litter the floor.", - "#DEM5\\DEM5N005#Ensign Everts cannot take his eyes off the sight of Mount Idyll.", - "#DEM5\\DEM5N006#James Kirk takes time to rest and ponder the remainder of the mission.", - "#DEM5\\DEM5N007#McCoy looks anxiously about the room.", - "#DEM5\\DEM5N008#Spock waits for your command, patient as ever.", - "#DEM5\\DEM5N009#The Tellarite appears completely at home surrounded by humans, but the wrinkling on his brow indicates a great deal of worry.", + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF + "", // RDF "#DEM5\\DEM5N010#He is too busy consoling the wounded man.", "#DEM5\\DEM5N011#He is too busy consoling the wounded man.", "#DEM5\\DEM5N012#They are too heavy to move.", diff --git a/engines/startrek/text.h b/engines/startrek/text.h index 1d19c5551c..a9204153e2 100644 --- a/engines/startrek/text.h +++ b/engines/startrek/text.h @@ -64,8 +64,9 @@ enum GroundTextIDs { // Text that's hardcoded into "RDF" files, and copied into here for a sane referencing // scheme. enum GameStringIDs { - TX_NULL, - TX_BLANK, + TX_BLANK = -1, + TX_NULL = 0, + TX_BLANK_OLD = 1, // unused, kept as filler TX_DIALOG_ERROR, TX_ANIMATION_ERROR, @@ -156,61 +157,61 @@ enum GameStringIDs { TX_COMPU193, - TX_DEM0_001, - TX_DEM0_002, - TX_DEM0_003, - TX_DEM0_004, - TX_DEM0_005, - TX_DEM0_006, - TX_DEM0_007, - TX_DEM0_008, - TX_DEM0_009, - TX_DEM0_010, - TX_DEM0_011, - TX_DEM0_012, + TX_DEM0_001_REMOVED, + TX_DEM0_002_REMOVED, + TX_DEM0_003_REMOVED, + TX_DEM0_004_REMOVED, + TX_DEM0_005_REMOVED, + TX_DEM0_006_REMOVED, + TX_DEM0_007_REMOVED, + TX_DEM0_008_REMOVED, + TX_DEM0_009_REMOVED, + TX_DEM0_010_REMOVED, + TX_DEM0_011_REMOVED, + TX_DEM0_012_REMOVED, TX_DEM0_013, - TX_DEM0_014, + TX_DEM0_014_REMOVED, TX_DEM0_015, TX_DEM0_016, TX_DEM0_017, - TX_DEM0_018, - TX_DEM0_019, - TX_DEM0_020, - TX_DEM0_021, - TX_DEM0_022, - TX_DEM0_023, - TX_DEM0_024, - TX_DEM0_025, - TX_DEM0_026, - TX_DEM0_027, - TX_DEM0_028, - TX_DEM0_029, - TX_DEM0_030, - TX_DEM0_031, - TX_DEM0_032, - TX_DEM0_033, - TX_DEM0_034, - TX_DEM0_035, - TX_DEM0_036, - TX_DEM0_037, - TX_DEM0_038, + TX_DEM0_018_REMOVED, + TX_DEM0_019_REMOVED, + TX_DEM0_020_REMOVED, + TX_DEM0_021_REMOVED, + TX_DEM0_022_REMOVED, + TX_DEM0_023_REMOVED, + TX_DEM0_024_REMOVED, + TX_DEM0_025_REMOVED, + TX_DEM0_026_REMOVED, + TX_DEM0_027_REMOVED, + TX_DEM0_028_REMOVED, + TX_DEM0_029_REMOVED, + TX_DEM0_030_REMOVED, + TX_DEM0_031_REMOVED, + TX_DEM0_032_REMOVED, + TX_DEM0_033_REMOVED, + TX_DEM0_034_REMOVED, + TX_DEM0_035_REMOVED, + TX_DEM0_036_REMOVED, + TX_DEM0_037_REMOVED, + TX_DEM0_038_REMOVED, TX_DEM0_039, TX_DEM0_040, - TX_DEM0_041, - TX_DEM0_042, - TX_DEM0_043, - TX_DEM0_044, - TX_DEM0N000, - TX_DEM0N001, - TX_DEM0N002, - TX_DEM0N003, - TX_DEM0N004, - TX_DEM0N005, - TX_DEM0N006, - TX_DEM0N007, - TX_DEM0N008, - TX_DEM0N009, - TX_DEM0N010, + TX_DEM0_041_REMOVED, + TX_DEM0_042_REMOVED, + TX_DEM0_043_REMOVED, + TX_DEM0_044_REMOVED, + TX_DEM0N000_REMOVED, + TX_DEM0N001_REMOVED, + TX_DEM0N002_REMOVED, + TX_DEM0N003_REMOVED, + TX_DEM0N004_REMOVED, + TX_DEM0N005_REMOVED, + TX_DEM0N006_REMOVED, + TX_DEM0N007_REMOVED, + TX_DEM0N008_REMOVED, + TX_DEM0N009, // kept because it's also used as an enhancement in mudd1 + TX_DEM0N010_REMOVED, TX_DEM0C001, // "C" = "Custom" (no ID originally assigned) @@ -425,37 +426,37 @@ enum GameStringIDs { TX_DEM4N014, - TX_DEM5_001, - TX_DEM5_002, - TX_DEM5_003, - TX_DEM5_004, - TX_DEM5_005, + TX_DEM5_001_REMOVED, + TX_DEM5_002_REMOVED, + TX_DEM5_003_REMOVED, + TX_DEM5_004_REMOVED, + TX_DEM5_005_REMOVED, TX_DEM5_006, TX_DEM5_007, TX_DEM5_008, TX_DEM5_009, TX_DEM5_010, - TX_DEM5_011, - TX_DEM5_012, - TX_DEM5_013, - TX_DEM5_014, - TX_DEM5_015, - TX_DEM5_016, - TX_DEM5_017, - TX_DEM5_018, - TX_DEM5_019, - TX_DEM5_020, - TX_DEM5_021, - TX_DEM5_022, - TX_DEM5_023, - TX_DEM5_024, - TX_DEM5_025, - TX_DEM5_026, - TX_DEM5_027, - TX_DEM5_028, - TX_DEM5_029, - TX_DEM5_030, - TX_DEM5_031, + TX_DEM5_011_REMOVED, + TX_DEM5_012_REMOVED, + TX_DEM5_013_REMOVED, + TX_DEM5_014_REMOVED, + TX_DEM5_015_REMOVED, + TX_DEM5_016_REMOVED, + TX_DEM5_017_REMOVED, + TX_DEM5_018_REMOVED, + TX_DEM5_019_REMOVED, + TX_DEM5_020_REMOVED, + TX_DEM5_021_REMOVED, + TX_DEM5_022_REMOVED, + TX_DEM5_023_REMOVED, + TX_DEM5_024_REMOVED, + TX_DEM5_025_REMOVED, + TX_DEM5_026_REMOVED, + TX_DEM5_027_REMOVED, + TX_DEM5_028_REMOVED, + TX_DEM5_029_REMOVED, + TX_DEM5_030_REMOVED, + TX_DEM5_031_REMOVED, TX_DEM5_032, TX_DEM5_033, TX_DEM5_034, @@ -464,27 +465,27 @@ enum GameStringIDs { TX_DEM5_037, TX_DEM5_038, TX_DEM5_039, - TX_DEM5_040, - TX_DEM5_041, - TX_DEM5_042, - TX_DEM5_043, - TX_DEM5_044, - TX_DEM5_045, + TX_DEM5_040_REMOVED, + TX_DEM5_041_REMOVED, + TX_DEM5_042_REMOVED, + TX_DEM5_043_REMOVED, + TX_DEM5_044_REMOVED, + TX_DEM5_045_REMOVED, TX_DEM5L027, - TX_DEM5L028, - TX_DEM5L029, - TX_DEM5L030, - TX_DEM5L031, - TX_DEM5N000, - TX_DEM5N001, - TX_DEM5N002, - TX_DEM5N003, - TX_DEM5N004, - TX_DEM5N005, - TX_DEM5N006, - TX_DEM5N007, - TX_DEM5N008, - TX_DEM5N009, + TX_DEM5L028, // name clash (L and _) + TX_DEM5L029, // name clash (L and _) + TX_DEM5L030, // name clash (L and _) + TX_DEM5L031, // name clash (L and _) + TX_DEM5N000_REMOVED, + TX_DEM5N001_REMOVED, + TX_DEM5N002_REMOVED, + TX_DEM5N003_REMOVED, + TX_DEM5N004_REMOVED, + TX_DEM5N005_REMOVED, + TX_DEM5N006_REMOVED, + TX_DEM5N007_REMOVED, + TX_DEM5N008_REMOVED, + TX_DEM5N009_REMOVED, TX_DEM5N010, TX_DEM5N011, TX_DEM5N012, diff --git a/engines/startrek/textbox.cpp b/engines/startrek/textbox.cpp index a6fc0d0ee2..a503c42a81 100644 --- a/engines/startrek/textbox.cpp +++ b/engines/startrek/textbox.cpp @@ -654,7 +654,7 @@ String StarTrekEngine::readTextFromArrayWithChoices(int choiceIndex, uintptr dat const char *headerText = textArray[0]; const char *mainText = textArray[choiceIndex + 1]; - if (*mainText == '\0') + if (mainText == nullptr || *mainText == '\0') return Common::String(); // Technically should be nullptr... if (headerTextOutput != nullptr) { |