changed B_WEATHER_FORM preproc to affect tables instead of function

This commit is contained in:
AgustinGDLV 2023-05-23 14:03:38 -07:00
parent 7b08713707
commit d4c7e5e559
4 changed files with 9 additions and 4 deletions

View file

@ -101,7 +101,6 @@
#define B_STOCKPILE_RAISES_DEFS GEN_LATEST // In Gen4+, Stockpile also raises Defense and Sp. Defense stats. Once Spit Up / Swallow is used, these stat changes are lost.
#define B_TRANSFORM_SHINY GEN_LATEST // In Gen4+, Transform will copy the shiny state of the opponent instead of maintaining its own shiny state.
#define B_TRANSFORM_FORM_CHANGES GEN_LATEST // In Gen5+, Transformed Pokemon cannot change forms.
#define B_WEATHER_FORM_SUPPRESS GEN_LATEST // In Gen5+, Cherrim and Castform revert to their normal forms upon losing their ability.
// Ability settings
#define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters.

View file

@ -16605,7 +16605,6 @@ void BS_ItemRestorePP(void)
void BS_TryRevertWeatherForm(void)
{
NATIVE_ARGS();
#if B_WEATHER_FORM_SUPPRESS >= GEN_5
if (TryBattleFormChange(gBattlerTarget, FORM_CHANGE_BATTLE_WEATHER))
{
gBattleScripting.battler = gBattlerTarget;
@ -16613,7 +16612,6 @@ void BS_TryRevertWeatherForm(void)
gBattlescriptCurrInstr = BattleScript_TargetFormChangeWithStringNoPopup;
return;
}
#endif
gBattlescriptCurrInstr = cmd->nextInstr;
}

View file

@ -10167,7 +10167,7 @@ u16 GetBattleFormChangeTargetSpecies(u8 battlerId, u16 method)
targetSpecies = formChanges[i].targetSpecies;
}
// We need to revert the weather form if the field is under Air Lock, too.
if (!WEATHER_HAS_EFFECT && formChanges[i].param1 == B_WEATHER_NONE)
else if (!WEATHER_HAS_EFFECT && formChanges[i].param1 == B_WEATHER_NONE)
{
targetSpecies = formChanges[i].targetSpecies;
}

View file

@ -156,11 +156,19 @@ static const struct FormChange sAbsolFormChangeTable[] = {
};
static const struct FormChange sCastformFormChangeTable[] = {
#ifdef B_WEATHER_FORMS >= GEN_5
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SUNNY, B_WEATHER_SUN, ABILITY_FORECAST},
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_RAINY, B_WEATHER_RAIN, ABILITY_FORECAST},
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SNOWY, B_WEATHER_HAIL | B_WEATHER_SNOW, ABILITY_FORECAST},
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM, ~(B_WEATHER_SUN | B_WEATHER_RAIN | B_WEATHER_HAIL | B_WEATHER_SNOW), ABILITY_FORECAST},
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM, B_WEATHER_NONE, ABILITY_FORECAST},
#else
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SUNNY, B_WEATHER_SUN},
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_RAINY, B_WEATHER_RAIN},
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM_SNOWY, B_WEATHER_HAIL | B_WEATHER_SNOW},
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM, ~(B_WEATHER_SUN | B_WEATHER_RAIN | B_WEATHER_HAIL | B_WEATHER_SNOW)},
{FORM_CHANGE_BATTLE_WEATHER, SPECIES_CASTFORM, B_WEATHER_NONE},
#endif
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_CASTFORM},
{FORM_CHANGE_FAINT, SPECIES_CASTFORM},
{FORM_CHANGE_END_BATTLE, SPECIES_CASTFORM},