aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/messages/bilge_dispensor_event.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-14 22:19:06 -0400
committerPaul Gilbert2016-08-14 22:19:06 -0400
commit440f0927570d30ab61fb640df22394296efbb265 (patch)
tree5ae2fa3d16228a79b995c8ebb21e5e20b4ff040d /engines/titanic/messages/bilge_dispensor_event.cpp
parent3dfd4ba296f407cec7533afee941be42ca5f61f1 (diff)
downloadscummvm-rg350-440f0927570d30ab61fb640df22394296efbb265.tar.gz
scummvm-rg350-440f0927570d30ab61fb640df22394296efbb265.tar.bz2
scummvm-rg350-440f0927570d30ab61fb640df22394296efbb265.zip
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic/messages/bilge_dispensor_event.cpp')
-rw-r--r--engines/titanic/messages/bilge_dispensor_event.cpp35
1 files changed, 35 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