Fixes Shell Trap not activating on contact but no damage (#8243)

This commit is contained in:
Alex 2025-11-13 22:51:07 +01:00 committed by GitHub
parent b72c2b244b
commit 82d09571fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 1 deletions

View File

@ -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))
{

View File

@ -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);
}
}