From 7c67f1ac27ad698d76754b88653e8e98739f6a29 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Mon, 5 Dec 2022 23:24:27 -0300 Subject: [PATCH] Activated Switch In abilities during weather and terrain change Abilities such as Protosynthesis and Quark Drive demand it. --- data/battle_scripts_1.s | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 746d83230..785625e32 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -4886,6 +4886,7 @@ BattleScript_MoveWeatherChange:: printfromtable gMoveWeatherChangeStringIds waitmessage B_WAIT_TIME_LONG call BattleScript_WeatherFormChanges + call BattleScript_ActivateSwitchInAbilities goto BattleScript_MoveEnd BattleScript_EffectSunnyDay:: @@ -8458,6 +8459,18 @@ BattleScript_TerrainSeedLoop_NextBattler: addbyte gBattlerTarget, 0x1 jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_TerrainSeedLoopIter restoretarget + call BattleScript_ActivateSwitchInAbilities + return + +BattleScript_ActivateSwitchInAbilities: + copybyte sBATTLER, gBattlerAttacker + setbyte gBattlerAttacker, 0 +BattleScript_ActivateSwitchInAbilities_Loop: + switchinabilities BS_ATTACKER +BattleScript_ActivateSwitchInAbilities_Increment: + addbyte gBattlerAttacker, 1 + jumpifbytenotequal gBattlerAttacker, gBattlersCount, BattleScript_ActivateSwitchInAbilities_Loop + copybyte gBattlerAttacker, sBATTLER return BattleScript_ElectricSurgeActivates::