aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-26 22:54:32 -0400
committerPaul Gilbert2016-07-26 22:54:32 -0400
commit7eece359513890137358a27366d488bc629be47a (patch)
treef3b4871d0560ef59640699474a5200f97d66cda9 /engines/titanic
parentebeea1bb232845b5a863bc73edc2aafd56da36fc (diff)
downloadscummvm-rg350-7eece359513890137358a27366d488bc629be47a.tar.gz
scummvm-rg350-7eece359513890137358a27366d488bc629be47a.tar.bz2
scummvm-rg350-7eece359513890137358a27366d488bc629be47a.zip
TITANIC: Added remainder of BellbotScript handleQuote
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/true_talk/barbot_script.cpp2
-rw-r--r--engines/titanic/true_talk/bellbot_script.cpp127
2 files changed, 126 insertions, 3 deletions
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 5c0c5fbe82..a3ab0586b4 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -1042,7 +1042,7 @@ int BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
rangeLimit = MAX(rangeLimit - 20, 20);
}
- dialogueId = (((int)remainder + 25) % 100) > rangeLimit ? 221376 : 221375;
+ dialogueId = (((int)remainder + 25) % 100) >= rangeLimit ? 221376 : 221375;
}
addResponse(getDialogueId(dialogueId));
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index f4a0a3e824..b91d78b057 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -27,6 +27,87 @@
namespace Titanic {
+static const TThandleQuoteEntry QUOTES[] = {
+ { 0x00000008, 0x00000000, 0x00031116 },
+ { 0x00000007, 0x00000000, 0x00031447 },
+ { 0x00000006, 0x00000000, 0x000310F9 },
+ { 0x00000005, 0x00000000, 0x000313A1 },
+ { 0x00000001, 0x56424144, 0x000313D7 },
+ { 0x00000001, 0x52554445, 0x000313D7 },
+ { 0x00000001, 0x5052534E, 0x00041EB3 },
+ { 0x00000001, 0x424F5953, 0x00041EB3 },
+ { 0x00000001, 0x4749524C, 0x00041EB3 },
+ { 0x00000001, 0x464F4F44, 0x00041EB3 },
+ { 0x00000001, 0x00000032, 0x00041EB1 },
+ { 0x0000001C, 0x00000032, 0x00041EB0 },
+ { 0x00000010, 0x54524156, 0x000313C6 },
+ { 0x00000010, 0x0000003C, 0x00041EB0 },
+ { 0x00000011, 0x00000000, 0x0003139E },
+ { 0x00000015, 0x00000032, 0x0003139F },
+ { 0x00000012, 0x00000042, 0x000313A0 },
+ { 0x00000013, 0x00000021, 0x000313A7 },
+ { 0x0000001D, 0x00000021, 0x000313A7 },
+ { 0x00000014, 0x00000042, 0x000313A4 },
+ { 0x0000001B, 0x00000000, 0x0003139B },
+ { 0x0000001E, 0x00000000, 0x000313A2 },
+ { 0x0000001F, 0x00000000, 0x00030DC0 },
+ { 0x0000000C, 0x00000000, 0x000313A9 },
+ { 0x0000000D, 0x00000000, 0x000313A9 },
+ { 0x0000000E, 0x00000000, 0x000313A8 },
+ { 0x0000000F, 0x00000000, 0x000313A8 },
+ { 0x00000020, 0x00000019, 0x000313AB },
+ { 0x00000021, 0x0000000F, 0x000313AC },
+ { 0x00000023, 0x00000000, 0x00031337 },
+ { 0x00000024, 0x00000000, 0x0003135A },
+ { 0x00000025, 0x00000000, 0x000311AB },
+ { 0x00000026, 0x00000000, 0x0003112E },
+ { 0x00000030, 0x00000000, 0x0003106C },
+ { 0x00000027, 0x424F5953, 0x0003140C },
+ { 0x00000027, 0x4749524C, 0x0003140D },
+ { 0x00000027, 0x00000000, 0x0003140D },
+ { 0x00000028, 0x00000000, 0x00031404 },
+ { 0x00000029, 0x00000000, 0x00031405 },
+ { 0x0000002A, 0x00000000, 0x00031406 },
+ { 0x0000002B, 0x00000000, 0x00031407 },
+ { 0x0000002C, 0x00000000, 0x00031408 },
+ { 0x0000002D, 0x00000000, 0x00031409 },
+ { 0x0000002E, 0x424F5953, 0x0003140A },
+ { 0x0000002E, 0x4749524C, 0x0003140B },
+ { 0x0000002E, 0x00000000, 0x0003140B },
+ { 0x00000032, 0x00000000, 0x000313D6 },
+ { 0x00000033, 0x00000000, 0x000313D7 },
+ { 0x00000034, 0x00000000, 0x000313D8 },
+ { 0x00000035, 0x00000000, 0x0003113D },
+ { 0x00000036, 0x00000000, 0x00030DCB },
+ { 0x00000031, 0x00000000, 0x00030DB5 },
+ { 0x00000037, 0x00000000, 0x000313DD },
+ { 0x00000038, 0x00000000, 0x00030EE4 },
+ { 0x00000039, 0x00000000, 0x0003160B },
+ { 0x0000003A, 0x00000000, 0x000310C4 },
+ { 0x0000003B, 0x00000000, 0x000310C5 },
+ { 0x0000003C, 0x00000000, 0x0003121C },
+ { 0x0000003D, 0x00000000, 0x00031623 },
+ { 0x0000003F, 0x00000000, 0x00030D99 },
+ { 0x0000003E, 0x00000000, 0x00030D99 },
+ { 0x00000040, 0x00000000, 0x000315CE },
+ { 0x00000041, 0x00000000, 0x000315DC },
+ { 0x00000042, 0x00000000, 0x00031478 },
+ { 0x00000043, 0x00000000, 0x00030FC8 },
+ { 0x00000044, 0x00000000, 0x0003106D },
+ { 0x00000054, 0x00000000, 0x00031514 },
+ { 0x00000055, 0x00000000, 0x00031515 },
+ { 0x00000056, 0x00000000, 0x000315CF },
+ { 0x0000005A, 0x00000000, 0x000310F9 },
+ { 0x00000058, 0x00000000, 0x000315DF },
+ { 0x0000005B, 0x00000000, 0x00031620 },
+ { 0x0000005C, 0x00000000, 0x0003134B },
+ { 0x00000059, 0x00000000, 0x0003150F },
+ { 0x00000057, 0x00000000, 0x00030D58 },
+ { 0x00000045, 0x0000000A, 0x000310C3 },
+ { 0x00000046, 0x00000000, 0x00030EAD },
+ { 0x00000000, 0x00000000, 0x00000000 }
+};
+
BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
const char *charName, int v3, int val2) :
TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
@@ -178,8 +259,50 @@ int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
break;
}
- warning("TODO: handleQuote");
- return false;
+ int loopCounter = 0;
+ for (const TThandleQuoteEntry *qe = QUOTES; qe->_index && loopCounter < 2; ++qe) {
+ if (!qe->_index) {
+ // End of list; start at beginning again
+ ++loopCounter;
+ qe = QUOTES;
+ }
+
+ if (qe->_index == val && (
+ (tagId == 0 && loopCounter == 2) ||
+ (qe->_tagId < MKTAG('A', 'A', 'A', 'A')) ||
+ (qe->_tagId == tagId)
+ )) {
+ uint foundTagId = qe->_tagId;
+ if (foundTagId > 0 && foundTagId < 100) {
+ if (!tagId)
+ foundTagId >>= 1;
+ if (getRandomNumber(100) < foundTagId)
+ return 1;
+ }
+
+ uint dialogueId = qe->_dialogueId;
+ if (dialogueId >= 270000 && dialogueId <= 275000) {
+ dialogueId -= 270000;
+ if (dialogueId >= 3)
+ error("Invalid dialogue index in BarbotScript");
+ const int RANDOM_LIMITS[3] = { 30, 50, 70 };
+ int rangeLimit = RANDOM_LIMITS[dialogueId];
+ int dialRegion = getDialRegion(0);
+
+ if (dialRegion != 1) {
+ rangeLimit = MAX(rangeLimit - 20, 20);
+ }
+
+ dialogueId = (((int)remainder + 25) % 100) >= rangeLimit ? 201687 : 201686;
+ }
+
+ addResponse(getDialogueId(dialogueId));
+ applyResponse();
+ return 2;
+ }
+ }
+
+ return 1;
}
int BellbotScript::proc21(int v1, int v2, int v3) {