diff options
Diffstat (limited to 'engines/titanic/game/parrot/parrot_lobby_controller.cpp')
-rw-r--r-- | engines/titanic/game/parrot/parrot_lobby_controller.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/engines/titanic/game/parrot/parrot_lobby_controller.cpp b/engines/titanic/game/parrot/parrot_lobby_controller.cpp index f1e054a8dd..907e7519b8 100644 --- a/engines/titanic/game/parrot/parrot_lobby_controller.cpp +++ b/engines/titanic/game/parrot/parrot_lobby_controller.cpp @@ -21,9 +21,14 @@ */ #include "titanic/game/parrot/parrot_lobby_controller.h" +#include "titanic/core/room_item.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CParrotLobbyController, CParrotLobbyObject) + ON_MESSAGE(ActMsg) +END_MESSAGE_MAP() + void CParrotLobbyController::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); CParrotLobbyObject::save(file, indent); @@ -34,4 +39,34 @@ void CParrotLobbyController::load(SimpleFile *file) { CParrotLobbyObject::load(file); } +bool CParrotLobbyController::ActMsg(CActMsg *msg) { + if (msg->_action == "Refresh") + return false; + else if (msg->_action == "GainParrot") + _haveParrot = true; + else if (msg->_action == "LoseParrot") + _haveParrot = false; + else if (msg->_action == "GainPerch") + _havePerch = true; + else if (msg->_action == "LosePerch") + _havePerch = false; + else if (msg->_action == "GainStick") + _haveStick = true; + else if (msg->_action == "LoseStick") + _haveStick = false; + + _flags = 0; + if (_haveParrot) + _flags = 4; + if (_havePerch) + _flags |= 2; + if (_haveStick) + _flags |= 1; + + CActMsg actMsg("Refresh"); + actMsg.execute(findRoom(), CParrotLobbyObject::_type, MSGFLAG_CLASS_DEF | MSGFLAG_SCAN); + actMsg.execute("ParrotLobbyUpdater_TOW"); + return true; +} + } // End of namespace Titanic |