From a461823cbf557706e5a8767e2b4f3279532e7300 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sat, 30 Oct 2021 09:48:23 -0400 Subject: [PATCH] weather ball anim checks utility umbrella --- src/battle_anim_effects_3.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 11e350535c..6ec5773888 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -22,6 +22,7 @@ #include "constants/rgb.h" #include "constants/songs.h" #include "constants/weather.h" +#include "constants/hold_effects.h" extern const struct SpriteTemplate gThoughtBubbleSpriteTemplate; @@ -5526,10 +5527,12 @@ static void AnimRecycle_Step(struct Sprite *sprite) void AnimTask_GetWeather(u8 taskId) { + bool32 utilityUmbrellaAffected = GetBattlerHoldEffect(gBattleAnimAttacker, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA; + gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_NONE; - if (gWeatherMoveAnim & WEATHER_SUN_ANY) + if (gWeatherMoveAnim & WEATHER_SUN_ANY && !utilityUmbrellaAffected) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SUN; - else if (gWeatherMoveAnim & WEATHER_RAIN_ANY) + else if (gWeatherMoveAnim & WEATHER_RAIN_ANY && !utilityUmbrellaAffected) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_RAIN; else if (gWeatherMoveAnim & WEATHER_SANDSTORM_ANY) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SANDSTORM;