aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devtools/create_titanic/create_titanic_dat.cpp2
-rw-r--r--devtools/create_titanic/script_responses.cpp330
-rw-r--r--engines/titanic/true_talk/barbot_script.cpp4
-rw-r--r--engines/titanic/true_talk/barbot_script.h6
-rw-r--r--engines/titanic/true_talk/bellbot_script.cpp5
-rw-r--r--engines/titanic/true_talk/bellbot_script.h1
-rw-r--r--engines/titanic/true_talk/deskbot_script.cpp17
-rw-r--r--engines/titanic/true_talk/deskbot_script.h3
-rw-r--r--engines/titanic/true_talk/doorbot_script.cpp4
-rw-r--r--engines/titanic/true_talk/doorbot_script.h6
-rw-r--r--engines/titanic/true_talk/liftbot_script.cpp4
-rw-r--r--engines/titanic/true_talk/liftbot_script.h6
-rw-r--r--engines/titanic/true_talk/maitred_script.cpp4
-rw-r--r--engines/titanic/true_talk/maitred_script.h6
-rw-r--r--engines/titanic/true_talk/parrot_script.cpp4
-rw-r--r--engines/titanic/true_talk/parrot_script.h6
-rw-r--r--engines/titanic/true_talk/script_handler.cpp2
-rw-r--r--engines/titanic/true_talk/succubus_script.cpp4
-rw-r--r--engines/titanic/true_talk/succubus_script.h6
-rw-r--r--engines/titanic/true_talk/tt_npc_script.cpp33
-rw-r--r--engines/titanic/true_talk/tt_npc_script.h27
21 files changed, 426 insertions, 54 deletions
diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 11b963c37f..4999ee3f7d 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -50,7 +50,7 @@
*/
#define VERSION_NUMBER 1
-#define HEADER_SIZE 0x300
+#define HEADER_SIZE 0x340
Common::File inputFile, outputFile;
Common::PEResources res;
diff --git a/devtools/create_titanic/script_responses.cpp b/devtools/create_titanic/script_responses.cpp
index 1c43eb0e20..30d0c7f1bd 100644
--- a/devtools/create_titanic/script_responses.cpp
+++ b/devtools/create_titanic/script_responses.cpp
@@ -295,17 +295,335 @@ static const int BELLBOT_RESPONSES[130][5] = {
{ MKTAG('Y', 'E', 'S', 'S'), 201525, 201529, 0, 0 },
};
-void writeScriptResponses(const char *name, const int *tags, uint count) {
+const int BARBOT_RESPONSES[93][2] = {
+ { MKTAG('S', 'L', 'O', 'W'), 0x3D09E },
+ { MKTAG('T', 'H', 'R', 'T'), 0x3D0B1 },
+ { MKTAG('A', 'C', 'T', 'R'), 0x3D77F },
+ { MKTAG('A', 'C', 'T', 'S'), 0x3D780 },
+ { MKTAG('A', 'D', 'V', 'T'), 0x3D781 },
+ { MKTAG('A', 'R', 'T', 'I'), 0x3D782 },
+ { MKTAG('A', 'R', 'T', 'Y'), 0x3D783 },
+ { MKTAG('A', 'U', 'T', 'H'), 0x3D784 },
+ { MKTAG('B', 'A', 'R', 'K'), 0x3D786 },
+ { MKTAG('B', 'A', 'R', 'U'), 0x3D786 },
+ { MKTAG('B', 'O', 'Y', 'S'), 0x3D239 },
+ { MKTAG('G', 'I', 'R', 'L'), 0x3D23A },
+ { MKTAG('B', 'R', 'N', 'D'), 0x3D787 },
+ { MKTAG('C', 'H', 'S', 'E'), 0x3D788 },
+ { MKTAG('C', 'O', 'M', 'D'), 0x3D789 },
+ { MKTAG('C', 'O', 'O', 'K'), 0x3D78A },
+ { MKTAG('C', 'O', 'P', 'S'), 0x3D78B },
+ { MKTAG('C', 'R', 'I', 'M'), 0x3D78C },
+ { MKTAG('C', 'S', 'P', 'Y'), 0x3D78D },
+ { MKTAG('D', 'C', 'T', 'R'), 0x3D78E },
+ { MKTAG('D', 'N', 'C', 'E'), 0x3D78F },
+ { MKTAG('D', 'R', 'U', 'G'), 0x3D790 },
+ { MKTAG('E', 'A', 'R', 'T'), 0x3D791 },
+ { MKTAG('E', 'M', 'O', 'T'), 0x3D792 },
+ { MKTAG('F', 'A', 'M', 'E'), 0x3D793 },
+ { MKTAG('A', 'S', 'H', '1'), 0x3D794 },
+ { MKTAG('A', 'S', 'H', '2'), 0x3D795 },
+ { MKTAG('F', 'A', 'U', 'N'), 0x3D796 },
+ { MKTAG('F', 'I', 'L', 'M'), 0x3D797 },
+ { MKTAG('F', 'I', 'S', 'H'), 0x3D798 },
+ { MKTAG('F', 'L', 'O', 'R'), 0x3D799 },
+ { MKTAG('F', 'O', 'O', 'D'), 0x3D79A },
+ { MKTAG('J', 'F', 'O', 'D'), 0x3D79A },
+ { MKTAG('H', 'B', 'B', 'Y'), 0x3D79B },
+ { MKTAG('H', 'E', 'R', 'O'), 0x3D79C },
+ { MKTAG('H', 'H', 'L', 'D'), 0x3D79D },
+ { MKTAG('H', 'O', 'M', 'E'), 0x3D79E },
+ { MKTAG('H', 'O', 'S', 'T'), 0x3D79F },
+ { MKTAG('K', 'N', 'O', 'B'), 0x3D7A0 },
+ { MKTAG('L', 'I', 'Q', 'D'), 0x3D7A1 },
+ { MKTAG('L', 'I', 'T', 'R'), 0x3D7A2 },
+ { MKTAG('M', 'A', 'G', 'S'), 0x3D7A3 },
+ { MKTAG('M', 'C', 'P', 'Y'), 0x3D7A4 },
+ { MKTAG('M', 'I', 'N', 'S'), 0x3D7A5 },
+ { MKTAG('M', 'L', 'T', 'Y'), 0x3D7A6 },
+ { MKTAG('M', 'U', 'S', 'I'), 0x3D7A7 },
+ { MKTAG('N', 'A', 'U', 'T'), 0x3D7A8 },
+ { MKTAG('P', 'G', 'R', 'P'), 0x3D7A9 },
+ { MKTAG('P', 'H', 'I', 'L'), 0x3D7AA },
+ { MKTAG('P', 'K', 'U', 'P'), 0x3D7AB },
+ { MKTAG('P', 'L', 'A', 'N'), 0x3D7AC },
+ { MKTAG('B', 'L', 'P', '1'), 0x3D7AD },
+ { MKTAG('B', 'L', 'P', '2'), 0x3D7AD },
+ { MKTAG('P', 'T', 'I', 'C'), 0x3D7AD },
+ { MKTAG('R', 'C', 'K', 'T'), 0x3D7AE },
+ { MKTAG('S', 'C', 'I', 'E'), 0x3D7AF },
+ { MKTAG('S', 'C', 'I', 'T'), 0x3D7B0 },
+ { MKTAG('S', 'E', 'X', '1'), 0x3D7B1 },
+ { MKTAG('S', 'F', 'S', 'F'), 0x3D7B2 },
+ { MKTAG('S', 'O', 'A', 'P'), 0x3D7B4 },
+ { MKTAG('S', 'O', 'N', 'G'), 0x3D7B5 },
+ { MKTAG('S', 'P', 'R', 'T'), 0x3D7B6 },
+ { MKTAG('S', 'W', 'E', 'R'), 0x3D7B7 },
+ { MKTAG('T', 'D', 'V', 'P'), 0x3D7BC },
+ { MKTAG('T', 'E', 'A', 'M'), 0x3D7BD },
+ { MKTAG('T', 'I', 'T', 'A'), 0x3D7BF },
+ { MKTAG('T', 'L', 'A', ' '), 0x3D7C0 },
+ { MKTAG('T', 'O', 'Y', 'S'), 0x3D7C1 },
+ { MKTAG('T', 'R', 'A', '2'), 0x3D7C2 },
+ { MKTAG('T', 'R', 'A', '3'), 0x3D7C3 },
+ { MKTAG('T', 'V', 'S', 'H'), 0x3D7C4 },
+ { MKTAG('W', 'E', 'A', 'P'), 0x3D7C5 },
+ { MKTAG('W', 'E', 'A', 'T'), 0x3D7C6 },
+ { MKTAG('W', 'W', 'E', 'B'), 0x3D7C7 },
+ { MKTAG('I', 'S', 'H', 'E'), 0x3D221 },
+ { MKTAG('L', 'I', 'T', 'E'), 0x3D31B },
+ { MKTAG('B', 'Y', 'Z', 'A'), 0x3D448 },
+ { MKTAG('W', 'T', 'H', 'R'), 0x3D6E5 },
+ { MKTAG('N', 'P', 'L', 'C'), 0x3D231 },
+ { MKTAG('B', 'A', 'R', '1'), 0x3D095 },
+ { MKTAG('B', 'A', 'R', '2'), 0x3D107 },
+ { MKTAG('B', 'A', 'R', '3'), 0x3D09D },
+ { MKTAG('M', 'P', 'O', 'P'), 0x3D0D3 },
+ { MKTAG('J', 'O', 'K', 'E'), 0x3D5A9 },
+ { MKTAG('J', 'N', 'A', 'M'), 0x3D5A9 },
+ { MKTAG('N', 'I', 'B', '1'), 0x3D128 },
+ { MKTAG('N', 'I', 'B', '2'), 0x3D0DC },
+ { MKTAG('N', 'I', 'B', '3'), 0x3D345 },
+ { MKTAG('N', 'I', 'B', '4'), 0x3D125 },
+ { MKTAG('N', 'I', 'B', '5'), 0x3D369 },
+ { MKTAG('N', 'I', 'B', '6'), 0x3D444 },
+ { MKTAG('B', 'A', 'R', '4'), 0x3D0DF },
+ { MKTAG('F', 'U', 'L', 'N'), 0x3D32C }
+};
+
+const int DOORBOT_RESPONSES[101][2] = {
+ { MKTAG('W', 'E', 'A', 'T'), 0x2E29 },
+ { MKTAG('T', 'W', 'A', 'T'), 0x2E29 },
+ { MKTAG('B', 'A', 'R', 'M'), 0x2E29 },
+ { MKTAG('B', 'A', 'R', 'U'), 0x2E29 },
+ { MKTAG('B', 'A', 'R', 'K'), 0x2E29 },
+ { MKTAG('B', 'Y', 'Z', 'A'), 0x274E },
+ { MKTAG('S', 'I', 'C', 'K'), 0x28AC },
+ { MKTAG('B', 'O', 'D', 'Y'), 0x28AC },
+ { MKTAG('N', 'H', 'R', 'O'), 0x28A8 },
+ { MKTAG('N', 'P', 'L', 'C'), 0x28A7 },
+ { MKTAG('H', 'O', 'M', 'E'), 0x28A7 },
+ { MKTAG('S', 'C', 'I', 'E'), 0x28A9 },
+ { MKTAG('P', 'T', 'I', 'C'), 0x2E42 },
+ { MKTAG('P', 'G', 'R', 'P'), 0x2E42 },
+ { MKTAG('B', 'L', 'P', '1'), 0x2E42 },
+ { MKTAG('B', 'L', 'P', '2'), 0x2E42 },
+ { MKTAG('B', 'L', 'P', '3'), 0x2E42 },
+ { MKTAG('B', 'L', 'P', '4'), 0x2E42 },
+ { MKTAG('B', 'L', 'F', '1'), 0x2E3C },
+ { MKTAG('B', 'L', 'F', '2'), 0x2E3C },
+ { MKTAG('B', 'L', 'R', '1'), 0x2E42 },
+ { MKTAG('B', 'L', 'T', '1'), 0x2E56 },
+ { MKTAG('B', 'L', 'T', '2'), 0x2E48 },
+ { MKTAG('B', 'L', 'T', '3'), 0x2E55 },
+ { MKTAG('B', 'L', 'T', '4'), 0x2E56 },
+ { MKTAG('B', 'L', 'T', '5'), 0x2E56 },
+ { MKTAG('S', 'W', 'E', 'R'), 0x2E4E },
+ { MKTAG('S', 'O', 'N', 'G'), 0x2E49 },
+ { MKTAG('L', 'I', 'T', 'R'), 0x2E40 },
+ { MKTAG('A', 'R', 'T', 'I'), 0x2E1F },
+ { MKTAG('N', 'I', 'K', 'E'), 0x2E22 },
+ { MKTAG('E', 'M', 'O', 'T'), 0x2E38 },
+ { MKTAG('D', 'R', 'U', 'G'), 0x2E36 },
+ { MKTAG('E', 'A', 'R', 'T'), 0x2E37 },
+ { MKTAG('F', 'A', 'M', 'E'), 0x2E39 },
+ { MKTAG('F', 'A', 'U', 'N'), 0x2E3B },
+ { MKTAG('F', 'I', 'S', 'H'), 0x2E3B },
+ { MKTAG('F', 'L', 'O', 'R'), 0x2E3D },
+ { MKTAG('F', 'O', 'O', 'D'), 0x2E3E },
+ { MKTAG('J', 'F', 'O', 'D'), 0x2E3E },
+ { MKTAG('H', 'B', 'B', 'Y'), 0x2E3F },
+ { MKTAG('H', 'E', 'R', 'O'), 0x2E4D },
+ { MKTAG('H', 'O', 'S', 'T'), 0x2E55 },
+ { MKTAG('L', 'I', 'Q', 'D'), 0x2E35 },
+ { MKTAG('M', 'A', 'G', 'S'), 0x2E40 },
+ { MKTAG('P', 'H', 'I', 'L'), 0x2E44 },
+ { MKTAG('P', 'K', 'U', 'P'), 0x2E24 },
+ { MKTAG('P', 'L', 'A', 'N'), 0x2E45 },
+ { MKTAG('R', 'C', 'K', 'T'), 0x2E4A },
+ { MKTAG('S', 'E', 'X', '1'), 0x2E47 },
+ { MKTAG('S', 'U', 'C', '1'), 0x2E47 },
+ { MKTAG('S', 'O', 'A', 'P'), 0x2E48 },
+ { MKTAG('T', 'O', 'Y', 'S'), 0x2E50 },
+ { MKTAG('H', 'H', 'L', 'D'), 0x2E50 },
+ { MKTAG('A', 'C', 'T', 'R'), 0x2E1B },
+ { MKTAG('A', 'C', 'T', 'S'), 0x2E1C },
+ { MKTAG('A', 'D', 'V', 'T'), 0x2E1D },
+ { MKTAG('B', 'R', 'N', 'D'), 0x2E21 },
+ { MKTAG('B', 'R', 'N', '2'), 0x2E22 },
+ { MKTAG('B', 'R', 'N', '3'), 0x2E23 },
+ { MKTAG('F', 'A', 'S', 'H'), 0x2E3A },
+ { MKTAG('F', 'I', 'L', 'M'), 0x2E3C },
+ { MKTAG('K', 'N', 'O', 'B'), 0x2E42 },
+ { MKTAG('M', 'U', 'S', 'I'), 0x2E43 },
+ { MKTAG('S', 'F', 'S', 'F'), 0x2E46 },
+ { MKTAG('S', 'P', 'R', 'T'), 0x2E4B },
+ { MKTAG('T', 'E', 'A', 'M'), 0x2E4C },
+ { MKTAG('T', 'R', 'A', 'V'), 0x2E52 },
+ { MKTAG('T', 'V', 'S', 'H'), 0x2E56 },
+ { MKTAG('W', 'E', 'A', 'P'), 0x2E57 },
+ { MKTAG('W', 'W', 'E', 'B'), 0x2E58 },
+ { MKTAG('A', 'R', 'T', 'Y'), 0x2E1E },
+ { MKTAG('C', 'O', 'M', 'D'), 0x2E25 },
+ { MKTAG('C', 'O', 'O', 'K'), 0x2E26 },
+ { MKTAG('C', 'O', 'P', 'S'), 0x2E27 },
+ { MKTAG('C', 'R', 'I', 'M'), 0x2E28 },
+ { MKTAG('D', 'C', 'T', 'R'), 0x2E29 },
+ { MKTAG('A', 'U', 'T', 'H'), 0x2E29 },
+ { MKTAG('M', 'L', 'T', 'Y'), 0x2E41 },
+ { MKTAG('S', 'A', 'S', 'S'), 0x28C3 },
+ { MKTAG('B', 'O', 'Y', 'S'), 0x2768 },
+ { MKTAG('G', 'I', 'R', 'L'), 0x2769 },
+ { MKTAG('T', 'D', 'V', 'P'), 0x277D },
+ { MKTAG('I', 'S', 'H', 'E'), 0x27B6 },
+ { MKTAG('J', 'O', 'K', 'E'), 0x29FF },
+ { MKTAG('J', 'N', 'A', 'M'), 0x29FF },
+ { MKTAG('S', 'L', 'O', 'W'), 0x2823 },
+ { MKTAG('T', 'H', 'R', 'T'), 0x2823 },
+ { MKTAG('D', 'O', 'R', '2'), 0x2BC0 },
+ { MKTAG('M', 'P', 'O', 'P'), 0x2BC0 },
+ { MKTAG('C', 'L', 'U', 'B'), 0x2E39 },
+ { MKTAG('C', 'O', 'L', 'R'), 0x2776 },
+ { MKTAG('D', 'N', 'C', 'E'), 0x2931 },
+ { MKTAG('M', 'C', 'P', 'Y'), 0x276B },
+ { MKTAG('M', 'I', 'N', 'S'), 0x2E43 },
+ { MKTAG('P', 'L', 'A', 'C'), 0x2E37 },
+ { MKTAG('T', 'I', 'T', 'A'), 0x2E40 },
+ { MKTAG('T', 'L', 'A', ' '), 0x277D },
+ { MKTAG('H', 'A', 'H', 'A'), 0x27A8 },
+ { MKTAG('F', 'U', 'L', 'N'), 0x2B15 },
+ { MKTAG('B', 'A', 'R', '1'), 0x2E35 }
+};
+
+const int LIFTBOT_RESPONSES[34][2] = {
+ { MKTAG('L', 'I', 'F', '1'), 0x33453 },
+ { MKTAG('L', 'I', 'F', '2'), 0x3345D },
+ { MKTAG('L', 'I', 'F', '3'), 0x3354E },
+ { MKTAG('L', 'I', 'F', '4'), 0x3374B },
+ { MKTAG('I', 'S', 'H', 'E'), 0x335F7 },
+ { MKTAG('J', 'O', 'K', 'E'), 0x3374B },
+ { MKTAG('J', 'N', 'A', 'M'), 0x3374B },
+ { MKTAG('S', 'L', 'O', 'W'), 0x337B5 },
+ { MKTAG('T', 'H', 'R', 'T'), 0x337BB },
+ { MKTAG('S', 'C', 'I', 'E'), 0x337B2 },
+ { MKTAG('S', 'C', 'I', 'T'), 0x337B4 },
+ { MKTAG('T', 'D', 'V', 'P'), 0x337BA },
+ { MKTAG('T', 'I', 'T', 'A'), 0x337C0 },
+ { MKTAG('C', 'S', 'P', 'Y'), 0x337A5 },
+ { MKTAG('M', 'U', 'S', 'I'), 0x337AA },
+ { MKTAG('M', 'C', 'P', 'Y'), 0x337A9 },
+ { MKTAG('D', 'N', 'C', 'E'), 0x337A7 },
+ { MKTAG('N', 'A', 'U', 'T'), 0x337AC },
+ { MKTAG('T', 'L', 'A', ' '), 0x337C1 },
+ { MKTAG('S', 'U', 'M', 'S'), 0x33598 },
+ { MKTAG('O', 'R', 'D', '1'), 0x33776 },
+ { MKTAG('O', 'R', 'D', '2'), 0x33779 },
+ { MKTAG('O', 'R', 'D', '3'), 0x3377A },
+ { MKTAG('O', 'R', 'D', '4'), 0x3377B },
+ { MKTAG('O', 'R', 'D', '5'), 0x3377C },
+ { MKTAG('O', 'R', 'D', '6'), 0x3377D },
+ { MKTAG('O', 'R', 'D', '7'), 0x3377E },
+ { MKTAG('L', 'I', 'Q', 'D'), 0x337FC },
+ { MKTAG('F', 'O', 'O', 'D'), 0x337FD },
+ { MKTAG('J', 'F', 'O', 'D'), 0x337FD },
+ { MKTAG('W', 'E', 'A', 'T'), 0x337E3 },
+ { MKTAG('S', 'I', 'C', 'K'), 0x336A1 },
+ { MKTAG('B', 'O', 'D', 'Y'), 0x33624 },
+ { MKTAG('B', 'Y', 'Z', 'A'), 0x33617 }
+};
+
+const int MAITRED_RESPONSES[74][2] = {
+ { MKTAG('M', 'A', 'D', '1'), 0x3F7E2 },
+ { MKTAG('M', 'A', 'D', '2'), 0x3F916 },
+ { MKTAG('M', 'A', 'D', '3'), 0x3F931 },
+ { MKTAG('M', 'A', 'D', '4'), 0x3F936 },
+ { MKTAG('M', 'A', 'D', '5'), 0x3F938 },
+ { MKTAG('M', 'A', 'D', '6'), 0x3F943 },
+ { MKTAG('M', 'A', 'D', '7'), 0x3F947 },
+ { MKTAG('M', 'A', 'D', '8'), 0x3F945 },
+ { MKTAG('M', 'A', 'D', '9'), 0x3F946 },
+ { MKTAG('M', 'D', '1', '0'), 0x3F9F5 },
+ { MKTAG('M', 'D', '1', '1'), 0x3F982 },
+ { MKTAG('J', 'F', 'O', 'D'), 0x3F930 },
+ { MKTAG('C', 'M', 'N', 'T'), 0x3F937 },
+ { MKTAG('H', 'A', 'H', 'A'), 0x3FA47 },
+ { MKTAG('S', 'U', 'M', 'S'), 0x3F9FE },
+ { MKTAG('A', 'N', 'S', 'W'), 0x3F90B },
+ { MKTAG('M', 'U', 'S', 'I'), 0x3FA35 },
+ { MKTAG('S', 'O', 'N', 'G'), 0x3FA35 },
+ { MKTAG('A', 'C', 'T', 'R'), 0x3F9B6 },
+ { MKTAG('A', 'C', 'T', 'S'), 0x3F9B7 },
+ { MKTAG('A', 'R', 'T', 'I'), 0x3F9CE },
+ { MKTAG('A', 'R', 'T', 'Y'), 0x3F9CE },
+ { MKTAG('A', 'U', 'T', 'H'), 0x3FAB6 },
+ { MKTAG('C', 'O', 'M', 'D'), 0x3F963 },
+ { MKTAG('C', 'O', 'P', 'S'), 0x3F9F8 },
+ { MKTAG('C', 'R', 'I', 'M'), 0x3F9F8 },
+ { MKTAG('C', 'S', 'P', 'Y'), 0x3F965 },
+ { MKTAG('D', 'C', 'T', 'R'), 0x3F9B6 },
+ { MKTAG('D', 'R', 'U', 'G'), 0x3F96F },
+ { MKTAG('E', 'A', 'R', 'T'), 0x3F9E3 },
+ { MKTAG('E', 'M', 'O', 'T'), 0x3FA29 },
+ { MKTAG('F', 'A', 'M', 'E'), 0x3FAB6 },
+ { MKTAG('F', 'A', 'S', 'H'), 0x3F8EA },
+ { MKTAG('F', 'A', 'U', 'N'), 0x3F969 },
+ { MKTAG('F', 'I', 'L', 'M'), 0x3F9CE },
+ { MKTAG('F', 'L', 'O', 'R'), 0x3F9A3 },
+ { MKTAG('H', 'B', 'B', 'Y'), 0x3F987 },
+ { MKTAG('H', 'E', 'R', 'O'), 0x3F8DA },
+ { MKTAG('H', 'H', 'G', 'Q'), 0x3F96B },
+ { MKTAG('H', 'H', 'L', 'D'), 0x3FA2B },
+ { MKTAG('H', 'O', 'S', 'T'), 0x3F9E1 },
+ { MKTAG('K', 'N', 'O', 'B'), 0x3F9E1 },
+ { MKTAG('L', 'I', 'Q', 'D'), 0x3F91C },
+ { MKTAG('L', 'I', 'T', 'R'), 0x3F9CE },
+ { MKTAG('M', 'A', 'G', 'S'), 0x3F912 },
+ { MKTAG('M', 'L', 'T', 'Y'), 0x3F9F7 },
+ { MKTAG('P', 'G', 'R', 'P'), 0x3F8D0 },
+ { MKTAG('P', 'H', 'I', 'L'), 0x3F8E9 },
+ { MKTAG('P', 'K', 'U', 'P'), 0x3F9FB },
+ { MKTAG('P', 'L', 'A', 'C'), 0x3FA22 },
+ { MKTAG('P', 'T', 'I', 'C'), 0x3F8D0 },
+ { MKTAG('R', 'C', 'K', 'T'), 0x3F9A3 },
+ { MKTAG('S', 'C', 'I', 'E'), 0x3F968 },
+ { MKTAG('S', 'C', 'I', 'T'), 0x3F9E2 },
+ { MKTAG('S', 'E', 'X', '1'), 0x3F9C9 },
+ { MKTAG('S', 'F', 'S', 'F'), 0x3F988 },
+ { MKTAG('S', 'O', 'A', 'P'), 0x3FA3C },
+ { MKTAG('S', 'P', 'R', 'T'), 0x3FAB6 },
+ { MKTAG('S', 'W', 'E', 'R'), 0x3F96B },
+ { MKTAG('T', 'E', 'A', 'M'), 0x3F9B8 },
+ { MKTAG('T', 'O', 'Y', 'S'), 0x3F96D },
+ { MKTAG('T', 'V', 'S', 'H'), 0x3F9CE },
+ { MKTAG('W', 'E', 'A', 'P'), 0x3F9D8 },
+ { MKTAG('W', 'W', 'E', 'B'), 0x3F987 },
+ { MKTAG('B', 'Y', 'Z', 'A'), 0x3F9A5 },
+ { MKTAG('T', 'W', 'A', 'T'), 0x3F96F },
+ { MKTAG('M', 'C', 'P', 'Y'), 0x3F9B9 },
+ { MKTAG('T', 'H', 'R', 'T'), 0x3FB15 },
+ { MKTAG('T', 'D', 'V', 'P'), 0x3FB17 },
+ { MKTAG('T', 'I', 'T', 'A'), 0x3FB18 },
+ { MKTAG('M', 'I', 'N', 'S'), 0x3FB19 },
+ { MKTAG('D', 'N', 'C', 'E'), 0x3FB1A },
+ { MKTAG('N', 'A', 'U', 'T'), 0x3FB1B },
+ { MKTAG('T', 'L', 'A', ' '), 0x3FB1C }
+};
+
+void writeScriptResponses(const char *name, const int *tags, uint count, int valuesPerTag) {
outputFile.seek(dataOffset);
- for (int idx = 0; idx < count * 5; ++idx, ++tags)
+ for (int idx = 0; idx < count * (valuesPerTag + 1); ++idx, ++tags)
outputFile.writeLong(*tags);
- writeEntryHeader(name, dataOffset, count * 5 * 4);
- dataOffset += count * 5 * 4;
+ writeEntryHeader(name, dataOffset, count * (valuesPerTag + 1) * 4);
+ dataOffset += count * (valuesPerTag + 1) * 4;
}
void writeAllScriptResponses() {
- writeScriptResponses("Responses/Deskbot", &DESKBOT_RESPONSES[0][0], 128);
- writeScriptResponses("Responses/Bellbot", &BELLBOT_RESPONSES[0][0], 130);
+ writeScriptResponses("Responses/Barbot", &BARBOT_RESPONSES[0][0], 93, 1);
+ writeScriptResponses("Responses/Bellbot", &BELLBOT_RESPONSES[0][0], 130, 4);
+ writeScriptResponses("Responses/Deskbot", &DESKBOT_RESPONSES[0][0], 128, 4);
+ writeScriptResponses("Responses/Doorbot", &DOORBOT_RESPONSES[0][0], 101, 1);
+ writeScriptResponses("Responses/Liftbot", &LIFTBOT_RESPONSES[0][0], 34, 1);
+ writeScriptResponses("Responses/MaitreD", &MAITRED_RESPONSES[0][0], 74, 1);
} \ No newline at end of file
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 2bb3a1876f..2c82949990 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -25,9 +25,9 @@
namespace Titanic {
-int BarbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
warning("TODO");
- return 2;
+ return SS_2;
}
void BarbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index a55c12bc71..45681874df 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -33,7 +33,11 @@ public:
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
- virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
+ /**
+ * Chooses and adds a conversation response based on a specified tag Id.
+ */
+ virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
virtual void proc7(int v1, int v2);
virtual int proc10() const;
virtual int proc15() const;
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 794e67130f..0e11aeaddf 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -38,11 +38,8 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
randomizeFlags();
_array[0] = 100;
_array[1] = 0;
-}
-int BellbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
- warning("TODO");
- return 2;
+ load("Responses/Bellbot");
}
void BellbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index d7fbab3a8f..86e9165d01 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -38,7 +38,6 @@ public:
BellbotScript(int val1, const char *charClass, int v2,
const char *charName, int v3, int val2);
- virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
virtual void proc7(int v1, int v2);
virtual int proc10() const;
virtual int proc15() const;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index dbe2664e99..319175f40a 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -39,23 +39,8 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
_array[0] = 100;
if (_field74 == 1)
_field74 = 0;
-}
-
-int DeskbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
- for (uint idx = 0; idx < _tags.size(); ++idx) {
- const TTnpcScriptTag &scriptTag = _tags[idx];
- uint currTag = (idx == 0) ? MKTAG('P', 'K', 'U', 'P') : scriptTag._tag;
-
- if (currTag == tag) {
- int valIndex = getRandomNumber(scriptTag.size()) - 1;
- uint diagId = getDialogueId(scriptTag._values[valIndex]);
- addResponse(diagId);
- applyResponse();
- break;
- }
- }
- return SS_1;
+ load("Responses/Deskbot");
}
void DeskbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index f2de881777..3dda552571 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -29,13 +29,10 @@
namespace Titanic {
class DeskbotScript : public TTnpcScript {
-private:
- Common::Array<TTnpcScriptTag> _tags;
public:
DeskbotScript(int val1, const char *charClass, int v2,
const char *charName, int v3, int val2);
- virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
virtual void proc7(int v1, int v2);
virtual int proc10() const;
virtual int proc15() const;
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 9d35f697f9..d1638eeff3 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -25,9 +25,9 @@
namespace Titanic {
-int DoorbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+int DoorbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
warning("TODO");
- return 2;
+ return SS_2;
}
void DoorbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 82897b7bfc..3158ef07d2 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -35,7 +35,11 @@ public:
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
- virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
+ /**
+ * Chooses and adds a conversation response based on a specified tag Id.
+ */
+ virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
virtual void proc7(int v1, int v2);
virtual int proc10() const;
virtual int proc15() const;
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index b1577b3979..b627df658f 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -25,9 +25,9 @@
namespace Titanic {
-int LiftbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
warning("TODO");
- return 2;
+ return SS_2;
}
void LiftbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 8c2ae3210c..9e7d72f012 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -33,7 +33,11 @@ public:
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
- virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
+ /**
+ * Chooses and adds a conversation response based on a specified tag Id.
+ */
+ virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
virtual void proc7(int v1, int v2);
virtual int proc9() const;
virtual int proc10() const;
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 5581c6b605..717dbca779 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -39,9 +39,9 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
CTrueTalkManager::setFlags(16, 0);
}
-int MaitreDScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+int MaitreDScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
warning("TODO");
- return 2;
+ return SS_2;
}
void MaitreDScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 14505ca616..d638dee52b 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -32,7 +32,11 @@ public:
MaitreDScript(int val1, const char *charClass, int v2,
const char *charName, int v3, int val2);
- virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
+ /**
+ * Chooses and adds a conversation response based on a specified tag Id.
+ */
+ virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
virtual void proc7(int v1, int v2);
virtual int proc10() const;
virtual bool proc16() const;
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index a6b37bfc57..6e90bbc0b1 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -25,9 +25,9 @@
namespace Titanic {
-int ParrotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+int ParrotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
warning("TODO");
- return 2;
+ return SS_2;
}
void ParrotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 0add5d9dfe..abf8042c37 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -33,7 +33,11 @@ public:
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
- virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
+ /**
+ * Chooses and adds a conversation response based on a specified tag Id.
+ */
+ virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
virtual void proc7(int v1, int v2);
virtual int proc10() const;
virtual bool proc17() const;
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index b689aba031..f5db6eb5de 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -89,7 +89,7 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip
if (result) {
sentence->set34(result);
if (roomScript->proc6(npcScript, sentence, result)) {
- canProcess = npcScript->proc6(roomScript, sentence, result);
+ canProcess = npcScript->chooseResponse(roomScript, sentence, result);
}
}
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 436b779432..60e3abbd65 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -25,9 +25,9 @@
namespace Titanic {
-int SuccUBusScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+int SuccUBusScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
warning("TODO");
- return 2;
+ return SS_2;
}
void SuccUBusScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 8a078c2639..43249999a5 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -36,7 +36,11 @@ public:
TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
_field2D0(0) {}
- virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
+ /**
+ * Chooses and adds a conversation response based on a specified tag Id.
+ */
+ virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
virtual void proc7(int v1, int v2);
virtual int proc10() const;
virtual bool proc17() const;
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index bbd75a4854..59212cba55 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -27,7 +27,7 @@
namespace Titanic {
-int TTnpcScriptTag::size() const {
+int TTnpcScriptResponse::size() const {
for (int idx = 0; idx < 4; ++idx) {
if (_values[idx] == 0)
return idx;
@@ -63,6 +63,21 @@ TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
resetFlags();
}
+void TTnpcScript::load(const char *name) {
+ Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+
+ while (r->pos() < r->size()) {
+ TTnpcScriptResponse sr;
+ sr._tag = r->readUint32LE();
+ for (int idx = 0; idx < 4; ++idx)
+ sr._values[idx] = r->readUint32LE();
+
+ _responses.push_back(sr);
+ }
+
+ delete r;
+}
+
void TTnpcScript::resetFlags() {
Common::fill(&_array[20], &_array[140], 0);
_field2CC = false;
@@ -76,6 +91,22 @@ void TTnpcScript::proc4(int v) {
warning("TODO");
}
+int TTnpcScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
+ for (uint idx = 0; idx < _responses.size(); ++idx) {
+ const TTnpcScriptResponse &response = _responses[idx];
+
+ if (response._tag == tag) {
+ int valIndex = getRandomNumber(response.size()) - 1;
+ uint diagId = getDialogueId(response._values[valIndex]);
+ addResponse(diagId);
+ applyResponse();
+ return 2;
+ }
+ }
+
+ return 1;
+}
+
void TTnpcScript::proc7(int v1, int v2) {
warning("TODO");
}
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index d52da2ed73..407b3648da 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -31,7 +31,7 @@ namespace Titanic {
class TTroomScript;
class TTsentence;
-struct TTnpcScriptTag {
+struct TTnpcScriptResponse {
uint _tag;
uint _values[4];
@@ -52,7 +52,11 @@ public:
const char *charName, int v3, int val2, int v4,
int v5, int v6, int v7);
- virtual int proc6(TTroomScript *roomScript, TTsentence *sentence, int val) const = 0;
+ /**
+ * Chooses and adds a conversation response based on a specified tag Id.
+ */
+ virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) = 0;
+
virtual void proc7(int v1, int v2) = 0;
virtual int proc8() const = 0;
virtual int proc9() const = 0;
@@ -70,6 +74,8 @@ public:
class TTnpcScript : public TTnpcScriptBase {
private:
+ Common::Array<TTnpcScriptResponse> _responses;
+private:
int translateByArray(int id);
protected:
byte *_subPtr;
@@ -85,6 +91,14 @@ protected:
int _array[146];
bool _field2CC;
protected:
+ /**
+ * Loads response data for the NPC from the given resource
+ */
+ void load(const char *name);
+
+ /**
+ * Reset script flags
+ */
void resetFlags();
void randomizeFlags();
@@ -111,7 +125,14 @@ public:
int v5, int v6, int v7);
virtual void proc4(int v);
- virtual int proc6(TTroomScript *roomScript, TTsentence *sentence, int val) const { return 1; }
+
+ /**
+ * Chooses and adds a conversation response based on a specified tag Id.
+ * This default implementation does a lookup into a list of known tags,
+ * and chooses a random dialogue Id from the available ones for that tag
+ */
+ virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
virtual void proc7(int v1, int v2);
virtual int proc8() const;
virtual int proc9() const;