aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-14 12:30:04 -0400
committerPaul Gilbert2016-08-14 12:30:04 -0400
commit54a6ec5c074bfb2d83f1841c5775ac606dbd9d90 (patch)
tree22a62e1902df6aae4550070d8558f3139f0f4f40 /engines/titanic
parent6e1045b5be9b8c03f56408234c6888e84f788fb8 (diff)
downloadscummvm-rg350-54a6ec5c074bfb2d83f1841c5775ac606dbd9d90.tar.gz
scummvm-rg350-54a6ec5c074bfb2d83f1841c5775ac606dbd9d90.tar.bz2
scummvm-rg350-54a6ec5c074bfb2d83f1841c5775ac606dbd9d90.zip
TITANIC: Implemented CSummonBots class
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/npcs/summon_bots.cpp37
-rw-r--r--engines/titanic/npcs/summon_bots.h3
2 files changed, 40 insertions, 0 deletions
diff --git a/engines/titanic/npcs/summon_bots.cpp b/engines/titanic/npcs/summon_bots.cpp
index 8796e5ffda..6d71847548 100644
--- a/engines/titanic/npcs/summon_bots.cpp
+++ b/engines/titanic/npcs/summon_bots.cpp
@@ -24,6 +24,11 @@
namespace Titanic {
+BEGIN_MESSAGE_MAP(CSummonBots, CRobotController)
+ ON_MESSAGE(SummonBotQueryMsg)
+ ON_MESSAGE(SummonBotMsg)
+END_MESSAGE_MAP()
+
CSummonBots::CSummonBots() : CRobotController(), _string2("NULL"),
_fieldC8(0), _fieldCC(0) {
}
@@ -46,4 +51,36 @@ void CSummonBots::load(SimpleFile *file) {
CRobotController::load(file);
}
+bool CSummonBots::SummonBotQueryMsg(CSummonBotQueryMsg *msg) {
+ if (msg->_npcName == "BellBot") {
+ if (_fieldC8 && !petCheckNode(_string2))
+ return true;
+ } else if (msg->_npcName == "DoorBot") {
+ if (_fieldCC && !petCheckNode(_string2))
+ return true;
+ }
+
+ return false;
+}
+
+bool CSummonBots::SummonBotMsg(CSummonBotMsg *msg) {
+ if (msg->_npcName == "BellBot") {
+ if (!_fieldC8)
+ return false;
+
+ if (petDismissBot("BellBot"))
+ petOnSummonBot("Bellbot", msg->_value);
+ } else if (msg->_npcName == "DoorBot") {
+ if (!_fieldCC)
+ return false;
+
+ if (petDismissBot("Doorbot"))
+ petOnSummonBot("Doorbot", msg->_value);
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/npcs/summon_bots.h b/engines/titanic/npcs/summon_bots.h
index ee537fee76..1da6e68245 100644
--- a/engines/titanic/npcs/summon_bots.h
+++ b/engines/titanic/npcs/summon_bots.h
@@ -28,6 +28,9 @@
namespace Titanic {
class CSummonBots : public CRobotController {
+ DECLARE_MESSAGE_MAP;
+ bool SummonBotQueryMsg(CSummonBotQueryMsg *msg);
+ bool SummonBotMsg(CSummonBotMsg *msg);
protected:
CString _string2;
int _fieldC8;