summaryrefslogtreecommitdiff
path: root/src/battle/calculate_base_damage.c
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2018-04-19 20:01:57 -0700
committerGitHub <noreply@github.com>2018-04-19 20:01:57 -0700
commita55b14d47def2735f7ec274ccf64b6e2d8805320 (patch)
treeb70298ac8785cbe3b5ec6a39da4453f20da34a69 /src/battle/calculate_base_damage.c
parentf6ed2ff9c31d7912e2dc259ddc10e17f0ecbbd1f (diff)
parent39710a12cbb854f2cc50ea2955c9f94b6b5e6024 (diff)
Merge pull request #597 from yenatch/type-mystery
physical/special type macros and move gBattleMoves to c
Diffstat (limited to 'src/battle/calculate_base_damage.c')
-rw-r--r--src/battle/calculate_base_damage.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/battle/calculate_base_damage.c b/src/battle/calculate_base_damage.c
index 5e63ee92c..d983e47a4 100644
--- a/src/battle/calculate_base_damage.c
+++ b/src/battle/calculate_base_damage.c
@@ -170,7 +170,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (attackerHoldEffect == gHoldEffectToType[i][0]
&& type == gHoldEffectToType[i][1])
{
- if (type <= 8)
+ if (TYPE_IS_PHYSICAL(type))
attack = (attack * (attackerHoldEffectParam + 100)) / 100;
else
spAttack = (spAttack * (attackerHoldEffectParam + 100)) / 100;
@@ -221,7 +221,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (gBattleMoves[gCurrentMove].effect == EFFECT_EXPLOSION)
defense /= 2;
- if (type < TYPE_MYSTERY) // is physical
+ if (TYPE_IS_PHYSICAL(type)) // type < TYPE_MYSTERY
{
if (gCritMultiplier == 2)
{
@@ -271,7 +271,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (type == TYPE_MYSTERY)
damage = 0; // is ??? type. does 0 damage.
- if (type > TYPE_MYSTERY) // is special?
+ if (TYPE_IS_SPECIAL(type)) // type > TYPE_MYSTERY
{
if (gCritMultiplier == 2)
{