comparison Player.cpp @ 1561:f8c15e45de7e

Player::IsUnarmed fixing condition
author Grumpy7
date Sun, 08 Sep 2013 01:17:33 +0200
parents a0cd6465ae0d
children 0311debb684c
comparison
equal deleted inserted replaced
1560:a0cd6465ae0d 1561:f8c15e45de7e
1903 return ui_character_default_text_color; 1903 return ui_character_default_text_color;
1904 } 1904 }
1905 1905
1906 //----- (0048D4B3) -------------------------------------------------------- 1906 //----- (0048D4B3) --------------------------------------------------------
1907 int Player::CalculateIncommingDamage( DAMAGE_TYPE dmg_type, int dmg ) 1907 int Player::CalculateIncommingDamage( DAMAGE_TYPE dmg_type, int dmg )
1908 { 1908 {
1909
1910 int resist_value; // edi@8 1909 int resist_value; // edi@8
1911 int player_luck; // eax@21 1910 int player_luck; // eax@21
1912 signed int res_rand_divider; // ebx@2 1911 signed int res_rand_divider; // ebx@2
1913 int armor_skill; // eax@29 1912 int armor_skill; // eax@29
1914
1915 1913
1916 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 1914 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
1917 return 0; 1915 return 0;
1918 1916
1919 resist_value = 0; 1917 resist_value = 0;
1975 } 1973 }
1976 1974
1977 //----- (0048D676) -------------------------------------------------------- 1975 //----- (0048D676) --------------------------------------------------------
1978 bool Player::IsUnarmed() 1976 bool Player::IsUnarmed()
1979 { 1977 {
1980 return HasItemEquipped(EQUIP_MAIN_HAND) != 0 && 1978 return !HasItemEquipped(EQUIP_MAIN_HAND) &&
1981 !(HasItemEquipped(EQUIP_OFF_HAND) == 0 && GetEquippedItemEquipType(EQUIP_OFF_HAND) != EQUIP_SHIELD); 1979 (!HasItemEquipped(EQUIP_OFF_HAND) || GetEquippedItemEquipType(EQUIP_OFF_HAND) == EQUIP_SHIELD);
1982 } 1980 }
1983 1981
1984 //----- (0048D6AA) -------------------------------------------------------- 1982 //----- (0048D6AA) --------------------------------------------------------
1985 bool Player::HasItemEquipped(ITEM_EQUIP_TYPE uEquipIndex) 1983 bool Player::HasItemEquipped(ITEM_EQUIP_TYPE uEquipIndex)
1986 { 1984 {