diff options
Diffstat (limited to 'engines/xeen/character.cpp')
-rw-r--r-- | engines/xeen/character.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/engines/xeen/character.cpp b/engines/xeen/character.cpp index ac25b32c55..afe385448a 100644 --- a/engines/xeen/character.cpp +++ b/engines/xeen/character.cpp @@ -818,6 +818,9 @@ void Character::synchronize(Common::Serializer &s) { s.syncAsByte(_currentCombatSpell); } +/** + * Returns the worst condition the character is suffering from + */ Condition Character::worstCondition() const { for (int cond = ERADICATED; cond >= CURSED; --cond) { if (_conditions[cond]) @@ -827,6 +830,28 @@ Condition Character::worstCondition() const { return NO_CONDITION; } +/** + * Returns whether the given character has a disabling condition, but still alive + */ +bool Character::isDisabled() const { + Condition condition = worstCondition(); + + return condition == ASLEEP || condition == PARALYZED || condition == UNCONSCIOUS + || condition == STONED || condition == ERADICATED; +} + +/** +* Returns whether the given character has a disabling condition, or is dead +*/ +bool Character::isDisabledOrDead() const { + Condition condition = worstCondition(); + + return condition == ASLEEP || (condition >= PARALYZED && condition <= ERADICATED); +} + +/** + * Get the character's age + */ int Character::getAge(bool ignoreTemp) const { int year = MIN(Party::_vm->_party->_year - _birthYear, (uint)254); |