From ec2c140ecbc35863410044b169738c6f3c970915 Mon Sep 17 00:00:00 2001 From: ExpoSeed <> Date: Fri, 4 Jun 2021 19:34:37 -0500 Subject: [PATCH] Disambiguate Thousand Arrows flag from other flags --- include/constants/pokemon.h | 2 +- src/battle_util.c | 4 ++-- src/data/battle_moves.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index a8d988ad8e..5e030698c3 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -314,7 +314,7 @@ #define FLAG_DANCE (1 << 21) #define FLAG_DMG_2X_IN_AIR (1 << 22) // If target is in the air, can hit and deal double damage. #define FLAG_DMG_IN_AIR (1 << 23) // If target is in the air, can hit. -#define FLAG_DAMAGE_AIRBORNE (1 << 24) // Makes a Ground type move do 1x damage to flying and levitating targets +#define FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING (1 << 24) // Makes a Ground type move do 1x damage to flying and levitating targets // Split defines. diff --git a/src/battle_util.c b/src/battle_util.c index a89063f788..86e0579955 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8092,7 +8092,7 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat && gBattleMons[battlerDef].type3 != gBattleMons[battlerDef].type1) MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, gBattleMons[battlerDef].type3, battlerAtk, recordAbilities); - if (moveType == TYPE_GROUND && !IsBattlerGrounded(battlerDef) && !(gBattleMoves[move].flags & FLAG_DAMAGE_AIRBORNE)) + if (moveType == TYPE_GROUND && !IsBattlerGrounded(battlerDef) && !(gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)) { modifier = UQ_4_12(0.0); if (recordAbilities && GetBattlerAbility(battlerDef) == ABILITY_LEVITATE) @@ -8106,7 +8106,7 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat } // Thousand Arrows ignores type modifiers for flying mons - if (!IsBattlerGrounded(battlerDef) && (gBattleMoves[move].flags & FLAG_DAMAGE_AIRBORNE) + if (!IsBattlerGrounded(battlerDef) && (gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING) && (gBattleMons[battlerDef].type1 == TYPE_FLYING || gBattleMons[battlerDef].type2 == TYPE_FLYING || gBattleMons[battlerDef].type3 == TYPE_FLYING)) { modifier = UQ_4_12(1.0); diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index caa343dfe4..db02083b0f 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -9588,7 +9588,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 100, .target = MOVE_TARGET_BOTH, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_IN_AIR | FLAG_DAMAGE_AIRBORNE, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_IN_AIR | FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING, .split = SPLIT_PHYSICAL, },