Fixes Spiky Shield Counter interaction (#5402)
* Fixes Spiky Shield Counter interaction * Update test/battle/move_effect/protect.c --------- Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
This commit is contained in:
parent
71dfd3e7c0
commit
68c51f8412
2 changed files with 22 additions and 1 deletions
|
@ -5448,7 +5448,9 @@ static void Cmd_moveend(void)
|
|||
case MOVEEND_PROTECT_LIKE_EFFECT:
|
||||
if (gProtectStructs[gBattlerAttacker].touchedProtectLike)
|
||||
{
|
||||
if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
|
||||
if (gProtectStructs[gBattlerTarget].spikyShielded
|
||||
&& gMovesInfo[gCurrentMove].effect != EFFECT_COUNTER
|
||||
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
|
||||
{
|
||||
gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE;
|
||||
gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 8;
|
||||
|
|
|
@ -547,3 +547,22 @@ DOUBLE_BATTLE_TEST("Crafty Shield does not protect against moves that target all
|
|||
MESSAGE("Foe Sunflora's Defense rose!");
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Spiky Shield does not damage users on Counter or Mirror Coat")
|
||||
{
|
||||
u32 move;
|
||||
PARAMETRIZE { move = MOVE_MIRROR_COAT; }
|
||||
PARAMETRIZE { move = MOVE_COUNTER; }
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_SPIKY_SHIELD); MOVE(opponent, move); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SPIKY_SHIELD, player);
|
||||
NONE_OF {
|
||||
ANIMATION(ANIM_TYPE_MOVE, move, opponent);
|
||||
HP_BAR(opponent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue