Skip to content

Commit

Permalink
fix baton pass not passing embargo (#3745)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
  • Loading branch information
DizzyEggg and AlexOn1ine authored Dec 16, 2023
1 parent 537f1c9 commit 3df101a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3141,6 +3141,7 @@ void SwitchInClearSetData(u32 battler)
gDisableStructs[battler].battlerWithSureHit = disableStructCopy.battlerWithSureHit;
gDisableStructs[battler].perishSongTimer = disableStructCopy.perishSongTimer;
gDisableStructs[battler].battlerPreventingEscape = disableStructCopy.battlerPreventingEscape;
gDisableStructs[battler].embargoTimer = disableStructCopy.embargoTimer;
}

gMoveResultFlags = 0;
Expand Down
10 changes: 2 additions & 8 deletions test/battle/move_effect/embargo.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ SINGLE_BATTLE_TEST("Embargo doesn't stop an item flung at an affected target fro

SINGLE_BATTLE_TEST("Embargo is passed via Baton Pass")
{
KNOWN_FAILING; // Embargo is currently being lifted right after a Baton Pass when it shouldn't.
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WYNAUT) { Item(ITEM_LIGHT_BALL); };
Expand Down Expand Up @@ -336,16 +335,14 @@ SINGLE_BATTLE_TEST("Embargo can be reflected by Magic Coat")

SINGLE_BATTLE_TEST("Embargo doesn't prevent Mega Evolution")
{
// Embargo is currently being lifted right after a Baton Pass when it shouldn't.
// As a result, we can't check if Embargo is letting the opponent Mega Evolve normally or not.
KNOWN_FAILING;
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_CHARIZARD) { Item(ITEM_CHARIZARDITE_Y); };
} WHEN {
TURN { MOVE(player, MOVE_EMBARGO); }
TURN { MOVE(opponent, MOVE_BATON_PASS); SEND_OUT(opponent, 1); }
TURN { MOVE(opponent, MOVE_CELEBRATE, megaEvolve: TRUE); }
} SCENE {
// Turn 1
MESSAGE("Wobbuffet used Embargo!");
Expand All @@ -354,6 +351,7 @@ SINGLE_BATTLE_TEST("Embargo doesn't prevent Mega Evolution")
MESSAGE("Foe Wobbuffet used Baton Pass!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_BATON_PASS, opponent);
MESSAGE("2 sent out Charizard!");
// Turn 3
MESSAGE("Foe Charizard's CharizarditeY is reacting to 2's Mega Ring!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_MEGA_EVOLUTION, opponent);
MESSAGE("Foe Charizard has Mega Evolved into Mega Charizard!");
Expand All @@ -362,9 +360,6 @@ SINGLE_BATTLE_TEST("Embargo doesn't prevent Mega Evolution")

SINGLE_BATTLE_TEST("Embargo doesn't prevent Primal Reversion")
{
// Embargo is currently being lifted right after a Baton Pass when it shouldn't.
// As a result, we can't check if Embargo is letting the opponent undergo Primal Reversion normally or not.
KNOWN_FAILING;
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
Expand All @@ -384,7 +379,6 @@ SINGLE_BATTLE_TEST("Embargo doesn't prevent Primal Reversion")
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, opponent);
MESSAGE("Foe Groudon's Primal Reversion! It reverted to its primal form!");
ABILITY_POPUP(opponent);
MESSAGE("The extremely harsh sunlight was not lessened at all!!");
// Turn 3
MESSAGE("Foe Groudon used Fling!");
MESSAGE("But it failed!");
Expand Down

0 comments on commit 3df101a

Please sign in to comment.