aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/throw_tv_down_well.cpp
diff options
context:
space:
mode:
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