diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index a8daf8841b..5f3feefa31 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -300,9 +300,9 @@ enum MoveEndEffects MOVEEND_RECOIL, MOVEEND_ITEM_EFFECTS_ATTACKER, MOVEEND_MAGICIAN, // Occurs after final multi-hit strike, and after other items/abilities would activate + MOVEEND_RED_CARD, // Red Card triggers before Eject Pack MOVEEND_EJECT_ITEMS, MOVEEND_WHITE_HERB, - MOVEEND_RED_CARD, MOVEEND_LIFEORB_SHELLBELL, // Includes shell bell, throat spray, etc MOVEEND_CHANGED_ITEMS, MOVEEND_PICKPOCKET, diff --git a/test/battle/form_change/primal_reversion.c b/test/battle/form_change/primal_reversion.c index df19a1d0d6..4b9e019b5b 100644 --- a/test/battle/form_change/primal_reversion.c +++ b/test/battle/form_change/primal_reversion.c @@ -332,3 +332,19 @@ DOUBLE_BATTLE_TEST("Primal reversion and other switch-in effects trigger for all EXPECT_EQ(opponentRight->statStages[STAT_SPEED], DEFAULT_STAT_STAGE - 1); } } + +SINGLE_BATTLE_TEST("111") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); + PLAYER(SPECIES_GROUDON) { HP(1); Item(ITEM_RED_ORB); } + PLAYER(SPECIES_WOBBUFFET) + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, player); + MESSAGE("Groudon's Primal Reversion! It reverted to its primal form!"); + MESSAGE("Groudon fainted!"); + } +} diff --git a/test/battle/hold_effect/red_card.c b/test/battle/hold_effect/red_card.c index 3209549de1..7cdbba2412 100644 --- a/test/battle/hold_effect/red_card.c +++ b/test/battle/hold_effect/red_card.c @@ -467,4 +467,26 @@ SINGLE_BATTLE_TEST("Red Card prevents Emergency Exit activation when triggered") } } +SINGLE_BATTLE_TEST("Red Card activates before Eject Pack") +{ + GIVEN { + ASSUME(MoveHasAdditionalEffectSelf(MOVE_OVERHEAT, MOVE_EFFECT_SP_ATK_MINUS_2) == TRUE); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_PACK); } + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(player, MOVE_OVERHEAT); MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_OVERHEAT, player); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet is switched out with the Eject Button!"); + } + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); + MESSAGE("Foe Wobbuffet held up its Red Card against Wobbuffet!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + } +} + // SINGLE_BATTLE_TEST("Red Card activates but fails if the attacker has Dynamaxed")