diff options
author | Paul Gilbert | 2015-02-26 20:50:49 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-02-26 20:50:49 -0500 |
commit | dc7e4153d4fb7de1d8e2241fe9b836e4680cf650 (patch) | |
tree | 1869ae7c01937b44b9437f58386a97a6327d9aa6 /engines/xeen | |
parent | c069a7f805b18428d095a0adf643753ceeaa59e3 (diff) | |
download | scummvm-rg350-dc7e4153d4fb7de1d8e2241fe9b836e4680cf650.tar.gz scummvm-rg350-dc7e4153d4fb7de1d8e2241fe9b836e4680cf650.tar.bz2 scummvm-rg350-dc7e4153d4fb7de1d8e2241fe9b836e4680cf650.zip |
XEEN: Fixes for attacking monsters
Diffstat (limited to 'engines/xeen')
-rw-r--r-- | engines/xeen/combat.cpp | 10 | ||||
-rw-r--r-- | engines/xeen/combat.h | 2 | ||||
-rw-r--r-- | engines/xeen/interface.cpp | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index 4e32d431a8..fca7fcb3ee 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -1342,11 +1342,11 @@ void Combat::attack(Character &c, RangeType rangeType) { break; } - int numberOfAttacks = c.getCurrentLevel() / divisor; + int numberOfAttacks = c.getCurrentLevel() / divisor + 1; damage = 0; while (numberOfAttacks-- > 0) { - if (hitMonster(c, RT_0)) + if (hitMonster(c, RT_CLOSE)) damage += getMonsterDamage(c); } @@ -1593,7 +1593,7 @@ void Combat::quickFight() { switch (c->_quickOption) { case QUICK_ATTACK: - attack(*c, RT_0); + attack(*c, RT_CLOSE); break; case QUICK_SPELL: if (c->_currentSpell != -1) { @@ -1720,7 +1720,7 @@ void Combat::getWeaponDamage(Character &c, RangeType rangeType) { } int Combat::getMonsterDamage(Character &c) { - return (c.statBonus(c.getStat(MIGHT)) + _weaponDamage) < 1; + return MAX(c.statBonus(c.getStat(MIGHT)) + _weaponDamage, 1); } int Combat::getDamageScale(int v) { @@ -1739,7 +1739,7 @@ int Combat::getMonsterResistence(RangeType rangeType) { MonsterStruct &monsterData = *monster._monsterData; int resistence = 0, damage = 0; - if (rangeType != RT_0 && rangeType != RT_3) { + if (rangeType != RT_CLOSE && rangeType != RT_3) { switch (_damageType) { case DT_PHYSICAL: resistence = monsterData._phsyicalResistence; diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h index 4783819c70..bf35ca819d 100644 --- a/engines/xeen/combat.h +++ b/engines/xeen/combat.h @@ -57,7 +57,7 @@ enum ElementalCategory { }; enum RangeType { - RT_0 = 0, RT_1 = 1, RT_2 = 2, RT_3 = 3 + RT_CLOSE = 0, RT_1 = 1, RT_2 = 2, RT_3 = 3 }; class XeenEngine; diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 076437add6..01cd494eff 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -1963,7 +1963,7 @@ void Interface::doCombat() { case Common::KEYCODE_a: // Attack - combat.attack(*combat._combatParty[combat._whosTurn], RT_0); + combat.attack(*combat._combatParty[combat._whosTurn], RT_CLOSE); nextChar(); break; |