diff --git a/src/enums/battle-spec.ts b/src/enums/battle-spec.ts index 00bc7f92fea..ca7dbe929e5 100644 --- a/src/enums/battle-spec.ts +++ b/src/enums/battle-spec.ts @@ -1,4 +1,5 @@ export enum BattleSpec { DEFAULT, - FINAL_BOSS + FINAL_BOSS, + FINAL_BOSS_MONOTYPE } diff --git a/src/phases.ts b/src/phases.ts index 34fbf7babb9..43b65a9ddb3 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2276,7 +2276,7 @@ export class TurnStartPhase extends FieldPhase { super(scene); } - getOrder(): BattlerIndex[] { + getSpeedOrder(): BattlerIndex[] { const playerField = this.scene.getPlayerField().filter(p => p.isActive()) as Pokemon[]; const enemyField = this.scene.getEnemyField().filter(p => p.isActive()) as Pokemon[]; @@ -2303,8 +2303,12 @@ export class TurnStartPhase extends FieldPhase { orderedTargets = orderedTargets.reverse(); } - let moveOrder : BattlerIndex[] = orderedTargets.map(t => t.getFieldIndex() + (!t.isPlayer() ? BattlerIndex.ENEMY : 0)); + return orderedTargets.map(t => t.getFieldIndex() + (!t.isPlayer() ? BattlerIndex.ENEMY : 0)); + } + getCommandOrder(): BattlerIndex[] { + + let moveOrder = this.getSpeedOrder(); // The creation of the battlerBypassSpeed object contains checks for the ability Quick Draw and the held item Quick Claw // The ability Mycelium Might disables Quick Claw's activation when using a status move // This occurs before the main loop because of battles with more than two Pokemon @@ -2378,7 +2382,7 @@ export class TurnStartPhase extends FieldPhase { super.start(); const field = this.scene.getField(); - const order = this.getOrder(); + const order = this.getCommandOrder(); let orderIndex = 0; diff --git a/src/test/battle/battle-order.test.ts b/src/test/battle/battle-order.test.ts index 6aa919186b4..6c4a1f7f511 100644 --- a/src/test/battle/battle-order.test.ts +++ b/src/test/battle/battle-order.test.ts @@ -52,7 +52,7 @@ describe("Battle order", () => { }); await game.phaseInterceptor.run(EnemyCommandPhase); const phase = game.scene.getCurrentPhase() as TurnStartPhase; - const order = phase.getOrder(); + const order = phase.getCommandOrder(); expect(order[0]).toBe(2); expect(order[1]).toBe(0); }, 20000); @@ -73,7 +73,7 @@ describe("Battle order", () => { }); await game.phaseInterceptor.run(EnemyCommandPhase); const phase = game.scene.getCurrentPhase() as TurnStartPhase; - const order = phase.getOrder(); + const order = phase.getCommandOrder(); expect(order[0]).toBe(0); expect(order[1]).toBe(2); }, 20000); @@ -113,7 +113,7 @@ describe("Battle order", () => { }); await game.phaseInterceptor.runFrom(SelectTargetPhase).to(TurnStartPhase, false); const phase = game.scene.getCurrentPhase() as TurnStartPhase; - const order = phase.getOrder(); + const order = phase.getCommandOrder(); expect(order.indexOf(0)).toBeGreaterThan(order.indexOf(2)); expect(order.indexOf(0)).toBeGreaterThan(order.indexOf(3)); expect(order.indexOf(1)).toBeGreaterThan(order.indexOf(2)); @@ -155,7 +155,7 @@ describe("Battle order", () => { }); await game.phaseInterceptor.runFrom(SelectTargetPhase).to(TurnStartPhase, false); const phase = game.scene.getCurrentPhase() as TurnStartPhase; - const order = phase.getOrder(); + const order = phase.getCommandOrder(); expect(order.indexOf(3)).toBeLessThan(order.indexOf(0)); expect(order.indexOf(3)).toBeLessThan(order.indexOf(1)); expect(order.indexOf(3)).toBeLessThan(order.indexOf(2)); @@ -196,7 +196,7 @@ describe("Battle order", () => { }); await game.phaseInterceptor.runFrom(SelectTargetPhase).to(TurnStartPhase, false); const phase = game.scene.getCurrentPhase() as TurnStartPhase; - const order = phase.getOrder(); + const order = phase.getCommandOrder(); expect(order.indexOf(1)).toBeLessThan(order.indexOf(0)); expect(order.indexOf(1)).toBeLessThan(order.indexOf(2)); expect(order.indexOf(3)).toBeLessThan(order.indexOf(0)); diff --git a/src/test/moves/dynamax_cannon.test.ts b/src/test/moves/dynamax_cannon.test.ts index 57846c1aef7..9d2be7c6e05 100644 --- a/src/test/moves/dynamax_cannon.test.ts +++ b/src/test/moves/dynamax_cannon.test.ts @@ -164,7 +164,7 @@ describe("Moves - Dynamax Cannon", () => { await game.phaseInterceptor.to(TurnStartPhase, false); // Force user to act before enemy - vi.spyOn((game.scene.getCurrentPhase() as TurnStartPhase), "getOrder").mockReturnValue([ BattlerIndex.PLAYER, BattlerIndex. ENEMY]); + vi.spyOn((game.scene.getCurrentPhase() as TurnStartPhase), "getCommandOrder").mockReturnValue([ BattlerIndex.PLAYER, BattlerIndex. ENEMY]); await game.phaseInterceptor.to(MoveEffectPhase, false); expect((game.scene.getCurrentPhase() as MoveEffectPhase).move.moveId).toBe(dynamaxCannon.id); diff --git a/src/test/utils/gameManager.ts b/src/test/utils/gameManager.ts index 935d40324a2..36f45107d9c 100644 --- a/src/test/utils/gameManager.ts +++ b/src/test/utils/gameManager.ts @@ -391,7 +391,7 @@ export default class GameManager { } /** - * Intercepts `TurnStartPhase` and mocks the getOrder's return value {@linkcode TurnStartPhase.getOrder} + * Intercepts `TurnStartPhase` and mocks the getSpeedOrder's return value {@linkcode TurnStartPhase.getSpeedOrder} * Used to modify the turn order. * @param {BattlerIndex[]} order The turn order to set * @example @@ -402,7 +402,7 @@ export default class GameManager { async setTurnOrder(order: BattlerIndex[]): Promise { await this.phaseInterceptor.to(TurnStartPhase, false); - vi.spyOn(this.scene.getCurrentPhase() as TurnStartPhase, "getOrder").mockReturnValue(order); + vi.spyOn(this.scene.getCurrentPhase() as TurnStartPhase, "getSpeedOrder").mockReturnValue(order); } /**