From 57ec87387d7880aa37737c89a78ae14706753f58 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sun, 19 May 2024 21:29:54 +0200 Subject: [PATCH] Fixes freeze on Galvanize Explosion against Volt Absorb (#4601) --- data/battle_scripts_1.s | 3 --- test/battle/move_effect/explosion.c | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a0f1e81ae3..b8a4a20922 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8097,7 +8097,6 @@ BattleScript_MoveStatDrain:: .endif BattleScript_MoveStatDrain_Cont: clearsemiinvulnerablebit - tryfaintmon BS_ATTACKER goto BattleScript_MoveEnd BattleScript_MonMadeMoveUseless_PPLoss:: @@ -8108,7 +8107,6 @@ BattleScript_MonMadeMoveUseless:: call BattleScript_AbilityPopUp printstring STRINGID_PKMNSXMADEYUSELESS waitmessage B_WAIT_TIME_LONG - tryfaintmon BS_ATTACKER orhalfword gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE goto BattleScript_MoveEnd @@ -8120,7 +8118,6 @@ BattleScript_FlashFireBoost:: call BattleScript_AbilityPopUp printfromtable gFlashFireStringIds waitmessage B_WAIT_TIME_LONG - tryfaintmon BS_ATTACKER goto BattleScript_MoveEnd BattleScript_AbilityPreventsPhasingOut:: diff --git a/test/battle/move_effect/explosion.c b/test/battle/move_effect/explosion.c index 10e9feaa80..a45a465ba2 100644 --- a/test/battle/move_effect/explosion.c +++ b/test/battle/move_effect/explosion.c @@ -123,3 +123,25 @@ SINGLE_BATTLE_TEST("Explosion does not trigger Destiny Bond") NOT HP_BAR(opponent); } } + +DOUBLE_BATTLE_TEST("Explosion boosted by Galvanize is correctly blocked by Volt Absorb") +{ + GIVEN { + PLAYER(SPECIES_GEODUDE_ALOLAN) { Ability(ABILITY_GALVANIZE); } + PLAYER(SPECIES_WYNAUT) { HP(1); } + OPPONENT(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); } + OPPONENT(SPECIES_WOBBUFFET) { HP(1); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_EXPLOSION); } + } SCENE { + MESSAGE("Geodude used Explosion!"); + HP_BAR(playerLeft, hp: 0); + ABILITY_POPUP(opponentLeft, ABILITY_VOLT_ABSORB); + NOT HP_BAR(opponentLeft, hp: 0); + HP_BAR(playerRight, hp: 0); + MESSAGE("Wynaut fainted!"); + HP_BAR(opponentRight, hp: 0); + MESSAGE("Foe Wobbuffet fainted!"); + MESSAGE("Geodude fainted!"); + } +}