From 96c6f5a41cf64f2ae4f1f6a669f0c847f80b256a Mon Sep 17 00:00:00 2001 From: lioniac Date: Sun, 14 Mar 2021 20:19:27 -0300 Subject: [PATCH] Snow Weather Fix (Credit: ghoulslash) --- src/battle_message.c | 4 ++-- src/battle_util.c | 9 +++++++++ src/field_weather.c | 2 ++ src/field_weather_effects.c | 4 ++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/battle_message.c b/src/battle_message.c index 68f75ffa1e..2984b01517 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1121,7 +1121,7 @@ const u16 gWeatherContinuesStringIds[] = { STRINGID_ITISRAINING, STRINGID_ITISRAINING, STRINGID_ITISRAINING, - STRINGID_ITISRAINING, + STRINGID_STARTEDHAIL, STRINGID_ITISRAINING, STRINGID_ITISRAINING, STRINGID_ITISRAINING, @@ -1130,7 +1130,7 @@ const u16 gWeatherContinuesStringIds[] = { STRINGID_ITISRAINING, STRINGID_ITISRAINING, STRINGID_SUNLIGHTSTRONG, - STRINGID_ITISRAINING, + STRINGID_STARTEDHAIL, STRINGID_ITISRAINING, STRINGID_ITISRAINING }; diff --git a/src/battle_util.c b/src/battle_util.c index 27d90b0d49..072e6bc890 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1656,6 +1656,15 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA ++effect; } break; + case WEATHER_SNOW: + if (!(gBattleWeather & WEATHER_HAIL_ANY)) + { + gBattleWeather = WEATHER_HAIL_ANY; + gBattleScripting.animArg1 = B_ANIM_HAIL_CONTINUES; + gBattleScripting.battler = battler; + effect++; + } + break; } if (effect) { diff --git a/src/field_weather.c b/src/field_weather.c index b097524bc2..1dc316ca31 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -1,6 +1,7 @@ #include "global.h" #include "gflib.h" #include "blend_palette.h" +#include "field_camera.h" #include "field_effect.h" #include "field_weather.h" #include "field_weather_util.h" @@ -211,6 +212,7 @@ static void Task_WeatherInit(u8 taskId) // When the screen fades in, this is set to TRUE. if (gWeatherPtr->readyForInit) { + UpdateCameraPanning(); sWeatherFuncs[gWeatherPtr->currWeather].initAll(); gTasks[taskId].func = Task_WeatherMain; } diff --git a/src/field_weather_effects.c b/src/field_weather_effects.c index f935b3afb6..2931831c7d 100644 --- a/src/field_weather_effects.c +++ b/src/field_weather_effects.c @@ -737,7 +737,7 @@ void Snow_InitVars(void) gWeatherPtr->weatherGfxLoaded = FALSE; gWeatherPtr->gammaTargetIndex = 3; gWeatherPtr->gammaStepDelay = 20; - gWeatherPtr->targetSnowflakeSpriteCount = 16; + gWeatherPtr->targetSnowflakeSpriteCount = 20; gWeatherPtr->snowflakeVisibleCounter = 0; } @@ -901,7 +901,7 @@ static void InitSnowflakeSpriteMovement(struct Sprite *sprite) static void WaitSnowflakeSprite(struct Sprite *sprite) { - if (gWeatherPtr->unknown_6E2 > 18) + if (++gWeatherPtr->unknown_6E2 > 18) { sprite->invisible = FALSE; sprite->callback = UpdateSnowflakeSprite;