diff options
-rw-r--r-- | engines/titanic/true_talk/bellbot_script.cpp | 40 | ||||
-rw-r--r-- | engines/titanic/true_talk/german/bellbot_script.cpp | 74 | ||||
-rw-r--r-- | engines/titanic/true_talk/german/bellbot_script.h | 5 |
3 files changed, 101 insertions, 18 deletions
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp index 931ad75a42..60a692c89b 100644 --- a/engines/titanic/true_talk/bellbot_script.cpp +++ b/engines/titanic/true_talk/bellbot_script.cpp @@ -1046,14 +1046,15 @@ int BellbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * break; case 21: - if (sentence->contains("hiker") || sentence->contains("hug")) { + if (sentence->localWord("hiker") && (sentence->contains("hug") || + sentence->contains("anhalter"))) { addResponse(getDialogueId(200379)); applyFlag = true; } break; case 22: - if (sentence->localWord("get") || sentence->localWord("it")) { + if (sentence->localWord("get") && sentence->localWord("it")) { addResponse(getDialogueId(200474)); applyFlag = true; } @@ -1109,9 +1110,9 @@ int BellbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * break; case 30: - if ((sentence->localWord("did") || sentence->localWord("not")) - || (sentence->localWord("would") || sentence->localWord("not")) - || (sentence->localWord("could") || sentence->localWord("not")) + if ((sentence->localWord("did") && sentence->localWord("not")) + || (sentence->localWord("would") && sentence->localWord("not")) + || (sentence->localWord("could") && sentence->localWord("not")) || sentence->localWord("tried")) { addResponse(getDialogueId(200416)); applyFlag = true; @@ -1272,8 +1273,8 @@ case44: break; case 51: - if (sentence->localWord("no") || sentence->localWord("it") - || sentence->localWord("is") || sentence->localWord("not") + if ((sentence->localWord("no") && sentence->localWord("it") + && sentence->localWord("is") && sentence->localWord("not")) || sentence->contains("yeah right")) { addResponse(getDialogueId(200636)); applyFlag = true; @@ -1379,7 +1380,7 @@ stateFlag = false; break; case 64: - if (sentence->localWord("rowboat")) { + if (sentence->localWord("rowbot")) { addResponse(getDialogueId(200052)); applyFlag = true; } @@ -1410,9 +1411,9 @@ stateFlag = false; break; case 68: - if ((sentence->localWord("i") && sentence->localWord("care")) - || sentence->localWord("do") - || sentence->localWord("me")) { + if ((sentence->localWord("i") && (sentence->localWord("care") || + sentence->localWord("do"))) + || sentence->localWord("me")) { addResponse(getDialogueId(201006)); applyFlag = true; } @@ -1453,10 +1454,13 @@ stateFlag = false; break; case 73: - if (sentence->localWord("mood") && (charId() == 7 || charId() == 5)) { - addResponse(getDialogueId(201021)); - applyFlag = true; - stateFlag = false; + if (sentence->localWord("mood") || sentence->contains("stimmung") || + sentence->contains("laune") || sentence->contains("verfassung")) { + if (charId() == 7 || charId() == 5) { + addResponse(getDialogueId(201021)); + applyFlag = true; + stateFlag = false; + } } break; @@ -1625,7 +1629,8 @@ stateFlag = false; break; case 88: - if (sentence->_category == 6 || sentence->contains("upside down")) { + if (sentence->_category == 6 || + (g_language != Common::DE_DEU && sentence->contains("upside down"))) { addResponse(getDialogueId(202142)); applyFlag = true; } @@ -1906,7 +1911,7 @@ bool BellbotScript::addRoomDescription(const TTroomScript *roomScript) { switch (roomScript->_scriptId) { case 101: - addResponse(getDialogueId(getValue(2) == 1 ? 20185 : 201832)); + addResponse(getDialogueId(getValue(2) == 1 ? 201835 : 201832)); break; case 107: if (_room107First) { @@ -1977,5 +1982,4 @@ bool BellbotScript::addRoomDescription(const TTroomScript *roomScript) { return true; } - } // End of namespace Titanic diff --git a/engines/titanic/true_talk/german/bellbot_script.cpp b/engines/titanic/true_talk/german/bellbot_script.cpp index c6ff9f6a50..1f82fb031e 100644 --- a/engines/titanic/true_talk/german/bellbot_script.cpp +++ b/engines/titanic/true_talk/german/bellbot_script.cpp @@ -21,9 +21,83 @@ */ #include "titanic/true_talk/german/bellbot_script.h" +#include "titanic/true_talk/true_talk_manager.h" namespace Titanic { namespace German { +int BellbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence) { + switch (val1) { + case 5001: + case 5021: + return 0; + + case 5002: + addResponse(getDialogueId(*srcIdP)); + addResponse(getDialogueId(200000)); + applyResponse(); + return 2; + + case 5003: + addResponse(getDialogueId(*srcIdP)); + return 2; + + case 5022: + case 5023: + if (CTrueTalkManager::getStateValue(7)) { + bool flag = true; + + if (!sentence->localWord("broken") && !sentence->contains("kaputt") && + !sentence->contains("im eimer") && !sentence->contains("funktioniert nicht") && + CTrueTalkManager::_currentNPC) { + CNodeItem *node = CTrueTalkManager::_currentNPC->getNode(); + if (node) { + CString nodeName = node->getName(); + if (nodeName.contains("5") || nodeName.contains("6") || nodeName.contains("7")) + flag = false; + } + } + + if (flag) { + CTrueTalkManager::triggerAction(29, 1); + selectResponse(201771); + } + else { + CTrueTalkManager::triggerAction(29, 2); + selectResponse(201554); + } + } + else { + selectResponse(21378); + } + + applyResponse(); + return 2; + + case 5024: + if (CTrueTalkManager::getStateValue(7)) { + CTrueTalkManager::triggerAction(29, 3); + return 0; + } + + selectResponse(21378); + applyResponse(); + return 2; + + case 5025: + if (CTrueTalkManager::getStateValue(7)) { + CTrueTalkManager::triggerAction(29, 4); + return 0; + } + + selectResponse(21378); + applyResponse(); + return 2; + + default: + return TTnpcScript::doSentenceEntry(val1, srcIdP, roomScript, sentence); + } +} + } // End of namespace German } // End of namespace Titanic diff --git a/engines/titanic/true_talk/german/bellbot_script.h b/engines/titanic/true_talk/german/bellbot_script.h index 42f6e5d7cf..4670c02e94 100644 --- a/engines/titanic/true_talk/german/bellbot_script.h +++ b/engines/titanic/true_talk/german/bellbot_script.h @@ -33,6 +33,11 @@ public: BellbotScript(int val1, const char *charClass, int v2, const char *charName, int v3, int val2) : ::Titanic::BellbotScript(val1, charClass, v2, charName, v3, val2) {} + + /** + * Process a sentence fragment entry + */ + virtual int doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence); }; } // End of namespace German |