diff options
Diffstat (limited to 'engines/titanic/carry/long_stick.cpp')
-rw-r--r-- | engines/titanic/carry/long_stick.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/engines/titanic/carry/long_stick.cpp b/engines/titanic/carry/long_stick.cpp index ab1e42b81f..557b75ab87 100644 --- a/engines/titanic/carry/long_stick.cpp +++ b/engines/titanic/carry/long_stick.cpp @@ -24,6 +24,12 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CLongStick, CCarry) + ON_MESSAGE(UseWithOtherMsg) + ON_MESSAGE(PuzzleSolvedMsg) + ON_MESSAGE(LeaveViewMsg) +END_MESSAGE_MAP() + CLongStick::CLongStick() : CCarry() { } @@ -37,4 +43,30 @@ void CLongStick::load(SimpleFile *file) { CCarry::load(file); } +bool CLongStick::UseWithOtherMsg(CUseWithOtherMsg *msg) { + if (msg->_other->isEquals("SpeechCentre")) { + CPuzzleSolvedMsg puzzleMsg; + puzzleMsg.execute(msg->_other); + } else if (msg->_other->isEquals("LongStickDispensor")) { + petDisplayMessage(1, "You already have one."); + } else if (msg->_other->isEquals("Bomb")) { + CActMsg actMsg("Hit"); + actMsg.execute("Bomb"); + } else { + return CCarry::UseWithOtherMsg(msg); + } + + return true; +} + +bool CLongStick::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) { + _fieldE0 = 1; + return true; +} + +bool CLongStick::LeaveViewMsg(CLeaveViewMsg *msg) { + setVisible(false); + return true; +} + } // End of namespace Titanic |