summaryrefslogtreecommitdiff
path: root/src/game-server/being.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game-server/being.cpp')
-rw-r--r--src/game-server/being.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp
index b18914fa..a6ba4023 100644
--- a/src/game-server/being.cpp
+++ b/src/game-server/being.cpp
@@ -64,21 +64,22 @@ int Being::damage(Object *, Damage const &damage)
/* Elemental modifier at 100 means normal damage. At 0, it means immune.
And at 200, it means vulnerable (double damage). */
int mod1 = getModifiedAttribute(BASE_ELEM_BEGIN + damage.element);
-
+ HPloss = HPloss * (mod1 / 100);
/* Defence is an absolute value which is subtracted from the damage total. */
int mod2 = 0;
switch (damage.type)
{
case DAMAGE_PHYSICAL:
mod2 = getModifiedAttribute(BASE_ATTR_PHY_RES);
+ HPloss = HPloss - mod2;
break;
case DAMAGE_MAGICAL:
mod2 = getModifiedAttribute(BASE_ATTR_MAG_RES);
+ HPloss = HPloss / (mod2 + 1);
break;
default:
break;
}
- HPloss = HPloss * (mod1 / 100) - mod2;
if (HPloss < 0) HPloss = 0;