diff --git a/data/moves.ts b/data/moves.ts index 67fc257f2d..cee205875d 100644 --- a/data/moves.ts +++ b/data/moves.ts @@ -15506,7 +15506,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { accuracy: 100, basePower: 60, basePowerCallback(target, source, move) { - if (move.sourceEffect === 'round') { + if (this.field.pseudoWeather.round.boost) { this.debug('BP doubled'); return move.basePower * 2; } @@ -15517,7 +15517,8 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { pp: 15, priority: 0, flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, - onTry(source, target, move) { + onTryMove(source, target, move) { + this.field.addPseudoWeather('round'); for (const action of this.queue.list as MoveAction[]) { if (!action.pokemon || !action.move || action.maxMove || action.zmove) continue; if (action.move.id === 'round') { @@ -15526,6 +15527,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } } }, + condition: { + duration: 1, + onFieldRestart() { + this.effectState.boost = true; + }, + }, target: "normal", type: "Normal", contestType: "Beautiful", diff --git a/sim/battle-queue.ts b/sim/battle-queue.ts index 59e5f80650..a85cebe08a 100644 --- a/sim/battle-queue.ts +++ b/sim/battle-queue.ts @@ -25,7 +25,7 @@ import type { Battle } from './battle'; export interface MoveAction { /** action type */ choice: 'move' | 'beforeTurnMove' | 'priorityChargeMove'; - order: 3 | 5 | 200 | 201 | 199 | 106; + order: 5 | 105 | 199 | 200 | 201; /** priority of the action (higher first) */ priority: number; /** fractional priority of the action (higher first) */ @@ -56,7 +56,7 @@ export interface MoveAction { export interface SwitchAction { /** action type */ choice: 'switch' | 'instaswitch' | 'revivalblessing'; - order: 3 | 6 | 103; + order: 3 | 6 | 101; /** priority of the action (higher first) */ priority: number; /** speed of pokemon switching (higher first if priority tie) */ @@ -179,14 +179,12 @@ export class BattleQueue { beforeTurnMove: 5, revivalblessing: 6, - runSwitch: 101, - switch: 103, - megaEvo: 104, - megaEvoX: 104, - megaEvoY: 104, - runDynamax: 105, - terastallize: 106, - priorityChargeMove: 107, + runSwitch: 100, + switch: 101, + megaEvo: 102, megaEvoX: 102, megaEvoY: 102, + runDynamax: 103, + terastallize: 104, + priorityChargeMove: 105, shift: 200, // default is 200 (for moves) @@ -282,7 +280,7 @@ export class BattleQueue { } } action.sourceEffect = sourceEffect; - action.order = 3; + action.order = action.choice === 'move' ? 199 : 3; this.list.unshift(action); } diff --git a/test/sim/moves/round.js b/test/sim/moves/round.js index 091f010bf9..2460c857c9 100644 --- a/test/sim/moves/round.js +++ b/test/sim/moves/round.js @@ -20,6 +20,43 @@ describe('Round', () => { battle.makeChoices('move round', 'move rest'); assert.equal(battle.p2.active[0].item, ''); }); + + it('is boosted if it was used prior in the turn and called by Instruct or Encore', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Aurorus", ability: 'refrigerate', moves: ['sleeptalk', 'round'], evs: { spe: 252 } }, + { species: "Aurorus", ability: 'refrigerate', moves: ['sleeptalk', 'round'] }, + ], [ + { species: "Carnivine", moves: ['sleeptalk', 'encore'], evs: { spe: 252 } }, + { species: "Carnivine", moves: ['sleeptalk'] }, + { species: "Carnivine", moves: ['instruct'] }, + { species: "Carnivine", moves: ['sleeptalk'], level: 1 }, + ]]); + battle.makeChoices('move sleeptalk, move round 2', 'move sleeptalk, move sleeptalk'); + battle.makeChoices('move round 2, move sleeptalk', 'move encore 2, move sleeptalk'); + assert.fainted(battle.p2.active[0]); + assert.fainted(battle.p2.active[1]); + battle.makeChoices(); + battle.makeChoices('move sleeptalk, move round 2', 'move instruct 2, move sleeptalk'); + assert.fainted(battle.p2.active[0]); + assert.fainted(battle.p2.active[1]); + }); + + it('should not take priority over abilities', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Charizard", moves: ['round'] }, + { species: "Venusaur", moves: ['round'] }, + ], [ + { species: "Blissey", item: 'ejectbutton', moves: ['sleeptalk'] }, + { species: "Blastoise", moves: ['sleeptalk'] }, + { species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] }, + ]]); + battle.makeChoices('move round 1, move round 1', 'auto'); + battle.makeChoices(); + const log = battle.getDebugLog(); + const intimidateIndex = log.lastIndexOf('|-ability|p2a: Incineroar|Intimidate|boost'); + const roundIndex = log.lastIndexOf('|move|p1b: Venusaur|Round|p2a: Incineroar|[from] move: Round'); + assert(intimidateIndex < roundIndex, 'Intimidate should activate before the rest of the Round attacks'); + }); }); describe('Round [Gen 5]', () => {