aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-24 22:30:30 -0400
committerPaul Gilbert2016-07-24 22:30:30 -0400
commit6558eb78c351aa852c02071ef1c73b5b9ff7259f (patch)
treee98d0ed80bc27eb8405f4e76eb04134d1bce47f8 /engines/titanic
parentcf805b07d33adb7809f88e8e5d297831d75df166 (diff)
downloadscummvm-rg350-6558eb78c351aa852c02071ef1c73b5b9ff7259f.tar.gz
scummvm-rg350-6558eb78c351aa852c02071ef1c73b5b9ff7259f.tar.bz2
scummvm-rg350-6558eb78c351aa852c02071ef1c73b5b9ff7259f.zip
TITANIC: More NPC Script support methods
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/true_talk/tt_npc_script.cpp20
-rw-r--r--engines/titanic/true_talk/tt_npc_script.h6
2 files changed, 26 insertions, 0 deletions
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 70be472d79..d7e3bc167e 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -22,6 +22,7 @@
#include "common/algorithm.h"
#include "common/textconsole.h"
+#include "titanic/messages/messages.h"
#include "titanic/pet_control/pet_control.h"
#include "titanic/true_talk/tt_npc_script.h"
#include "titanic/true_talk/tt_sentence.h"
@@ -972,4 +973,23 @@ bool TTnpcScript::fn10(bool flag) {
return false;
}
+bool TTnpcScript::getStateValue() const {
+ if (!CTrueTalkManager::_currentNPC)
+ return false;
+
+ CGameObject *bomb;
+ if (CTrueTalkManager::_currentNPC->find("Bomb", &bomb, FIND_GLOBAL) && bomb) {
+ CTrueTalkGetStateValueMsg stateMsg(10, -1000);
+ stateMsg.execute(bomb);
+ if (stateMsg._stateVal)
+ return true;
+ }
+
+ return false;
+}
+
+bool TTnpcScript::sentence2C(TTsentence *sentence) {
+ return sentence->_field2C >= 2 && sentence->_field2C <= 7;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 2bd4e6dae3..ab4379bf60 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -266,6 +266,12 @@ protected:
bool fn10(bool flag);
+ static bool sentence2C(TTsentence *sentence);
+
+ /**
+ * Gets the True Talk state value
+ */
+ bool getStateValue() const;
public:
static void init();
static void deinit();