aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-25 08:17:22 -0400
committerPaul Gilbert2016-07-25 08:17:22 -0400
commit3efc9f5cdea40c1658466b1f0d6ea8235567b293 (patch)
treeb72343abd4a7d9a82ca9d1473c12c111bba060ee /engines
parent2844574dc0f9e8c50e13cbebddd68db8c4dbc0bf (diff)
downloadscummvm-rg350-3efc9f5cdea40c1658466b1f0d6ea8235567b293.tar.gz
scummvm-rg350-3efc9f5cdea40c1658466b1f0d6ea8235567b293.tar.bz2
scummvm-rg350-3efc9f5cdea40c1658466b1f0d6ea8235567b293.zip
TITANIC: Added NPC scripts gitDialsBitsets methods
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/true_talk/barbot_script.cpp17
-rw-r--r--engines/titanic/true_talk/barbot_script.h7
-rw-r--r--engines/titanic/true_talk/doorbot_script.cpp11
-rw-r--r--engines/titanic/true_talk/doorbot_script.h7
-rw-r--r--engines/titanic/true_talk/liftbot_script.cpp14
-rw-r--r--engines/titanic/true_talk/liftbot_script.h7
-rw-r--r--engines/titanic/true_talk/tt_npc_script.cpp6
-rw-r--r--engines/titanic/true_talk/tt_npc_script.h7
8 files changed, 56 insertions, 20 deletions
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 36916e2710..d191f4d0b3 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -92,7 +92,7 @@ int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
} else if (tag == MKTAG('B', 'A', 'R', 'K') && getRandomNumber(100) > 50) {
selectResponse(250025);
- switch (proc23()) {
+ switch (getDialsBitset()) {
case 4:
case 6:
addResponse(getDialogueId(250125));
@@ -106,7 +106,7 @@ int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
} else if (tag == MKTAG('B', 'A', 'R', 'U') && getRandomNumber(100) > 50) {
selectResponse(250025);
- switch (proc23()) {
+ switch (getDialsBitset()) {
case 4:
case 6:
addResponse(getDialogueId(250112));
@@ -856,9 +856,16 @@ int BarbotScript::proc22(int id) const {
return 0;
}
-int BarbotScript::proc23() const {
- warning("TODO");
- return 0;
+uint BarbotScript::getDialsBitset() const {
+ uint bits = 0;
+ if (!getDialRegion(0))
+ bits = 1;
+ if (!getDialRegion(1))
+ bits |= 2;
+ if (!getDialRegion(2))
+ bits |= 4;
+
+ return bits;
}
int BarbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index cc8c2f19e3..a6739114ec 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -70,7 +70,12 @@ public:
virtual int proc21(int v1, int v2, int v3);
virtual int proc22(int id) const;
- virtual int proc23() const;
+
+ /**
+ * Returns a bitset of the first three dialgs being on or not
+ */
+ virtual uint getDialsBitset() const;
+
virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 15ede3a727..ba84c9a7d7 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -135,9 +135,14 @@ int DoorbotScript::proc22(int id) const {
return 0;
}
-int DoorbotScript::proc23() const {
- warning("TODO");
- return 0;
+uint DoorbotScript::getDialsBitset() const {
+ uint bits = 0;
+ if (!getDialRegion(1))
+ bits = 1;
+ if (!getDialRegion(0))
+ bits |= 2;
+
+ return bits;
}
int DoorbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 21a3e7f976..cc3428cade 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -64,7 +64,12 @@ public:
virtual int proc21(int v1, int v2, int v3);
virtual int proc22(int id) const;
- virtual int proc23() const;
+
+ /**
+ * Returns a bitset of the dials being off or not
+ */
+ virtual uint getDialsBitset() const;
+
virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
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 cfa8a70480..b37274a122 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -112,11 +112,19 @@ int LiftbotScript::proc22(int id) const {
return 0;
}
-int LiftbotScript::proc23() const {
- warning("TODO");
- return 0;
+uint LiftbotScript::getDialsBitset() const {
+ uint bits = 0;
+ if (!getDialRegion(1))
+ bits = 1;
+ if (!getDialRegion(0))
+ bits |= 2;
+ if (bits > 1)
+ bits ^= 1;
+
+ return bits;
}
+
int LiftbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
warning("TODO");
return 0;
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 553c3712ad..6e38287b12 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -61,7 +61,12 @@ public:
virtual int proc21(int v1, int v2, int v3);
virtual int proc22(int id) const;
- virtual int proc23() const;
+
+ /**
+ * Returns a bitset of the dials being off or not
+ */
+ virtual uint getDialsBitset() const;
+
virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
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 c552d00eed..68e74467d1 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -444,10 +444,6 @@ int TTnpcScript::proc22(int id) const {
return 0;
}
-int TTnpcScript::proc23() const {
- return 0;
-}
-
const TTscriptMapping *TTnpcScript::getMapping(int index) {
if (index >= 0 && index < (int)_mappings.size())
return &_mappings[index];
@@ -705,7 +701,7 @@ uint TTnpcScript::getDialogueId(uint tagId) {
if (tagId != oldTagId)
tagId = getRangeValue(tagId);
- oldTagId = proc23();
+ oldTagId = getDialsBitset();
uint newId = proc21(origId, tagId, oldTagId);
if (!newId)
return 0;
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 29b174b8e0..ff4c34e963 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -349,7 +349,12 @@ public:
virtual int proc21(int v1, int v2, int v3);
virtual int proc22(int id) const;
- virtual int proc23() const;
+
+ /**
+ * Returns a bitset of the dials being off or not
+ */
+ 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 void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);