[Scummvm-cvs-logs] scummvm master -> e54dc36035aa7b66163064a0206c901bdf8ba5bd

dreammaster dreammaster at scummvm.org
Tue Aug 16 01:09: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:
e54dc36035 TITANIC: Implemented CParrotSuccUBus class


Commit: e54dc36035aa7b66163064a0206c901bdf8ba5bd
    https://github.com/scummvm/scummvm/commit/e54dc36035aa7b66163064a0206c901bdf8ba5bd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-15T19:09:03-04:00

Commit Message:
TITANIC: Implemented CParrotSuccUBus class

Changed paths:
    engines/titanic/carry/hose.h
    engines/titanic/messages/messages.h
    engines/titanic/npcs/parrot_succubus.cpp
    engines/titanic/npcs/parrot_succubus.h



diff --git a/engines/titanic/carry/hose.h b/engines/titanic/carry/hose.h
index ebd4586..77ab437 100644
--- a/engines/titanic/carry/hose.h
+++ b/engines/titanic/carry/hose.h
@@ -34,10 +34,10 @@ struct CHoseStatics {
 
 class CHose : public CCarry {
 protected:
-	static CHoseStatics *_statics;
-
 	CString _string6;
 public:
+	static CHoseStatics *_statics;
+public:
 	CLASSDEF;
 	CHose();
 	static void init();
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 71807f4..6076d43 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -249,7 +249,7 @@ MESSAGE1(CGetChevLiftBits, int, value, 0);
 MESSAGE1(CGetChevLiftNum, int, value, 0);
 MESSAGE1(CGetChevRoomBits, int, value, 0);
 MESSAGE1(CGetChevRoomNum, int, value, 0);
-MESSAGE2(CHoseConnectedMsg, int, value1, 1, int, value2, 0);
+MESSAGE2(CHoseConnectedMsg, int, value, 1, CGameObject *, object, nullptr);
 MESSAGE0(CInitializeAnimMsg);
 MESSAGE1(CIsEarBowlPuzzleDone, int, value, 0);
 MESSAGE3(CIsHookedOnMsg, Rect, rect, Rect(), bool, result, false, CString, string1, "");
@@ -288,7 +288,7 @@ MESSAGE2(CPlayRangeMsg, int, value1, 0, int, value2, 0);
 MESSAGE2(CPlayerTriesRestaurantTableMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CPreSaveMsg, int, value, 0);
 MESSAGE1(CProdMaitreDMsg, int, value, 0);
-MESSAGE2(CPumpingMsg, int, value1, 0, int, value2, 0);
+MESSAGE2(CPumpingMsg, int, value, 0, CGameObject *, object, nullptr);
 MESSAGE1(CPutBotBackInHisBoxMsg, int, value, 0);
 MESSAGE1(CPutParrotBackMsg, int, value, 0);
 MESSAGE0(CPuzzleSolvedMsg);
diff --git a/engines/titanic/npcs/parrot_succubus.cpp b/engines/titanic/npcs/parrot_succubus.cpp
index 49c4afa..652282b 100644
--- a/engines/titanic/npcs/parrot_succubus.cpp
+++ b/engines/titanic/npcs/parrot_succubus.cpp
@@ -21,9 +21,19 @@
  */
 
 #include "titanic/npcs/parrot_succubus.h"
+#include "titanic/pet_control/pet_control.h"
+#include "titanic/carry/hose.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CParrotSuccUBus, CSuccUBus)
+	ON_MESSAGE(HoseConnectedMsg)
+	ON_MESSAGE(EnterViewMsg)
+	ON_MESSAGE(MovieEndMsg)
+	ON_MESSAGE(MouseButtonDownMsg)
+	ON_MESSAGE(LeaveNodeMsg)
+END_MESSAGE_MAP()
+
 CParrotSuccUBus::CParrotSuccUBus() : CSuccUBus(), _field1DC(0), 
 	_field1EC(0), _field1F0(376), _field1F4(393) {
 }
@@ -46,4 +56,96 @@ void CParrotSuccUBus::load(SimpleFile *file) {
 	CSuccUBus::load(file);
 }
 
+bool CParrotSuccUBus::HoseConnectedMsg(CHoseConnectedMsg *msg) {
+	CPetControl *pet = getPetControl();
+	if (msg->_value == _field1DC)
+		return true;
+	if (mailExists(pet->getRoomFlags()))
+		return false;
+
+	_field1DC = msg->_value;
+	if (_field1DC) {
+		CGameObject *item = msg->_object;
+		_string3 = item->getName();
+		CHoseConnectedMsg hoseMsg(1, this);
+		hoseMsg.execute(msg->_object);
+		item->petMoveToHiddenRoom();
+
+		CPumpingMsg pumpingMsg(1, this);
+		pumpingMsg.execute(this);
+		_field1DC = 1;
+
+		if (_enabled) {
+			_enabled = false;
+		} else {
+			playMovie(_startFrame9, _endFrame9, 0);
+			playSound("z#26.wav");
+		}
+
+		playMovie(_field1C4, _field1C8, MOVIE_NOTIFY_OBJECT);
+	} else {
+		stopMovie();
+		stopSound(_field1EC);
+		playMovie(_field1F0, _field1F4, MOVIE_NOTIFY_OBJECT);
+
+		CPumpingMsg pumpingMsg(0, this);
+		pumpingMsg.execute(_string3);
+
+		CGameObject *obj = getHiddenObject(_string3);
+		if (obj) {
+			obj->petAddToInventory();
+			obj->setVisible(true);
+		}
+
+		_enabled = true;
+		CTurnOff offMsg;
+		offMsg.execute(this);
+	}
+
+	return true;
+}
+
+bool CParrotSuccUBus::EnterViewMsg(CEnterViewMsg *msg) {
+	if (_field1DC) {
+		playMovie(_field1CC, _field1D0, MOVIE_REPEAT);
+		return true;
+	} else {
+		return CSuccUBus::EnterViewMsg(msg);
+	}
+}
+
+bool CParrotSuccUBus::MovieEndMsg(CMovieEndMsg *msg) {
+	if (msg->_endFrame == _field1C8) {
+		playMovie(_field1CC, _field1D0, MOVIE_REPEAT);
+		_field1EC = playSound("z#472.wav");
+		return true;
+	} else {
+		return CSuccUBus::MovieEndMsg(msg);
+	}
+}
+
+bool CParrotSuccUBus::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	if (_field1DC) {
+		CHoseConnectedMsg hoseMsg;
+		hoseMsg._value = 0;
+		hoseMsg.execute(this);
+	} else {
+		return CSuccUBus::MouseButtonDownMsg(msg);
+	}
+}
+
+bool CParrotSuccUBus::LeaveNodeMsg(CLeaveNodeMsg *msg) {
+	if (_field1DC) {
+		CGameObject *obj = getHiddenObject(_string3);
+		if (CHose::_statics->_v2.empty()) {
+			playSound("z#51.wav");
+			CHoseConnectedMsg hoseMsg;
+			hoseMsg._value = 0;
+			hoseMsg.execute(this);
+		}
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/parrot_succubus.h b/engines/titanic/npcs/parrot_succubus.h
index 6f5d9e6..74a4a03 100644
--- a/engines/titanic/npcs/parrot_succubus.h
+++ b/engines/titanic/npcs/parrot_succubus.h
@@ -28,6 +28,12 @@
 namespace Titanic {
 
 class CParrotSuccUBus : public CSuccUBus {
+	DECLARE_MESSAGE_MAP;
+	bool HoseConnectedMsg(CHoseConnectedMsg *msg);
+	bool EnterViewMsg(CEnterViewMsg *msg);
+	bool MovieEndMsg(CMovieEndMsg *msg);
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	bool LeaveNodeMsg(CLeaveNodeMsg *msg);
 public:
 	int _field1DC;
 	CString _string3;






More information about the Scummvm-git-logs mailing list