aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/throw_tv_down_well.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-28 14:39:59 -0400
committerPaul Gilbert2016-08-28 14:39:59 -0400
commit4933b59e8e039ae346f650c044e5fe0ba6310ead (patch)
tree805e33ea6fa6109e42d8f8b267ed2b6e5c2a00e2 /engines/titanic/game/throw_tv_down_well.cpp
parent1760fb3e0d25704685e9b44f0792536da962082d (diff)
downloadscummvm-rg350-4933b59e8e039ae346f650c044e5fe0ba6310ead.tar.gz
scummvm-rg350-4933b59e8e039ae346f650c044e5fe0ba6310ead.tar.bz2
scummvm-rg350-4933b59e8e039ae346f650c044e5fe0ba6310ead.zip
TITANIC: Implemented remaining game classes
Diffstat (limited to 'engines/titanic/game/throw_tv_down_well.cpp')
-rw-r--r--engines/titanic/game/throw_tv_down_well.cpp63
1 files changed, 59 insertions, 4 deletions
diff --git a/engines/titanic/game/throw_tv_down_well.cpp b/engines/titanic/game/throw_tv_down_well.cpp
index c8a9fc7c9e..9de028cbde 100644
--- a/engines/titanic/game/throw_tv_down_well.cpp
+++ b/engines/titanic/game/throw_tv_down_well.cpp
@@ -24,18 +24,73 @@
namespace Titanic {
+BEGIN_MESSAGE_MAP(CThrowTVDownWell, CGameObject)
+ ON_MESSAGE(ActMsg)
+ ON_MESSAGE(EnterViewMsg)
+ ON_MESSAGE(MovieEndMsg)
+ ON_MESSAGE(TimerMsg)
+ ON_MESSAGE(MovieFrameMsg)
+END_MESSAGE_MAP()
+
void CThrowTVDownWell::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeQuotedLine(_strValue, indent);
- file->writeNumberLine(_numValue, indent);
+ file->writeQuotedLine(_viewName, indent);
+ file->writeNumberLine(_flag, indent);
CGameObject::save(file, indent);
}
void CThrowTVDownWell::load(SimpleFile *file) {
file->readNumber();
- _strValue = file->readString();
- _numValue = file->readNumber();
+ _viewName = file->readString();
+ _flag = file->readNumber();
CGameObject::load(file);
}
+bool CThrowTVDownWell::ActMsg(CActMsg *msg) {
+ if (msg->_action == "ThrowTVDownWell" && !_flag) {
+ CString viewName = getFullViewName();
+ lockMouse();
+ addTimer(1, 8000, 0);
+
+ CActMsg actMsg("ThrownTVDownWell");
+ actMsg.execute("BOWTelevisionMonitor");
+ }
+
+ return true;
+}
+
+bool CThrowTVDownWell::EnterViewMsg(CEnterViewMsg *msg) {
+ playMovie(MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
+ movieEvent(49);
+ return true;
+}
+
+bool CThrowTVDownWell::MovieEndMsg(CMovieEndMsg *msg) {
+ sleep(2000);
+ changeView("ParrotLobby.Node 11.N");
+ playSound("z#471.wav");
+ addTimer(2, 7000, 0);
+ return true;
+}
+
+bool CThrowTVDownWell::TimerMsg(CTimerMsg *msg) {
+ if (msg->_actionVal == 1) {
+ changeView("ParrotLobby.Node 10.N");
+ } else if (msg->_actionVal == 2) {
+ playSound("z#468.wav", 50);
+ sleep(1500);
+ changeView(_viewName);
+ _viewName = "NULL";
+ unlockMouse();
+ playSound("z#47.wav");
+ }
+
+ return true;
+}
+
+bool CThrowTVDownWell::MovieFrameMsg(CMovieFrameMsg *msg) {
+ playSound("z#470.wav");
+ return true;
+}
+
} // End of namespace Titanic