Permalink
Browse files

XEEN: REplace award values with descriptive constants

  • Loading branch information...
dreammaster committed Dec 30, 2017
1 parent 2fac15a commit 02aaff2a9f2e03c711bcae121920546532c3f06f
Showing with 17 additions and 10 deletions.
  1. +9 −8 engines/xeen/character.cpp
  2. +6 −0 engines/xeen/character.h
  3. +2 −2 engines/xeen/scripts.cpp
View
@@ -1451,23 +1451,24 @@ void Character::setValue(int id, uint value) {
}
bool Character::guildMember() const {
Party &party = *Party::_vm->_party;
FileManager &files = *g_vm->_files;
Party &party = *g_vm->_party;
if (party._mazeId == 49 && !Party::_vm->_files->_isDarkCc) {
return hasAward(5);
if (party._mazeId == 49 && !files._isDarkCc) {
return hasAward(SHANGRILA_GUILD_MEMBER);
}
switch (party._mazeId) {
case 29:
return hasAward(83);
return hasAward(CASTLEVIEW_GUILD_MEMBER);
case 31:
return hasAward(84);
return hasAward(SANDCASTER_GUILD_MEMBER);
case 33:
return hasAward(85);
return hasAward(LAKESIDE_GUILD_MEMBER);
case 35:
return hasAward(86);
return hasAward(NECROPOLIS_GUILD_MEMBER);
default:
return hasAward(87);
return hasAward(OLYMPUS_GUILD_MEMBER);
}
}
View
@@ -37,6 +37,12 @@ namespace Xeen {
#define AWARDS_TOTAL 88
#define WARZONE_AWARD 9
enum Award {
SHANGRILA_GUILD_MEMBER = 5, GOOBER = 76, SUPER_GOOBER = 77,
CASTLEVIEW_GUILD_MEMBER = 83, SANDCASTER_GUILD_MEMBER = 84,
LAKESIDE_GUILD_MEMBER = 85, NECROPOLIS_GUILD_MEMBER = 86, OLYMPUS_GUILD_MEMBER = 87
};
enum BonusFlags {
ITEMFLAG_BONUS_MASK = 0xBF, ITEMFLAG_CURSED = 0x40, ITEMFLAG_BROKEN = 0x80
};
View
@@ -1432,10 +1432,10 @@ void Scripts::doEnding(const Common::String &endStr) {
int state = 0;
for (uint idx = 0; idx < party._activeParty.size(); ++idx) {
Character &player = party._activeParty[idx];
if (player.hasAward(77)) {
if (player.hasAward(SUPER_GOOBER)) {
state = 2;
break;
} else if (player.hasAward(76)) {
} else if (player.hasAward(GOOBER)) {
state = 1;
break;
}

0 comments on commit 02aaff2

Please sign in to comment.