aboutsummaryrefslogtreecommitdiff
path: root/src/game/StatSystem.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-17 16:20:24 -0700
committermaximius <none@none>2009-10-17 16:20:24 -0700
commit3f338cc1c328c7280957583b50598292cd8fb64b (patch)
treeca209c2cd024e3902b7844b3224bceff7c5bb570 /src/game/StatSystem.cpp
parente585187b248f48b3c6e9247b49fa07c6565d65e5 (diff)
*Massive cleanup redux.
--HG-- branch : trunk
Diffstat (limited to 'src/game/StatSystem.cpp')
-rw-r--r--src/game/StatSystem.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp
index 56bde0e5442..1f0e828699c 100644
--- a/src/game/StatSystem.cpp
+++ b/src/game/StatSystem.cpp
@@ -98,7 +98,7 @@ bool Player::UpdateStats(Stats stat)
// Update ratings in exist SPELL_AURA_MOD_RATING_FROM_STAT and only depends from stat
uint32 mask = 0;
AuraEffectList const& modRatingFromStat = GetAurasByType(SPELL_AURA_MOD_RATING_FROM_STAT);
- for(AuraEffectList::const_iterator i = modRatingFromStat.begin();i != modRatingFromStat.end(); ++i)
+ for (AuraEffectList::const_iterator i = modRatingFromStat.begin(); i != modRatingFromStat.end(); ++i)
if (Stats((*i)->GetMiscBValue()) == stat)
mask |= (*i)->GetMiscValue();
if (mask)
@@ -116,7 +116,7 @@ void Player::ApplySpellPowerBonus(int32 amount, bool apply)
// For speed just update for client
ApplyModUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, amount, apply);
- for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
+ for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, amount, apply);;
}
@@ -127,7 +127,7 @@ void Player::UpdateSpellDamageAndHealingBonus()
// Get healing bonus for all schools
SetStatInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonus(SPELL_SCHOOL_MASK_ALL));
// Get damage bonus for all schools
- for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
+ for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, SpellBaseDamageBonus(SpellSchoolMask(1 << i)));
}
@@ -144,7 +144,7 @@ bool Player::UpdateAllStats()
UpdateAttackPowerAndDamage(true);
UpdateMaxHealth();
- for(int i = POWER_MANA; i < MAX_POWERS; ++i)
+ for (int i = POWER_MANA; i < MAX_POWERS; ++i)
UpdateMaxPower(Powers(i));
UpdateAllCritPercentages();
@@ -189,7 +189,7 @@ void Player::UpdateArmor()
//add dynamic flat mods
AuraEffectList const& mResbyIntellect = GetAurasByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
- for(AuraEffectList::const_iterator i = mResbyIntellect.begin();i != mResbyIntellect.end(); ++i)
+ for (AuraEffectList::const_iterator i = mResbyIntellect.begin(); i != mResbyIntellect.end(); ++i)
{
if((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)
value += int32(GetStat(Stats((*i)->GetMiscBValue())) * (*i)->GetAmount() / 100.0f);
@@ -316,7 +316,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
case FORM_MOONKIN:
{
Unit::AuraEffectList const& mDummy = GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr)
+ for (Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr)
{
// Predatory Strikes (effect 0)
if ((*itr)->GetEffIndex()==0 && (*itr)->GetSpellProto()->SpellIconID == 1563)
@@ -361,18 +361,18 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
if ((getClassMask() & CLASSMASK_WAND_USERS)==0)
{
AuraEffectList const& mRAPbyStat = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
- for(AuraEffectList::const_iterator i = mRAPbyStat.begin();i != mRAPbyStat.end(); ++i)
+ for (AuraEffectList::const_iterator i = mRAPbyStat.begin(); i != mRAPbyStat.end(); ++i)
attPowerMod += int32(GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 100.0f);
}
}
else
{
AuraEffectList const& mAPbyStat = GetAurasByType(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT);
- for(AuraEffectList::const_iterator i = mAPbyStat.begin();i != mAPbyStat.end(); ++i)
+ for (AuraEffectList::const_iterator i = mAPbyStat.begin(); i != mAPbyStat.end(); ++i)
attPowerMod += int32(GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 100.0f);
AuraEffectList const& mAPbyArmor = GetAurasByType(SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR);
- for(AuraEffectList::const_iterator iter = mAPbyArmor.begin(); iter != mAPbyArmor.end(); ++iter)
+ for (AuraEffectList::const_iterator iter = mAPbyArmor.begin(); iter != mAPbyArmor.end(); ++iter)
// always: ((*i)->GetModifier()->m_miscvalue == 1 == SPELL_SCHOOL_MASK_NORMAL)
attPowerMod += int32(GetArmor() / (*iter)->GetAmount());
}
@@ -666,7 +666,7 @@ void Player::UpdateExpertise(WeaponAttackType attack)
Item *weapon = GetWeaponForAttack(attack);
AuraEffectList const& expAuras = GetAurasByType(SPELL_AURA_MOD_EXPERTISE);
- for(AuraEffectList::const_iterator itr = expAuras.begin(); itr != expAuras.end(); ++itr)
+ for (AuraEffectList::const_iterator itr = expAuras.begin(); itr != expAuras.end(); ++itr)
{
// item neutral spell
if((*itr)->GetSpellProto()->EquippedItemClass == -1)
@@ -706,7 +706,7 @@ void Player::UpdateManaRegen()
// Get bonus from SPELL_AURA_MOD_MANA_REGEN_FROM_STAT aura
AuraEffectList const& regenAura = GetAurasByType(SPELL_AURA_MOD_MANA_REGEN_FROM_STAT);
- for(AuraEffectList::const_iterator i = regenAura.begin();i != regenAura.end(); ++i)
+ for (AuraEffectList::const_iterator i = regenAura.begin(); i != regenAura.end(); ++i)
{
power_regen_mp5 += GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 500.0f;
}
@@ -761,10 +761,10 @@ bool Creature::UpdateAllStats()
UpdateAttackPowerAndDamage();
UpdateAttackPowerAndDamage(true);
- for(int i = POWER_MANA; i < MAX_POWERS; ++i)
+ for (int i = POWER_MANA; i < MAX_POWERS; ++i)
UpdateMaxPower(Powers(i));
- for(int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
+ for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
UpdateResistances(i);
return true;
@@ -955,7 +955,7 @@ bool Guardian::UpdateAllStats()
for (int i = STAT_STRENGTH; i < MAX_STATS; ++i)
UpdateStats(Stats(i));
- for(int i = POWER_MANA; i < MAX_POWERS; ++i)
+ for (int i = POWER_MANA; i < MAX_POWERS; ++i)
UpdateMaxPower(Powers(i));
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)