aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-06-01 07:27:13 -0400
committerPaul Gilbert2016-07-15 19:18:47 -0400
commit58c8833d82cc9f7c19cd9424cacce8a71c555108 (patch)
tree63d75d3e34e96debae4e3e0343cd89bfe0b36d2c /engines/titanic
parent451ab9d452e4003c6b0304d4c4609cf442fb3f81 (diff)
downloadscummvm-rg350-58c8833d82cc9f7c19cd9424cacce8a71c555108.tar.gz
scummvm-rg350-58c8833d82cc9f7c19cd9424cacce8a71c555108.tar.bz2
scummvm-rg350-58c8833d82cc9f7c19cd9424cacce8a71c555108.zip
TITANIC: Implementing npc scripts chooseResponse methods
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/true_talk/liftbot_script.cpp34
-rw-r--r--engines/titanic/true_talk/liftbot_script.h2
-rw-r--r--engines/titanic/true_talk/maitred_script.cpp11
-rw-r--r--engines/titanic/true_talk/parrot_script.cpp9
-rw-r--r--engines/titanic/true_talk/succubus_script.cpp32
-rw-r--r--engines/titanic/true_talk/tt_script_base.h2
6 files changed, 81 insertions, 9 deletions
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 90b8f10563..dd6203dc62 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -25,16 +25,44 @@
namespace Titanic {
+static const int STATE_ARRAY[7] = {
+ 0x78BE, 0x78C0, 0x78C1, 0x78C2, 0x78C3, 0x78C4, 0x78C5
+};
+
LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2,
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) {
+ _state = 0;
load("Responses/Liftbot");
}
-
int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
- warning("TODO");
- return SS_2;
+ switch (tag) {
+ case MKTAG('D', 'N', 'A', '1'):
+ case MKTAG('H', 'H', 'G', 'Q'):
+ case MKTAG('A', 'N', 'S', 'W'):
+ if (_state >= 7) {
+ proc14(30918);
+ set34(2);
+ _state = 0;
+ } else {
+ addResponse(STATE_ARRAY[_state++]);
+ }
+
+ applyResponse();
+ return 2;
+
+ case MKTAG('O', 'R', 'D', '8'):
+ addResponse(30475);
+ addResponse(30467);
+ addResponse(30466);
+ addResponse(30474);
+ applyResponse();
+ return SS_2;
+
+ default:
+ return TTnpcScript::chooseResponse(roomScript, sentence, tag);
+ }
}
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 0279392e68..04454c84d0 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -28,6 +28,8 @@
namespace Titanic {
class LiftbotScript : public TTnpcScript {
+private:
+ int _state;
public:
LiftbotScript(int val1, const char *charClass, int v2,
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 10c115dedd..ed9cc5b56b 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -42,8 +42,15 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
}
int MaitreDScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
- warning("TODO");
- return SS_2;
+ if (tag == MKTAG('F', 'O', 'O', 'D') || tag == MKTAG('F', 'I', 'S', 'H') ||
+ tag == MKTAG('C', 'H', 'S', 'E')) {
+ addResponse(getDialogueId(260388));
+ addResponse(getDialogueId(260659));
+ applyResponse();
+ return 2;
+ }
+
+ return TTnpcScript::chooseResponse(roomScript, sentence, tag);
}
void MaitreDScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index 6e90bbc0b1..3e195a00c1 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -26,8 +26,13 @@
namespace Titanic {
int ParrotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
- warning("TODO");
- return SS_2;
+ if (tag == MKTAG('B', 'Y', 'Z', 'A')) {
+ addResponse(getDialogueId(280246));
+ applyResponse();
+ return 2;
+ } else {
+ return 1;
+ }
}
void ParrotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 60e3abbd65..c09cadd9b0 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -26,8 +26,36 @@
namespace Titanic {
int SuccUBusScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
- warning("TODO");
- return SS_2;
+ uint dialogueId = tag;
+
+ switch (tag) {
+ case MKTAG('S', 'L', 'O', 'W'):
+ case MKTAG('T', 'H', 'R', 'T'):
+ dialogueId = 70021;
+
+ case MKTAG('S', 'U', 'C', '1'):
+ dialogueId = getDialogueId(230009);
+ break;
+
+ case MKTAG('S', 'U', 'C', '2'):
+ dialogueId = 70117;
+ break;
+
+ case MKTAG('S', 'W', 'E', 'R'):
+ dialogueId = getRandomNumber(100) > 40 ? 70103 : getDialogueId(230030);
+ break;
+
+ default:
+ break;
+ }
+
+ if (dialogueId) {
+ addResponse(dialogueId);
+ applyResponse();
+ return 2;
+ } else {
+ return 1;
+ }
}
void SuccUBusScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index 8387d24dbd..cdaf8c7fab 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -71,6 +71,8 @@ protected:
void appendResponse2(int val1, int *val2, const TTstring &str) {
appendResponse(val1, val2, str);
}
+
+ void set34(int val) { _field34 = val; }
public:
int _id;
public: