Fixes Magic Coat message when move is bounced back (#6419)

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
This commit is contained in:
Alex 2025-03-19 13:57:48 +01:00 committed by GitHub
parent cf9ee2caee
commit 8dfd3bd278
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View File

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

View File

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

View File

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