mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-17 03:57:38 +01:00
Fix Thousand Arrows vs. Flying Type
Should ignore type modifiers against flying types that aren't grounded. Previous code just negated the targets' flying typing.
This commit is contained in:
parent
35add44a90
commit
20a7dec070
@ -7831,8 +7831,6 @@ static void MulByTypeEffectiveness(u16 *modifier, u16 move, u8 moveType, u8 batt
|
||||
mod = UQ_4_12(2.0);
|
||||
if (moveType == TYPE_GROUND && defType == TYPE_FLYING && IsBattlerGrounded(battlerDef) && mod == UQ_4_12(0.0))
|
||||
mod = UQ_4_12(1.0);
|
||||
if (gBattleMoves[move].flags & FLAG_DAMAGE_AIRBORNE && defType == TYPE_FLYING) // Thousand Arrows
|
||||
mod = UQ_4_12(1.0);
|
||||
|
||||
if (gProtectStructs[battlerDef].kingsShielded && gBattleMoves[move].effect != EFFECT_FEINT)
|
||||
mod = UQ_4_12(1.0);
|
||||
@ -7884,6 +7882,14 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat
|
||||
RecordAbilityBattle(battlerDef, ABILITY_LEVITATE);
|
||||
}
|
||||
}
|
||||
|
||||
// Thousand Arrows ignores type modifiers for flying mons
|
||||
if (!IsBattlerGrounded(battlerDef) && (gBattleMoves[move].flags & FLAG_DAMAGE_AIRBORNE)
|
||||
&& (gBattleMons[battlerDef].type1 == TYPE_FLYING || gBattleMons[battlerDef].type2 == TYPE_FLYING || gBattleMons[battlerDef].type3 == TYPE_FLYING))
|
||||
{
|
||||
modifier = UQ_4_12(1.0);
|
||||
}
|
||||
|
||||
if (GetBattlerAbility(battlerDef) == ABILITY_WONDER_GUARD && modifier <= UQ_4_12(1.0) && gBattleMoves[move].power)
|
||||
{
|
||||
modifier = UQ_4_12(0.0);
|
||||
|
Loading…
Reference in New Issue
Block a user