From 64a45d8f4851e0d56af1cfcec1c6023f48871f27 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 3 Oct 2021 07:21:47 -0300 Subject: [PATCH] =?UTF-8?q?Tweaked=20trytoclearprimalweather=20Made=20it?= =?UTF-8?q?=20so=20it=20won't=20actually=20try=20to=20clear=20a=20primal?= =?UTF-8?q?=20weather=20if=20a=20Pok=C3=A9mon=20with=20Desolate=20Land,=20?= =?UTF-8?q?Primordial=20Sea=20or=20Delta=20Stream=20is=20present=20on=20th?= =?UTF-8?q?e=20field.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/battle_script_commands.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6b1e4e77a..90979264a 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8762,19 +8762,30 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; return; case VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER: - if (gBattleWeather & WEATHER_SUN_PRIMAL) + { + bool8 shouldNotClear = FALSE; + + for (i = 0; i < gBattlersCount; i++) + { + if (((GetBattlerAbility(i) == ABILITY_DESOLATE_LAND && gBattleWeather & WEATHER_SUN_PRIMAL) + || (GetBattlerAbility(i) == ABILITY_PRIMORDIAL_SEA && gBattleWeather & WEATHER_RAIN_PRIMAL) + || (GetBattlerAbility(i) == ABILITY_DELTA_STREAM && gBattleWeather & WEATHER_STRONG_WINDS)) + && IsBattlerAlive(i)) + shouldNotClear = TRUE; + } + if (gBattleWeather & WEATHER_SUN_PRIMAL && !shouldNotClear) { gBattleWeather &= ~WEATHER_SUN_PRIMAL; PrepareStringBattle(STRINGID_EXTREMESUNLIGHTFADED, gActiveBattler); gBattleCommunication[MSG_DISPLAY] = 1; } - else if (gBattleWeather & WEATHER_RAIN_PRIMAL) + else if (gBattleWeather & WEATHER_RAIN_PRIMAL && !shouldNotClear) { gBattleWeather &= ~WEATHER_RAIN_PRIMAL; PrepareStringBattle(STRINGID_HEAVYRAINLIFTED, gActiveBattler); gBattleCommunication[MSG_DISPLAY] = 1; } - else if (gBattleWeather & WEATHER_STRONG_WINDS) + else if (gBattleWeather & WEATHER_STRONG_WINDS && !shouldNotClear) { gBattleWeather &= ~WEATHER_STRONG_WINDS; PrepareStringBattle(STRINGID_STRONGWINDSDISSIPATED, gActiveBattler); @@ -8782,6 +8793,7 @@ static void Cmd_various(void) } break; } + } gBattlescriptCurrInstr += 3; }