diff options
author | Paul Gilbert | 2016-11-05 09:46:57 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-11-05 09:46:57 -0400 |
commit | 738bdf94aa216aacee378aa574eb869af67e9089 (patch) | |
tree | 35f3a07672a39ac9c4db5ffee2413256785d1d84 /engines/titanic | |
parent | 4e927128da784a7b2b2ab3eb7840ee15556f0046 (diff) | |
download | scummvm-rg350-738bdf94aa216aacee378aa574eb869af67e9089.tar.gz scummvm-rg350-738bdf94aa216aacee378aa574eb869af67e9089.tar.bz2 scummvm-rg350-738bdf94aa216aacee378aa574eb869af67e9089.zip |
TITANIC: Fix showing replies with multiple response fragments
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/true_talk/deskbot_script.cpp | 10 | ||||
-rw-r--r-- | engines/titanic/true_talk/deskbot_script.h | 4 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_response.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_response.h | 6 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_script_base.cpp | 2 |
5 files changed, 22 insertions, 6 deletions
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp index 4df47e0af1..9fd0662def 100644 --- a/engines/titanic/true_talk/deskbot_script.cpp +++ b/engines/titanic/true_talk/deskbot_script.cpp @@ -1116,14 +1116,18 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * } case 78: + // "Do you have a reservation?" if (sentence->_field2C == 11 || sentence->_field2C == 13) { + // Player said they have a reservation addResponse(getDialogueId(241262)); } else if (sentence->_field2C == 12 || sentence->contains("do not")) { + // Player said they don't have a reservation setDialRegion(0, 0); setDialRegion(1, 0); addResponse(getDialogueId(241268)); - add241716(); + addAskBreakfast(); } else { + // Player didn't say yes or no addResponse(getDialogueId(240745)); } @@ -1149,7 +1153,7 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * break; } - add241716(); + addAskBreakfast(); applyFlag = true; stateFlag = false; break; @@ -1480,7 +1484,7 @@ int DeskbotScript::checkCommonWords(const TTsentence *sentence) { return 0; } -void DeskbotScript::add241716() { +void DeskbotScript::addAskBreakfast() { addResponse(getDialogueId(241716)); } diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h index f5978553ce..1d00abb655 100644 --- a/engines/titanic/true_talk/deskbot_script.h +++ b/engines/titanic/true_talk/deskbot_script.h @@ -81,9 +81,9 @@ private: int checkCommonWords(const TTsentence *sentence); /** - * Adds response dialogue 241716 + * Adds a dialogue for asking the player what kind of breakfast they'd like */ - void add241716(); + void addAskBreakfast(); /** * Adds a dialogue description for the player's assigned room diff --git a/engines/titanic/true_talk/tt_response.cpp b/engines/titanic/true_talk/tt_response.cpp index 1c784ad320..3cb8d2c9ec 100644 --- a/engines/titanic/true_talk/tt_response.cpp +++ b/engines/titanic/true_talk/tt_response.cpp @@ -49,6 +49,12 @@ TTresponse::~TTresponse() { } } +TTresponse *TTresponse::appendResponse(int id) { + TTresponse *resp = new TTresponse(id, 3); + _nextP = resp; + return resp; +} + TTresponse *TTresponse::copyChain() const { TTresponse *returnResponseP = new TTresponse(this); diff --git a/engines/titanic/true_talk/tt_response.h b/engines/titanic/true_talk/tt_response.h index d39d18c193..950e1cd23e 100644 --- a/engines/titanic/true_talk/tt_response.h +++ b/engines/titanic/true_talk/tt_response.h @@ -42,6 +42,12 @@ public: virtual ~TTresponse(); /** + * Creates a new response and adds it as the current + * response's next response + */ + TTresponse *appendResponse(int id); + + /** * Makes a copy of the chain of responses */ TTresponse *copyChain() const; diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp index 2f58ad1400..1fa1ce3315 100644 --- a/engines/titanic/true_talk/tt_script_base.cpp +++ b/engines/titanic/true_talk/tt_script_base.cpp @@ -129,7 +129,7 @@ void TTscriptBase::appendResponse(int index, int *maxP, int id) { if (id && (!maxP || index <= *maxP)) { if (_respTailP) { // Prior fragments already exist, so append to end of chain - _respTailP = new TTresponse(_respTailP); + _respTailP = _respTailP->appendResponse(id); } else { // Currently no tail _respTailP = new TTresponse(id, 3); |