diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 937c007acd..7c6b95352d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1240,6 +1240,7 @@ static void Cmd_attackcanceler(void) ClearDamageCalcResults(); SetAtkCancellerForCalledMove(); + gEffectBattler = gBattlerTarget; if (BlocksPrankster(gCurrentMove, gBattlerTarget, gBattlerAttacker, TRUE)) { // Opponent used a prankster'd magic coat -> reflected status move should fail against a dark-type attacker diff --git a/test/battle/move_effect/magic_coat.c b/test/battle/move_effect/magic_coat.c index 561d15a532..343322408d 100644 --- a/test/battle/move_effect/magic_coat.c +++ b/test/battle/move_effect/magic_coat.c @@ -11,13 +11,23 @@ SINGLE_BATTLE_TEST("Magic Coat prints the correct message when bouncing back a m GIVEN { ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ZIGZAGOON); - OPPONENT(SPECIES_WYNAUT); + PLAYER(SPECIES_ZIGZAGOON); + OPPONENT(SPECIES_ZIGZAGOON); + OPPONENT(SPECIES_ZIGZAGOON); } WHEN { TURN { MOVE(player, MOVE_MAGIC_COAT); MOVE(opponent, MOVE_SPORE); } + TURN { SWITCH(opponent, 1); } + TURN { MOVE(player, MOVE_MAGIC_COAT); MOVE(opponent, MOVE_SPORE); } } SCENE { ANIMATION(ANIM_TYPE_MOVE, MOVE_MAGIC_COAT, player); - MESSAGE("Zigzagoon bounced the Spore back!");; - MESSAGE("The opposing Wynaut fell asleep!"); + MESSAGE("Zigzagoon bounced the Spore back!"); + MESSAGE("The opposing Zigzagoon fell asleep!"); + STATUS_ICON(opponent, sleep: TRUE); + ANIMATION(ANIM_TYPE_MOVE, MOVE_MAGIC_COAT, player); + MESSAGE("Zigzagoon bounced the Spore back!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SPORE, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_SLP, opponent); + MESSAGE("The opposing Zigzagoon fell asleep!"); STATUS_ICON(opponent, sleep: TRUE); } } diff --git a/test/battle/sleep_clause.c b/test/battle/sleep_clause.c index bb967020ac..678accb585 100644 --- a/test/battle/sleep_clause.c +++ b/test/battle/sleep_clause.c @@ -1517,7 +1517,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Reflection moves (ie. Magic Coat) fail if slee MESSAGE("The opposing Zigzagoon fell asleep!"); STATUS_ICON(opponent, sleep: TRUE); ANIMATION(ANIM_TYPE_MOVE, MOVE_MAGIC_COAT, player); - MESSAGE("The opposing Zigzagoon bounced the Spore back!"); // Should be MESSAGE("Zigzagoon bounced the Spore back!"); Issue #5579 https://github.com/rh-hideout/pokeemerald-expansion/issues/5579 + MESSAGE("Zigzagoon bounced the Spore back!"); MESSAGE("Sleep Clause kept the opposing Zigzagoon awake!"); } }