mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-28 16:38:57 +01:00
Merge pull request #2169 from Sneed69/inverse-flying
Make ungrounded flying mons weak to ground in inverse battles
This commit is contained in:
commit
1ddf3ca7e0
@ -7771,33 +7771,35 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only called directly when calculating damage type effectiveness
|
||||||
bool32 IsBattlerGrounded(u8 battlerId)
|
static bool32 IsBattlerGrounded2(u8 battlerId, bool32 considerInverse)
|
||||||
{
|
{
|
||||||
if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_IRON_BALL)
|
if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_IRON_BALL)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else if (gFieldStatuses & STATUS_FIELD_GRAVITY)
|
if (gFieldStatuses & STATUS_FIELD_GRAVITY)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#if B_ROOTED_GROUNDING >= GEN_4
|
#if B_ROOTED_GROUNDING >= GEN_4
|
||||||
else if (gStatuses3[battlerId] & STATUS3_ROOTED)
|
if (gStatuses3[battlerId] & STATUS3_ROOTED)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
#endif
|
||||||
else if (gStatuses3[battlerId] & STATUS3_SMACKED_DOWN)
|
if (gStatuses3[battlerId] & STATUS3_SMACKED_DOWN)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
if (gStatuses3[battlerId] & STATUS3_TELEKINESIS)
|
||||||
|
return FALSE;
|
||||||
|
if (gStatuses3[battlerId] & STATUS3_MAGNET_RISE)
|
||||||
|
return FALSE;
|
||||||
|
if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_AIR_BALLOON)
|
||||||
|
return FALSE;
|
||||||
|
if (GetBattlerAbility(battlerId) == ABILITY_LEVITATE)
|
||||||
|
return FALSE;
|
||||||
|
if (IS_BATTLER_OF_TYPE(battlerId, TYPE_FLYING) && (!considerInverse || !FlagGet(B_FLAG_INVERSE_BATTLE)))
|
||||||
|
return FALSE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
else if (gStatuses3[battlerId] & STATUS3_TELEKINESIS)
|
bool32 IsBattlerGrounded(u8 battlerId)
|
||||||
return FALSE;
|
{
|
||||||
else if (gStatuses3[battlerId] & STATUS3_MAGNET_RISE)
|
IsBattlerGrounded2(battlerId, FALSE);
|
||||||
return FALSE;
|
|
||||||
else if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_AIR_BALLOON)
|
|
||||||
return FALSE;
|
|
||||||
else if (GetBattlerAbility(battlerId) == ABILITY_LEVITATE)
|
|
||||||
return FALSE;
|
|
||||||
else if (IS_BATTLER_OF_TYPE(battlerId, TYPE_FLYING))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
else
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 IsBattlerAlive(u8 battlerId)
|
bool32 IsBattlerAlive(u8 battlerId)
|
||||||
@ -9173,7 +9175,7 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat
|
|||||||
&& gBattleMons[battlerDef].type3 != gBattleMons[battlerDef].type1)
|
&& gBattleMons[battlerDef].type3 != gBattleMons[battlerDef].type1)
|
||||||
MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, gBattleMons[battlerDef].type3, battlerAtk, recordAbilities);
|
MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, gBattleMons[battlerDef].type3, battlerAtk, recordAbilities);
|
||||||
|
|
||||||
if (moveType == TYPE_GROUND && !IsBattlerGrounded(battlerDef) && !(gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING))
|
if (moveType == TYPE_GROUND && !IsBattlerGrounded2(battlerDef, TRUE) && !(gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING))
|
||||||
{
|
{
|
||||||
modifier = UQ_4_12(0.0);
|
modifier = UQ_4_12(0.0);
|
||||||
if (recordAbilities && defAbility == ABILITY_LEVITATE)
|
if (recordAbilities && defAbility == ABILITY_LEVITATE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user