Fixes Shell Trap not activating on contact but no damage (#8243)
This commit is contained in:
parent
b72c2b244b
commit
82d09571fd
@ -6294,9 +6294,10 @@ static void Cmd_moveend(void)
|
||||
|
||||
// Set ShellTrap to activate after the attacker's turn if target was hit by a physical move.
|
||||
if (GetMoveEffect(gChosenMoveByBattler[gBattlerTarget]) == EFFECT_SHELL_TRAP
|
||||
&& IsBattleMovePhysical(gCurrentMove)
|
||||
&& IsBattlerTurnDamaged(gBattlerTarget)
|
||||
&& gBattlerTarget != gBattlerAttacker
|
||||
&& !IsBattlerAlly(gBattlerTarget, gBattlerAttacker)
|
||||
&& gProtectStructs[gBattlerTarget].physicalDmg
|
||||
&& gProtectStructs[gBattlerTarget].physicalBattlerId == gBattlerAttacker
|
||||
&& !TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove))
|
||||
{
|
||||
|
||||
@ -198,3 +198,19 @@ DOUBLE_BATTLE_TEST("Shell Trap targets correctly if one of the opponents has fai
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerLeft);
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Shell Trap activates if user is hit with a physical move but does no damage")
|
||||
{
|
||||
GIVEN {
|
||||
ASSUME(GetMoveEffect(MOVE_FALSE_SWIPE) == EFFECT_FALSE_SWIPE);
|
||||
PLAYER(SPECIES_WOBBUFFET) { HP(1); }
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_SHELL_TRAP); MOVE(opponent, MOVE_FALSE_SWIPE); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, player);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_FALSE_SWIPE, opponent);
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, player);
|
||||
HP_BAR(opponent);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user