aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/sgt/basin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/game/sgt/basin.cpp')
-rw-r--r--engines/titanic/game/sgt/basin.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/engines/titanic/game/sgt/basin.cpp b/engines/titanic/game/sgt/basin.cpp
index 1eb1d161c9..3f85edc4ca 100644
--- a/engines/titanic/game/sgt/basin.cpp
+++ b/engines/titanic/game/sgt/basin.cpp
@@ -24,6 +24,12 @@
namespace Titanic {
+BEGIN_MESSAGE_MAP(CBasin, CSGTStateRoom)
+ ON_MESSAGE(TurnOn)
+ ON_MESSAGE(TurnOff)
+ ON_MESSAGE(MovieEndMsg)
+END_MESSAGE_MAP()
+
void CBasin::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CSGTStateRoom::save(file, indent);
@@ -34,4 +40,39 @@ void CBasin::load(SimpleFile *file) {
CSGTStateRoom::load(file);
}
+bool CBasin::TurnOn(CTurnOn *msg) {
+ if (_statics->_v10 == "Open" && _statics->_v11 == "Closed"
+ || _statics->_v2 == "Closed") {
+ setVisible(true);
+ _statics->_v11 = "Open";
+ _fieldE0 = 0;
+ _startFrame = 0;
+ _endFrame = 6;
+ playMovie(0, 6, MOVIE_GAMESTATE);
+ playSound("b#13.wav");
+ }
+
+ return true;
+}
+
+bool CBasin::TurnOff(CTurnOff *msg) {
+ if (_statics->_v11 == "Open") {
+ _statics->_v11 = "Closed";
+ _fieldE0 = 1;
+ _startFrame = 8;
+ _endFrame = 14;
+ playMovie(8, 14, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
+ playSound("b#13.wav");
+ }
+
+ return true;
+}
+
+bool CBasin::MovieEndMsg(CMovieEndMsg *msg) {
+ if (_statics->_v11 == "Closed")
+ setVisible(false);
+
+ return true;
+}
+
} // End of namespace Titanic