diff options
author | Paul Gilbert | 2016-07-30 23:52:09 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-30 23:52:09 -0400 |
commit | 377f926a6bfba385c883ba14d96e247e6fcf88f8 (patch) | |
tree | 730e7347618f45a932bc3acba7230ad32e6791ee /engines/titanic | |
parent | 45fb6a2d32d46ab5c1acbc90302a324520474fed (diff) | |
download | scummvm-rg350-377f926a6bfba385c883ba14d96e247e6fcf88f8.tar.gz scummvm-rg350-377f926a6bfba385c883ba14d96e247e6fcf88f8.tar.bz2 scummvm-rg350-377f926a6bfba385c883ba14d96e247e6fcf88f8.zip |
TITANIC: Added BellbotScript scriptChanged
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/true_talk/barbot_script.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/barbot_script.h | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/bellbot_script.cpp | 73 | ||||
-rw-r--r-- | engines/titanic/true_talk/bellbot_script.h | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/deskbot_script.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/deskbot_script.h | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/doorbot_script.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/doorbot_script.h | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/liftbot_script.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/liftbot_script.h | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/maitred_script.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/maitred_script.h | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/parrot_script.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/parrot_script.h | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/succubus_script.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/succubus_script.h | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_npc_script.h | 8 |
17 files changed, 88 insertions, 23 deletions
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp index cc987f00b9..6d69244cd5 100644 --- a/engines/titanic/true_talk/barbot_script.cpp +++ b/engines/titanic/true_talk/barbot_script.cpp @@ -756,7 +756,7 @@ done: return 2; } -ScriptChangedResult BarbotScript::scriptChanged(TTscriptBase *roomScript, uint id) { +ScriptChangedResult BarbotScript::scriptChanged(TTroomScript *roomScript, uint id) { switch (id) { case 1: case 100: diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h index cf53e66b3d..b7a19334d1 100644 --- a/engines/titanic/true_talk/barbot_script.h +++ b/engines/titanic/true_talk/barbot_script.h @@ -70,7 +70,7 @@ public: /** * Called when the script/id changes */ - virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id); + virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id); virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence, uint val, uint tagId, uint remainder); diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp index 15cbc21b64..ddfd315f02 100644 --- a/engines/titanic/true_talk/bellbot_script.cpp +++ b/engines/titanic/true_talk/bellbot_script.cpp @@ -344,9 +344,75 @@ int BellbotScript::process(TTroomScript *roomScript, TTsentence *sentence) { return 2; } -ScriptChangedResult BellbotScript::scriptChanged(TTscriptBase *roomScript, uint id) { - warning("TODO"); - return SCR_1; +ScriptChangedResult BellbotScript::scriptChanged(TTroomScript *roomScript, uint id) { + if (!roomScript) + return SCR_2; + + switch (id) { + case 104: + addResponse(getDialogueId(200617)); + applyResponse(); + break; + + case 105: + addResponse(getDialogueId(200732)); + applyResponse(); + break; + + case 106: + addResponse(getDialogueId(200733)); + applyResponse(); + break; + + case 107: + addResponse(getDialogueId(200731)); + applyResponse(); + break; + + case 157: + _field2DC = 1; + break; + + case 158: + CTrueTalkManager::setFlags(26, 1); + break; + + case 3: + if (_field2DC) { + if (randomResponse0(roomScript, id)) + return SCR_2; + } else { + addResponse(getDialogueId(201693)); + applyResponse(); + } + + _field2DC = 0; + CTrueTalkManager::_v9 = 0; + // Deliberate fall-through + default: + if (roomScript->_scriptId == 115 && id == 103) { + switch (getValue(4)) { + case 0: + addResponse(getDialogueId(200014)); + applyResponse(); + break; + case 1: + case 2: + addResponse(getDialogueId(200011)); + applyResponse(); + break; + case 3: + addResponse(getDialogueId(200007)); + applyResponse(); + break; + default: + break; + } + } + break; + } + + return SCR_2; } int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence, @@ -1623,7 +1689,6 @@ int BellbotScript::checkCommonSentences(TTroomScript *roomScript, TTsentence *se return 1; uint val1 = getValue(1); - uint newId = 0; for (uint idx = 0; idx < _phrases.size(); ++idx) { TTcommonPhrase &cp = _phrases[idx]; diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h index 58fb762cf4..ee5a679041 100644 --- a/engines/titanic/true_talk/bellbot_script.h +++ b/engines/titanic/true_talk/bellbot_script.h @@ -98,7 +98,7 @@ public: /** * Called when the script/id changes */ - virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id); + virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id); virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence, uint val, uint tagId, uint remainder); diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp index 4ac04c70fb..13d6869c70 100644 --- a/engines/titanic/true_talk/deskbot_script.cpp +++ b/engines/titanic/true_talk/deskbot_script.cpp @@ -64,7 +64,7 @@ int DeskbotScript::process(TTroomScript *roomScript, TTsentence *sentence) { return 0; } -ScriptChangedResult DeskbotScript::scriptChanged(TTscriptBase *roomScript, uint id) { +ScriptChangedResult DeskbotScript::scriptChanged(TTroomScript *roomScript, uint id) { warning("TODO"); return SCR_1; } diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h index d8a181c07b..bbe52bd557 100644 --- a/engines/titanic/true_talk/deskbot_script.h +++ b/engines/titanic/true_talk/deskbot_script.h @@ -74,7 +74,7 @@ public: /** * Called when the script/id changes */ - virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id); + virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id); virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence, uint val, uint tagId, uint remainder); diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp index 5839b72ba2..7319058c0a 100644 --- a/engines/titanic/true_talk/doorbot_script.cpp +++ b/engines/titanic/true_talk/doorbot_script.cpp @@ -132,7 +132,7 @@ int DoorbotScript::process(TTroomScript *roomScript, TTsentence *sentence) { return 0; } -ScriptChangedResult DoorbotScript::scriptChanged(TTscriptBase *roomScript, uint id) { +ScriptChangedResult DoorbotScript::scriptChanged(TTroomScript *roomScript, uint id) { warning("TODO"); return SCR_1; } diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h index 70cdfeaf3a..be653fd1b6 100644 --- a/engines/titanic/true_talk/doorbot_script.h +++ b/engines/titanic/true_talk/doorbot_script.h @@ -68,7 +68,7 @@ public: /** * Called when the script/id changes */ - virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id); + virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id); virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence, uint val, uint tagId, uint remainder); diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp index 397338a1ab..2f079cbaac 100644 --- a/engines/titanic/true_talk/liftbot_script.cpp +++ b/engines/titanic/true_talk/liftbot_script.cpp @@ -95,7 +95,7 @@ int LiftbotScript::proc9() const { return 0; } -ScriptChangedResult LiftbotScript::scriptChanged(TTscriptBase *roomScript, uint id) { +ScriptChangedResult LiftbotScript::scriptChanged(TTroomScript *roomScript, uint id) { warning("TODO"); return SCR_1; } diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h index 118d6585bd..55752e1df6 100644 --- a/engines/titanic/true_talk/liftbot_script.h +++ b/engines/titanic/true_talk/liftbot_script.h @@ -65,7 +65,7 @@ public: /** * Called when the script/id changes */ - virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id); + virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id); virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence, uint val, uint tagId, uint remainder); diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp index d013380fe7..7da541f0f7 100644 --- a/engines/titanic/true_talk/maitred_script.cpp +++ b/engines/titanic/true_talk/maitred_script.cpp @@ -70,7 +70,7 @@ int MaitreDScript::process(TTroomScript *roomScript, TTsentence *sentence) { return 0; } -ScriptChangedResult MaitreDScript::scriptChanged(TTscriptBase *roomScript, uint id) { +ScriptChangedResult MaitreDScript::scriptChanged(TTroomScript *roomScript, uint id) { warning("TODO"); return SCR_1; } diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h index b3185d3b61..06fc6866ab 100644 --- a/engines/titanic/true_talk/maitred_script.h +++ b/engines/titanic/true_talk/maitred_script.h @@ -73,7 +73,7 @@ public: /** * Called when the script/id changes */ - virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id); + virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id); virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence, uint val, uint tagId, uint remainder); diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp index 0cd8082272..96efc627c1 100644 --- a/engines/titanic/true_talk/parrot_script.cpp +++ b/engines/titanic/true_talk/parrot_script.cpp @@ -63,7 +63,7 @@ int ParrotScript::process(TTroomScript *roomScript, TTsentence *sentence) { return 2; } -ScriptChangedResult ParrotScript::scriptChanged(TTscriptBase *roomScript, uint id) { +ScriptChangedResult ParrotScript::scriptChanged(TTroomScript *roomScript, uint id) { if (id >= 280000 && id <= 280276) { if (id == 280258) { if (CTrueTalkManager::_currentNPC) { diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h index a27c159c79..7e473bf242 100644 --- a/engines/titanic/true_talk/parrot_script.h +++ b/engines/titanic/true_talk/parrot_script.h @@ -50,7 +50,7 @@ public: /** * Called when the script/id changes */ - virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id); + virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id); /** * Process a sentence fragment entry diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp index 07442ed758..9be779513f 100644 --- a/engines/titanic/true_talk/succubus_script.cpp +++ b/engines/titanic/true_talk/succubus_script.cpp @@ -79,7 +79,7 @@ int SuccUBusScript::process(TTroomScript *roomScript, TTsentence *sentence) { return 0; } -ScriptChangedResult SuccUBusScript::scriptChanged(TTscriptBase *roomScript, uint id) { +ScriptChangedResult SuccUBusScript::scriptChanged(TTroomScript *roomScript, uint id) { warning("TODO"); return SCR_1; } diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h index 4710e79a49..4ea85f1a92 100644 --- a/engines/titanic/true_talk/succubus_script.h +++ b/engines/titanic/true_talk/succubus_script.h @@ -52,7 +52,7 @@ public: /** * Called when the script/id changes */ - virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id); + virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id); /** * Handles updating NPC state based on specified dialogue Ids and dial positions diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h index 09fe470e72..d208576caf 100644 --- a/engines/titanic/true_talk/tt_npc_script.h +++ b/engines/titanic/true_talk/tt_npc_script.h @@ -72,7 +72,7 @@ public: /** * Called when the script/id changes */ - virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id) = 0; + virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id) = 0; virtual int proc11() const = 0; virtual int proc12() const = 0; @@ -237,7 +237,7 @@ public: /** * Called when the script/id changes */ - virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id) { + virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id) { return SCR_2; } @@ -335,8 +335,8 @@ public: /** * Called with the script and id changes */ - ScriptChangedResult notifyScript(TTscriptBase *npcScript, int id) { - return scriptChanged(npcScript, id); + ScriptChangedResult notifyScript(TTroomScript *roomScript, int id) { + return scriptChanged(roomScript, id); } }; |