aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/carry
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-15 08:01:39 -0400
committerPaul Gilbert2016-07-10 16:11:10 -0400
commit95c885f877ac1fa243479d113b59e6f83a360c71 (patch)
tree636668ce5345cf70149991baa6997a5e57f6df0f /engines/titanic/carry
parent2dcda26eb1253d884d6a921a3f2ead76021b9bc4 (diff)
downloadscummvm-rg350-95c885f877ac1fa243479d113b59e6f83a360c71.tar.gz
scummvm-rg350-95c885f877ac1fa243479d113b59e6f83a360c71.tar.bz2
scummvm-rg350-95c885f877ac1fa243479d113b59e6f83a360c71.zip
TITANIC: Implementing CCarryParrot msg handlers
Diffstat (limited to 'engines/titanic/carry')
-rw-r--r--engines/titanic/carry/carry_parrot.cpp91
-rw-r--r--engines/titanic/carry/carry_parrot.h13
2 files changed, 104 insertions, 0 deletions
diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index 80c833261c..1081980121 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -21,9 +21,23 @@
*/
#include "titanic/carry/carry_parrot.h"
+#include "titanic/game/cage.h"
+#include "titanic/npcs/parrot.h"
namespace Titanic {
+BEGIN_MESSAGE_MAP(CCarryParrot, CCarry)
+ ON_MESSAGE(PETGainedObjectMsg)
+ ON_MESSAGE(TimerMsg)
+ ON_MESSAGE(IsParrotPresentMsg)
+ ON_MESSAGE(LeaveViewMsg)
+ ON_MESSAGE(MouseDragEndMsg)
+ ON_MESSAGE(PassOnDragStartMsg)
+ ON_MESSAGE(PreEnterViewMsg)
+ ON_MESSAGE(UseWithCharMsg)
+ ON_MESSAGE(ActMsg)
+END_MESSAGE_MAP()
+
CCarryParrot::CCarryParrot() : CCarry(), _string6("PerchedParrot"),
_field138(0), _field13C(0), _field140(0), _field144(10),
_field148(25), _field14C(0), _field150(8) {
@@ -49,4 +63,81 @@ void CCarryParrot::load(SimpleFile *file) {
CCarry::load(file);
}
+bool CCarryParrot::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
+ CParrot::_v4 = 4;
+ CActMsg actMsg("Shut");
+ actMsg.execute("ParrotCage");
+
+ return true;
+}
+
+bool CCarryParrot::TimerMsg(CTimerMsg *msg) {
+ if (CParrot::_v4 == 1 || CParrot::_v4 == 4) {
+ if (++_field13C >= 30) {
+ CActMsg actMsg("FreeParrot");
+ actMsg.execute(this);
+ }
+ }
+
+ return true;
+}
+
+bool CCarryParrot::IsParrotPresentMsg(CIsParrotPresentMsg *msg) {
+ msg->_value = true;
+ return true;
+}
+
+bool CCarryParrot::LeaveViewMsg(CLeaveViewMsg *msg) {
+ if (_visible) {
+ setVisible(false);
+ _fieldE0 = 0;
+ CParrot::_v4 = 2;
+ }
+
+ return true;
+}
+
+bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
+ stopMovie();
+
+ if (msg->_mousePos.y >= 360) {
+ dropOnPet();
+ return true;
+ }
+
+ if (compareViewNameTo("ParrotLobby.Node 1.N")) {
+ if (msg->_mousePos.x >= 75 && msg->_mousePos.x <= 565 &&
+ !CParrot::_v2 && !CCage::_v2) {
+ setVisible(false);
+ // TODO
+ } else {
+ // TODO
+ }
+ } else {
+ // TODO
+ }
+
+ return true;
+}
+
+bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
+ // TODO
+ return true;
+}
+
+bool CCarryParrot::PreEnterViewMsg(CPreEnterViewMsg *msg) {
+ // TODO
+ return true;
+}
+
+bool CCarryParrot::UseWithCharMsg(CUseWithCharMsg *msg) {
+ // TODO
+ return true;
+}
+
+bool CCarryParrot::ActMsg(CActMsg *msg) {
+ // TODO
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/carry/carry_parrot.h b/engines/titanic/carry/carry_parrot.h
index a2b17004ac..fc1bbba255 100644
--- a/engines/titanic/carry/carry_parrot.h
+++ b/engines/titanic/carry/carry_parrot.h
@@ -24,10 +24,23 @@
#define TITANIC_CARRY_PARROT_H
#include "titanic/carry/carry.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
+#include "titanic/messages/pet_messages.h"
namespace Titanic {
class CCarryParrot : public CCarry {
+ DECLARE_MESSAGE_MAP
+ bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
+ bool TimerMsg(CTimerMsg *msg);
+ bool IsParrotPresentMsg(CIsParrotPresentMsg *msg);
+ bool LeaveViewMsg(CLeaveViewMsg *msg);
+ bool MouseDragEndMsg(CMouseDragEndMsg *msg);
+ bool PassOnDragStartMsg(CPassOnDragStartMsg *msg);
+ bool PreEnterViewMsg(CPreEnterViewMsg *msg);
+ bool UseWithCharMsg(CUseWithCharMsg *msg);
+ bool ActMsg(CActMsg *msg);
private:
CString _string6;
int _field138;