Parametrized Ice Face's weather form change (#8115)
This commit is contained in:
parent
d95c6427b0
commit
51a6081c8e
@ -67,6 +67,7 @@ static void SetRandomMultiHitCounter();
|
||||
static bool32 IsNonVolatileStatusBlocked(u32 battlerDef, enum Ability abilityDef, enum Ability abilityAffected, const u8 *battleScript, enum FunctionCallOption option);
|
||||
static bool32 CanSleepDueToSleepClause(u32 battlerAtk, u32 battlerDef, enum FunctionCallOption option);
|
||||
static bool32 IsOpposingSideEmpty(u32 battler);
|
||||
static bool32 CanBattlerFormChange(u32 battler, enum FormChanges method);
|
||||
|
||||
// Submoves
|
||||
static u32 GetMirrorMoveMove(void);
|
||||
@ -4518,17 +4519,6 @@ u32 AbilityBattleEffects(enum AbilityEffect caseID, u32 battler, enum Ability ab
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
case ABILITY_ICE_FACE:
|
||||
if (IsBattlerWeatherAffected(battler, B_WEATHER_HAIL | B_WEATHER_SNOW)
|
||||
&& gBattleMons[battler].species == SPECIES_EISCUE_NOICE
|
||||
&& !(gBattleMons[battler].volatiles.transformed))
|
||||
{
|
||||
// TODO: Convert this to a proper FORM_CHANGE type.
|
||||
gBattleMons[battler].species = SPECIES_EISCUE_ICE;
|
||||
BattleScriptPushCursorAndCallback(BattleScript_BattlerFormChangeWithStringEnd3);
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
case ABILITY_COMMANDER:
|
||||
partner = BATTLE_PARTNER(battler);
|
||||
if (!gSpecialStatuses[battler].switchInAbilityDone
|
||||
@ -5518,33 +5508,22 @@ u32 AbilityBattleEffects(enum AbilityEffect caseID, u32 battler, enum Ability ab
|
||||
{
|
||||
case ABILITY_FORECAST:
|
||||
case ABILITY_FLOWER_GIFT:
|
||||
if ((IsBattlerWeatherAffected(battler, gBattleWeather)
|
||||
case ABILITY_ICE_FACE:
|
||||
{
|
||||
u32 battlerWeatherAffected = IsBattlerWeatherAffected(battler, gBattleWeather);
|
||||
if (battlerWeatherAffected && !CanBattlerFormChange(battler, FORM_CHANGE_BATTLE_WEATHER))
|
||||
{
|
||||
// If Hail/Snow activates when in Eiscue is in base, prevent reversion when Eiscue Noice gets broken
|
||||
gDisableStructs[battler].weatherAbilityDone = TRUE;
|
||||
}
|
||||
|
||||
if (((!gDisableStructs[battler].weatherAbilityDone && battlerWeatherAffected)
|
||||
|| gBattleWeather == B_WEATHER_NONE
|
||||
|| !HasWeatherEffect()) // Air Lock active
|
||||
&& TryBattleFormChange(battler, FORM_CHANGE_BATTLE_WEATHER))
|
||||
{
|
||||
gBattleScripting.battler = battler;
|
||||
BattleScriptPushCursorAndCallback(BattleScript_BattlerFormChangeWithStringEnd3);
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
case ABILITY_ICE_FACE:
|
||||
{
|
||||
u32 battlerWeatherAffected = IsBattlerWeatherAffected(battler, B_WEATHER_HAIL | B_WEATHER_SNOW);
|
||||
if (battlerWeatherAffected && gBattleMons[battler].species == SPECIES_EISCUE)
|
||||
{
|
||||
// If Hail/Snow activates when in Eiscue is in base, prevent reversion when Eiscue Noice gets broken
|
||||
gDisableStructs[battler].weatherAbilityDone = TRUE;
|
||||
}
|
||||
if (!gDisableStructs[battler].weatherAbilityDone
|
||||
&& battlerWeatherAffected
|
||||
&& gBattleMons[battler].species == SPECIES_EISCUE_NOICE
|
||||
&& !(gBattleMons[battler].volatiles.transformed))
|
||||
{
|
||||
// TODO: Convert this to a proper FORM_CHANGE type.
|
||||
gBattleScripting.battler = battler;
|
||||
gDisableStructs[battler].weatherAbilityDone = TRUE;
|
||||
gBattleMons[battler].species = SPECIES_EISCUE_ICE;
|
||||
BattleScriptPushCursorAndCallback(BattleScript_BattlerFormChangeWithStringEnd3);
|
||||
effect++;
|
||||
}
|
||||
@ -9048,7 +9027,7 @@ u16 GetBattleFormChangeTargetSpecies(u32 battler, enum FormChanges method)
|
||||
return targetSpecies;
|
||||
}
|
||||
|
||||
bool32 CanBattlerFormChange(u32 battler, enum FormChanges method)
|
||||
static bool32 CanBattlerFormChange(u32 battler, enum FormChanges method)
|
||||
{
|
||||
// Can't change form if transformed.
|
||||
if (gBattleMons[battler].volatiles.transformed
|
||||
|
||||
@ -1204,6 +1204,7 @@ static const struct FormChange sAlcremieFormChangeTable[] =
|
||||
|
||||
#if P_FAMILY_EISCUE
|
||||
static const struct FormChange sEiscueFormChangeTable[] = {
|
||||
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_EISCUE_ICE, B_WEATHER_HAIL | B_WEATHER_SNOW, ABILITY_ICE_FACE},
|
||||
{FORM_CHANGE_FAINT, SPECIES_EISCUE_ICE},
|
||||
{FORM_CHANGE_END_BATTLE, SPECIES_EISCUE_ICE},
|
||||
{FORM_CHANGE_TERMINATOR},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user