changeset 1560:a0cd6465ae0d

Player::CalculateIncommingDamage, liches shouldn't be immune to damage if above 200 resistance to it
author Grumpy7
date Sun, 08 Sep 2013 01:03:04 +0200
parents 1f3f01d39300
children f8c15e45de7e
files Player.cpp
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Sun Sep 08 00:35:03 2013 +0200
+++ b/Player.cpp	Sun Sep 08 01:03:04 2013 +0200
@@ -1349,7 +1349,7 @@
 }
 
 //----- (0048C6F6) --------------------------------------------------------
-bool Party::AddItemToParty(ItemGen *pItem)
+bool Party::AddItemToParty(ItemGen *pItem)      //TODO move to party.cpp
 {
   unsigned int v2; // eax@1
   char *v5; // eax@8
@@ -1912,21 +1912,23 @@
   signed int res_rand_divider; // ebx@2
   int armor_skill; // eax@29
 
+
+  if ( classType == PLAYER_CLASS_LICH && (dmg_type == CHARACTER_ATTRIBUTE_RESIST_MIND || dmg_type == CHARACTER_ATTRIBUTE_RESIST_BODY || dmg_type == CHARACTER_ATTRIBUTE_RESIST_SPIRIT )) //TODO: determine if spirit resistance should be handled by body res. modifier
+    return 0;
+
   resist_value = 0;
   switch(dmg_type)
       {
       case DMGT_FIRE:   resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE); break;
       case DMGT_ELECTR: resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR);  break;
       case DMGT_COLD:   resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER); break;
-      case DMGT_EARTH:      resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); break;
+      case DMGT_EARTH:  resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); break;
       
       case DMGT_SPIRIT: resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_SPIRIT);break;
       case DMGT_MIND:   resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND); break;
       case DMGT_BODY:   resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); break;
       }
 
-  if ( classType == PLAYER_CLASS_LICH && resist_value >= 200 )
-    return 0;
   player_luck = GetActualLuck();
   res_rand_divider = GetParameterBonus(player_luck) + resist_value + 30;