diff options
author | Paul Gilbert | 2016-08-23 21:46:04 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-23 21:46:04 -0400 |
commit | 3a20dca0cb487e1c542b75f442eacb33eadd2e26 (patch) | |
tree | 3a6f77bd089ddf81c7ad9921fb96149c9193964d /engines/titanic/carry/liftbot_head.cpp | |
parent | 3d558fe6ca0ad61558f5283f2ff4751b034fed5f (diff) | |
download | scummvm-rg350-3a20dca0cb487e1c542b75f442eacb33eadd2e26.tar.gz scummvm-rg350-3a20dca0cb487e1c542b75f442eacb33eadd2e26.tar.bz2 scummvm-rg350-3a20dca0cb487e1c542b75f442eacb33eadd2e26.zip |
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic/carry/liftbot_head.cpp')
-rw-r--r-- | engines/titanic/carry/liftbot_head.cpp | 67 |
1 files changed, 64 insertions, 3 deletions
diff --git a/engines/titanic/carry/liftbot_head.cpp b/engines/titanic/carry/liftbot_head.cpp index bcab8e8574..5f516fcf8c 100644 --- a/engines/titanic/carry/liftbot_head.cpp +++ b/engines/titanic/carry/liftbot_head.cpp @@ -21,22 +21,83 @@ */ #include "titanic/carry/liftbot_head.h" +#include "titanic/game/transport/lift.h" +#include "titanic/pet_control/pet_control.h" namespace Titanic { -CLiftbotHead::CLiftbotHead() : CCarry(), _field12C(0) { +BEGIN_MESSAGE_MAP(CLiftbotHead, CCarry) + ON_MESSAGE(UseWithOtherMsg) + ON_MESSAGE(UseWithCharMsg) + ON_MESSAGE(MouseDragStartMsg) +END_MESSAGE_MAP() + +CLiftbotHead::CLiftbotHead() : CCarry(), _flag(false) { } void CLiftbotHead::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_field12C, indent); + file->writeNumberLine(_flag, indent); CCarry::save(file, indent); } void CLiftbotHead::load(SimpleFile *file) { file->readNumber(); - _field12C = file->readNumber(); + _flag = file->readNumber(); CCarry::load(file); } +bool CLiftbotHead::UseWithOtherMsg(CUseWithOtherMsg *msg) { + if (msg->_other->getName() == "LiftbotWithoutHead") { + CPetControl *pet = getPetControl(); + if (CLift::_v1 == 1 && pet->getRoomsElevatorNum() == 4) { + _flag = true; + CActMsg actMsg("AddRightHead"); + actMsg.execute("FaultyLiftbot"); + setVisible(false); + } + + return true; + } else { + return CCarry::UseWithOtherMsg(msg); + } +} + +bool CLiftbotHead::UseWithCharMsg(CUseWithCharMsg *msg) { + CLift *lift = dynamic_cast<CLift *>(msg->_character); + if (lift) { + CPetControl *pet = getPetControl(); + if (lift->isEquals("Well") && !CLift::_v1 && pet->getRoomsElevatorNum() == 4) { + _flag = true; + CActMsg actMsg("AddRightHead"); + actMsg.execute(lift); + setVisible(false); + + return true; + } + } + + return CCarry::UseWithCharMsg(msg); +} + +bool CLiftbotHead::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (!checkStartDragging(msg)) { + return false; + } else if (compareViewNameTo("BottomOfWell.Node 8.N")) { + changeView("BottomOfWell.Node 13.N"); + moveToView(); + + CActMsg actMsg("LiftbotHeadTaken"); + actMsg.execute("BOWLiftbotHeadMonitor"); + + return CCarry::MouseDragStartMsg(msg); + } else if (_flag) { + _flag = false; + CActMsg actMsg("LoseHead"); + actMsg.execute("FaultyLiftbot"); + } + + return CCarry::MouseDragStartMsg(msg); +} + } // End of namespace Titanic |