Skip to content

Commit

Permalink
Fixes intimidate missing timing during a mega evo / switch (#6322)
Browse files Browse the repository at this point in the history
Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
  • Loading branch information
AlexOn1ine and Bassoonian authored Feb 22, 2025
1 parent 4cf219e commit 5b4de20
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3259,6 +3259,9 @@ void SwitchInClearSetData(u32 battler)
gCurrentMove = MOVE_NONE;
gBattleStruct->arenaTurnCounter = 0xFF;

// Restore struct member so replacement does not miss timing
gSpecialStatuses[battler].switchInAbilityDone = FALSE;

// Reset damage to prevent things like red card activating if the switched-in mon is holding it
gSpecialStatuses[battler].physicalDmg = 0;
gSpecialStatuses[battler].specialDmg = 0;
Expand Down
15 changes: 15 additions & 0 deletions test/battle/ability/intimidate.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,3 +375,18 @@ DOUBLE_BATTLE_TEST("Intimidate will correctly decrease the attack of the second
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight);
}
}

SINGLE_BATTLE_TEST("Intimdate does not lose timing after mega evolution and switch out by a hit escape move")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_U_TURN].effect == EFFECT_HIT_ESCAPE);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_MANECTRIC) { Item(ITEM_MANECTITE); }
OPPONENT(SPECIES_ARBOK) { Ability(ABILITY_INTIMIDATE); }
} WHEN {
TURN { MOVE(opponent, MOVE_U_TURN, gimmick: GIMMICK_MEGA); SEND_OUT(opponent, 1); }
} SCENE {
ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);
ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);
}
}

0 comments on commit 5b4de20

Please sign in to comment.