[Scummvm-cvs-logs] scummvm master -> 54a6ec5c074bfb2d83f1841c5775ac606dbd9d90

dreammaster dreammaster at scummvm.org
Sun Aug 14 18:30:14 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
54a6ec5c07 TITANIC: Implemented CSummonBots class


Commit: 54a6ec5c074bfb2d83f1841c5775ac606dbd9d90
    https://github.com/scummvm/scummvm/commit/54a6ec5c074bfb2d83f1841c5775ac606dbd9d90
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-14T12:30:04-04:00

Commit Message:
TITANIC: Implemented CSummonBots class

Changed paths:
    engines/titanic/npcs/summon_bots.cpp
    engines/titanic/npcs/summon_bots.h



diff --git a/engines/titanic/npcs/summon_bots.cpp b/engines/titanic/npcs/summon_bots.cpp
index 8796e5f..6d71847 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 ee537fe..1da6e68 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;






More information about the Scummvm-git-logs mailing list