Cleanup and reorganization of Unit and SpellEntry headers. (#312)

* Move some unit and spell defines to dedicated header.

* Reorder functions in unit header.

* Clean up until spell category.

* Finish cleaning up spell functions.

* Cleanup combat system methods.

* Done cleaning up unit header.

* Reduce not needed includes.
This commit is contained in:
ratkosrb
2019-11-24 22:20:44 +02:00
committed by GitHub
parent df76eff1d3
commit 66659fe13f
374 changed files with 7116 additions and 7379 deletions
+11 -12
View File
@@ -19,7 +19,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Unit.h"
#include "Player.h"
#include "Pet.h"
#include "Creature.h"
@@ -142,7 +141,7 @@ void Player::UpdateArmor()
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_8_4
// Add dummy effects from spells (check class and other conditions first for optimization)
if (getClass() == CLASS_DRUID)
if (GetClass() == CLASS_DRUID)
{
ShapeshiftForm form = GetShapeshiftForm();
if ((form == FORM_DIREBEAR) || (form == FORM_BEAR))
@@ -219,7 +218,7 @@ void Player::UpdateMaxPower(Powers power)
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;
@@ -237,7 +236,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
index_mult = UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER;
#endif
switch (getClass())
switch (GetClass())
{
case CLASS_HUNTER:
val2 = level * 2.0f + GetStat(STAT_AGILITY) * 2.0f - 10.0f;
@@ -268,7 +267,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;
@@ -316,14 +315,14 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
switch (form)
{
case FORM_CAT:
val2 = getLevel() * mLevelMult + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) - 20.0f;
val2 = GetLevel() * mLevelMult + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) - 20.0f;
break;
case FORM_BEAR:
case FORM_DIREBEAR:
val2 = getLevel() * mLevelMult + GetStat(STAT_STRENGTH) * 2.0f - 20.0f;
val2 = GetLevel() * mLevelMult + GetStat(STAT_STRENGTH) * 2.0f - 20.0f;
break;
case FORM_MOONKIN:
val2 = getLevel() * mLevelMult + GetStat(STAT_STRENGTH) * 2.0f - 20.0f;
val2 = GetLevel() * mLevelMult + GetStat(STAT_STRENGTH) * 2.0f - 20.0f;
break;
default:
val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f;
@@ -362,7 +361,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
else
{
UpdateDamagePhysical(BASE_ATTACK);
if (CanDualWield() && haveOffhandWeapon()) //allow update offhand damage only if player knows DualWield Spec and has equipped offhand weapon
if (CanDualWield() && HaveOffhandWeapon()) //allow update offhand damage only if player knows DualWield Spec and has equipped offhand weapon
UpdateDamagePhysical(OFF_ATTACK);
}
}
@@ -410,7 +409,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, fl
}
else
{
uint32 lvl = getLevel();
uint32 lvl = GetLevel();
if (lvl > 60)
lvl = 60;
@@ -512,7 +511,7 @@ void Player::UpdateCritPercentage(WeaponAttackType attType)
}
float value = GetTotalPercentageModValue(modGroup);
switch (getClass())
switch (GetClass())
{
case CLASS_DRUID:
value += 0.9f;
@@ -573,7 +572,7 @@ void Player::UpdateDodgePercentage()
{
// Nostalrius : base dodge per class
float value = 0.0f;
switch (getClass())
switch (GetClass())
{
case CLASS_DRUID:
value += 0.9f;