diff options
author | Paul Gilbert | 2016-08-19 23:41:19 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-19 23:41:19 -0400 |
commit | 3c2c82fcd593e7b358f359de69070b6dd0e92150 (patch) | |
tree | 53251f5642b35626c606633cfe7baa1ce87b1fea /engines/titanic | |
parent | 449d8a02e05754e889e13ff721ff2c0cb995c486 (diff) | |
download | scummvm-rg350-3c2c82fcd593e7b358f359de69070b6dd0e92150.tar.gz scummvm-rg350-3c2c82fcd593e7b358f359de69070b6dd0e92150.tar.bz2 scummvm-rg350-3c2c82fcd593e7b358f359de69070b6dd0e92150.zip |
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic')
21 files changed, 368 insertions, 36 deletions
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index 0749bde5f2..fca635388e 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -52,7 +52,6 @@ class CGameObject : public CNamedItem { friend class OSMovie; DECLARE_MESSAGE_MAP; private: - static CCreditText *_credits; static int _soundHandles[4]; private: /** @@ -71,6 +70,8 @@ private: */ bool clipRect(const Rect &rect1, Rect &rect2) const; protected: + static CCreditText *_credits; +protected: double _field34; double _field38; double _field3C; diff --git a/engines/titanic/game/elevator_action_area.cpp b/engines/titanic/game/elevator_action_area.cpp index 1cbff8d64d..d59c9b9e7a 100644 --- a/engines/titanic/game/elevator_action_area.cpp +++ b/engines/titanic/game/elevator_action_area.cpp @@ -21,9 +21,14 @@ */ #include "titanic/game/elevator_action_area.h" +#include "titanic/core/room_item.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CElevatorActionArea, CGameObject) + ON_MESSAGE(MouseButtonDownMsg) +END_MESSAGE_MAP() + void CElevatorActionArea::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeNumberLine(_value, indent); @@ -36,4 +41,10 @@ void CElevatorActionArea::load(SimpleFile *file) { CGameObject::load(file); } +bool CElevatorActionArea::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + CServiceElevatorMsg elevMsg(_value); + elevMsg.execute(findRoom()->findByName("Service Elevator Entity")); + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/elevator_action_area.h b/engines/titanic/game/elevator_action_area.h index 6c756fb95f..75d3a06d29 100644 --- a/engines/titanic/game/elevator_action_area.h +++ b/engines/titanic/game/elevator_action_area.h @@ -28,6 +28,8 @@ namespace Titanic { class CElevatorActionArea : public CGameObject { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); public: int _value; public: diff --git a/engines/titanic/game/emma_control.cpp b/engines/titanic/game/emma_control.cpp index 814cb44d79..e3ba7cc42c 100644 --- a/engines/titanic/game/emma_control.cpp +++ b/engines/titanic/game/emma_control.cpp @@ -21,27 +21,46 @@ */ #include "titanic/game/emma_control.h" +#include "titanic/core/room_item.h" +#include "titanic/sound/auto_music_player.h" namespace Titanic { -int CEmmaControl::_v1; +BEGIN_MESSAGE_MAP(CEmmaControl, CBackground) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(StatusChangeMsg) +END_MESSAGE_MAP() void CEmmaControl::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_v1, indent); - file->writeQuotedLine(_wavFile1, indent); - file->writeQuotedLine(_wavFile2, indent); + file->writeNumberLine(_flag, indent); + file->writeQuotedLine(_hiddenSoundName, indent); + file->writeQuotedLine(_visibleSoundName, indent); CBackground::save(file, indent); } void CEmmaControl::load(SimpleFile *file) { file->readNumber(); - _v1 = file->readNumber(); - _wavFile1 = file->readString(); - _wavFile2 = file->readString(); + _flag = file->readNumber(); + _hiddenSoundName = file->readString(); + _visibleSoundName = file->readString(); CBackground::load(file); } +bool CEmmaControl::EnterViewMsg(CEnterViewMsg *msg) { + setVisible(_flag); + return true; +} + +bool CEmmaControl::StatusChangeMsg(CStatusChangeMsg *msg) { + _flag = !_flag; + setVisible(_flag); + CChangeMusicMsg changeMsg(_flag ? _visibleSoundName : _hiddenSoundName, 0); + changeMsg.execute(findRoom(), CAutoMusicPlayer::_type, + MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_CLASS_DEF); + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/emma_control.h b/engines/titanic/game/emma_control.h index 721660f61e..e4032ca1a5 100644 --- a/engines/titanic/game/emma_control.h +++ b/engines/titanic/game/emma_control.h @@ -28,13 +28,18 @@ namespace Titanic { class CEmmaControl : public CBackground { + DECLARE_MESSAGE_MAP; + bool EnterViewMsg(CEnterViewMsg *msg); + bool StatusChangeMsg(CStatusChangeMsg *msg); private: - static int _v1; + bool _flag; - CString _wavFile1, _wavFile2; + CString _hiddenSoundName; + CString _visibleSoundName; public: CLASSDEF; - CEmmaControl() : CBackground(), _wavFile1("b#39.wav"), _wavFile2("b#38.wav") {} + CEmmaControl() : CBackground(), _flag(false), + _hiddenSoundName("b#39.wav"), _visibleSoundName("b#38.wav") {} /** * Save the data for the class to file diff --git a/engines/titanic/game/empty_nut_bowl.cpp b/engines/titanic/game/empty_nut_bowl.cpp index ae9cb35e4d..adee2589f6 100644 --- a/engines/titanic/game/empty_nut_bowl.cpp +++ b/engines/titanic/game/empty_nut_bowl.cpp @@ -21,19 +21,58 @@ */ #include "titanic/game/empty_nut_bowl.h" +#include "titanic/core/room_item.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CEmptyNutBowl, CGameObject) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(ReplaceBowlAndNutsMsg) + ON_MESSAGE(NutPuzzleMsg) + ON_MESSAGE(MouseDragStartMsg) +END_MESSAGE_MAP() + void CEmptyNutBowl::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_value, indent); + file->writeNumberLine(_flag, indent); CGameObject::save(file, indent); } void CEmptyNutBowl::load(SimpleFile *file) { file->readNumber(); - _value = file->readNumber(); + _flag = file->readNumber(); CGameObject::load(file); } +bool CEmptyNutBowl::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + if (_flag) { + CNutPuzzleMsg nutMsg("UnlockBowl"); + nutMsg.execute(getRoom(), nullptr, MSGFLAG_SCAN); + _flag = false; + } + + return true; +} + +bool CEmptyNutBowl::ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg) { + setVisible(false); + _flag = true; + return true; +} + +bool CEmptyNutBowl::NutPuzzleMsg(CNutPuzzleMsg *msg) { + if (msg->_value == "NutsGone") + setVisible(true); + return true; +} + +bool CEmptyNutBowl::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (!_flag) { + msg->execute("Ear1"); + setVisible(false); + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/empty_nut_bowl.h b/engines/titanic/game/empty_nut_bowl.h index 112e2c6075..d67e75b0aa 100644 --- a/engines/titanic/game/empty_nut_bowl.h +++ b/engines/titanic/game/empty_nut_bowl.h @@ -28,11 +28,16 @@ namespace Titanic { class CEmptyNutBowl : public CGameObject { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); + bool ReplaceBowlAndNutsMsg(CReplaceBowlAndNutsMsg *msg); + bool NutPuzzleMsg(CNutPuzzleMsg *msg); + bool MouseDragStartMsg(CMouseDragStartMsg *msg); public: - int _value; + bool _flag; public: CLASSDEF; - CEmptyNutBowl() : CGameObject(), _value(1) {} + CEmptyNutBowl() : CGameObject(), _flag(true) {} /** * Save the data for the class to file diff --git a/engines/titanic/game/end_credit_text.cpp b/engines/titanic/game/end_credit_text.cpp index 6e0c21bbe9..4eee13d3fb 100644 --- a/engines/titanic/game/end_credit_text.cpp +++ b/engines/titanic/game/end_credit_text.cpp @@ -24,16 +24,49 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CEndCreditText, CGameObject) + ON_MESSAGE(ActMsg) + ON_MESSAGE(FrameMsg) + ON_MESSAGE(TimerMsg) +END_MESSAGE_MAP() + void CEndCreditText::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_value, indent); + file->writeNumberLine(_flag, indent); CGameObject::save(file, indent); } void CEndCreditText::load(SimpleFile *file) { file->readNumber(); - _value = file->readNumber(); + _flag = file->readNumber(); CGameObject::load(file); } +bool CEndCreditText::ActMsg(CActMsg *msg) { + playGlobalSound("z#41.wav", -1, false, false, 0); + createCredits(); + _flag = true; + return true; +} + +bool CEndCreditText::FrameMsg(CFrameMsg *msg) { + if (_flag) { + if (_credits) { + makeDirty(); + } else { + addTimer(5000); + _flag = false; + } + } + + return true; +} + +bool CEndCreditText::TimerMsg(CTimerMsg *msg) { + setGlobalSoundVolume(-4, 2, -1); + sleep(1000); + quitGame(); + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/end_credit_text.h b/engines/titanic/game/end_credit_text.h index 54c6c7ff73..a0e0078837 100644 --- a/engines/titanic/game/end_credit_text.h +++ b/engines/titanic/game/end_credit_text.h @@ -28,11 +28,15 @@ namespace Titanic { class CEndCreditText : public CGameObject { + DECLARE_MESSAGE_MAP; + bool ActMsg(CActMsg *msg); + bool FrameMsg(CFrameMsg *msg); + bool TimerMsg(CTimerMsg *msg); private: - int _value; + bool _flag; public: CLASSDEF; - CEndCreditText() : CGameObject(), _value(0) {} + CEndCreditText() : CGameObject(), _flag(false) {} /** * Save the data for the class to file diff --git a/engines/titanic/game/end_credits.cpp b/engines/titanic/game/end_credits.cpp index 61640b92ad..f613e5a008 100644 --- a/engines/titanic/game/end_credits.cpp +++ b/engines/titanic/game/end_credits.cpp @@ -24,16 +24,41 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CEndCredits, CGameObject) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(FrameMsg) +END_MESSAGE_MAP() + void CEndCredits::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_value, indent); + file->writeNumberLine(_flag, indent); CGameObject::save(file, indent); } void CEndCredits::load(SimpleFile *file) { file->readNumber(); - _value = file->readNumber(); + _flag = file->readNumber(); CGameObject::load(file); } +bool CEndCredits::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + if (_flag) { + deinit(); + stopGlobalSound(true, -1); + _flag = false; + } else { + loadSound("z#41.wav"); + playGlobalSound("z#41.wav", -1, false, false, 0); + _flag = true; + } + + return true; +} + +bool CEndCredits::FrameMsg(CFrameMsg *msg) { + if (_flag) + makeDirty(); + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/end_credits.h b/engines/titanic/game/end_credits.h index d160bc94e8..257c5b64a7 100644 --- a/engines/titanic/game/end_credits.h +++ b/engines/titanic/game/end_credits.h @@ -28,11 +28,14 @@ namespace Titanic { class CEndCredits : public CGameObject { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); + bool FrameMsg(CFrameMsg *msg); public: - int _value; + bool _flag; public: CLASSDEF; - CEndCredits() : CGameObject(), _value(0) {} + CEndCredits() : CGameObject(), _flag(false) {} /** * Save the data for the class to file diff --git a/engines/titanic/game/end_explode_ship.cpp b/engines/titanic/game/end_explode_ship.cpp index f7ac36503f..10c80f5863 100644 --- a/engines/titanic/game/end_explode_ship.cpp +++ b/engines/titanic/game/end_explode_ship.cpp @@ -24,6 +24,13 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CEndExplodeShip, CGameObject) + ON_MESSAGE(ActMsg) + ON_MESSAGE(TimerMsg) + ON_MESSAGE(MovieEndMsg) + ON_MESSAGE(MovieFrameMsg) +END_MESSAGE_MAP() + void CEndExplodeShip::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeNumberLine(_value1, indent); @@ -40,4 +47,61 @@ void CEndExplodeShip::load(SimpleFile *file) { CGameObject::load(file); } +bool CEndExplodeShip::ActMsg(CActMsg *msg) { + if (msg->_action == "Arm Bomb") { + _value1 = 1; + } else if (msg->_action == "Disarm Bomb") { + _value1 = 0; + } else if (msg->_action == "TakeOff") { + loadSound("a#31.wav"); + loadSound("a#14.wav"); + playGlobalSound("a#13.wav", -1, true, true, 0); + addTimer(1, 10212, 0); + } + + return true; +} + +bool CEndExplodeShip::TimerMsg(CTimerMsg *msg) { + if (msg->_actionVal == 1) { + setVisible(true); + playMovie(0, 449, 0); + movieEvent(58); + playMovie(516, _value1 ? 550 : 551, MOVIE_NOTIFY_OBJECT); + } + + if (msg->_actionVal == 3) { + setGlobalSoundVolume(-4, 2, -1); + CActMsg actMsg(_value1 ? "ExplodeCredits" : "Credits"); + actMsg.execute("EndGameCredits"); + } + + if (msg->_action == "Room") { + playMovie(550, 583, MOVIE_NOTIFY_OBJECT); + movieEvent(551); + } + + return true; +} + +bool CEndExplodeShip::MovieEndMsg(CMovieEndMsg *msg) { + if (getMovieFrame() == 550) { + playSound("z#399.wav"); + startAnimTimer("Boom", 4200, 0); + } else { + addTimer(3, 8000, 0); + } + + return true; +} + +bool CEndExplodeShip::MovieFrameMsg(CMovieFrameMsg *msg) { + if (getMovieFrame() == 58) + playSound("a#31.wav", 70); + else if (getMovieFrame() == 551) + playSound("a#14.wav"); + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/end_explode_ship.h b/engines/titanic/game/end_explode_ship.h index b8159d3ca7..c48f822af8 100644 --- a/engines/titanic/game/end_explode_ship.h +++ b/engines/titanic/game/end_explode_ship.h @@ -28,6 +28,11 @@ namespace Titanic { class CEndExplodeShip : public CGameObject { + DECLARE_MESSAGE_MAP; + bool ActMsg(CActMsg *msg); + bool TimerMsg(CTimerMsg *msg); + bool MovieEndMsg(CMovieEndMsg *msg); + bool MovieFrameMsg(CMovieFrameMsg *msg); public: int _value1, _value2; public: diff --git a/engines/titanic/game/end_game_credits.cpp b/engines/titanic/game/end_game_credits.cpp index 2d1aa79b1d..4edcef0a17 100644 --- a/engines/titanic/game/end_game_credits.cpp +++ b/engines/titanic/game/end_game_credits.cpp @@ -24,23 +24,64 @@ namespace Titanic { -CEndGameCredits::CEndGameCredits() : CGameObject(), _fieldBC(0) { +BEGIN_MESSAGE_MAP(CEndGameCredits, CGameObject) + ON_MESSAGE(ActMsg) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(MovieEndMsg) + ON_MESSAGE(TimerMsg) +END_MESSAGE_MAP() + +CEndGameCredits::CEndGameCredits() : CGameObject(), _flag(0), + _frameRange(0, 28) { } void CEndGameCredits::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_fieldBC, indent); - file->writePoint(_pos1, indent); + file->writeNumberLine(_flag, indent); + file->writePoint(_frameRange, indent); CGameObject::save(file, indent); } void CEndGameCredits::load(SimpleFile *file) { file->readNumber(); - _fieldBC = file->readNumber(); - _pos1 = file->readPoint(); + _flag = file->readNumber(); + _frameRange = file->readPoint(); CGameObject::load(file); } +bool CEndGameCredits::ActMsg(CActMsg *msg) { + if (!_flag) { + if (msg->_action == "ExplodeCredits") + _frameRange = Point(0, 27); + if (msg->_action == "Credits") + _frameRange = Point(28, 46); + + changeView("TheEnd.Node 4.N"); + } + + return true; +} + +bool CEndGameCredits::EnterViewMsg(CEnterViewMsg *msg) { + playMovie(_frameRange.x, _frameRange.y, MOVIE_NOTIFY_OBJECT); + return true; +} + +bool CEndGameCredits::MovieEndMsg(CMovieEndMsg *msg) { + if (getMovieFrame() == 46) { + CVisibleMsg visibleMsg; + visibleMsg.execute("CreditsBackdrop"); + } + + return true; +} + +bool CEndGameCredits::TimerMsg(CTimerMsg *msg) { + CActMsg actMsg; + actMsg.execute("EndCreditsText"); + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/end_game_credits.h b/engines/titanic/game/end_game_credits.h index 5962950737..13a92423f6 100644 --- a/engines/titanic/game/end_game_credits.h +++ b/engines/titanic/game/end_game_credits.h @@ -28,9 +28,14 @@ namespace Titanic { class CEndGameCredits : public CGameObject { + DECLARE_MESSAGE_MAP; + bool ActMsg(CActMsg *msg); + bool EnterViewMsg(CEnterViewMsg *msg); + bool MovieEndMsg(CMovieEndMsg *msg); + bool TimerMsg(CTimerMsg *msg); private: - int _fieldBC; - Point _pos1; + bool _flag; + Point _frameRange; public: CLASSDEF; CEndGameCredits(); diff --git a/engines/titanic/game/end_sequence_control.cpp b/engines/titanic/game/end_sequence_control.cpp index d32b3d1713..033a7752a3 100644 --- a/engines/titanic/game/end_sequence_control.cpp +++ b/engines/titanic/game/end_sequence_control.cpp @@ -24,6 +24,13 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CEndSequenceControl, CGameObject) + ON_MESSAGE(TimerMsg) + ON_MESSAGE(MovieEndMsg) + ON_MESSAGE(EnterRoomMsg) + ON_MESSAGE(EnterViewMsg) +END_MESSAGE_MAP() + void CEndSequenceControl::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); CGameObject::save(file, indent); @@ -34,8 +41,43 @@ void CEndSequenceControl::load(SimpleFile *file) { CGameObject::load(file); } +bool CEndSequenceControl::TimerMsg(CTimerMsg *msg) { + switch (msg->_actionVal) { + case 1: + changeView("TheEnd.Node 2.N"); + break; + case 2: { + playSound("ShipFlyingMusic.wav"); + CActMsg actMsg("TakeOff"); + actMsg.execute("EndExplodeShip"); + break; + } + + default: + break; + } + + return true; +} + +bool CEndSequenceControl::MovieEndMsg(CMovieEndMsg *msg) { + setGlobalSoundVolume(-4, 2, -1); + changeView("TheEnd.Node 3.N"); + addTimer(2, 1000, 0); + return true; +} + bool CEndSequenceControl::EnterRoomMsg(CEnterRoomMsg *msg) { - warning("TODO: CEndSequenceControl::handleEvent"); + petHide(); + disableMouse(); + addTimer(1, 1000, 0); + playGlobalSound("a#15.wav", -1, true, true, 0); + return true; +} + +bool CEndSequenceControl::EnterViewMsg(CEnterViewMsg *msg) { + movieSetAudioTiming(true); + playMovie(MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); return true; } diff --git a/engines/titanic/game/end_sequence_control.h b/engines/titanic/game/end_sequence_control.h index 35e9a934e1..223f25186d 100644 --- a/engines/titanic/game/end_sequence_control.h +++ b/engines/titanic/game/end_sequence_control.h @@ -29,7 +29,11 @@ namespace Titanic { class CEndSequenceControl : public CGameObject { + DECLARE_MESSAGE_MAP; + bool TimerMsg(CTimerMsg *msg); + bool MovieEndMsg(CMovieEndMsg *msg); bool EnterRoomMsg(CEnterRoomMsg *msg); + bool EnterViewMsg(CEnterViewMsg *msg); public: CLASSDEF; diff --git a/engines/titanic/moves/enter_bomb_room.cpp b/engines/titanic/moves/enter_bomb_room.cpp index 55b838d026..9956c669ee 100644 --- a/engines/titanic/moves/enter_bomb_room.cpp +++ b/engines/titanic/moves/enter_bomb_room.cpp @@ -24,6 +24,10 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CEnterBombRoom, CMovePlayerTo) + ON_MESSAGE(MouseButtonDownMsg) +END_MESSAGE_MAP() + CEnterBombRoom::CEnterBombRoom() : CMovePlayerTo(), _fieldC8(0) { } @@ -37,4 +41,10 @@ void CEnterBombRoom::load(SimpleFile *file) { CMovePlayerTo::load(file); } +bool CEnterBombRoom::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + changeView("Titania.Node 2.SE"); + changeView(_destination); + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/moves/enter_bomb_room.h b/engines/titanic/moves/enter_bomb_room.h index 7fe8287eae..ccdd51f37b 100644 --- a/engines/titanic/moves/enter_bomb_room.h +++ b/engines/titanic/moves/enter_bomb_room.h @@ -28,6 +28,8 @@ namespace Titanic { class CEnterBombRoom : public CMovePlayerTo { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); protected: int _fieldC8; public: diff --git a/engines/titanic/moves/enter_bridge.cpp b/engines/titanic/moves/enter_bridge.cpp index 2600ee699f..fb44fe2e02 100644 --- a/engines/titanic/moves/enter_bridge.cpp +++ b/engines/titanic/moves/enter_bridge.cpp @@ -24,20 +24,31 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CEnterBridge, CGameObject) + ON_MESSAGE(EnterRoomMsg) +END_MESSAGE_MAP() + void CEnterBridge::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_value, indent); + file->writeNumberLine(_flag, indent); CGameObject::save(file, indent); } void CEnterBridge::load(SimpleFile *file) { file->readNumber(); - _value = file->readNumber(); + _flag = file->readNumber(); CGameObject::load(file); } bool CEnterBridge::EnterRoomMsg(CEnterRoomMsg *msg) { - warning("CEnterBridge::handlEvent"); + if (_flag) { + CActMsg actMsg("Disable"); + actMsg.execute("ShipAnnouncements"); + + setState1C(false); + _flag = false; + } + return true; } diff --git a/engines/titanic/moves/enter_bridge.h b/engines/titanic/moves/enter_bridge.h index a2410a6f1f..837c0e9f7d 100644 --- a/engines/titanic/moves/enter_bridge.h +++ b/engines/titanic/moves/enter_bridge.h @@ -29,12 +29,13 @@ namespace Titanic { class CEnterBridge : public CGameObject { + DECLARE_MESSAGE_MAP; bool EnterRoomMsg(CEnterRoomMsg *msg); private: - int _value; + bool _flag; public: CLASSDEF; - CEnterBridge() : CGameObject(), _value(1) {} + CEnterBridge() : CGameObject(), _flag(true) {} /** * Save the data for the class to file |