Core: Cleaning up hungarian notation - Phase3: pVictim -> victim
This commit is contained in:
1 parent
5cafed655a
commit
f997363c08
16 files changed
+46
-46
No files matched your search
@@ -71,31 +71,31 @@ public:
|
||||
|
||||
void Absorb(AuraEffect * aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
||||
{
|
||||
Unit* pVictim = GetTarget();
|
||||
int32 remainingHealth = pVictim->GetHealth() - dmgInfo.GetDamage();
|
||||
uint32 allowedHealth = pVictim->CountPctFromMaxHealth(35);
|
||||
Unit* victim = GetTarget();
|
||||
int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage();
|
||||
uint32 allowedHealth = victim->CountPctFromMaxHealth(35);
|
||||
// If damage kills us
|
||||
if (remainingHealth <= 0 && !pVictim->ToPlayer()->HasSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL))
|
||||
if (remainingHealth <= 0 && !victim->ToPlayer()->HasSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL))
|
||||
{
|
||||
// Cast healing spell, completely avoid damage
|
||||
absorbAmount = dmgInfo.GetDamage();
|
||||
|
||||
uint32 defenseSkillValue = pVictim->GetDefenseSkillValue();
|
||||
uint32 defenseSkillValue = victim->GetDefenseSkillValue();
|
||||
// Max heal when defense skill denies critical hits from raid bosses
|
||||
// Formula: max defense at level + 140 (raiting from gear)
|
||||
uint32 reqDefForMaxHeal = pVictim->getLevel() * 5 + 140;
|
||||
uint32 reqDefForMaxHeal = victim->getLevel() * 5 + 140;
|
||||
float pctFromDefense = (defenseSkillValue >= reqDefForMaxHeal)
|
||||
? 1.0f
|
||||
: float(defenseSkillValue) / float(reqDefForMaxHeal);
|
||||
|
||||
int32 healAmount = int32(pVictim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense)));
|
||||
pVictim->CastCustomSpell(pVictim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff);
|
||||
pVictim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, time(NULL) + 120);
|
||||
int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense)));
|
||||
victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff);
|
||||
victim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, time(NULL) + 120);
|
||||
}
|
||||
else if (remainingHealth < int32(allowedHealth))
|
||||
{
|
||||
// Reduce damage that brings us under 35% (or full damage if we are already under 35%) by x%
|
||||
uint32 damageToReduce = (pVictim->GetHealth() < allowedHealth)
|
||||
uint32 damageToReduce = (victim->GetHealth() < allowedHealth)
|
||||
? dmgInfo.GetDamage()
|
||||
: allowedHealth - remainingHealth;
|
||||
absorbAmount = CalculatePctN(damageToReduce, absorbPct);
|
||||
|
||||
Reference in new issue
Block a user