diff options
-rw-r--r-- | engines/titanic/npcs/barbot.cpp | 18 | ||||
-rw-r--r-- | engines/titanic/npcs/barbot.h | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/barbot_script.cpp | 43 |
3 files changed, 28 insertions, 35 deletions
diff --git a/engines/titanic/npcs/barbot.cpp b/engines/titanic/npcs/barbot.cpp index 065ae6e14c..b62dad77d7 100644 --- a/engines/titanic/npcs/barbot.cpp +++ b/engines/titanic/npcs/barbot.cpp @@ -69,7 +69,7 @@ CBarbot::CBarbot() : CTrueTalkNPC() { _field124 = 0; _visCenterOnCounter = false; _addedVodka = false; - _ingredientsGiven = false; + _gottenDrunk = false; _field134 = 0; _field138 = 0; _field13C = -1; @@ -98,7 +98,7 @@ void CBarbot::save(SimpleFile *file, int indent) { file->writeNumberLine(_timesCalled, indent); file->writeNumberLine(_addedVodka, indent); - file->writeNumberLine(_ingredientsGiven, indent); + file->writeNumberLine(_gottenDrunk, indent); file->writeNumberLine(_field134, indent); file->writeNumberLine(_field138, indent); file->writeNumberLine(_field13C, indent); @@ -129,7 +129,7 @@ void CBarbot::load(SimpleFile *file) { _timesCalled = file->readNumber(); _addedVodka = file->readNumber(); - _ingredientsGiven = file->readNumber(); + _gottenDrunk = file->readNumber(); _field134 = file->readNumber(); _field138 = file->readNumber(); _field13C = file->readNumber(); @@ -307,7 +307,7 @@ bool CBarbot::TurnOn(CTurnOn *msg) { setVisible(true); CGameObject *glass = findInRoom("BeerGlass"); - if (!_ingredientsGiven) { + if (!_gottenDrunk) { CVisibleMsg visibleMsg(false); visibleMsg.execute("BarShelfVisCentre"); } @@ -439,7 +439,7 @@ bool CBarbot::MovieEndMsg(CMovieEndMsg *msg) { } if (msg->_endFrame == _frames[45]._endFrame) { - if (!_ingredientsGiven) { + if (!_gottenDrunk) { CVisibleMsg visibleMsg(false); visibleMsg.execute("BarShelfVisCentre"); } @@ -449,7 +449,7 @@ bool CBarbot::MovieEndMsg(CMovieEndMsg *msg) { if (msg->_endFrame == _frames[44]._endFrame) { _visCenterOnCounter = true; - _ingredientsGiven = true; + _gottenDrunk = true; CStatusChangeMsg statusMsg; statusMsg._newStatus = 1; statusMsg.execute("PickUpVisCentre"); @@ -458,7 +458,7 @@ bool CBarbot::MovieEndMsg(CMovieEndMsg *msg) { } if (msg->_endFrame == _frames[46]._endFrame) { - if (!_ingredientsGiven && !areIngredientsMissing()) + if (!_gottenDrunk && !areIngredientsMissing()) startTalking(this, 250571); return true; } @@ -518,7 +518,7 @@ bool CBarbot::TrueTalkQueueUpAnimSetMsg(CTrueTalkQueueUpAnimSetMsg *msg) { bool CBarbot::TrueTalkGetStateValueMsg(CTrueTalkGetStateValueMsg *msg) { switch (msg->_stateNum) { case 2: - if (!_ingredientsGiven) { + if (!_gottenDrunk) { if (_field15C) { msg->_stateVal = _field134 | 1; return true; @@ -557,7 +557,7 @@ bool CBarbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) { if (_field134) { playRange(_frames[27], MOVIE_NOTIFY_OBJECT); _frameNum = _frames[27]._endFrame; - } else if (!_ingredientsGiven && _field15C) { + } else if (!_gottenDrunk && _field15C) { // Vision center has been placed on the counter playRange(_frames[45], MOVIE_NOTIFY_OBJECT); playRange(_frames[44], MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h index 94830b2e7d..2569904ab6 100644 --- a/engines/titanic/npcs/barbot.h +++ b/engines/titanic/npcs/barbot.h @@ -71,7 +71,7 @@ private: int _field124; bool _visCenterOnCounter; bool _addedVodka; - bool _ingredientsGiven; + bool _gottenDrunk; int _field134; int _field138; int _field13C; diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp index 3da9d0e05f..c0d879b965 100644 --- a/engines/titanic/true_talk/barbot_script.cpp +++ b/engines/titanic/true_talk/barbot_script.cpp @@ -1016,11 +1016,10 @@ uint BarbotScript::getDialsBitset() const { } int BarbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence) { - int v34 = getState(); uint id = 0; - if (v34 > 0x200) { - switch (v34 - 0x201) { + if (val1 > 0x200) { + switch (val1 - 0x201) { case 0: if (getValue(4) != 2) id = 250738; @@ -1035,11 +1034,11 @@ int BarbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScrip default: break; } - } else if (v34 == 0x200) { + } else if (val1 == 0x200) { if (getValue(4) != 1) id = 250738; } else { - switch (v34) { + switch (val1) { case 2: if (getValue(1) != 1) return 1; @@ -1072,40 +1071,34 @@ int BarbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScrip break; case 9: { uint val = CTrueTalkManager::getStateValue(3); - bool bit0 = (val & 1) != 0; - bool bit2 = (val & 4) != 0; - bool bit3 = (val & 8) != 0; + bool lemonFlag = (val & 1) != 0; + bool puretFlag = (val & 4) != 0; + bool tvFlag = (val & 8) != 0; - if (bit2) { - if (!bit0) { - id = 250085 - (bit3 ? 0 : 199715); + if (puretFlag) { + if (!lemonFlag) { + id = tvFlag ? 50369 : 250085; break; - } else if (!bit3) { + } else if (!tvFlag) { id = 250627; } } else { - if (!bit0) { - id = 50365 + (bit3 ? 0 : 2); - } else if (!bit3) { + if (lemonFlag) { + id = tvFlag ? 50367 : 50365; + } else if (tvFlag) { id = 50370; } } - - if (id) { - addResponse(getDialogueId(id)); - applyResponse(); - return 2; - } break; } case 10: { uint val = CTrueTalkManager::getStateValue(3); - bool bit0 = (val & 1) != 0; - bool bit2 = (val & 4) != 0; - bool bit3 = (val & 8) != 0; + bool lemonFlag = (val & 1) != 0; + bool puretFlag = (val & 4) != 0; + bool tvFlag = (val & 8) != 0; - if (bit0 && bit2 && bit3) { + if (lemonFlag && puretFlag && tvFlag) { addResponse(getDialogueId(251027)); applyResponse(); CTrueTalkManager::triggerAction(7, 0); |