aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/carry/mouth.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/carry/mouth.cpp')
-rw-r--r--engines/titanic/carry/mouth.cpp40
1 files changed, 40 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