comparison Player.cpp @ 1594:c0238b60d0f2

Player::GetMaxHealth, GetBaseAC, GetActualAC minor cleanups
author Grumpy7
date Sun, 08 Sep 2013 08:10:09 +0200
parents 5658d0f3b5ee
children a52a01aaf439
comparison
equal deleted inserted replaced
1593:5658d0f3b5ee 1594:c0238b60d0f2
2776 weapon->uSpecEnchantmentType == 41 || 2776 weapon->uSpecEnchantmentType == 41 ||
2777 weapon->uSpecEnchantmentType == 500) 2777 weapon->uSpecEnchantmentType == 500)
2778 weapon_enchantment_recovery_reduction = 20; 2778 weapon_enchantment_recovery_reduction = 20;
2779 } 2779 }
2780 2780
2781
2782 int recovery = weapon_recovery + 2781 int recovery = weapon_recovery +
2783 armour_recovery + 2782 armour_recovery +
2784 shield_recovery 2783 shield_recovery
2785 - armsmaster_recovery_reduction 2784 - armsmaster_recovery_reduction
2786 - weapon_enchantment_recovery_reduction 2785 - weapon_enchantment_recovery_reduction
2818 v4 = pBaseHealthPerLevelByClass[classType] * (GetActualLevel() + v3); 2817 v4 = pBaseHealthPerLevelByClass[classType] * (GetActualLevel() + v3);
2819 v6 = uFullHealthBonus 2818 v6 = uFullHealthBonus
2820 + pBaseHealthByClass[classType / 4] 2819 + pBaseHealthByClass[classType / 4]
2821 + GetSkillBonus(CHARACTER_ATTRIBUTE_HEALTH) 2820 + GetSkillBonus(CHARACTER_ATTRIBUTE_HEALTH)
2822 + GetItemsBonus(CHARACTER_ATTRIBUTE_HEALTH, 0) + v4; 2821 + GetItemsBonus(CHARACTER_ATTRIBUTE_HEALTH, 0) + v4;
2823 if (v6 <= 0) 2822 return max(1, v6);
2824 return 1;
2825 return v6;
2826 } 2823 }
2827 2824
2828 //----- (0048E565) -------------------------------------------------------- 2825 //----- (0048E565) --------------------------------------------------------
2829 int Player::GetMaxMana() 2826 int Player::GetMaxMana()
2830 { 2827 {
2894 } 2891 }
2895 2892
2896 //----- (0048E656) -------------------------------------------------------- 2893 //----- (0048E656) --------------------------------------------------------
2897 int Player::GetBaseAC() 2894 int Player::GetBaseAC()
2898 { 2895 {
2899 Player *v1; // edi@1
2900 int v2; // eax@1 2896 int v2; // eax@1
2901 int v3; // esi@1 2897 int v3; // esi@1
2902 int v4; // esi@1 2898 int v4; // esi@1
2903 int v5; // esi@1 2899 int v5; // esi@1
2904 int result; // eax@2 2900 int result; // eax@2
2905 2901
2906 v1 = this;
2907 v2 = GetActualSpeed(); 2902 v2 = GetActualSpeed();
2908 v3 = GetParameterBonus(v2); 2903 v3 = GetParameterBonus(v2);
2909 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS, 0) + v3; 2904 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS, 0) + v3;
2910 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4; 2905 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4;
2911 if ( v5 >= 1 ) 2906 return max(0, v5);
2912 result = v5;
2913 else
2914 result = 0;
2915 return result;
2916 } 2907 }
2917 2908
2918 //----- (0048E68F) -------------------------------------------------------- 2909 //----- (0048E68F) --------------------------------------------------------
2919 int Player::GetActualAC() 2910 int Player::GetActualAC()
2920 { 2911 {
2921 Player *v1; // edi@1
2922 int v2; // eax@1 2912 int v2; // eax@1
2923 int v3; // esi@1 2913 int v3; // esi@1
2924 int v4; // esi@1 2914 int v4; // esi@1
2925 int v5; // esi@1 2915 int v5; // esi@1
2926 int v6; // esi@1 2916 int v6; // esi@1
2927 int result; // eax@2 2917 int result; // eax@2
2928 2918
2929 v1 = this;
2930 v2 = GetActualSpeed(); 2919 v2 = GetActualSpeed();
2931 v3 = GetParameterBonus(v2); 2920 v3 = GetParameterBonus(v2);
2932 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS, 0) + v3; 2921 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS, 0) + v3;
2933 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4; 2922 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4;
2934 v6 = v1->sACModifier + GetMagicalBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v5; 2923 v6 = this->sACModifier + GetMagicalBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v5;
2935 if ( v6 >= 1 ) 2924 return max(0, v6);
2936 result = v6;
2937 else
2938 result = 0;
2939 return result;
2940 } 2925 }
2941 2926
2942 //----- (0048E6DC) -------------------------------------------------------- 2927 //----- (0048E6DC) --------------------------------------------------------
2943 unsigned int Player::GetBaseAge() 2928 unsigned int Player::GetBaseAge()
2944 { 2929 {