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/moves | |
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/moves')
-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 |
11 files changed, 222 insertions, 29 deletions
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(); |