XEEN: Cleanup of game completion flags

This commit is contained in:
Paul Gilbert 2018-04-07 16:55:07 -04:00
parent a42ca33a1c
commit f1cfc9e696
6 changed files with 19 additions and 13 deletions

View File

@ -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);

View File

@ -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;

View File

@ -47,6 +47,10 @@ enum MonsterType {
MONSTER_DRAGON = 6
};
enum MapId {
XEEN_CASTLE1 = 75, XEEN_CASTLE4 = 78
};
class MonsterStruct {
public:
Common::String _name;

View File

@ -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);

View File

@ -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;

View File

@ -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");
}