diff options
author | Paul Gilbert | 2016-04-16 13:11:17 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:11:13 -0400 |
commit | 6a4e7c3d731fba108b1da34413f60a3490529291 (patch) | |
tree | 4aea379937545b1dae228e36e812480e056b0cf4 /engines/titanic/carry | |
parent | ee2a70f466057eaebfc05118374d3def81eca6f3 (diff) | |
download | scummvm-rg350-6a4e7c3d731fba108b1da34413f60a3490529291.tar.gz scummvm-rg350-6a4e7c3d731fba108b1da34413f60a3490529291.tar.bz2 scummvm-rg350-6a4e7c3d731fba108b1da34413f60a3490529291.zip |
TITANIC: Implement CCrushedTV message handlers
Diffstat (limited to 'engines/titanic/carry')
-rw-r--r-- | engines/titanic/carry/crushed_tv.cpp | 40 | ||||
-rw-r--r-- | engines/titanic/carry/crushed_tv.h | 6 |
2 files changed, 46 insertions, 0 deletions
diff --git a/engines/titanic/carry/crushed_tv.cpp b/engines/titanic/carry/crushed_tv.cpp index a0a7ee7a43..5abc8fac98 100644 --- a/engines/titanic/carry/crushed_tv.cpp +++ b/engines/titanic/carry/crushed_tv.cpp @@ -21,9 +21,16 @@ */ #include "titanic/carry/crushed_tv.h" +#include "titanic/npcs/character.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CCrushedTV, CCarry) + ON_MESSAGE(ActMsg) + ON_MESSAGE(UseWithCharMsg) + ON_MESSAGE(MouseDragStartMsg) +END_MESSAGE_MAP() + CCrushedTV::CCrushedTV() : CCarry() { } @@ -37,4 +44,37 @@ void CCrushedTV::load(SimpleFile *file) { CCarry::load(file); } +bool CCrushedTV::ActMsg(CActMsg *msg) { + if (msg->_action == "SmashTV") { + setVisible(true); + _fieldE0 = 1; + } + + return true; +} + +bool CCrushedTV::UseWithCharMsg(CUseWithCharMsg *msg) { + if (msg->_character->getName() == "Barbot" && msg->_character->_visible) { + setVisible(false); + CActMsg actMsg("CrushedTV"); + actMsg.execute(msg->_character); + return true; + } else { + return CCarry::UseWithCharMsg(msg); + } +} + +bool CCrushedTV::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (!checkStartDragging(msg)) { + return false; + } else if (compareViewNameTo("BottomOfWell.Node 7.N")) { + changeView("BottomOfWell.Node 12.N", ""); + CActMsg actMsg("TelevisionTaken"); + actMsg.execute("BOWTelevisionMonitor"); + } + + return CCarry::MouseDragStartMsg(msg); +} + + } // End of namespace Titanic diff --git a/engines/titanic/carry/crushed_tv.h b/engines/titanic/carry/crushed_tv.h index b2bfd7580e..3e7753499d 100644 --- a/engines/titanic/carry/crushed_tv.h +++ b/engines/titanic/carry/crushed_tv.h @@ -24,10 +24,16 @@ #define TITANIC_CRUSHED_TV_H #include "titanic/carry/carry.h" +#include "titanic/messages/messages.h" +#include "titanic/messages/mouse_messages.h" namespace Titanic { class CCrushedTV : public CCarry { + DECLARE_MESSAGE_MAP + bool ActMsg(CActMsg *msg); + bool UseWithCharMsg(CUseWithCharMsg *msg); + bool MouseDragStartMsg(CMouseDragStartMsg *msg); public: CLASSDEF CCrushedTV(); |