aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/character.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/xeen/character.cpp')
-rw-r--r--engines/xeen/character.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/engines/xeen/character.cpp b/engines/xeen/character.cpp
index 7e36e54190..b2cf11d0cb 100644
--- a/engines/xeen/character.cpp
+++ b/engines/xeen/character.cpp
@@ -702,7 +702,7 @@ void Character::clear() {
_tempAge = 0;
Common::fill(&_skills[0], &_skills[18], 0);
Common::fill(&_awards[0], &_awards[128], 0);
- Common::fill(&_spells[0], &_spells[39], 0);
+ Common::fill(&_spells[0], &_spells[39], false);
_lloydMap = 0;
_hasSpells = false;
_currentSpell = 0;
@@ -1192,13 +1192,6 @@ int Character::itemScan(int itemId) const {
if (mIndex == itemId)
result += Res.ELEMENTAL_RESISTENCES[item._material];
}
-
- if (itemId == 9) {
- result += Res.ARMOR_STRENGTHS[item._id];
- if (item._material >= 37 && item._material <= 58) {
- result += Res.METAL_LAC[item._material - 37];
- }
- }
}
}
@@ -1294,7 +1287,7 @@ void Character::setValue(int id, uint value) {
// Set condition
if (value == 16) {
// Clear all the conditions
- Common::fill(&_conditions[CURSED], &_conditions[NO_CONDITION], false);
+ clearConditions();
} else if (value == 6) {
_conditions[value] = 1;
} else {
@@ -1792,7 +1785,14 @@ void Character::addHitPoints(int amount) {
}
void Character::subtractHitPoints(int amount) {
- Sound &sound = *Party::_vm->_sound;
+ Debugger &debugger = *g_vm->_debugger;
+ Sound &sound = *g_vm->_sound;
+
+ // If invincibility is turned on in the debugger, ignore all damage
+ if (debugger._invincible)
+ return;
+
+ // Subtract the given HP amount
_currentHp -= amount;
bool flag = _currentHp <= 10;
@@ -1854,4 +1854,8 @@ int Character::getClassCategory() const {
}
}
+void Character::clearConditions() {
+ Common::fill(&_conditions[CURSED], &_conditions[NO_CONDITION], false);
+}
+
} // End of namespace Xeen