TITANIC: Renaming checks for player's first class suite

This commit is contained in:
Paul Gilbert 2017-01-16 11:50:42 -05:00
parent 3e2f084b41
commit efb43d9621
6 changed files with 23 additions and 15 deletions

View file

@ -98,9 +98,9 @@ bool CLight::TurnOn(CTurnOn *msg) {
bool CLight::StatusChangeMsg(CStatusChangeMsg *msg) { bool CLight::StatusChangeMsg(CStatusChangeMsg *msg) {
CPetControl *pet = getPetControl(); CPetControl *pet = getPetControl();
bool flag = pet ? pet->isRoom59706() : false; bool isYourStateroom = pet ? pet->isFirstClassSuite() : false;
if (_eyePresent && flag) { if (_eyePresent && isYourStateroom) {
petDisplayMessage(1, LIGHT_IS_LOOSE); petDisplayMessage(1, LIGHT_IS_LOOSE);
playSound("z#144.wav", 70); playSound("z#144.wav", 70);
} else { } else {
@ -113,9 +113,9 @@ bool CLight::StatusChangeMsg(CStatusChangeMsg *msg) {
bool CLight::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { bool CLight::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
CPetControl *pet = getPetControl(); CPetControl *pet = getPetControl();
bool flag = pet ? pet->isRoom59706() : false; bool isYourStateroom = pet ? pet->isFirstClassSuite() : false;
if (_eyePresent && flag) { if (_eyePresent && isYourStateroom) {
petDisplayMessage(1, LIGHT_IS_LOOSE); petDisplayMessage(1, LIGHT_IS_LOOSE);
playSound("z#144.wav", 70); playSound("z#144.wav", 70);
} else { } else {
@ -141,8 +141,8 @@ bool CLight::EnterRoomMsg(CEnterRoomMsg *msg) {
CLightsMsg lightsMsg(true, true, true, true); CLightsMsg lightsMsg(true, true, true, true);
lightsMsg.execute("1stClassState", CLight::_type, MSGFLAG_SCAN); lightsMsg.execute("1stClassState", CLight::_type, MSGFLAG_SCAN);
bool flag = pet ? pet->isRoom59706() : false; bool isYourStateroom = pet ? pet->isFirstClassSuite() : false;
if (flag) if (isYourStateroom)
CTelevision::_turnOn = true; CTelevision::_turnOn = true;
} }

View file

@ -144,7 +144,7 @@ bool CLightSwitch::EnterRoomMsg(CEnterRoomMsg *msg) {
_flag = true; _flag = true;
CPetControl *pet = getPetControl(); CPetControl *pet = getPetControl();
if (pet) if (pet)
_turnOnTV = pet->isRoom59706(); _turnOnTV = pet->isFirstClassSuite();
return true; return true;
} }

View file

@ -283,12 +283,12 @@ bool CTelevision::TurnOn(CTurnOn *msg) {
bool CTelevision::LightsMsg(CLightsMsg *msg) { bool CTelevision::LightsMsg(CLightsMsg *msg) {
CPetControl *pet = getPetControl(); CPetControl *pet = getPetControl();
bool flag = false; bool isYourStateroom = false;
if (pet) if (pet)
flag = pet->isRoom59706(); isYourStateroom = pet->isFirstClassSuite();
if (msg->_topLeft || !flag) if (msg->_topLeft || !isYourStateroom)
_turnOn = true; _turnOn = true;
return true; return true;

View file

@ -256,10 +256,10 @@ bool CBellBot::TimerMsg(CTimerMsg *msg) {
bool CBellBot::TrueTalkGetStateValueMsg(CTrueTalkGetStateValueMsg *msg) { bool CBellBot::TrueTalkGetStateValueMsg(CTrueTalkGetStateValueMsg *msg) {
CPetControl *pet = getPetControl(); CPetControl *pet = getPetControl();
bool flag = pet ? pet->isRoom59706() : false; bool isYourStateroom = pet ? pet->isFirstClassSuite() : false;
if (msg->_stateNum == 7) if (msg->_stateNum == 7)
msg->_stateVal = flag ? 1 : 0; msg->_stateVal = isYourStateroom ? 1 : 0;
return true; return true;
} }

View file

@ -561,8 +561,11 @@ public:
_rooms.setElevatorBroken(flag); _rooms.setElevatorBroken(flag);
} }
bool isRoom59706() const { /**
return CRoomFlags(getRoomFlags()).is59706(); * Returns true if the player is in their 1st class stateroom
*/
bool isFirstClassSuite() const {
return CRoomFlags(getRoomFlags()).isFirstClassSuite();
} }
/** /**

View file

@ -225,7 +225,12 @@ public:
bool not5() const { return getConditionally() != 5; } bool not5() const { return getConditionally() != 5; }
bool is59706() const { return _data == 0x59706; } /**
* Returns true if the player is in their 1st class stateroom
*/
bool isFirstClassSuite() const {
return _data == 0x59706;
}
}; };
} // End of namespace Titanic } // End of namespace Titanic