From 89d595a46c44df0bc3c449affc47867d14903224 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 10 Dec 2016 11:51:51 -0500 Subject: TITANIC: Renaming of parrot met flag methods --- engines/titanic/core/game_object.cpp | 8 ++++---- engines/titanic/core/game_object.h | 12 ++++++++++-- engines/titanic/game/parrot/player_meets_parrot.cpp | 2 +- engines/titanic/game/pet/pet_sounds.cpp | 2 +- engines/titanic/game_state.cpp | 6 +++--- engines/titanic/game_state.h | 14 +++++++++++--- engines/titanic/npcs/parrot.cpp | 2 +- 7 files changed, 31 insertions(+), 15 deletions(-) diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index 48cc5206fd..19cae3f330 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -1046,12 +1046,12 @@ Season CGameObject::stateGetSeason() const { return getGameManager()->_gameState._seasonNum; } -void CGameObject::stateSet24() { - getGameManager()->_gameState.set24(1); +void CGameObject::stateSetParrotMet() { + getGameManager()->_gameState.setParrotMet(true); } -int CGameObject::stateGet24() const { - return getGameManager()->_gameState.get24(); +bool CGameObject::stateGetParrotMet() const { + return getGameManager()->_gameState.getParrotMet(); } void CGameObject::stateInc38() { diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index 9417fd7aa3..744887a04b 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -991,8 +991,16 @@ public: */ Season stateGetSeason() const; - void stateSet24(); - int stateGet24() const; + /** + * Sets the flag for the parrot having been met + */ + void stateSetParrotMet(); + + /** + * Returns whether the parrot has been met + */ + bool stateGetParrotMet() const; + void stateInc38(); int stateGet38() const; diff --git a/engines/titanic/game/parrot/player_meets_parrot.cpp b/engines/titanic/game/parrot/player_meets_parrot.cpp index cdb14516bf..e573ba41c9 100644 --- a/engines/titanic/game/parrot/player_meets_parrot.cpp +++ b/engines/titanic/game/parrot/player_meets_parrot.cpp @@ -39,7 +39,7 @@ void CPlayerMeetsParrot::load(SimpleFile *file) { } bool CPlayerMeetsParrot::EnterRoomMsg(CEnterRoomMsg *msg) { - stateSet24(); + stateSetParrotMet(); return true; } diff --git a/engines/titanic/game/pet/pet_sounds.cpp b/engines/titanic/game/pet/pet_sounds.cpp index c7f3cd3bf8..b2c9902cc8 100644 --- a/engines/titanic/game/pet/pet_sounds.cpp +++ b/engines/titanic/game/pet/pet_sounds.cpp @@ -44,7 +44,7 @@ void CPETSounds::load(SimpleFile *file) { bool CPETSounds::PETPlaySoundMsg(CPETPlaySoundMsg *msg) { if (msg->_soundNum == 1) { playSound("z#65.wav"); - } else if (msg->_soundNum == 2 && stateGet24()) { + } else if (msg->_soundNum == 2 && stateGetParrotMet()) { uint ticks = getTicksCount(); if (!_ticks || ticks > (_ticks + 12000)) { playSound("z#36.wav"); diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp index e75f0975c3..26a4297358 100644 --- a/engines/titanic/game_state.cpp +++ b/engines/titanic/game_state.cpp @@ -46,7 +46,7 @@ bool CGameStateMovieList::empty() { CGameState::CGameState(CGameManager *gameManager) : _gameManager(gameManager), _gameLocation(this), _passengerClass(NO_CLASS), _priorClass(NO_CLASS), _mode(GSMODE_NONE), _seasonNum(SEASON_SUMMER), - _petActive(false), _field1C(false), _quitGame(false), _field24(0), + _petActive(false), _field1C(false), _quitGame(false), _parrotMet(false), _nodeChangeCtr(0), _nodeEnterTicks(0), _field38(0) { } @@ -55,7 +55,7 @@ void CGameState::save(SimpleFile *file) const { file->writeNumber(_passengerClass); file->writeNumber(_priorClass); file->writeNumber(_seasonNum); - file->writeNumber(_field24); + file->writeNumber(_parrotMet); file->writeNumber(_field38); _gameLocation.save(file); file->writeNumber(_field1C); @@ -66,7 +66,7 @@ void CGameState::load(SimpleFile *file) { _passengerClass = (PassengerClass)file->readNumber(); _priorClass = (PassengerClass)file->readNumber(); _seasonNum = (Season)file->readNumber(); - _field24 = file->readNumber(); + _parrotMet = file->readNumber(); _field38 = file->readNumber(); _gameLocation.load(file); diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h index 965735026c..5d0f67c02c 100644 --- a/engines/titanic/game_state.h +++ b/engines/titanic/game_state.h @@ -71,7 +71,7 @@ public: bool _petActive; bool _field1C; bool _quitGame; - int _field24; + bool _parrotMet; uint _nodeChangeCtr; uint32 _nodeEnterTicks; Point _mousePos; @@ -141,8 +141,16 @@ public: _seasonNum = (Season)(((int)_seasonNum + 1) & 3); } - void set24(int v) { _field24 = v; } - int get24() const { return _field24; } + /** + * Sets whether the parrot has been met + */ + void setParrotMet(bool flag) { _parrotMet = flag; } + + /** + * Gets whether the parrot has been met + */ + bool getParrotMet() const { return _parrotMet; } + int getNodeChangedCtr() const { return _nodeChangeCtr; } uint32 getNodeEnterTicks() const { return _nodeEnterTicks; } void inc38() { ++_field38; } diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp index c3702e17d4..37710e50bf 100644 --- a/engines/titanic/npcs/parrot.cpp +++ b/engines/titanic/npcs/parrot.cpp @@ -415,7 +415,7 @@ bool CParrot::ParrotSpeakMsg(CParrotSpeakMsg *msg) { "Lift", "ServiceElevator", "Dome", "Home", "MoonEmbLobby", nullptr }; - if (!stateGet24() || _v4 == 3 || compareViewNameTo("Titania.Node 18.N")) + if (!stateGetParrotMet() || _v4 == 3 || compareViewNameTo("Titania.Node 18.N")) return true; // Check for rooms not to speak in -- cgit v1.2.3