[Scummvm-git-logs] scummvm master -> 10a82b271899df3f51f69ecb4cb202d42f889f8d
dreammaster
dreammaster at scummvm.org
Sat Feb 24 13:16:15 CET 2018
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
10a82b2718 XEEN: Fix reduction of damage from physical resistence
Commit: 10a82b271899df3f51f69ecb4cb202d42f889f8d
https://github.com/scummvm/scummvm/commit/10a82b271899df3f51f69ecb4cb202d42f889f8d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-02-24T07:16:16-05:00
Commit Message:
XEEN: Fix reduction of damage from physical resistence
Changed paths:
engines/xeen/combat.cpp
engines/xeen/combat.h
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index e7502d6..2559559 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 e8121be..92efc05 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;
More information about the Scummvm-git-logs
mailing list