diff options
author | Paul Gilbert | 2016-07-25 19:38:33 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-25 19:38:33 -0400 |
commit | 9c763c978d9ba5b5115ca305429b7dea81091731 (patch) | |
tree | 874109b96acea0592d3205969eb667e95f1196d7 /engines | |
parent | 3efc9f5cdea40c1658466b1f0d6ea8235567b293 (diff) | |
download | scummvm-rg350-9c763c978d9ba5b5115ca305429b7dea81091731.tar.gz scummvm-rg350-9c763c978d9ba5b5115ca305429b7dea81091731.tar.bz2 scummvm-rg350-9c763c978d9ba5b5115ca305429b7dea81091731.zip |
TITANIC: Added BarbotScript proc25
Diffstat (limited to 'engines')
19 files changed, 157 insertions, 22 deletions
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp index d191f4d0b3..d3e25eacaf 100644 --- a/engines/titanic/true_talk/barbot_script.cpp +++ b/engines/titanic/true_talk/barbot_script.cpp @@ -868,9 +868,141 @@ uint BarbotScript::getDialsBitset() const { return bits; } -int BarbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const { - warning("TODO"); - return 0; +int BarbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) { + int v34 = get34(); + uint id = 0; + + if (v34 > 0x200) { + switch (v34 - 0x201) { + case 0: + if (getValue(4) != 2) + id = 250738; + break; + case 1: + if (getValue(4) != 3) + id = 250738; + case 2: + if (getValue(4) != 0) + id = 250738; + break; + default: + break; + } + } else if (v34 == 0x200) { + if (getValue(4) != 1) + id = 250738; + } else { + switch (v34) { + case 2: + if (getValue(1) != 1) + return 1; + break; + case 3: + if (getValue(1) != 2) + return 1; + break; + case 4: + if (getValue(1) != 3) + return 1; + break; + case 5: + if (getValue(1) == 3) + return 1; + break; + case 6: + if (sentence->contains("do not") || sentence->contains("have no") || + sentence->contains("got no")) + return 1; + break; + case 7: + if (!sentence->contains("do not") && !sentence->contains("have no") && + !sentence->contains("got no")) + return 1; + break; + case 8: + if (sentence->_field38 == 2) + return 1; + break; + case 9: { + uint val = CTrueTalkManager::getStateValue(3); + bool bit0 = (val & 1) != 0; + bool bit2 = (val & 4) != 0; + bool bit3 = (val & 8) != 0; + + if (bit2) { + if (!bit0) { + id = 250085 - bit3 ? 0 : 199715; + break; + } else if (!bit3) { + id = 250627; + } + } else { + if (!bit0) { + id = 50365 + bit3 ? 0 : 2; + } else if (!bit3) { + id = 50370; + } + } + + if (id) { + addResponse(getDialogueId(id)); + applyResponse(); + return 2; + } + break; + } + + case 10: { + uint val = CTrueTalkManager::getStateValue(3); + bool bit0 = (val & 1) != 0; + bool bit2 = (val & 4) != 0; + bool bit3 = (val & 8) != 0; + + if (bit0 && bit2 && bit3) { + addResponse(getDialogueId(251027)); + applyResponse(); + CTrueTalkManager::triggerAction(7, 0); + return 2; + } else { + if (getDialRegion(1) == 1) { + if (*val2 != 251650) + id = 251651; + } else { + addResponse(getDialRegion(0) != 0 ? 51444 : 51530); + applyResponse(); + return 2; + } + } + break; + } + + case 11: + if (CTrueTalkManager::getStateValue(2) != 0) { + CTrueTalkManager::triggerAction(6, 0); + id = 251003; + } + break; + + case 12: + if (getDialRegion(1) == 0) { + addResponse(getDialogueId(251871)); + applyResponse(); + return 2; + } else if (getRandomNumber(100) > 25 && addRandomResponse(false)) { + return 2; + } + + default: + break; + } + } + + if (id) { + addResponse(getDialogueId(id)); + applyResponse(); + } + + return 2; } void BarbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) { diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h index a6739114ec..4ce9be6b0a 100644 --- a/engines/titanic/true_talk/barbot_script.h +++ b/engines/titanic/true_talk/barbot_script.h @@ -76,7 +76,8 @@ public: */ virtual uint getDialsBitset() const; - virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const; + virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence); + virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence); /** diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp index baf75cd405..66719be0b7 100644 --- a/engines/titanic/true_talk/bellbot_script.cpp +++ b/engines/titanic/true_talk/bellbot_script.cpp @@ -90,7 +90,7 @@ int BellbotScript::proc23() const { return 0; } -int BellbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const { +int BellbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) { warning("TODO"); return 0; } diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h index b21d689b71..dbe3d6272c 100644 --- a/engines/titanic/true_talk/bellbot_script.h +++ b/engines/titanic/true_talk/bellbot_script.h @@ -61,7 +61,9 @@ public: virtual int proc21(int v1, int v2, int v3); virtual int proc22(int id) const; virtual int proc23() const; - virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const; + + virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence); + virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence); virtual int proc36(int val) const; }; diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp index 0458868e29..b50f4ad99e 100644 --- a/engines/titanic/true_talk/deskbot_script.cpp +++ b/engines/titanic/true_talk/deskbot_script.cpp @@ -86,7 +86,7 @@ int DeskbotScript::proc23() const { return 0; } -int DeskbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const { +int DeskbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) { warning("TODO"); return 0; } diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h index 417cebd37c..2348a2b59e 100644 --- a/engines/titanic/true_talk/deskbot_script.h +++ b/engines/titanic/true_talk/deskbot_script.h @@ -54,7 +54,7 @@ public: virtual int proc21(int v1, int v2, int v3); virtual int proc22(int id) const; virtual int proc23() const; - virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const; + virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence); virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence); virtual int proc36(int val) const; diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp index ba84c9a7d7..5450bbe0df 100644 --- a/engines/titanic/true_talk/doorbot_script.cpp +++ b/engines/titanic/true_talk/doorbot_script.cpp @@ -145,7 +145,7 @@ uint DoorbotScript::getDialsBitset() const { return bits; } -int DoorbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const { +int DoorbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) { warning("TODO"); return 0; } diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h index cc3428cade..25d66acd7d 100644 --- a/engines/titanic/true_talk/doorbot_script.h +++ b/engines/titanic/true_talk/doorbot_script.h @@ -70,7 +70,7 @@ public: */ virtual uint getDialsBitset() const; - virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const; + virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence); virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence); /** diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp index b37274a122..fe45624b48 100644 --- a/engines/titanic/true_talk/liftbot_script.cpp +++ b/engines/titanic/true_talk/liftbot_script.cpp @@ -125,7 +125,7 @@ uint LiftbotScript::getDialsBitset() const { } -int LiftbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const { +int LiftbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) { warning("TODO"); return 0; } diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h index 6e38287b12..8fec92ebf4 100644 --- a/engines/titanic/true_talk/liftbot_script.h +++ b/engines/titanic/true_talk/liftbot_script.h @@ -67,7 +67,7 @@ public: */ virtual uint getDialsBitset() const; - virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const; + virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence); virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence); /** diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp index 998048f272..dc96e8f168 100644 --- a/engines/titanic/true_talk/maitred_script.cpp +++ b/engines/titanic/true_talk/maitred_script.cpp @@ -94,7 +94,7 @@ int MaitreDScript::proc23() const { return 0; } -int MaitreDScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const { +int MaitreDScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) { warning("TODO"); return 0; } diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h index c210f71a7d..4b6d967ee4 100644 --- a/engines/titanic/true_talk/maitred_script.h +++ b/engines/titanic/true_talk/maitred_script.h @@ -58,7 +58,7 @@ public: virtual int proc21(int v1, int v2, int v3); virtual int proc22(int id) const; virtual int proc23() const; - virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const; + virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence); virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence); }; diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp index 358c943cc4..d69f6b7807 100644 --- a/engines/titanic/true_talk/parrot_script.cpp +++ b/engines/titanic/true_talk/parrot_script.cpp @@ -107,7 +107,7 @@ int ParrotScript::proc23() const { return 0; } -int ParrotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const { +int ParrotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) { return 0; } diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h index 921dc22df4..2da5897e4b 100644 --- a/engines/titanic/true_talk/parrot_script.h +++ b/engines/titanic/true_talk/parrot_script.h @@ -53,7 +53,7 @@ public: virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id); virtual int proc23() const; - virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const; + virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence); virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence); }; diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp index cb1c12f580..346c75e1ff 100644 --- a/engines/titanic/true_talk/succubus_script.cpp +++ b/engines/titanic/true_talk/succubus_script.cpp @@ -94,7 +94,7 @@ int SuccUBusScript::proc23() const { return 0; } -int SuccUBusScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const { +int SuccUBusScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) { warning("TODO"); return 0; } diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h index c5ba51ee1c..1ff07d48a1 100644 --- a/engines/titanic/true_talk/succubus_script.h +++ b/engines/titanic/true_talk/succubus_script.h @@ -56,7 +56,7 @@ public: virtual int proc21(int v1, int v2, int v3); virtual int proc23() const; - virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const; + virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence); virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence); }; diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp index 68e74467d1..6199f1123e 100644 --- a/engines/titanic/true_talk/tt_npc_script.cpp +++ b/engines/titanic/true_talk/tt_npc_script.cpp @@ -450,7 +450,7 @@ const TTscriptMapping *TTnpcScript::getMapping(int index) { return nullptr; } -int TTnpcScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const { +int TTnpcScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) { return 0; } @@ -789,7 +789,7 @@ int TTnpcScript::processEntries(const TTsentenceEntries *entries, uint entryCoun if (!flag2) { flag = false; } else { - int result = proc25(entry._field2C & 0xFFFFFF, entry._field0, + int result = proc25(entry._field2C & 0xFFFFFF, &entry._field0, roomScript, sentence); if (result == 2) return 2; diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h index ff4c34e963..346ed694ee 100644 --- a/engines/titanic/true_talk/tt_npc_script.h +++ b/engines/titanic/true_talk/tt_npc_script.h @@ -356,7 +356,7 @@ public: virtual uint getDialsBitset() const { return 0; } virtual const TTscriptMapping *getMapping(int index); - virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const; + virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence); virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence); virtual void save(SimpleFile *file); virtual void load(SimpleFile *file); diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h index 94cc265f5f..2e40dd7e93 100644 --- a/engines/titanic/true_talk/tt_sentence.h +++ b/engines/titanic/true_talk/tt_sentence.h @@ -51,7 +51,6 @@ private: CScriptHandler *_owner; int _inputCtr; int _field34; - int _field38; TTsentenceNode *_nodesP; int _field5C; int _status; @@ -64,6 +63,7 @@ public: TTsentenceConcept _sentenceConcept; TTstring _initialLine; TTstring _normalizedLine; + int _field38; int _field58; TTroomScript *_roomScript; TTnpcScript *_npcScript; |