Skip to content

Commit

Permalink
A configuration to change all ice weather effects to either Hail or S…
Browse files Browse the repository at this point in the history
…nowscape. rh-hideout#6147
  • Loading branch information
surskitty committed Jan 31, 2025
1 parent fc00dc0 commit ca11a6f
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 2 deletions.
4 changes: 4 additions & 0 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 8 additions & 1 deletion include/config/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions src/battle_dynamax.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
19 changes: 19 additions & 0 deletions src/data/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
39 changes: 38 additions & 1 deletion src/data/moves_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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] =
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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] =
Expand Down

0 comments on commit ca11a6f

Please sign in to comment.