diff options
author | Paul Gilbert | 2016-08-25 20:46:33 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-25 20:46:33 -0400 |
commit | 1f0b9cb68d02d956ec745bef16f0dbddaa743bec (patch) | |
tree | 1caba7007cc529982bd5932923d33b5cf8569853 /engines/titanic/carry | |
parent | db179c11bb7d8f82183e39e2778491ead55d875e (diff) | |
download | scummvm-rg350-1f0b9cb68d02d956ec745bef16f0dbddaa743bec.tar.gz scummvm-rg350-1f0b9cb68d02d956ec745bef16f0dbddaa743bec.tar.bz2 scummvm-rg350-1f0b9cb68d02d956ec745bef16f0dbddaa743bec.zip |
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic/carry')
-rw-r--r-- | engines/titanic/carry/mouth.cpp | 40 | ||||
-rw-r--r-- | engines/titanic/carry/mouth.h | 4 |
2 files changed, 44 insertions, 0 deletions
diff --git a/engines/titanic/carry/mouth.cpp b/engines/titanic/carry/mouth.cpp index 8c3791fa9c..e48929a391 100644 --- a/engines/titanic/carry/mouth.cpp +++ b/engines/titanic/carry/mouth.cpp @@ -21,9 +21,16 @@ */ #include "titanic/carry/mouth.h" +#include "titanic/game/head_slot.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CMouth, CHeadPiece) + ON_MESSAGE(UseWithOtherMsg) + ON_MESSAGE(MovieEndMsg) + ON_MESSAGE(PETGainedObjectMsg) +END_MESSAGE_MAP() + CMouth::CMouth() : CHeadPiece() { } @@ -37,4 +44,37 @@ void CMouth::load(SimpleFile *file) { CHeadPiece::load(file); } +bool CMouth::UseWithOtherMsg(CUseWithOtherMsg *msg) { + CHeadSlot *slot = dynamic_cast<CHeadSlot *>(msg->_other); + if (!slot) + return CHeadPiece::UseWithOtherMsg(msg); + + _flag = true; + setVisible(false); + setPosition(Point(0, 0)); + petMoveToHiddenRoom(); + + CAddHeadPieceMsg addMsg(getName()); + if (addMsg._value != "NULL") + addMsg.execute("MouthSlot"); + + return true; +} + +bool CMouth::MovieEndMsg(CMovieEndMsg *msg) { + return true; +} + +bool CMouth::PETGainedObjectMsg(CPETGainedObjectMsg *msg) { + _visibleFrame = 2; + loadFrame(2); + setVisible(true); + if (!_field13C) { + stateInc38(); + _field13C = true; + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/carry/mouth.h b/engines/titanic/carry/mouth.h index e394330494..f5f0f53b45 100644 --- a/engines/titanic/carry/mouth.h +++ b/engines/titanic/carry/mouth.h @@ -28,6 +28,10 @@ namespace Titanic { class CMouth : public CHeadPiece { + DECLARE_MESSAGE_MAP; + bool UseWithOtherMsg(CUseWithOtherMsg *msg); + bool MovieEndMsg(CMovieEndMsg *msg); + bool PETGainedObjectMsg(CPETGainedObjectMsg *msg); public: CLASSDEF; CMouth(); |