Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for Magic Guard to avoid taking recoil damage #4578

Merged
merged 3 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions test/battle/ability/magic_guard.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#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 {
NOT HP_BAR(player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_EDGE, player);
AlexOn1ine marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading