Skip to content

Commit

Permalink
Fix interaction between Terastallization and Pursuit in NatDex format…
Browse files Browse the repository at this point in the history
…st if used on a switching enemy

* Terastallization should happen before Pursuit.
  • Loading branch information
Zrp200 committed Oct 17, 2024
1 parent a3c090d commit 274ee23
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions data/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14916,10 +14916,20 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = {
}
// Run through each action in queue to check if the Pursuit user is supposed to Mega Evolve this turn.
// If it is, then Mega Evolve before moving.
if (source.canMegaEvo || source.canUltraBurst) {
if (source.canMegaEvo || source.canUltraBurst || source.canTerastallize) {
for (const [actionIndex, action] of this.queue.entries()) {
if (action.pokemon === source && action.choice === 'megaEvo') {
this.actions.runMegaEvo(source);
if (action.pokemon === source) {
switch (action.choice) {
case 'megaEvo':
this.actions.runMegaEvo(source);
break;
// Also a "forme" change that happens before moves, though only possible in NatDex
case 'terastallize':
this.actions.terastallize(source);
break;
default:
continue;
}
this.queue.list.splice(actionIndex, 1);
break;
}
Expand Down

0 comments on commit 274ee23

Please sign in to comment.