Correcting phase interception

This commit is contained in:
Christopher Schmidt 2024-12-29 11:50:59 -05:00
parent 400cdb3784
commit 013c6b2c15
2 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,7 @@
import { BattlerIndex } from "#app/battle";
import { Stat } from "#app/enums/stat";
import { MoveResult } from "#app/field/pokemon";
import { CommandPhase } from "#app/phases/command-phase";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
@ -66,8 +67,8 @@ describe("Moves - Assist", () => {
// Player uses Sketch to copy Swords Dance, Player_2 stalls a turn. Player will attempt Assist and should have no usable moves
await game.toNextTurn();
game.move.select(Moves.ASSIST, 0);
await game.phaseInterceptor.to(CommandPhase);
game.move.select(Moves.PROTECT, 1);
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER, BattlerIndex.PLAYER_2 ]);
await game.toNextTurn();
expect(game.scene.getPlayerPokemon()!.getLastXMoves()[0].result).toBe(MoveResult.FAIL);
@ -78,8 +79,8 @@ describe("Moves - Assist", () => {
await game.classicMode.startBattle([ Species.FEEBAS, Species.SHUCKLE ]);
game.move.select(Moves.ASSIST, 0);
await game.phaseInterceptor.to(CommandPhase);
game.move.select(Moves.ASSIST, 1);
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER, BattlerIndex.PLAYER_2 ]);
await game.toNextTurn();
expect(game.scene.getPlayerPokemon()!.isFullHp()).toBeFalsy(); // should receive recoil damage from Wood Hammer

View File

@ -1,8 +1,8 @@
import { BattlerIndex } from "#app/battle";
import { RechargingTag, SemiInvulnerableTag } from "#app/data/battler-tags";
import { allMoves, RandomMoveAttr } from "#app/data/move";
import { Abilities } from "#app/enums/abilities";
import { Stat } from "#app/enums/stat";
import { CommandPhase } from "#app/phases/command-phase";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import GameManager from "#test/utils/gameManager";
@ -85,9 +85,9 @@ describe("Moves - Metronome", () => {
const [ leftOpp, rightOpp ] = game.scene.getEnemyField();
vi.spyOn(randomMoveAttr, "getMoveOverride").mockReturnValue(Moves.AROMATIC_MIST);
game.move.select(Moves.METRONOME);
game.move.select(Moves.METRONOME, 0);
await game.phaseInterceptor.to(CommandPhase);
game.move.select(Moves.SPLASH, 1);
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.ENEMY_2, BattlerIndex.PLAYER, BattlerIndex.PLAYER_2 ]);
await game.toNextTurn();
expect(rightPlayer.getStatStage(Stat.SPDEF)).toBe(1);