diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index f20e13e8ae0a..a0f1e81ae344 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7467,6 +7467,7 @@ BattleScript_MoveEffectConfusion:: BattleScript_MoveEffectRecoil:: jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd + jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_RecoilEnd BattleScript_DoRecoil:: orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_IGNORE_DISGUISE healthbarupdate BS_ATTACKER diff --git a/test/battle/ability/magic_guard.c b/test/battle/ability/magic_guard.c new file mode 100644 index 000000000000..69e8bac9c7fc --- /dev/null +++ b/test/battle/ability/magic_guard.c @@ -0,0 +1,17 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Magic Guard prevents recoil damage to the user") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_DOUBLE_EDGE].recoil == 33); + PLAYER(SPECIES_CLEFABLE) { Ability(ABILITY_MAGIC_GUARD); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_DOUBLE_EDGE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_EDGE, player); + HP_BAR(opponent); + NOT HP_BAR(player); + } +} diff --git a/test/battle/move_effect/max_hp_50_recoil.c b/test/battle/move_effect/max_hp_50_recoil.c index 8d5cbdaed2cd..1ac98854e095 100644 --- a/test/battle/move_effect/max_hp_50_recoil.c +++ b/test/battle/move_effect/max_hp_50_recoil.c @@ -91,8 +91,9 @@ SINGLE_BATTLE_TEST("Steel Beam hp loss is prevented by Magic Guard") } WHEN { TURN { MOVE(player, MOVE_STEEL_BEAM); } } SCENE { - NOT HP_BAR(player); ANIMATION(ANIM_TYPE_MOVE, MOVE_STEEL_BEAM, player); + HP_BAR(opponent); + NOT HP_BAR(player); } } diff --git a/test/battle/move_effect/mind_blown.c b/test/battle/move_effect/mind_blown.c index f1b7d8b98a46..da39cf18d787 100644 --- a/test/battle/move_effect/mind_blown.c +++ b/test/battle/move_effect/mind_blown.c @@ -114,8 +114,9 @@ SINGLE_BATTLE_TEST("Mind Blown hp loss is prevented by Magic Guard") } WHEN { TURN { MOVE(player, MOVE_MIND_BLOWN); } } SCENE { - NOT HP_BAR(player); ANIMATION(ANIM_TYPE_MOVE, MOVE_MIND_BLOWN, player); + HP_BAR(opponent); + NOT HP_BAR(player); } }