aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-02-24 07:16:16 -0500
committerPaul Gilbert2018-02-24 07:16:16 -0500
commit10a82b271899df3f51f69ecb4cb202d42f889f8d (patch)
tree9ad955474c38744073bba74aaf4fed9acfa93bdf
parente5a3f5b7e16ca63b3d8d3ea6a5d00b8476eed4e6 (diff)
downloadscummvm-rg350-10a82b271899df3f51f69ecb4cb202d42f889f8d.tar.gz
scummvm-rg350-10a82b271899df3f51f69ecb4cb202d42f889f8d.tar.bz2
scummvm-rg350-10a82b271899df3f51f69ecb4cb202d42f889f8d.zip
XEEN: Fix reduction of damage from physical resistence
-rw-r--r--engines/xeen/combat.cpp9
-rw-r--r--engines/xeen/combat.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index e7502d6437..2559559d47 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -91,7 +91,7 @@ static const int MONSTER_ITEM_RANGES[6] = { 10, 20, 50, 100, 100, 100 };
/*------------------------------------------------------------------------*/
-Combat::Combat(XeenEngine *vm): _vm(vm), _missVoc("miss.voc"), _pow1Voc("pow1.voc") {
+Combat::Combat(XeenEngine *vm): _vm(vm), _missVoc("miss.voc") {
Common::fill(&_attackMonsters[0], &_attackMonsters[26], 0);
Common::fill(&_charsArray1[0], &_charsArray1[12], 0);
Common::fill(&_monPow[0], &_monPow[12], 0);
@@ -1414,13 +1414,14 @@ void Combat::attack2(int damage, RangeType rangeType) {
if (monster._damageType == DT_SLEEP || monster._damageType == DT_DRAGONSLEEP)
monster._damageType = DT_PHYSICAL;
- if ((!rangeType || !_damageType) && _attackWeaponId != 34) {
+ if ((rangeType == RT_SINGLE || _damageType == DT_PHYSICAL) && _attackWeaponId != 34) {
if (monsterData._phsyicalResistence != 0) {
if (monsterData._phsyicalResistence == 100) {
+ // Completely immune to the damage
damage = 0;
} else {
- // This doesn't seem to have any effect?
- damage = (damage * 100) / 100;
+ // Reduce the damage based on physical resistance
+ damage = damage * (100 - monsterData._phsyicalResistence) / 100;
}
}
}
diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h
index e8121bee46..92efc058b4 100644
--- a/engines/xeen/combat.h
+++ b/engines/xeen/combat.h
@@ -136,7 +136,7 @@ public:
int _weaponDie, _weaponDice;
XeenItem *_attackWeapon;
int _attackWeaponId;
- File _missVoc, _pow1Voc;
+ File _missVoc;
int _hitChanceBonus;
bool _dangerPresent;
bool _moveMonsters;