aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/titanic/npcs/bilge_succubus.cpp7
-rw-r--r--engines/titanic/npcs/succubus.cpp20
-rw-r--r--engines/titanic/npcs/succubus.h2
-rw-r--r--engines/titanic/pet_control/pet_control.cpp6
-rw-r--r--engines/titanic/pet_control/pet_control.h9
-rw-r--r--engines/titanic/room_flags.cpp42
-rw-r--r--engines/titanic/room_flags.h4
7 files changed, 45 insertions, 45 deletions
diff --git a/engines/titanic/npcs/bilge_succubus.cpp b/engines/titanic/npcs/bilge_succubus.cpp
index 53cf963de7..01d80beb44 100644
--- a/engines/titanic/npcs/bilge_succubus.cpp
+++ b/engines/titanic/npcs/bilge_succubus.cpp
@@ -116,14 +116,13 @@ bool CBilgeSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {
return true;
}
- _field19C = 0;
+ _sendLost = false;
_mailP = mailObject;
uint roomFlags = _roomFlags;
- if (!pet->testRooms5(roomFlags) ||
- getPassengerClass() > pet->getMailDest(roomFlags)) {
+ if (!pet->isSuccUBusDest(roomFlags) || pet->getMailDestClass(roomFlags) < getPassengerClass()) {
roomFlags = pet->getSpecialRoomFlags("BilgeRoom");
- _field19C = 1;
+ _sendLost = true;
}
_isChicken = mailObject->getName() == "Chicken";
diff --git a/engines/titanic/npcs/succubus.cpp b/engines/titanic/npcs/succubus.cpp
index 2e92d5d541..637a04171e 100644
--- a/engines/titanic/npcs/succubus.cpp
+++ b/engines/titanic/npcs/succubus.cpp
@@ -82,7 +82,7 @@ CSuccUBus::CSuccUBus() : CTrueTalkNPC() {
_field184 = 15;
_field188 = 0;
_rect2 = Rect(0, 0, 240, 340);
- _field19C = 0;
+ _sendLost = false;
_soundHandle = -1;
_isChicken = false;
_isFeathers = false;
@@ -141,7 +141,7 @@ void CSuccUBus::save(SimpleFile *file, int indent) {
file->writeNumberLine(_rect2.top, indent);
file->writeNumberLine(_rect2.right, indent);
file->writeNumberLine(_rect2.bottom, indent);
- file->writeNumberLine(_field19C, indent);
+ file->writeNumberLine(_sendLost, indent);
file->writeNumberLine(_soundHandle, indent);
file->writeNumberLine(_isChicken, indent);
file->writeNumberLine(_isFeathers, indent);
@@ -205,7 +205,7 @@ void CSuccUBus::load(SimpleFile *file) {
_rect2.top = file->readNumber();
_rect2.right = file->readNumber();
_rect2.bottom = file->readNumber();
- _field19C = file->readNumber();
+ _sendLost = file->readNumber();
_soundHandle = file->readNumber();
_isChicken = file->readNumber();
_isFeathers = file->readNumber();
@@ -397,14 +397,12 @@ bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {
petDisplayMessage(2, NOTHING_IN_SUCCUBUS_TRAY);
} else {
- _field19C = 0;
+ _sendLost = false;
CRoomFlags roomFlags = _roomFlags;
- if (!pet->testRooms5(roomFlags) || getPassengerClass() > 0) {
+ if (!pet->isSuccUBusDest(roomFlags) || pet->getMailDestClass(roomFlags) < getPassengerClass()) {
roomFlags = pet->getSpecialRoomFlags("BilgeRoom");
- _field19C = 1;
- } else {
- pet->getMailDest(roomFlags);
+ _sendLost = true;
}
_isFeathers = mailObject->getName() == "Feathers";
@@ -415,7 +413,7 @@ bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {
incTransitions();
if (_isFeathers) {
- _field19C = 0;
+ _sendLost = false;
removeMail(destRoomFlags, roomFlags);
pet->phonographAction("");
@@ -593,9 +591,9 @@ bool CSuccUBus::MovieEndMsg(CMovieEndMsg *msg) {
startTalking(this, 230022, findView());
} else if (_field158 == 2) {
startTalking(this, 230017, findView());
- } else if (_field19C) {
+ } else if (_sendLost) {
startTalking(this, 230019, findView());
- _field19C = 0;
+ _sendLost = false;
} else if (_isChicken) {
startTalking(this, 230018, findView());
_isChicken = false;
diff --git a/engines/titanic/npcs/succubus.h b/engines/titanic/npcs/succubus.h
index 07a3cd991e..d81ae84e67 100644
--- a/engines/titanic/npcs/succubus.h
+++ b/engines/titanic/npcs/succubus.h
@@ -84,7 +84,7 @@ protected:
int _field190;
int _field194;
int _field198;
- int _field19C;
+ bool _sendLost;
int _soundHandle;
bool _isChicken;
bool _isFeathers;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index b7fece7569..55b2ecc24b 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -699,11 +699,11 @@ void CPetControl::resetDials0() {
_conversations.resetDials0();
}
-int CPetControl::getMailDest(const CRoomFlags &roomFlags) const {
+PassengerClass CPetControl::getMailDestClass(const CRoomFlags &roomFlags) const {
if (!roomFlags.isSuccUBusRoomFlags())
- return (int)roomFlags.getPassengerClassNum();
+ return roomFlags.getPassengerClassNum();
- return roomFlags.getSuccUBusNum(roomFlags.getSuccUBusRoomName());
+ return roomFlags.getSuccUBusClass(roomFlags.getSuccUBusRoomName());
}
void CPetControl::starsSetButtons(int val1, int val2) {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 0a8b6295be..a63c29d6b3 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -522,11 +522,14 @@ public:
}
/**
- * Get mail destination given the specified flags
+ * Get the passenger class of the specified room flags
*/
- int getMailDest(const CRoomFlags &roomFlags) const;
+ PassengerClass getMailDestClass(const CRoomFlags &roomFlags) const;
- bool testRooms5(uint roomFlags) {
+ /**
+ * Returns whether the given room flags specify a location with a SuccUBus
+ */
+ bool isSuccUBusDest(uint roomFlags) {
return CRoomFlags(roomFlags).not5();
}
diff --git a/engines/titanic/room_flags.cpp b/engines/titanic/room_flags.cpp
index 25c604ba93..4bd186238f 100644
--- a/engines/titanic/room_flags.cpp
+++ b/engines/titanic/room_flags.cpp
@@ -41,7 +41,7 @@ struct TransportFlagsEntry {
struct SuccUBusFlagsEntry {
const char *const _roomName;
uint _roomFlags;
- uint _succubusNum;
+ PassengerClass _classNum;
};
#define TRANSPORT_ROOMS_SIZE 6
@@ -56,23 +56,23 @@ const TransportFlagsEntry TRANSPORT_ROOMS[TRANSPORT_ROOMS_SIZE] = {
#define SUCCUBUS_ROOMS_SIZE 17
const SuccUBusFlagsEntry SUCCUBUS_ROOMS[SUCCUBUS_ROOMS_SIZE] = {
- { "ParrotLobby", 0x1D0D9, 3 },
- { "SculptureChamber", 0x465FB, 2 },
- { "Bar", 0x0B3D97, 2 },
- { "EmbLobby", 0x0CC971, 3 },
- { "MoonEmbLobby", 0x0CC971, 3 },
- { "MusicRoom", 0x0F34DB, 2 },
- { "MusicRoomLobby", 0x0F34DB, 2 },
- { "Titania", 0x8A397, 3 },
- { "BottomOfWell", 0x59FAD, 3 },
- { "Arboretum", 0x4D6AF, 1 },
- { "PromenadeDeck", 0x79C45, 2 },
- { "1stClassRestaurant", 0x896B9, 1 },
- { "CreatorsChamber", 0x2F86D, 2 },
- { "CreatorsChamberOn", 0x2F86D, 2 },
- { "BilgeRoom", 0x3D94B, 3 },
- { "BilgeRoomWith", 0x3D94B, 3 },
- { "Bridge", 0x39FCB, 3 }
+ { "ParrotLobby", 0x1D0D9, THIRD_CLASS },
+ { "SculptureChamber", 0x465FB, SECOND_CLASS },
+ { "Bar", 0x0B3D97, SECOND_CLASS },
+ { "EmbLobby", 0x0CC971, THIRD_CLASS },
+ { "MoonEmbLobby", 0x0CC971, THIRD_CLASS },
+ { "MusicRoom", 0x0F34DB, SECOND_CLASS },
+ { "MusicRoomLobby", 0x0F34DB, SECOND_CLASS },
+ { "Titania", 0x8A397, THIRD_CLASS },
+ { "BottomOfWell", 0x59FAD, THIRD_CLASS },
+ { "Arboretum", 0x4D6AF, FIRST_CLASS },
+ { "PromenadeDeck", 0x79C45, SECOND_CLASS },
+ { "1stClassRestaurant", 0x896B9, FIRST_CLASS },
+ { "CreatorsChamber", 0x2F86D, SECOND_CLASS },
+ { "CreatorsChamberOn", 0x2F86D, SECOND_CLASS },
+ { "BilgeRoom", 0x3D94B, THIRD_CLASS },
+ { "BilgeRoomWith", 0x3D94B, THIRD_CLASS },
+ { "Bridge", 0x39FCB, THIRD_CLASS }
};
int CRoomFlags::getConditionally() const {
@@ -355,13 +355,13 @@ uint CRoomFlags::getSpecialRoomFlags(const CString &roomName) {
return 0;
}
-uint CRoomFlags::getSuccUBusNum(const CString &roomName) const {
+PassengerClass CRoomFlags::getSuccUBusClass(const CString &roomName) const {
for (int idx = 0; idx < SUCCUBUS_ROOMS_SIZE; ++idx) {
if (roomName == SUCCUBUS_ROOMS[idx]._roomName)
- return SUCCUBUS_ROOMS[idx]._succubusNum;
+ return SUCCUBUS_ROOMS[idx]._classNum;
}
- return 0;
+ return NO_CLASS;
}
CString CRoomFlags::getSuccUBusRoomName() const {
diff --git a/engines/titanic/room_flags.h b/engines/titanic/room_flags.h
index 8e86bf707e..e2fb91015a 100644
--- a/engines/titanic/room_flags.h
+++ b/engines/titanic/room_flags.h
@@ -209,9 +209,9 @@ public:
void setRandomLocation(PassengerClass classNum, bool flag);
/**
- * Gets the succubus number associated with a given room
+ * Gets the passenger class for a succubus associated with a given room
*/
- uint getSuccUBusNum(const CString &roomName) const;
+ PassengerClass getSuccUBusClass(const CString &roomName) const;
/**
* Gets the succubus room name associated with the current room flags