aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/moves
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-20 15:11:07 -0400
committerPaul Gilbert2016-08-20 15:11:07 -0400
commit04242118ca7bca31aa9659ffceaf80702bc90fb8 (patch)
tree05b9afd600f97f1d20c2774121512bd4e8f990a4 /engines/titanic/moves
parent1dc8ae58e40c08e1e50cfe8c892b3dac27abdafd (diff)
downloadscummvm-rg350-04242118ca7bca31aa9659ffceaf80702bc90fb8.tar.gz
scummvm-rg350-04242118ca7bca31aa9659ffceaf80702bc90fb8.tar.bz2
scummvm-rg350-04242118ca7bca31aa9659ffceaf80702bc90fb8.zip
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic/moves')
-rw-r--r--engines/titanic/moves/enter_exit_first_class_state.cpp40
-rw-r--r--engines/titanic/moves/enter_exit_first_class_state.h16
-rw-r--r--engines/titanic/moves/enter_exit_mini_lift.cpp35
-rw-r--r--engines/titanic/moves/enter_exit_mini_lift.h7
-rw-r--r--engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp51
-rw-r--r--engines/titanic/moves/enter_exit_sec_class_mini_lift.h13
-rw-r--r--engines/titanic/moves/enter_exit_view.cpp49
-rw-r--r--engines/titanic/moves/enter_exit_view.h14
-rw-r--r--engines/titanic/moves/enter_sec_class_state.cpp73
-rw-r--r--engines/titanic/moves/enter_sec_class_state.h8
10 files changed, 244 insertions, 62 deletions
diff --git a/engines/titanic/moves/enter_exit_first_class_state.cpp b/engines/titanic/moves/enter_exit_first_class_state.cpp
index 0e2c6c0b6c..34e9984aa7 100644
--- a/engines/titanic/moves/enter_exit_first_class_state.cpp
+++ b/engines/titanic/moves/enter_exit_first_class_state.cpp
@@ -24,26 +24,44 @@
namespace Titanic {
-CString *CEnterExitFirstClassState::_v1;
-
-void CEnterExitFirstClassState::init() {
- _v1 = new CString();
-}
-
-void CEnterExitFirstClassState::deinit() {
- delete _v1;
-}
+BEGIN_MESSAGE_MAP(CEnterExitFirstClassState, CGameObject)
+ ON_MESSAGE(MouseButtonDownMsg)
+END_MESSAGE_MAP()
void CEnterExitFirstClassState::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeQuotedLine(*_v1, indent);
+ file->writeQuotedLine(_viewName, indent);
CGameObject::save(file, indent);
}
void CEnterExitFirstClassState::load(SimpleFile *file) {
file->readNumber();
- *_v1 = file->readString();
+ _viewName = file->readString();
CGameObject::load(file);
}
+bool CEnterExitFirstClassState::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ switch (getPassengerClass()) {
+ case 1:
+ if (compareRoomNameTo("1stClassLobby")) {
+ _viewName = getRoomNodeName() + ".E";
+ changeView(_viewName);
+ } else if (compareRoomNameTo("1stClassState")) {
+ changeView(_viewName);
+ }
+ break;
+
+ case 2:
+ petDisplayMessage(1, "This room is reserved for the exclusive use of first class passengeres."
+ " That does not currently include you");
+ break;
+
+ default:
+ petDisplayMessage("No losers.");
+ break;
+ }
+
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_exit_first_class_state.h b/engines/titanic/moves/enter_exit_first_class_state.h
index a08de07711..fe63e553de 100644
--- a/engines/titanic/moves/enter_exit_first_class_state.h
+++ b/engines/titanic/moves/enter_exit_first_class_state.h
@@ -28,18 +28,10 @@
namespace Titanic {
class CEnterExitFirstClassState : public CGameObject {
-public:
- static CString *_v1;
-
- /**
- * Initialize static data
- */
- static void init();
-
- /**
- * De-initialize static data
- */
- static void deinit();
+ DECLARE_MESSAGE_MAP;
+ bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+private:
+ CString _viewName;
public:
CLASSDEF;
diff --git a/engines/titanic/moves/enter_exit_mini_lift.cpp b/engines/titanic/moves/enter_exit_mini_lift.cpp
index eb56bdb3bd..e626d70a9e 100644
--- a/engines/titanic/moves/enter_exit_mini_lift.cpp
+++ b/engines/titanic/moves/enter_exit_mini_lift.cpp
@@ -21,23 +21,52 @@
*/
#include "titanic/moves/enter_exit_mini_lift.h"
+#include "titanic/pet_control/pet_control.h"
namespace Titanic {
+BEGIN_MESSAGE_MAP(CEnterExitMiniLift, CSGTNavigation)
+ ON_MESSAGE(MouseButtonDownMsg)
+ ON_MESSAGE(EnterViewMsg)
+END_MESSAGE_MAP()
+
void CEnterExitMiniLift::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_fieldBC, indent);
- file->writeNumberLine(_fieldC0, indent);
-
+ file->writeNumberLine(_destRoomNum, indent);
+
CSGTNavigation::save(file, indent);
}
void CEnterExitMiniLift::load(SimpleFile *file) {
file->readNumber();
_fieldBC = file->readNumber();
- _fieldC0 = file->readNumber();
+ _destRoomNum = file->readNumber();
CSGTNavigation::load(file);
}
+bool CEnterExitMiniLift::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ if (compareRoomNameTo("SgtLobby")) {
+ _statics->_destView = getRoomNodeName() + ".S";
+ _statics->_destRoom = "SgtLobby";
+ changeView("SGTLittleLift.Node 1.E");
+
+ CPetControl *pet = getPetControl();
+ if (pet)
+ pet->setRoomsRoomNum(_destRoomNum);
+ } else if (compareRoomNameTo("SGTLittleLift")) {
+ if (_statics->_changeViewFlag) {
+ changeView(_statics->_destView);
+ }
+ }
+
+ return true;
+}
+
+bool CEnterExitMiniLift::EnterViewMsg(CEnterViewMsg *msg) {
+ _cursorId = _statics->_changeViewFlag ? CURSOR_MOVE_FORWARD : CURSOR_INVALID;
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_exit_mini_lift.h b/engines/titanic/moves/enter_exit_mini_lift.h
index 26f3dba8d4..f2671a89b2 100644
--- a/engines/titanic/moves/enter_exit_mini_lift.h
+++ b/engines/titanic/moves/enter_exit_mini_lift.h
@@ -28,12 +28,15 @@
namespace Titanic {
class CEnterExitMiniLift : public CSGTNavigation {
+ DECLARE_MESSAGE_MAP;
+ bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+ bool EnterViewMsg(CEnterViewMsg *msg);
private:
int _fieldBC;
- int _fieldC0;
+ int _destRoomNum;
public:
CLASSDEF;
- CEnterExitMiniLift() : CSGTNavigation(), _fieldBC(0), _fieldC0(1) {}
+ CEnterExitMiniLift() : CSGTNavigation(), _fieldBC(0), _destRoomNum(1) {}
/**
* Save the data for the class to file
diff --git a/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp b/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
index b571a255c5..c7e16ef84e 100644
--- a/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
+++ b/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
@@ -21,9 +21,15 @@
*/
#include "titanic/moves/enter_exit_sec_class_mini_lift.h"
+#include "titanic/pet_control/pet_control.h"
namespace Titanic {
+BEGIN_MESSAGE_MAP(CEnterExitSecClassMiniLift, CGameObject)
+ ON_MESSAGE(MouseButtonDownMsg)
+ ON_MESSAGE(StatusChangeMsg)
+END_MESSAGE_MAP()
+
CEnterExitSecClassMiniLiftStatics *CEnterExitSecClassMiniLift::_statics;
void CEnterExitSecClassMiniLift::init() {
@@ -36,20 +42,53 @@ void CEnterExitSecClassMiniLift::deinit() {
void CEnterExitSecClassMiniLift::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeQuotedLine(_statics->_v1, indent);
- file->writeNumberLine(_statics->_v2, indent);
- file->writeNumberLine(_value, indent);
+ file->writeQuotedLine(_statics->_viewName, indent);
+ file->writeNumberLine(_statics->_state, indent);
+ file->writeNumberLine(_roomNum, indent);
CGameObject::save(file, indent);
}
void CEnterExitSecClassMiniLift::load(SimpleFile *file) {
file->readNumber();
- _statics->_v1 = file->readString();
- _statics->_v2 = file->readNumber();
- _value = file->readNumber();
+ _statics->_viewName = file->readString();
+ _statics->_state = file->readNumber();
+ _roomNum = file->readNumber();
CGameObject::load(file);
}
+bool CEnterExitSecClassMiniLift::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ if (compareRoomNameTo("2ndClassLobby")) {
+ _statics->_viewName = getRoomNodeName() + ".W";
+ changeView("SecClassLittleLift.Node 1.E");
+ _statics->_state = 1;
+
+ CPetControl *pet = getPetControl();
+ if (pet) {
+ pet->setRoomsRoomNum(_roomNum);
+ pet->setRooms1CC(1);
+ }
+ } else if (compareRoomNameTo("SecClassLittleLift")) {
+ if (_statics->_state == 1) {
+ changeView(_statics->_viewName);
+ }
+ }
+
+ return true;
+}
+
+bool CEnterExitSecClassMiniLift::StatusChangeMsg(CStatusChangeMsg *msg) {
+ _statics->_state = msg->_newStatus;
+ if (msg->_newStatus == 3)
+ _statics->_state = 2;
+
+ CPetControl *pet = getPetControl();
+ if (pet)
+ pet->setRooms1CC(_statics->_state);
+
+ _cursorId = _statics->_state == 1 ? CURSOR_MOVE_FORWARD : CURSOR_INVALID;
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_exit_sec_class_mini_lift.h b/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
index 10c7edca7d..839d2c04fa 100644
--- a/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
+++ b/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
@@ -28,19 +28,22 @@
namespace Titanic {
struct CEnterExitSecClassMiniLiftStatics {
- CString _v1;
- int _v2;
+ CString _viewName;
+ int _state;
- CEnterExitSecClassMiniLiftStatics() : _v2(1) {}
+ CEnterExitSecClassMiniLiftStatics() : _state(1) {}
};
class CEnterExitSecClassMiniLift : public CGameObject {
+ DECLARE_MESSAGE_MAP;
+ bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+ bool StatusChangeMsg(CStatusChangeMsg *msg);
private:
static CEnterExitSecClassMiniLiftStatics *_statics;
- int _value;
+ int _roomNum;
public:
CLASSDEF;
- CEnterExitSecClassMiniLift() : CGameObject(), _value(0) {}
+ CEnterExitSecClassMiniLift() : CGameObject(), _roomNum(0) {}
static void init();
static void deinit();
diff --git a/engines/titanic/moves/enter_exit_view.cpp b/engines/titanic/moves/enter_exit_view.cpp
index 825156acce..6778ebb52a 100644
--- a/engines/titanic/moves/enter_exit_view.cpp
+++ b/engines/titanic/moves/enter_exit_view.cpp
@@ -24,30 +24,55 @@
namespace Titanic {
-CEnterExitView::CEnterExitView() : CGameObject(), _fieldBC(0),
- _fieldC0(0), _fieldC4(0), _fieldC8(0), _fieldCC(0) {
+BEGIN_MESSAGE_MAP(CEnterExitView, CGameObject)
+ ON_MESSAGE(EnterViewMsg)
+ ON_MESSAGE(LeaveViewMsg)
+ ON_MESSAGE(MovieEndMsg)
+END_MESSAGE_MAP()
+
+CEnterExitView::CEnterExitView() : CGameObject(), _leaveEndFrame(0),
+ _leaveStartFrame(0), _enterEndFrame(0), _enterStartFrame(0),
+ _visibleAfterMovie(true) {
}
void CEnterExitView::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_fieldBC, indent);
- file->writeNumberLine(_fieldC0, indent);
- file->writeNumberLine(_fieldC4, indent);
- file->writeNumberLine(_fieldC8, indent);
- file->writeNumberLine(_fieldCC, indent);
+ file->writeNumberLine(_leaveEndFrame, indent);
+ file->writeNumberLine(_leaveStartFrame, indent);
+ file->writeNumberLine(_enterEndFrame, indent);
+ file->writeNumberLine(_enterStartFrame, indent);
+ file->writeNumberLine(_visibleAfterMovie, indent);
CGameObject::save(file, indent);
}
void CEnterExitView::load(SimpleFile *file) {
file->readNumber();
- _fieldBC = file->readNumber();
- _fieldC0 = file->readNumber();
- _fieldC4 = file->readNumber();
- _fieldC8 = file->readNumber();
- _fieldCC = file->readNumber();
+ _leaveEndFrame = file->readNumber();
+ _leaveStartFrame = file->readNumber();
+ _enterEndFrame = file->readNumber();
+ _enterStartFrame = file->readNumber();
+ _visibleAfterMovie = file->readNumber();
CGameObject::load(file);
}
+bool CEnterExitView::EnterViewMsg(CEnterViewMsg *msg) {
+ setVisible(true);
+ playMovie(_enterStartFrame, _enterEndFrame, MOVIE_NOTIFY_OBJECT);
+ return true;
+}
+
+bool CEnterExitView::LeaveViewMsg(CLeaveViewMsg *msg) {
+ setVisible(true);
+ playMovie(_leaveStartFrame, _leaveEndFrame, MOVIE_NOTIFY_OBJECT);
+ return true;
+}
+
+bool CEnterExitView::MovieEndMsg(CMovieEndMsg *msg) {
+ if (!_visibleAfterMovie)
+ setVisible(false);
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_exit_view.h b/engines/titanic/moves/enter_exit_view.h
index 4a3f1a967b..67aa5643ff 100644
--- a/engines/titanic/moves/enter_exit_view.h
+++ b/engines/titanic/moves/enter_exit_view.h
@@ -28,12 +28,16 @@
namespace Titanic {
class CEnterExitView : public CGameObject {
+ DECLARE_MESSAGE_MAP;
+ bool EnterViewMsg(CEnterViewMsg *msg);
+ bool LeaveViewMsg(CLeaveViewMsg *msg);
+ bool MovieEndMsg(CMovieEndMsg *msg);
public:
- int _fieldBC;
- int _fieldC0;
- int _fieldC4;
- int _fieldC8;
- int _fieldCC;
+ int _leaveEndFrame;
+ int _leaveStartFrame;
+ int _enterEndFrame;
+ int _enterStartFrame;
+ bool _visibleAfterMovie;
public:
CLASSDEF;
CEnterExitView();
diff --git a/engines/titanic/moves/enter_sec_class_state.cpp b/engines/titanic/moves/enter_sec_class_state.cpp
index dced724de7..406803ba4e 100644
--- a/engines/titanic/moves/enter_sec_class_state.cpp
+++ b/engines/titanic/moves/enter_sec_class_state.cpp
@@ -21,23 +21,88 @@
*/
#include "titanic/moves/enter_sec_class_state.h"
+#include "titanic/pet_control/pet_control.h"
namespace Titanic {
+BEGIN_MESSAGE_MAP(CEnterSecClassState, CGameObject)
+ ON_MESSAGE(MouseButtonDownMsg)
+ ON_MESSAGE(StatusChangeMsg)
+ ON_MESSAGE(MovieEndMsg)
+END_MESSAGE_MAP()
+
void CEnterSecClassState::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_value1, indent);
- file->writeNumberLine(_value2, indent);
+ file->writeNumberLine(_mode, indent);
+ file->writeNumberLine(_soundHandle, indent);
CGameObject::save(file, indent);
}
void CEnterSecClassState::load(SimpleFile *file) {
file->readNumber();
- _value1 = file->readNumber();
- _value2 = file->readNumber();
+ _mode = file->readNumber();
+ _soundHandle = file->readNumber();
CGameObject::load(file);
}
+bool CEnterSecClassState::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ if (getPassengerClass() > 2) {
+ playSound("b#105.wav");
+ petDisplayMessage(1, "Passengers of your class are not permitted to enter this area.");
+ } else if (!compareRoomNameTo("SecClassLittleLift") || _mode == 2) {
+ CActMsg actMsg(getFullViewName().deleteRight(3) + ".S");
+ actMsg.execute("SecClassRoomLeaver");
+ changeView("secClassState.Node 01.N");
+ }
+
+ return true;
+}
+
+bool CEnterSecClassState::StatusChangeMsg(CStatusChangeMsg *msg) {
+ stopSound(_soundHandle);
+
+ if (msg->_newStatus == _mode || (_mode == 2 && msg->_newStatus == 3)) {
+ if (_mode == 2) {
+ _soundHandle = queueSound("b#36.wav", _soundHandle);
+ } else {
+ _soundHandle = queueSound("b#31.wav", _soundHandle);
+ }
+ if (msg->_newStatus == 3)
+ msg->_newStatus == 2;
+ } else {
+ changeView("SecClassLittleLift.Node 1.N");
+ if (msg->_newStatus == 1) {
+ _soundHandle = queueSound("b#32.wav", _soundHandle);
+ } else if (msg->_newStatus == 2) {
+ _soundHandle = queueSound("b#25.wav", _soundHandle);
+ } else if (msg->_newStatus == 3) {
+ _soundHandle = queueSound("b#33.wav", _soundHandle);
+ msg->_newStatus = 2;
+ }
+ }
+
+ if (msg->_newStatus != 3) {
+ if (msg->_newStatus == 2 && _mode == 1)
+ playMovie(0, 10, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
+ else if (msg->_newStatus == 1)
+ playMovie(11, 21, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
+ }
+
+ _cursorId = msg->_newStatus == 2 ? CURSOR_MOVE_FORWARD : CURSOR_INVALID;
+ _mode = msg->_newStatus;
+ return true;
+}
+
+bool CEnterSecClassState::MovieEndMsg(CMovieEndMsg *msg) {
+ CPetControl *pet = getPetControl();
+ if (pet) {
+ pet->setRooms1CC(_mode);
+ pet->resetRoomsHighlight();
+ }
+
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_sec_class_state.h b/engines/titanic/moves/enter_sec_class_state.h
index c3e3cabf20..2b1bcaa401 100644
--- a/engines/titanic/moves/enter_sec_class_state.h
+++ b/engines/titanic/moves/enter_sec_class_state.h
@@ -28,11 +28,15 @@
namespace Titanic {
class CEnterSecClassState : public CGameObject {
+ DECLARE_MESSAGE_MAP;
+ bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+ bool StatusChangeMsg(CStatusChangeMsg *msg);
+ bool MovieEndMsg(CMovieEndMsg *msg);
public:
- int _value1, _value2;
+ int _mode, _soundHandle;
public:
CLASSDEF;
- CEnterSecClassState() : CGameObject(), _value1(0), _value2(0) {}
+ CEnterSecClassState() : CGameObject(), _mode(1), _soundHandle(0) {}
/**
* Save the data for the class to file