diff options
author | Paul Gilbert | 2015-02-01 11:56:08 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-02-01 11:56:08 -0500 |
commit | d855aa0dab588f2993a4c4f103a4632a9f0ba278 (patch) | |
tree | d0bdc8ada5eaaabfd9c82d0c2a77092a048daa5c /engines/xeen/party.cpp | |
parent | d3e3093b035bb0e13492098e3f304474d0886fa4 (diff) | |
download | scummvm-rg350-d855aa0dab588f2993a4c4f103a4632a9f0ba278.tar.gz scummvm-rg350-d855aa0dab588f2993a4c4f103a4632a9f0ba278.tar.bz2 scummvm-rg350-d855aa0dab588f2993a4c4f103a4632a9f0ba278.zip |
XEEN: Implemented Character Info dialog
Diffstat (limited to 'engines/xeen/party.cpp')
-rw-r--r-- | engines/xeen/party.cpp | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index 66078b67e8..3cfc56e1ec 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -238,7 +238,7 @@ int Character::getMaxSP() const { /** * Get the effective value of a given stat for the character */ -int Character::getStat(Attribute attrib, bool baseOnly) const { +uint Character::getStat(Attribute attrib, bool baseOnly) const { AttributePair attr; int mode = 0; @@ -289,7 +289,24 @@ int Character::getStat(Attribute attrib, bool baseOnly) const { attr._permanent += attr._temporary; } - return MAX(attr._permanent, 0); + return MAX(attr._permanent, (uint)0); +} + +/** + * Return the color number to use for a given stat value in the character + * info or quick reference dialogs + */ +int Character::statColor(int amount, int threshold) { + if (amount < 1) + return 6; + else if (amount > threshold) + return 2; + else if (amount == threshold) + return 15; + else if (amount <= (threshold / 4)) + return 9; + else + return 32; } int Character::statBonus(int statValue) const { @@ -422,8 +439,8 @@ int Character::getThievery() const { return MAX(result, 0); } -int Character::getCurrentLevel() const { - return MAX(_level._permanent + _level._temporary, 0); +uint Character::getCurrentLevel() const { + return MAX(_level._permanent + _level._temporary, (uint)0); } int Character::itemScan(int itemId) const { @@ -817,6 +834,28 @@ uint Character::getCurrentExperience() const { _experience; } + +int Character::getNumSkills() const { + int total = 0; + for (int idx = THIEVERY; idx <= DANGER_SENSE; ++idx) { + if (_skills[idx]) + ++total; + } + + return total; +} + +int Character::getNumAwards() const { + int total = 0; + for (int idx = 0; idx < 88; ++idx) { + if (hasAward(idx)) + ++total; + } + + return total; +} + + /*------------------------------------------------------------------------*/ void Roster::synchronize(Common::Serializer &s) { |