diff options
author | Paul Gilbert | 2016-08-21 11:25:39 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-21 11:25:39 -0400 |
commit | 06008ae5caf0e086b0952c73bd5047e9c78cd921 (patch) | |
tree | eaa1ba835cf4c3dc38dd853600835bbc6e421fbf /engines/titanic | |
parent | c7ac12272a3b448c9d6118753a62426e42d2a62f (diff) | |
download | scummvm-rg350-06008ae5caf0e086b0952c73bd5047e9c78cd921.tar.gz scummvm-rg350-06008ae5caf0e086b0952c73bd5047e9c78cd921.tar.bz2 scummvm-rg350-06008ae5caf0e086b0952c73bd5047e9c78cd921.zip |
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/carry/eye.cpp | 103 | ||||
-rw-r--r-- | engines/titanic/carry/eye.h | 8 | ||||
-rw-r--r-- | engines/titanic/carry/head_piece.h | 2 | ||||
-rw-r--r-- | engines/titanic/game/fan.cpp | 87 | ||||
-rw-r--r-- | engines/titanic/game/fan.h | 8 | ||||
-rw-r--r-- | engines/titanic/game/television.h | 12 | ||||
-rw-r--r-- | engines/titanic/game/transport/lift.h | 2 | ||||
-rw-r--r-- | engines/titanic/moves/enter_sec_class_state.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/moves/exit_arboretum.cpp | 66 | ||||
-rw-r--r-- | engines/titanic/moves/exit_arboretum.h | 9 | ||||
-rw-r--r-- | engines/titanic/moves/exit_bridge.cpp | 20 | ||||
-rw-r--r-- | engines/titanic/moves/exit_bridge.h | 4 | ||||
-rw-r--r-- | engines/titanic/moves/exit_lift.cpp | 86 | ||||
-rw-r--r-- | engines/titanic/moves/exit_lift.h | 5 | ||||
-rw-r--r-- | engines/titanic/moves/exit_state_room.cpp | 11 | ||||
-rw-r--r-- | engines/titanic/moves/exit_state_room.h | 4 | ||||
-rw-r--r-- | engines/titanic/moves/exit_tiania.cpp | 38 | ||||
-rw-r--r-- | engines/titanic/moves/exit_tiania.h | 6 |
18 files changed, 428 insertions, 45 deletions
diff --git a/engines/titanic/carry/eye.cpp b/engines/titanic/carry/eye.cpp index 5de1789e54..400df2fdc8 100644 --- a/engines/titanic/carry/eye.cpp +++ b/engines/titanic/carry/eye.cpp @@ -21,22 +21,119 @@ */ #include "titanic/carry/eye.h" +#include "titanic/game/head_slot.h" +#include "titanic/pet_control/pet_control.h" +#include "titanic/game/transport/lift.h" +#include "titanic/game/television.h" namespace Titanic { -CEye::CEye() : CHeadPiece(), _eyeNum(0) { +BEGIN_MESSAGE_MAP(CEye, CHeadPiece) + ON_MESSAGE(UseWithOtherMsg) + ON_MESSAGE(UseWithCharMsg) + ON_MESSAGE(ActMsg) + ON_MESSAGE(PETGainedObjectMsg) + ON_MESSAGE(PassOnDragStartMsg) +END_MESSAGE_MAP() + +CEye::CEye() : CHeadPiece(), _eyeFlag(false) { } void CEye::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_eyeNum, indent); + file->writeNumberLine(_eyeFlag, indent); CHeadPiece::save(file, indent); } void CEye::load(SimpleFile *file) { file->readNumber(); - _eyeNum = file->readNumber(); + _eyeFlag = file->readNumber(); CHeadPiece::load(file); } + +bool CEye::UseWithOtherMsg(CUseWithOtherMsg *msg) { + CHeadSlot *slot = dynamic_cast<CHeadSlot *>(msg->_other); + if (slot) { + petMoveToHiddenRoom(); + _flag = true; + CAddHeadPieceMsg headMsg(getName()); + + if (headMsg._value != "NULL") + headMsg.execute(isEquals("Eye1") ? "Eye1Slot" : "Eye2Slot"); + } else if (msg->_other->isEquals("LiftbotWithoutHead")) { + CPetControl *pet = getPetControl(); + if (!CLift::_v1 && pet->getRoomsElevatorNum() == 4) { + _eyeFlag = true; + setPosition(_origPos); + setVisible(false); + CActMsg actMsg1(getName()); + actMsg1.execute("GetLiftEye"); + + CActMsg actMsg2("AddWrongHead"); + actMsg2.execute("FaultyLiftbot"); + } + } else { + return CCarry::UseWithOtherMsg(msg); + } + + return true; +} + +bool CEye::UseWithCharMsg(CUseWithCharMsg *msg) { + CLift *lift = dynamic_cast<CLift *>(msg->_character); + if (lift && lift->getName() == "Well") { + CPetControl *pet = getPetControl(); + if (!CLift::_v1 && pet->getRoomsElevatorNum() == 4) { + _eyeFlag = true; + setPosition(_origPos); + setVisible(false); + + CActMsg actMsg1(getName()); + actMsg1.execute("GetLiftEye"); + CActMsg actMsg2("AddWrongHead"); + actMsg2.execute(msg->_character); + } + + return true; + } else { + return CHeadPiece::UseWithCharMsg(msg); + } +} + +bool CEye::ActMsg(CActMsg *msg) { + if (msg->_action == "BellbotGetLight") { + setVisible(true); + petAddToInventory(); + playSound("z#47.wav"); + + CActMsg actMsg("Eye Removed"); + actMsg.execute("1stClassState"); + } else { + _eyeFlag = false; + + CActMsg actMsg("LoseHead"); + actMsg.execute("FaultyLiftbot"); + } + + return true; +} + +bool CEye::PETGainedObjectMsg(CPETGainedObjectMsg *msg) { + if (isEquals("Eye1")) + CTelevision::_v5 = 0; + + return CHeadPiece::PETGainedObjectMsg(msg); +} + +bool CEye::PassOnDragStartMsg(CPassOnDragStartMsg *msg) { + setVisible(true); + if (_eyeFlag) + CTelevision::_v6 = 0; + else if (isEquals("Eye1")) + CTelevision::_v5 = 0; + + return CHeadPiece::PassOnDragStartMsg(msg); +} + } // End of namespace Titanic diff --git a/engines/titanic/carry/eye.h b/engines/titanic/carry/eye.h index 066a85609b..886bd39b84 100644 --- a/engines/titanic/carry/eye.h +++ b/engines/titanic/carry/eye.h @@ -28,8 +28,14 @@ namespace Titanic { class CEye : public CHeadPiece { + DECLARE_MESSAGE_MAP; + bool UseWithOtherMsg(CUseWithOtherMsg *msg); + bool UseWithCharMsg(CUseWithCharMsg *msg); + bool ActMsg(CActMsg *msg); + bool PETGainedObjectMsg(CPETGainedObjectMsg *msg); + bool PassOnDragStartMsg(CPassOnDragStartMsg *msg); private: - int _eyeNum; + bool _eyeFlag; public: CLASSDEF; CEye(); diff --git a/engines/titanic/carry/head_piece.h b/engines/titanic/carry/head_piece.h index a76496072b..367f781f0e 100644 --- a/engines/titanic/carry/head_piece.h +++ b/engines/titanic/carry/head_piece.h @@ -33,7 +33,7 @@ class CHeadPiece : public CCarry { bool SenseWorkingMsg(CSenseWorkingMsg *msg); bool PETGainedObjectMsg(CPETGainedObjectMsg *msg); bool MouseDragStartMsg(CMouseDragStartMsg *msg); -private: +protected: bool _flag; CString _string6; bool _field13C; diff --git a/engines/titanic/game/fan.cpp b/engines/titanic/game/fan.cpp index eabaf63568..3fdebbd3ef 100644 --- a/engines/titanic/game/fan.cpp +++ b/engines/titanic/game/fan.cpp @@ -24,9 +24,15 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CFan, CGameObject) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(StatusChangeMsg) + ON_MESSAGE(MovieEndMsg) +END_MESSAGE_MAP() + void CFan::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_value1, indent); + file->writeNumberLine(_state, indent); file->writeNumberLine(_value2, indent); CGameObject::save(file, indent); @@ -34,10 +40,87 @@ void CFan::save(SimpleFile *file, int indent) { void CFan::load(SimpleFile *file) { file->readNumber(); - _value1 = file->readNumber(); + _state = file->readNumber(); _value2 = file->readNumber(); CGameObject::load(file); } +bool CFan::EnterViewMsg(CEnterViewMsg *msg) { + switch (_state) { + case 0: + case 1: + loadFrame(0); + break; + case 2: + playMovie(24, 34, MOVIE_REPEAT); + break; + case 3: + playMovie(63, 65, MOVIE_REPEAT); + break; + } + + return true; +} + +bool CFan::StatusChangeMsg(CStatusChangeMsg *msg) { + if (msg->_newStatus >= -1 && msg->_newStatus < 3) { + int oldState = _state; + _state = msg->_newStatus; + switch (_state) { + case -1: + case 0: + if (oldState == 0) + loadFrame(0); + else if (oldState == 1) + playMovie(24, 34, MOVIE_STOP_PREVIOUS | MOVIE_NOTIFY_OBJECT); + else if (oldState == 2) { + playMovie(66, 79, MOVIE_STOP_PREVIOUS); + playMovie(24, 34, MOVIE_NOTIFY_OBJECT); + } + break; + + case 1: + if (oldState == 0) + playMovie(24, 34, MOVIE_REPEAT | MOVIE_STOP_PREVIOUS); + if (oldState == 2) + playMovie(66, 79, MOVIE_NOTIFY_OBJECT | MOVIE_STOP_PREVIOUS); + break; + + case 2: + if (oldState == 1) + playMovie(48, 62, MOVIE_NOTIFY_OBJECT | MOVIE_STOP_PREVIOUS); + break; + + default: + break; + } + } + + msg->execute("PromDeckFanNoises"); + return true; +} + +bool CFan::MovieEndMsg(CMovieEndMsg *msg) { + switch (_state) { + case -1: + case 0: + loadFrame(0); + break; + + case 1: + playMovie(24, 34, MOVIE_REPEAT); + break; + + case 2: + playMovie(63, 65, MOVIE_REPEAT); + break; + + default: + break; + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/fan.h b/engines/titanic/game/fan.h index 2c5a2410a8..9cffce8b68 100644 --- a/engines/titanic/game/fan.h +++ b/engines/titanic/game/fan.h @@ -28,11 +28,15 @@ namespace Titanic { class CFan : public CGameObject { + DECLARE_MESSAGE_MAP; + bool EnterViewMsg(CEnterViewMsg *msg); + bool StatusChangeMsg(CStatusChangeMsg *msg); + bool MovieEndMsg(CMovieEndMsg *msg); public: - int _value1, _value2; + int _state, _value2; public: CLASSDEF; - CFan() : CGameObject(), _value1(0), _value2(0) {} + CFan() : CGameObject(), _state(0), _value2(0) {} /** * Save the data for the class to file diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h index 6e6d9b23c2..2e8d469bde 100644 --- a/engines/titanic/game/television.h +++ b/engines/titanic/game/television.h @@ -45,18 +45,18 @@ class CTelevision : public CBackground { bool TurnOn(CTurnOn *msg); bool LightsMsg(CLightsMsg *msg); private: + int _fieldE0; + int _fieldE4; + bool _isOn; + int _fieldEC; + int _soundHandle; +public: static int _v1; static bool _turnOn; static int _v3; static int _v4; static int _v5; static int _v6; -private: - int _fieldE0; - int _fieldE4; - bool _isOn; - int _fieldEC; - int _soundHandle; public: CLASSDEF; CTelevision(); diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h index 4595f0fec2..763e545c31 100644 --- a/engines/titanic/game/transport/lift.h +++ b/engines/titanic/game/transport/lift.h @@ -31,7 +31,7 @@ namespace Titanic { class CLift : public CTransport { DECLARE_MESSAGE_MAP; bool EnterRoomMsg(CEnterRoomMsg *msg); -private: +public: static int _v1; static int _v2; static int _v3; diff --git a/engines/titanic/moves/enter_sec_class_state.cpp b/engines/titanic/moves/enter_sec_class_state.cpp index 406803ba4e..2a35621003 100644 --- a/engines/titanic/moves/enter_sec_class_state.cpp +++ b/engines/titanic/moves/enter_sec_class_state.cpp @@ -70,7 +70,7 @@ bool CEnterSecClassState::StatusChangeMsg(CStatusChangeMsg *msg) { _soundHandle = queueSound("b#31.wav", _soundHandle); } if (msg->_newStatus == 3) - msg->_newStatus == 2; + msg->_newStatus = 2; } else { changeView("SecClassLittleLift.Node 1.N"); if (msg->_newStatus == 1) { diff --git a/engines/titanic/moves/exit_arboretum.cpp b/engines/titanic/moves/exit_arboretum.cpp index d606510c6e..169adb87a5 100644 --- a/engines/titanic/moves/exit_arboretum.cpp +++ b/engines/titanic/moves/exit_arboretum.cpp @@ -21,29 +21,85 @@ */ #include "titanic/moves/exit_arboretum.h" +#include "titanic/titanic.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CExitArboretum, CMovePlayerTo) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(ChangeSeasonMsg) + ON_MESSAGE(TurnOn) + ON_MESSAGE(TurnOff) +END_MESSAGE_MAP() + CExitArboretum::CExitArboretum() : CMovePlayerTo(), - _fieldC8(0), _fieldCC(0), _fieldD0(1) { + _seasonNum(0), _fieldCC(0), _enabled(true) { } void CExitArboretum::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_fieldC8, indent); + file->writeNumberLine(_seasonNum, indent); file->writeNumberLine(_fieldCC, indent); - file->writeNumberLine(_fieldD0, indent); + file->writeNumberLine(_enabled, indent); CMovePlayerTo::save(file, indent); } void CExitArboretum::load(SimpleFile *file) { file->readNumber(); - _fieldC8 = file->readNumber(); + _seasonNum = file->readNumber(); _fieldCC = file->readNumber(); - _fieldD0 = file->readNumber(); + _enabled = file->readNumber(); CMovePlayerTo::load(file); } +bool CExitArboretum::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + if (_enabled) { + CActMsg actMsg; + if (_seasonNum == AUTUMN) { + switch (_fieldCC) { + case 0: + actMsg._action = "ExitLFrozen"; + break; + case 1: + actMsg._action = "ExitRFrozen"; + break; + default: + break; + } + } else { + switch (_fieldCC) { + case 0: + actMsg._action = "ExitLNormal"; + break; + case 1: + actMsg._action = "ExitRNormal"; + break; + default: + break; + } + } + + actMsg.execute("ArbGate"); + } + + return true; +} + +bool CExitArboretum::ChangeSeasonMsg(CChangeSeasonMsg *msg) { + _seasonNum = (_seasonNum + 1) % 4; + return true; +} + +bool CExitArboretum::TurnOn(CTurnOn *msg) { + _enabled = false; + return true; +} + +bool CExitArboretum::TurnOff(CTurnOff *msg) { + _enabled = true; + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/moves/exit_arboretum.h b/engines/titanic/moves/exit_arboretum.h index f6ebf71515..b65eb92b17 100644 --- a/engines/titanic/moves/exit_arboretum.h +++ b/engines/titanic/moves/exit_arboretum.h @@ -28,10 +28,15 @@ namespace Titanic { class CExitArboretum : public CMovePlayerTo { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); + bool ChangeSeasonMsg(CChangeSeasonMsg *msg); + bool TurnOn(CTurnOn *msg); + bool TurnOff(CTurnOff *msg); protected: - int _fieldC8; + int _seasonNum; int _fieldCC; - int _fieldD0; + bool _enabled; public: CLASSDEF; CExitArboretum(); diff --git a/engines/titanic/moves/exit_bridge.cpp b/engines/titanic/moves/exit_bridge.cpp index b913911341..6b69b88004 100644 --- a/engines/titanic/moves/exit_bridge.cpp +++ b/engines/titanic/moves/exit_bridge.cpp @@ -24,21 +24,35 @@ namespace Titanic { -CExitBridge::CExitBridge() : CMovePlayerTo() { +BEGIN_MESSAGE_MAP(CExitBridge, CMovePlayerTo) + ON_MESSAGE(MouseButtonDownMsg) +END_MESSAGE_MAP() + +CExitBridge::CExitBridge() : CMovePlayerTo(), _viewName("Titania.Node 1.S") { } void CExitBridge::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeQuotedLine(_string1, indent); + file->writeQuotedLine(_viewName, indent); CMovePlayerTo::save(file, indent); } void CExitBridge::load(SimpleFile *file) { file->readNumber(); - _string1 = file->readString(); + _viewName = file->readString(); CMovePlayerTo::load(file); } +bool CExitBridge::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + if (getGameManager()) { + changeView(_destination); + playSound("a#53.wav"); + changeView(_viewName); + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/moves/exit_bridge.h b/engines/titanic/moves/exit_bridge.h index 4ab29524db..6d8ba01c91 100644 --- a/engines/titanic/moves/exit_bridge.h +++ b/engines/titanic/moves/exit_bridge.h @@ -28,8 +28,10 @@ namespace Titanic { class CExitBridge : public CMovePlayerTo { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); private: - CString _string1; + CString _viewName; public: CLASSDEF; CExitBridge(); diff --git a/engines/titanic/moves/exit_lift.cpp b/engines/titanic/moves/exit_lift.cpp index a264be883d..de9a3117af 100644 --- a/engines/titanic/moves/exit_lift.cpp +++ b/engines/titanic/moves/exit_lift.cpp @@ -21,19 +21,101 @@ */ #include "titanic/moves/exit_lift.h" +#include "titanic/pet_control/pet_control.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CExitLift, CGameObject) + ON_MESSAGE(MouseButtonDownMsg) +END_MESSAGE_MAP() + +CExitLift::CExitLift() : CGameObject(), _viewName("NULL") { +} + void CExitLift::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeQuotedLine(_value, indent); + file->writeQuotedLine(_viewName, indent); CGameObject::save(file, indent); } void CExitLift::load(SimpleFile *file) { file->readNumber(); - _value = file->readString(); + _viewName = file->readString(); CGameObject::load(file); } +bool CExitLift::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + CPetControl *pet = getPetControl(); + int floorNum = pet->getRoomsFloorNum();//ebx + int elevNum = pet->getRoomsElevatorNum(); //eax + + if (floorNum == 39) { + switch (elevNum) { + case 1: + _viewName = "BottomOfWell.Node 5.SE"; + break; + case 3: + _viewName = "BottomOfWell.Node 1.NW"; + break; + default: + break; + } + } else if (floorNum > 27) { + switch (elevNum) { + case 1: + case 2: + _viewName = "SgtLobby.Node 1.N"; + break; + default: + break; + } + } else if (floorNum > 19) { + switch (elevNum) { + case 0: + case 2: + _viewName = "2ndClassLobby.Node 8.N"; + break; + case 1: + case 3: + _viewName = "2ndClassLobby.Node 1.N"; + break; + default: + break; + } + } else if (floorNum > 1) { + switch (elevNum) { + case 0: + case 2: + _viewName = "1stClassLobby.Node 1.W"; + break; + case 1: + case 3: + _viewName = "1stClassLobby.Node 1.E"; + break; + default: + break; + } + } else { + switch (elevNum) { + case 0: + _viewName = "TopOfWell.Node 6.E"; + break; + case 1: + _viewName = "TopOfWell.Node 6.W"; + break; + case 2: + _viewName = "TopOfWell.Node 10.W"; + break; + case 3: + _viewName = "TopOfWell.Node 10.E"; + break; + default: + break; + } + } + + changeView(_viewName); + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/moves/exit_lift.h b/engines/titanic/moves/exit_lift.h index 04dabfaf13..93d760c35a 100644 --- a/engines/titanic/moves/exit_lift.h +++ b/engines/titanic/moves/exit_lift.h @@ -28,10 +28,13 @@ namespace Titanic { class CExitLift : public CGameObject { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); public: - CString _value; + CString _viewName; public: CLASSDEF; + CExitLift(); /** * Save the data for the class to file diff --git a/engines/titanic/moves/exit_state_room.cpp b/engines/titanic/moves/exit_state_room.cpp index 1c78a69ac2..f0b0534c12 100644 --- a/engines/titanic/moves/exit_state_room.cpp +++ b/engines/titanic/moves/exit_state_room.cpp @@ -24,7 +24,11 @@ namespace Titanic { -CExitStateRoom::CExitStateRoom() : CMovePlayerTo(), _fieldC8(0) { +BEGIN_MESSAGE_MAP(CExitStateRoom, CMovePlayerTo) + ON_MESSAGE(MouseButtonDownMsg) +END_MESSAGE_MAP() + +CExitStateRoom::CExitStateRoom() : CMovePlayerTo() { } void CExitStateRoom::save(SimpleFile *file, int indent) { @@ -37,4 +41,9 @@ void CExitStateRoom::load(SimpleFile *file) { CMovePlayerTo::load(file); } +bool CExitStateRoom::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + changeView(_destination); + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/moves/exit_state_room.h b/engines/titanic/moves/exit_state_room.h index c0f9737817..19322ced7f 100644 --- a/engines/titanic/moves/exit_state_room.h +++ b/engines/titanic/moves/exit_state_room.h @@ -28,8 +28,8 @@ namespace Titanic { class CExitStateRoom : public CMovePlayerTo { -protected: - int _fieldC8; + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); public: CLASSDEF; CExitStateRoom(); diff --git a/engines/titanic/moves/exit_tiania.cpp b/engines/titanic/moves/exit_tiania.cpp index 6cb2422b1f..fb0f149ba9 100644 --- a/engines/titanic/moves/exit_tiania.cpp +++ b/engines/titanic/moves/exit_tiania.cpp @@ -24,16 +24,20 @@ namespace Titanic { -CExitTiania::CExitTiania() : CMovePlayerTo(), _fieldC8(0), - _string1("NULL"), _string2("NULL"), _string3("NULL") { +BEGIN_MESSAGE_MAP(CExitTiania, CMovePlayerTo) + ON_MESSAGE(MouseButtonDownMsg) +END_MESSAGE_MAP() + +CExitTiania::CExitTiania() : CMovePlayerTo(), _fieldC8(0) { + _viewNames[0] = _viewNames[1] = _viewNames[2] = "NULL"; } void CExitTiania::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeNumberLine(_fieldC8, indent); - file->writeQuotedLine(_string1, indent); - file->writeQuotedLine(_string2, indent); - file->writeQuotedLine(_string3, indent); + file->writeQuotedLine(_viewNames[0], indent); + file->writeQuotedLine(_viewNames[1], indent); + file->writeQuotedLine(_viewNames[2], indent); CMovePlayerTo::save(file, indent); } @@ -41,11 +45,29 @@ void CExitTiania::save(SimpleFile *file, int indent) { void CExitTiania::load(SimpleFile *file) { file->readNumber(); _fieldC8 = file->readNumber(); - _string1 = file->readString(); - _string2 = file->readString(); - _string3 = file->readString(); + _viewNames[0] = file->readString(); + _viewNames[1] = file->readString(); + _viewNames[2] = file->readString(); CMovePlayerTo::load(file); } +bool CExitTiania::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + if (getPassengerClass() == 4) { + petDisplayMessage(1, "For mysterious and unknowable reasons, " + "this transport is temporarily out of order."); + } else { + lockMouse(); + for (int idx = 0; idx < 3; ++idx) + changeView(_viewNames[idx]); + changeView("Titania.Node 16.N"); + changeView("Dome.Node 4.N"); + changeView("Dome.Node 3.N"); + changeView("Dome.Node 3.S"); + unlockMouse(); + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/moves/exit_tiania.h b/engines/titanic/moves/exit_tiania.h index c2b7772ce7..b911e102d1 100644 --- a/engines/titanic/moves/exit_tiania.h +++ b/engines/titanic/moves/exit_tiania.h @@ -28,11 +28,11 @@ namespace Titanic { class CExitTiania : public CMovePlayerTo { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); private: int _fieldC8; - CString _string1; - CString _string2; - CString _string3; + CString _viewNames[3]; public: CLASSDEF; CExitTiania(); |