mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 15:27:47 -04:00
Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
uint8 GetLevelForTarget(WorldObject const* /*target*/)
void SetLevel(uint8 lvl)
uint8 GetRace()
uint32 GetRaceMask()
uint8 GetClass()
uint32 GetClassMask()
uint8 GetGender()
This commit is contained in:
@@ -338,7 +338,7 @@ void Player::ApplyFeralAPBonus(int32 amount, bool apply)
|
||||
void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
{
|
||||
float val2 = 0.0f;
|
||||
float level = float(getLevel());
|
||||
float level = float(GetLevel());
|
||||
|
||||
UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER;
|
||||
|
||||
@@ -352,7 +352,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
index_mod = UNIT_FIELD_RANGED_ATTACK_POWER_MODS;
|
||||
index_mult = UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER;
|
||||
|
||||
switch (getClass())
|
||||
switch (GetClass())
|
||||
{
|
||||
case CLASS_HUNTER:
|
||||
val2 = level * 2.0f + GetStat(STAT_AGILITY) - 10.0f;
|
||||
@@ -379,7 +379,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (getClass())
|
||||
switch (GetClass())
|
||||
{
|
||||
case CLASS_WARRIOR:
|
||||
val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f - 20.0f;
|
||||
@@ -427,11 +427,11 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
switch (GetShapeshiftForm())
|
||||
{
|
||||
case FORM_CAT:
|
||||
val2 = getLevel() * levelBonus + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) - 20.0f + weaponBonus + m_baseFeralAP;
|
||||
val2 = GetLevel() * levelBonus + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) - 20.0f + weaponBonus + m_baseFeralAP;
|
||||
break;
|
||||
case FORM_BEAR:
|
||||
case FORM_DIREBEAR:
|
||||
val2 = getLevel() * levelBonus + GetStat(STAT_STRENGTH) * 2.0f - 20.0f + weaponBonus + m_baseFeralAP;
|
||||
val2 = GetLevel() * levelBonus + GetStat(STAT_STRENGTH) * 2.0f - 20.0f + weaponBonus + m_baseFeralAP;
|
||||
break;
|
||||
case FORM_MOONKIN:
|
||||
val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f + m_baseFeralAP;
|
||||
@@ -462,7 +462,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
//add dynamic flat mods
|
||||
if (ranged)
|
||||
{
|
||||
if ((getClassMask() & CLASSMASK_WAND_USERS) == 0)
|
||||
if ((GetClassMask() & CLASSMASK_WAND_USERS) == 0)
|
||||
{
|
||||
AuraEffectList const& mRAPbyStat = GetAuraEffectsByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
|
||||
for (AuraEffect const* aurEff : mRAPbyStat)
|
||||
@@ -499,7 +499,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
UpdateDamagePhysical(BASE_ATTACK);
|
||||
if (CanDualWield() && haveOffhandWeapon()) //allow update offhand damage only if player knows DualWield Spec and has equipped offhand weapon
|
||||
UpdateDamagePhysical(OFF_ATTACK);
|
||||
if (getClass() == CLASS_SHAMAN || getClass() == CLASS_PALADIN) // mental quickness
|
||||
if (GetClass() == CLASS_SHAMAN || GetClass() == CLASS_PALADIN) // mental quickness
|
||||
UpdateSpellDamageAndHealingBonus();
|
||||
|
||||
if (pet && (pet->IsPetGhoul() || pet->IsRisenAlly())) // At melee attack power change for DK pet
|
||||
@@ -562,7 +562,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
|
||||
// check if player is druid and in cat or bear forms
|
||||
if (IsInFeralForm())
|
||||
{
|
||||
uint8 lvl = getLevel();
|
||||
uint8 lvl = GetLevel();
|
||||
if (lvl > 60)
|
||||
lvl = 60;
|
||||
|
||||
@@ -735,7 +735,7 @@ float Player::GetMissPercentageFromDefense() const
|
||||
diminishing += (GetRatingBonusValue(CR_DEFENSE_SKILL) * 0.04f);
|
||||
|
||||
// apply diminishing formula to diminishing miss chance
|
||||
return CalculateDiminishingReturns(miss_cap, getClass(), nondiminishing, diminishing);
|
||||
return CalculateDiminishingReturns(miss_cap, GetClass(), nondiminishing, diminishing);
|
||||
}
|
||||
|
||||
float const parry_cap[MAX_CLASSES] =
|
||||
@@ -757,7 +757,7 @@ void Player::UpdateParryPercentage()
|
||||
{
|
||||
// No parry
|
||||
float value = 0.0f;
|
||||
uint32 pclass = getClass() - 1;
|
||||
uint32 pclass = GetClass() - 1;
|
||||
if (CanParry() && parry_cap[pclass] > 0.0f)
|
||||
{
|
||||
float nondiminishing = 5.0f;
|
||||
@@ -770,7 +770,7 @@ void Player::UpdateParryPercentage()
|
||||
nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT);
|
||||
|
||||
// apply diminishing formula to diminishing parry chance
|
||||
value = CalculateDiminishingReturns(parry_cap, getClass(), nondiminishing, diminishing);
|
||||
value = CalculateDiminishingReturns(parry_cap, GetClass(), nondiminishing, diminishing);
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) : value;
|
||||
@@ -808,7 +808,7 @@ void Player::UpdateDodgePercentage()
|
||||
diminishing += GetRatingBonusValue(CR_DODGE);
|
||||
|
||||
// apply diminishing formula to diminishing dodge chance
|
||||
float value = CalculateDiminishingReturns(dodge_cap, getClass(), nondiminishing, diminishing);
|
||||
float value = CalculateDiminishingReturns(dodge_cap, GetClass(), nondiminishing, diminishing);
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) : value;
|
||||
@@ -1183,7 +1183,7 @@ bool Guardian::UpdateStats(Stats stat)
|
||||
}
|
||||
else if (stat == STAT_STAMINA)
|
||||
{
|
||||
if (owner->getClass() == CLASS_WARLOCK && IsPet())
|
||||
if (owner->GetClass() == CLASS_WARLOCK && IsPet())
|
||||
{
|
||||
ownersBonus = CalculatePct(owner->GetStat(STAT_STAMINA), 75);
|
||||
value += ownersBonus;
|
||||
@@ -1210,7 +1210,7 @@ bool Guardian::UpdateStats(Stats stat)
|
||||
//warlock's and mage's pets gain 30% of owner's intellect
|
||||
else if (stat == STAT_INTELLECT)
|
||||
{
|
||||
if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE)
|
||||
if (owner->GetClass() == CLASS_WARLOCK || owner->GetClass() == CLASS_MAGE)
|
||||
{
|
||||
ownersBonus = CalculatePct(owner->GetStat(stat), 30);
|
||||
value += ownersBonus;
|
||||
|
||||
Reference in New Issue
Block a user