From ca11a6f6e4bd85ddb5ae2c692b61428636b39e02 Mon Sep 17 00:00:00 2001 From: surskitty Date: Thu, 30 Jan 2025 21:17:24 -0500 Subject: [PATCH] A configuration to change all ice weather effects to either Hail or Snowscape. #6147 --- data/battle_scripts_1.s | 4 ++++ include/config/battle.h | 9 ++++++++- src/battle_dynamax.c | 5 +++++ src/data/items.h | 19 +++++++++++++++++++ src/data/moves_info.h | 39 ++++++++++++++++++++++++++++++++++++++- 5 files changed, 74 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0703dc09c010..7126004f5ade 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -272,7 +272,11 @@ BattleScript_EffectChillyReception:: jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_RAIN_PRIMAL, BattleScript_EffectChillyReceptionBlockedByPrimalRain jumpifhalfword CMP_COMMON_BITS, gBattleWeather, B_WEATHER_STRONG_WINDS, BattleScript_EffectChillyReceptionBlockedByStrongWinds call BattleScript_EffectChillyReceptionPlayAnimation +#if B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_HAIL + setfieldweather ENUM_WEATHER_HAIL +#else setfieldweather ENUM_WEATHER_SNOW +#endif call BattleScript_MoveWeatherChangeRet goto BattleScript_MoveSwitch BattleScript_EffectChillyReceptionPlayAnimation: diff --git a/include/config/battle.h b/include/config/battle.h index f86c529c46c2..6e30af0bad65 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -213,11 +213,18 @@ #define B_SHOW_PARTNER_TARGET FALSE // Shows the battler partner will target. // Weather settings +// Search for 'rain', 'sunny day', and 'hail' for move-specific or species-specific weather interactions. + +#define B_ICE_WEATHER_BOTH 0 +#define B_ICE_WEATHER_HAIL 1 +#define B_ICE_WEATHER_SNOW 2 + #define B_ABILITY_WEATHER GEN_LATEST // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move or a different weather-affecting ability. #define B_SANDSTORM_SPDEF_BOOST GEN_LATEST // In Gen4+, Sandstorm weather multiplies the Sp. Defense of Rock-type Pokémon by x1.5. -#define B_OVERWORLD_SNOW GEN_LATEST // In Gen9+, overworld Snow will summon snow instead of hail in battle. #define B_OVERWORLD_FOG GEN_LATEST // In Gen8+, overworld Fog summons Misty Terrain in battle. In Gen4 only, overworld Fog summons the unique fog weather condition in battle. +#define B_OVERWORLD_SNOW GEN_LATEST // In Gen9+, overworld Snow will summon snow instead of hail in battle. #define B_SNOW_WARNING GEN_LATEST // In Gen9+, Snow Warning will summon snow instead of hail. +#define B_PREFERRED_ICE_WEATHER B_ICE_WEATHER_BOTH // Toggles Hail move effects to Snow and vis versa. // Terrain settings #define B_TERRAIN_BG_CHANGE TRUE // If set to TRUE, terrain moves permanently change the default battle background until the effect fades. diff --git a/src/battle_dynamax.c b/src/battle_dynamax.c index 0f55b33dab7e..24f0e1c86899 100644 --- a/src/battle_dynamax.c +++ b/src/battle_dynamax.c @@ -601,8 +601,13 @@ void BS_SetMaxMoveEffect(void) msg = B_MSG_STARTED_SANDSTORM; break; case MAX_EFFECT_HAIL: +#if B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_SNOW + weather = ENUM_WEATHER_SNOW; + msg = B_MSG_STARTED_SNOW; +#else weather = ENUM_WEATHER_HAIL; msg = B_MSG_STARTED_HAIL; +#endif break; } if (TryChangeBattleWeather(gBattlerAttacker, weather, FALSE)) diff --git a/src/data/items.h b/src/data/items.h index 2b560ad9d5fd..1146c4b0e2ef 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -8008,10 +8008,22 @@ const struct Item gItemsInfo[] = .name = _("Icy Rock"), .price = (I_PRICE >= GEN_9) ? 8000 : ((I_PRICE >= GEN_7) ? 4000 : 200), .holdEffect = HOLD_EFFECT_ICY_ROCK, +#if B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_HAIL .description = COMPOUND_STRING( "Extends the length\n" "of the move Hail\n" "used by the holder."), +#elif B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_SNOW + .description = COMPOUND_STRING( + "Extends the length\n" + "of Snowscape if\n" + "used by the holder."), +#else + .description = COMPOUND_STRING( + "Extends the length\n" + "of Ice-type weathers\n" + "used by the holder."), +#endif .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -10502,10 +10514,17 @@ const struct Item gItemsInfo[] = { .name = _("TM07"), .price = 3000, +#if B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_SNOW + .description = COMPOUND_STRING( + "Raises the Defense\n" + "of Ice type {PKMN}\n" + "for 5 turns."), +#else .description = COMPOUND_STRING( "Creates a hailstorm\n" "that damages all\n" "types except Ice."), +#endif .importance = I_REUSABLE_TMS, .pocket = POCKET_TM_HM, .type = ITEM_USE_PARTY_MENU, diff --git a/src/data/moves_info.h b/src/data/moves_info.h index 50f8cebbd3a3..94cefa2a7aa5 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -6554,10 +6554,17 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = [MOVE_HAIL] = { .name = COMPOUND_STRING("Hail"), +#if B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_SNOW + .description = COMPOUND_STRING( + "Summons a snowstorm that\n" + "lasts for five turns."), + .effect = EFFECT_SNOWSCAPE, +#else .description = COMPOUND_STRING( "Summons a hailstorm that\n" "strikes every turn."), .effect = EFFECT_HAIL, +#endif .power = 0, .type = TYPE_ICE, .accuracy = 0, @@ -6572,7 +6579,11 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .contestCategory = CONTEST_CATEGORY_BEAUTY, .contestComboStarterId = COMBO_STARTER_HAIL, .contestComboMoves = {0}, +#if B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_SNOW + .battleAnimScript = gBattleAnimMove_Snowscape, +#else .battleAnimScript = gBattleAnimMove_Hail, +#endif }, [MOVE_TORMENT] = @@ -16336,9 +16347,19 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = [MOVE_AURORA_VEIL] = { .name = COMPOUND_STRING("Aurora Veil"), +#if B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_SNOW + .description = COMPOUND_STRING( + "Weakens all attacks, but\n" + "only usable with snow."), +#elif B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_BOTH + .description = COMPOUND_STRING( + "Weakens all attacks if\n" + "used in hail or snow."), +#else .description = COMPOUND_STRING( "Weakens all attacks, but\n" "only usable with hail."), +#endif .effect = EFFECT_AURORA_VEIL, .power = 0, .type = TYPE_ICE, @@ -19840,9 +19861,15 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = [MOVE_CHILLY_RECEPTION] = { .name = COMPOUND_STRING("Chilly Reception"), +#if B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_HAIL + .description = COMPOUND_STRING( + "Bad joke summons hailstorm.\n" + "The user also switches out."), +#else .description = COMPOUND_STRING( "Bad joke summons snowstorm.\n" "The user also switches out."), +#endif .effect = EFFECT_CHILLY_RECEPTION, .power = 0, .type = TYPE_ICE, @@ -19881,10 +19908,17 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = [MOVE_SNOWSCAPE] = { .name = COMPOUND_STRING("Snowscape"), +#if B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_HAIL + .description = COMPOUND_STRING( + "Summons a hailstorm that\n" + "strikes every turn."), + .effect = EFFECT_HAIL, +#else .description = COMPOUND_STRING( "Summons a snowstorm that\n" "lasts for five turns."), .effect = EFFECT_SNOWSCAPE, +#endif .power = 0, .type = TYPE_ICE, .accuracy = 0, @@ -19895,8 +19929,11 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .zMove = { .effect = Z_EFFECT_SPD_UP_1 }, .ignoresProtect = TRUE, .mirrorMoveBanned = TRUE, - .metronomeBanned = TRUE, +#if B_PREFERRED_ICE_WEATHER == B_ICE_WEATHER_HAIL + .battleAnimScript = gBattleAnimMove_Hail, +#else .battleAnimScript = gBattleAnimMove_Snowscape, +#endif }, [MOVE_POUNCE] =