diff options
author | Paul Gilbert | 2016-08-14 22:19:06 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-14 22:19:06 -0400 |
commit | 440f0927570d30ab61fb640df22394296efbb265 (patch) | |
tree | 5ae2fa3d16228a79b995c8ebb21e5e20b4ff040d /engines/titanic/messages | |
parent | 3dfd4ba296f407cec7533afee941be42ca5f61f1 (diff) | |
download | scummvm-rg350-440f0927570d30ab61fb640df22394296efbb265.tar.gz scummvm-rg350-440f0927570d30ab61fb640df22394296efbb265.tar.bz2 scummvm-rg350-440f0927570d30ab61fb640df22394296efbb265.zip |
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic/messages')
-rw-r--r-- | engines/titanic/messages/bilge_dispensor_event.cpp | 35 | ||||
-rw-r--r-- | engines/titanic/messages/bilge_dispensor_event.h | 5 |
2 files changed, 40 insertions, 0 deletions
diff --git a/engines/titanic/messages/bilge_dispensor_event.cpp b/engines/titanic/messages/bilge_dispensor_event.cpp index 043ffe75d3..584da00a6f 100644 --- a/engines/titanic/messages/bilge_dispensor_event.cpp +++ b/engines/titanic/messages/bilge_dispensor_event.cpp @@ -24,6 +24,13 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CBilgeDispensorEvent, CAutoSoundEvent) + ON_MESSAGE(EnterRoomMsg) + ON_MESSAGE(LeaveRoomMsg) + ON_MESSAGE(FrameMsg) + ON_MESSAGE(StatusChangeMsg) +END_MESSAGE_MAP() + void CBilgeDispensorEvent::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); CAutoSoundEvent::save(file, indent); @@ -39,4 +46,32 @@ bool CBilgeDispensorEvent::EnterRoomMsg(CEnterRoomMsg *msg) { return true; } +bool CBilgeDispensorEvent::LeaveRoomMsg(CLeaveRoomMsg *msg) { + _value1 = -1; + return true; +} + +bool CBilgeDispensorEvent::FrameMsg(CFrameMsg *msg) { + if (_value1 >= 0 && (_value1 & 0xffff) == 0x4000) { + int volume = 20 + getRandomNumber(30); + int val3 = getRandomNumber(20) - 10; + + if (getRandomNumber(2) == 0) { + playSound("b#18.wav", volume, val3); + } + } + + CAutoSoundEvent::FrameMsg(msg); + return true; +} + +bool CBilgeDispensorEvent::StatusChangeMsg(CStatusChangeMsg *msg) { + if (msg->_newStatus == 1) + _value1 = -1; + else if (msg->_newStatus == 2) + _value1 = 0; + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/messages/bilge_dispensor_event.h b/engines/titanic/messages/bilge_dispensor_event.h index 96ef92a54e..61d3116db4 100644 --- a/engines/titanic/messages/bilge_dispensor_event.h +++ b/engines/titanic/messages/bilge_dispensor_event.h @@ -29,9 +29,14 @@ namespace Titanic { class CBilgeDispensorEvent : public CAutoSoundEvent { + DECLARE_MESSAGE_MAP; bool EnterRoomMsg(CEnterRoomMsg *msg); + bool LeaveRoomMsg(CLeaveRoomMsg *msg); + bool FrameMsg(CFrameMsg *msg); + bool StatusChangeMsg(CStatusChangeMsg *msg); public: CLASSDEF; + CBilgeDispensorEvent() : CAutoSoundEvent() {} /** * Save the data for the class to file |