aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-04-07 16:55:07 -0400
committerPaul Gilbert2018-04-07 16:55:07 -0400
commitf1cfc9e69606fb100d85609b0a29e99a8ba4f55f (patch)
treee3ef0e935bc41b767bdeeb7b024a0736bea862b2
parenta42ca33a1cd43e804018d88d5c272859ddecb878 (diff)
downloadscummvm-rg350-f1cfc9e69606fb100d85609b0a29e99a8ba4f55f.tar.gz
scummvm-rg350-f1cfc9e69606fb100d85609b0a29e99a8ba4f55f.tar.bz2
scummvm-rg350-f1cfc9e69606fb100d85609b0a29e99a8ba4f55f.zip
XEEN: Cleanup of game completion flags
-rw-r--r--engines/xeen/dialogs/dialogs_spells.cpp2
-rw-r--r--engines/xeen/map.cpp2
-rw-r--r--engines/xeen/map.h4
-rw-r--r--engines/xeen/party.cpp12
-rw-r--r--engines/xeen/party.h6
-rw-r--r--engines/xeen/scripts.cpp6
6 files changed, 19 insertions, 13 deletions
diff --git a/engines/xeen/dialogs/dialogs_spells.cpp b/engines/xeen/dialogs/dialogs_spells.cpp
index 43d76191ca..6e76f7bd69 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 53b16326d8..1fb5a9f73e 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 727c2e0c47..ef27bdb8ce 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 50c5992129..cb8072f060 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 b0be1a2f21..4b0616bfc6 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 7d36b83f34..3cc8b44c39 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -1418,7 +1418,7 @@ bool Scripts::cmdCutsceneEndDarkside(ParamsIterator &params) {
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 &params) {
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 &params) {
bool Scripts::cmdPlayCD(ParamsIterator &params) { error("TODO"); }
void Scripts::doCloudsEnding() {
+ g_vm->_party->_cloudsCompleted = true;
doEnding("ENDGAME");
}
void Scripts::doDarkSideEnding() {
+ g_vm->_party->_darkSideCompleted = true;
doEnding("ENDGAME2");
}