diff --git a/engines/xeen/dialogs/dialogs_spells.cpp b/engines/xeen/dialogs/dialogs_spells.cpp index 43d76191cab..6e76f7bd698 100644 --- a/engines/xeen/dialogs/dialogs_spells.cpp +++ b/engines/xeen/dialogs/dialogs_spells.cpp @@ -765,7 +765,7 @@ bool LloydsBeacon::execute() { switch (_buttonValue) { case Common::KEYCODE_r: - if (!ccNum && c._lloydMap >= 75 && c._lloydMap <= 78 && !party._cloudsEnd) { + if (!ccNum && c._lloydMap >= XEEN_CASTLE1 && c._lloydMap <= XEEN_CASTLE4 && !party._cloudsCompleted) { result = false; } else { sound.playFX(51); diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index 53b16326d8d..1fb5a9f73e5 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -794,7 +794,7 @@ void Map::load(int mapId) { for (uint i = 0; i < _mobData._objectSprites.size(); ++i) { files.setGameCc(_sideObjects); - if (party._cloudsEnd && _mobData._objectSprites[i]._spriteId == 85 && + if (party._cloudsCompleted && _mobData._objectSprites[i]._spriteId == 85 && mapId == 27 && ccNum) { _mobData._objects[29]._spriteId = 0; _mobData._objects[29]._id = 8; diff --git a/engines/xeen/map.h b/engines/xeen/map.h index 727c2e0c47e..ef27bdb8cef 100644 --- a/engines/xeen/map.h +++ b/engines/xeen/map.h @@ -47,6 +47,10 @@ enum MonsterType { MONSTER_DRAGON = 6 }; +enum MapId { + XEEN_CASTLE1 = 75, XEEN_CASTLE4 = 78 +}; + class MonsterStruct { public: Common::String _name; diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index 50c59921294..cb8072f060b 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -212,9 +212,9 @@ Party::Party(XeenEngine *vm) { _holyBonus = 0; _heroism = 0; _difficulty = ADVENTURER; - _cloudsEnd = false; - _darkSideEnd = false; - _worldEnd = false; + _cloudsCompleted = false; + _darkSideCompleted = false; + _worldCompleted = false; _ctr24 = 0; _day = 0; _year = 0; @@ -299,9 +299,9 @@ void Party::synchronize(Common::Serializer &s) { _blacksmithWares.synchronize(s, 0); - s.syncAsUint16LE(_cloudsEnd); - s.syncAsUint16LE(_darkSideEnd); - s.syncAsUint16LE(_worldEnd); + s.syncAsUint16LE(_cloudsCompleted); + s.syncAsUint16LE(_darkSideCompleted); + s.syncAsUint16LE(_worldCompleted); s.syncAsUint16LE(_ctr24); s.syncAsUint16LE(_day); s.syncAsUint16LE(_year); diff --git a/engines/xeen/party.h b/engines/xeen/party.h index b0be1a2f21e..4b0616bfc69 100644 --- a/engines/xeen/party.h +++ b/engines/xeen/party.h @@ -190,9 +190,9 @@ public: int _heroism; Difficulty _difficulty; BlacksmithWares _blacksmithWares; - bool _cloudsEnd; - bool _darkSideEnd; - bool _worldEnd; + bool _cloudsCompleted; + bool _darkSideCompleted; + bool _worldCompleted; int _ctr24; // Unused counter int _day; uint _year; diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp index 7d36b83f340..3cc8b44c394 100644 --- a/engines/xeen/scripts.cpp +++ b/engines/xeen/scripts.cpp @@ -1418,7 +1418,7 @@ bool Scripts::cmdCutsceneEndDarkside(ParamsIterator ¶ms) { Party &party = *_vm->_party; _vm->_saves->_wonDarkSide = true; party._questItems[53] = 1; - party._darkSideEnd = true; + party._darkSideCompleted = true; party._mazeId = 29; party._mazeDirection = DIR_NORTH; party._mazePosition = Common::Point(25, 21); @@ -1439,7 +1439,7 @@ bool Scripts::cmdCutsceneEndWorld(ParamsIterator ¶ms) { g_vm->saveSettings(); _vm->_saves->_wonWorld = true; - _vm->_party->_worldEnd = true; + _vm->_party->_worldCompleted = true; doWorldEnding(); return false; @@ -1453,10 +1453,12 @@ bool Scripts::cmdFlipWorld(ParamsIterator ¶ms) { bool Scripts::cmdPlayCD(ParamsIterator ¶ms) { error("TODO"); } void Scripts::doCloudsEnding() { + g_vm->_party->_cloudsCompleted = true; doEnding("ENDGAME"); } void Scripts::doDarkSideEnding() { + g_vm->_party->_darkSideCompleted = true; doEnding("ENDGAME2"); }