diff options
Diffstat (limited to 'engines/titanic/game')
-rw-r--r-- | engines/titanic/game/chicken_cooler.cpp | 25 | ||||
-rw-r--r-- | engines/titanic/game/chicken_cooler.h | 6 | ||||
-rw-r--r-- | engines/titanic/game/chicken_dispensor.cpp | 17 | ||||
-rw-r--r-- | engines/titanic/game/sauce_dispensor.cpp | 25 | ||||
-rw-r--r-- | engines/titanic/game/sauce_dispensor.h | 4 |
5 files changed, 32 insertions, 45 deletions
diff --git a/engines/titanic/game/chicken_cooler.cpp b/engines/titanic/game/chicken_cooler.cpp index d10405de38..514ab07de8 100644 --- a/engines/titanic/game/chicken_cooler.cpp +++ b/engines/titanic/game/chicken_cooler.cpp @@ -32,29 +32,26 @@ END_MESSAGE_MAP() void CChickenCooler::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_fieldBC, indent); - file->writeNumberLine(_fieldC0, indent); + file->writeNumberLine(_newTemperature, indent); + file->writeNumberLine(_triggerOnRoomEntry, indent); CGameObject::save(file, indent); } void CChickenCooler::load(SimpleFile *file) { file->readNumber(); - _fieldBC = file->readNumber(); - _fieldC0 = file->readNumber(); + _newTemperature = file->readNumber(); + _triggerOnRoomEntry = file->readNumber(); CGameObject::load(file); } bool CChickenCooler::EnterRoomMsg(CEnterRoomMsg *msg) { - if (_fieldC0) { + if (_triggerOnRoomEntry) { CGameObject *obj = getMailManFirstObject(); - if (obj) { - // WORKAROUND: Redundant loop for chicken in originalhere - } else { - getNextMail(nullptr); - if (CChicken::_v1 > _fieldBC) - CChicken::_v1 = _fieldBC; + if (!obj) { + if (CChicken::_temperature > _newTemperature) + CChicken::_temperature = _newTemperature; } } @@ -62,15 +59,15 @@ bool CChickenCooler::EnterRoomMsg(CEnterRoomMsg *msg) { } bool CChickenCooler::EnterViewMsg(CEnterViewMsg *msg) { - if (!_fieldC0) { + if (!_triggerOnRoomEntry) { for (CGameObject *obj = getMailManFirstObject(); obj; obj = getNextMail(obj)) { if (obj->isEquals("Chicken")) return true; } - if (CChicken::_v1 > _fieldBC) - CChicken::_v1 = _fieldBC; + if (CChicken::_temperature > _newTemperature) + CChicken::_temperature = _newTemperature; } return true; diff --git a/engines/titanic/game/chicken_cooler.h b/engines/titanic/game/chicken_cooler.h index 54dba90686..e1ad7cb8fa 100644 --- a/engines/titanic/game/chicken_cooler.h +++ b/engines/titanic/game/chicken_cooler.h @@ -33,11 +33,11 @@ class CChickenCooler : public CGameObject { bool EnterRoomMsg(CEnterRoomMsg *msg); bool EnterViewMsg(CEnterViewMsg *msg); private: - int _fieldBC; - int _fieldC0; + int _newTemperature; + bool _triggerOnRoomEntry; public: CLASSDEF; - CChickenCooler() : CGameObject(), _fieldBC(0), _fieldC0(0) {} + CChickenCooler() : CGameObject(), _newTemperature(0), _triggerOnRoomEntry(false) {} /** * Save the data for the class to file diff --git a/engines/titanic/game/chicken_dispensor.cpp b/engines/titanic/game/chicken_dispensor.cpp index a1070c312a..dd87848456 100644 --- a/engines/titanic/game/chicken_dispensor.cpp +++ b/engines/titanic/game/chicken_dispensor.cpp @@ -77,28 +77,16 @@ bool CChickenDispensor::StatusChangeMsg(CStatusChangeMsg *msg) { } } - if (dispenseMode != DISPENSE_NONE) - _dispensed = true; - switch (dispenseMode) { case DISPENSE_NONE: petDisplayMessage(1, ONE_ALLOCATED_CHICKEN_PER_CUSTOMER); break; case DISPENSE_HOT: - setVisible(true); - if (_disabled) { - playMovie(0, 12, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); - playSound("z#400.wav"); - } else { - playMovie(12, 16, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); - _dispensed = true; - } - _dispenseMode = DISPENSE_NONE; - break; - case DISPENSE_COLD: + _dispensed = true; setVisible(true); + if (_disabled) { playMovie(0, 12, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); playSound("z#400.wav"); @@ -106,6 +94,7 @@ bool CChickenDispensor::StatusChangeMsg(CStatusChangeMsg *msg) { playMovie(12, 16, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); _dispensed = true; } + _dispenseMode = DISPENSE_NONE; break; default: diff --git a/engines/titanic/game/sauce_dispensor.cpp b/engines/titanic/game/sauce_dispensor.cpp index b58de99a62..7b395e5b11 100644 --- a/engines/titanic/game/sauce_dispensor.cpp +++ b/engines/titanic/game/sauce_dispensor.cpp @@ -36,14 +36,15 @@ BEGIN_MESSAGE_MAP(CSauceDispensor, CBackground) END_MESSAGE_MAP() CSauceDispensor::CSauceDispensor() : CBackground(), - _pouringCondiment(false), _fieldF0(0), _field104(0), _field108(0) { + _pouringCondiment(false), _starlingsDead(false), + _field104(0), _field108(0) { } void CSauceDispensor::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeQuotedLine(_string3, indent); + file->writeQuotedLine(_condimentName, indent); file->writeNumberLine(_pouringCondiment, indent); - file->writeNumberLine(_fieldF0, indent); + file->writeNumberLine(_starlingsDead, indent); file->writePoint(_pos1, indent); file->writePoint(_pos2, indent); file->writeNumberLine(_field104, indent); @@ -54,9 +55,9 @@ void CSauceDispensor::save(SimpleFile *file, int indent) { void CSauceDispensor::load(SimpleFile *file) { file->readNumber(); - _string3 = file->readString(); + _condimentName = file->readString(); _pouringCondiment = file->readNumber(); - _fieldF0 = file->readNumber(); + _starlingsDead = file->readNumber(); _pos1 = file->readPoint(); _pos2 = file->readPoint(); _field104 = file->readNumber(); @@ -71,7 +72,7 @@ bool CSauceDispensor::Use(CUse *msg) { if (msg->_item->isEquals("Chicken")) { CChicken *chicken = static_cast<CChicken *>(msg->_item); _field104 = true; - if (_fieldF0) { + if (_starlingsDead) { playSound("b#15.wav", 50); if (chicken->_condiment != "None") { @@ -79,17 +80,17 @@ bool CSauceDispensor::Use(CUse *msg) { msg->execute("Chicken"); } else { setVisible(true); - if (chicken->_field12C) { + if (chicken->_greasy) { _pouringCondiment = true; playMovie(_pos1.x, _pos1.y, MOVIE_NOTIFY_OBJECT); } else { - CActMsg actMsg(_string3); + CActMsg actMsg(_condimentName); actMsg.execute("Chicken"); playMovie(_pos2.x, _pos2.y, MOVIE_NOTIFY_OBJECT); } } - if (_fieldF0) + if (_starlingsDead) return true; } @@ -103,7 +104,7 @@ bool CSauceDispensor::Use(CUse *msg) { assert(glass); _field108 = true; - if (_field104 != 1 || _fieldF0 != 1) { + if (_field104 != 1 || !_starlingsDead) { glass->petAddToInventory(); } else if (glass->_condiment != "None") { visibleMsg.execute("BeerGlass"); @@ -113,7 +114,7 @@ bool CSauceDispensor::Use(CUse *msg) { 300)); setVisible(true); - CActMsg actMsg(_string3); + CActMsg actMsg(_condimentName); actMsg.execute("BeerGlass"); } } @@ -138,7 +139,7 @@ bool CSauceDispensor::MovieEndMsg(CMovieEndMsg *msg) { bool CSauceDispensor::ActMsg(CActMsg *msg) { if (msg->_action == "StarlingsDead") - _fieldF0 = true; + _starlingsDead = true; return true; } diff --git a/engines/titanic/game/sauce_dispensor.h b/engines/titanic/game/sauce_dispensor.h index cdcd592546..7d7d921429 100644 --- a/engines/titanic/game/sauce_dispensor.h +++ b/engines/titanic/game/sauce_dispensor.h @@ -36,9 +36,9 @@ class CSauceDispensor : public CBackground { bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); bool StatusChangeMsg(CStatusChangeMsg *msg); public: - CString _string3; + CString _condimentName; bool _pouringCondiment; - int _fieldF0; + bool _starlingsDead; Point _pos1; Point _pos2; int _field104; |