diff options
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/true_talk/script_handler.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_concept.h | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_room_script.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_room_script.h | 28 |
4 files changed, 26 insertions, 10 deletions
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp index f5db6eb5de..5e31a9de52 100644 --- a/engines/titanic/true_talk/script_handler.cpp +++ b/engines/titanic/true_talk/script_handler.cpp @@ -88,7 +88,7 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip int canProcess = 0; if (result) { sentence->set34(result); - if (roomScript->proc6(npcScript, sentence, result)) { + if (roomScript->canRespond(npcScript, sentence, result)) { canProcess = npcScript->chooseResponse(roomScript, sentence, result); } } diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h index 97cc70e41d..01f51e1ce9 100644 --- a/engines/titanic/true_talk/tt_concept.h +++ b/engines/titanic/true_talk/tt_concept.h @@ -70,7 +70,7 @@ public: TTconcept *_nextP; TTscriptBase *_scriptP; TTword *_wordP; - ScriptType _scriptType; + int _scriptType; int _field14; int _field20; int _field34; diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp index 885021eb7f..4182498fa5 100644 --- a/engines/titanic/true_talk/tt_room_script.cpp +++ b/engines/titanic/true_talk/tt_room_script.cpp @@ -37,10 +37,6 @@ TTroomScript::TTroomScript(int scriptId) : TTroomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) { } -void TTroomScript::proc7() { - warning("TODO"); -} - void TTroomScript::proc8() { warning("TODO"); } diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h index 63aedd260c..4aa9b16da3 100644 --- a/engines/titanic/true_talk/tt_room_script.h +++ b/engines/titanic/true_talk/tt_room_script.h @@ -37,8 +37,16 @@ public: TTroomScriptBase(int scriptId, const char *charClass, const char *charName, int v3, int v4, int v5, int v6, int v2, int v7); - virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, int val) = 0; - virtual void proc7() = 0; + /** + * Returns true if a response can be made + */ + virtual bool canRespond(TTnpcScript *npcScript, TTsentence *sentence, int val) const = 0; + + /** + * Returns true if further sentence processing is allowed + */ + virtual bool canProcess(TTnpcScript *npcScript, TTsentence *sentence) const = 0; + virtual void proc8() = 0; virtual void proc9() = 0; @@ -57,8 +65,20 @@ public: public: TTroomScript(int scriptId); - virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, int val) { return 1; } - virtual void proc7(); + /** + * Returns true if a response can be made + */ + virtual bool canRespond(TTnpcScript *npcScript, TTsentence *sentence, int val) const { + return true; + } + + /** + * Returns true if further sentence processing is allowed + */ + virtual bool canProcess(TTnpcScript *npcScript, TTsentence *sentence) const { + return true; + } + virtual void proc8(); virtual void proc9(); |