Eslint fix attempt

This commit is contained in:
Christopher Schmidt 2024-09-07 09:54:26 -04:00
parent 49e749f289
commit 37d2a6db74

View File

@ -23,83 +23,83 @@ describe("Moves - Freezy Frost", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.battleType("single") .battleType("single")
.enemySpecies(Species.RATTATA) .enemySpecies(Species.RATTATA)
.enemyLevel(100) .enemyLevel(100)
.enemyMoveset([Moves.HOWL, Moves.HOWL, Moves.HOWL, Moves.HOWL]) .enemyMoveset([ Moves.HOWL, Moves.HOWL, Moves.HOWL, Moves.HOWL ])
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(Abilities.BALL_FETCH)
.startingLevel(100) .startingLevel(100)
.moveset([Moves.FREEZY_FROST, Moves.HOWL, Moves.SPLASH]) .moveset([ Moves.FREEZY_FROST, Moves.HOWL, Moves.SPLASH ])
.ability(Abilities.BALL_FETCH); .ability(Abilities.BALL_FETCH);
vi.spyOn(allMoves[Moves.FREEZY_FROST], "accuracy", "get").mockReturnValue(100); vi.spyOn(allMoves[ Moves.FREEZY_FROST ], "accuracy", "get").mockReturnValue(100);
});
it(
"should clear stat changes of user and opponent",
async () => {
await game.classicMode.startBattle([ Species.SHUCKLE ]);
const user = game.scene.getPlayerPokemon()!;
const enemy = game.scene.getEnemyPokemon()!;
game.move.select(Moves.HOWL);
await game.toNextTurn();
expect(user.getStatStage(Stat.ATK)).toBe(1);
expect(enemy.getStatStage(Stat.ATK)).toBe(1);
game.move.select(Moves.FREEZY_FROST);
await game.toNextTurn();
expect(user.getStatStage(Stat.ATK)).toBe(0);
expect(enemy.getStatStage(Stat.ATK)).toBe(0);
}); });
it( it(
"should clear stat changes of user and opponent", "should clear all stat changes even when enemy uses the move",
async () => { async () => {
await game.classicMode.startBattle([Species.SHUCKLE]); game.override.enemyMoveset([ Moves.FREEZY_FROST, Moves.FREEZY_FROST, Moves.FREEZY_FROST, Moves.FREEZY_FROST ]);
const user = game.scene.getPlayerPokemon()!; await game.classicMode.startBattle([ Species.SHUCKLE ]); // Shuckle for slower Howl on first turn so Freezy Frost doesn't affect it.
const enemy = game.scene.getEnemyPokemon()!; const user = game.scene.getPlayerPokemon()!;
game.move.select(Moves.HOWL); game.move.select(Moves.HOWL);
await game.toNextTurn(); await game.toNextTurn();
expect(user.getStatStage(Stat.ATK)).toBe(1); const userAtkBefore = user.getStatStage(Stat.ATK);
expect(enemy.getStatStage(Stat.ATK)).toBe(1); expect(userAtkBefore).toBe(1);
game.move.select(Moves.FREEZY_FROST); game.move.select(Moves.SPLASH);
await game.toNextTurn(); await game.toNextTurn();
expect(user.getStatStage(Stat.ATK)).toBe(0);
expect(user.getStatStage(Stat.ATK)).toBe(0);
expect(enemy.getStatStage(Stat.ATK)).toBe(0);
}); });
it( it(
"should clear all stat changes even when enemy uses the move", "should clear all stat changes in double battle",
async () => { async () => {
game.override.enemyMoveset([Moves.FREEZY_FROST, Moves.FREEZY_FROST, Moves.FREEZY_FROST, Moves.FREEZY_FROST]); game.override.battleType("double");
await game.classicMode.startBattle([Species.SHUCKLE]); // Shuckle for slower Howl on first turn so Freezy Frost doesn't affect it. await game.classicMode.startBattle([ Species.SHUCKLE, Species.RATTATA ]);
const user = game.scene.getPlayerPokemon()!; const [ leftPlayer, rightPlayer ] = game.scene.getPlayerField();
const [ leftOpp, rightOpp ] = game.scene.getEnemyField();
game.move.select(Moves.HOWL); game.move.select(Moves.HOWL, 0);
await game.toNextTurn(); await game.phaseInterceptor.to(CommandPhase);
game.move.select(Moves.SPLASH, 1);
await game.toNextTurn();
const userAtkBefore = user.getStatStage(Stat.ATK); expect(leftPlayer.getStatStage(Stat.ATK)).toBe(1);
expect(userAtkBefore).toBe(1); expect(rightPlayer.getStatStage(Stat.ATK)).toBe(1);
expect(leftOpp.getStatStage(Stat.ATK)).toBe(2); // Both enemies use Howl
expect(rightOpp.getStatStage(Stat.ATK)).toBe(2);
game.move.select(Moves.SPLASH); game.move.select(Moves.FREEZY_FROST, 0, leftOpp.getBattlerIndex());
await game.toNextTurn(); await game.phaseInterceptor.to(CommandPhase);
expect(user.getStatStage(Stat.ATK)).toBe(0); game.move.select(Moves.SPLASH, 1);
}); await game.toNextTurn();
it( expect(leftPlayer.getStatStage(Stat.ATK)).toBe(0);
"should clear all stat changes in double battle", expect(rightPlayer.getStatStage(Stat.ATK)).toBe(0);
async () => { expect(leftOpp.getStatStage(Stat.ATK)).toBe(0);
game.override.battleType("double"); expect(rightOpp.getStatStage(Stat.ATK)).toBe(0);
await game.classicMode.startBattle([Species.SHUCKLE, Species.RATTATA]);
const [leftPlayer, rightPlayer] = game.scene.getPlayerField();
const [leftOpp, rightOpp] = game.scene.getEnemyField();
game.move.select(Moves.HOWL, 0);
await game.phaseInterceptor.to(CommandPhase);
game.move.select(Moves.SPLASH, 1);
await game.toNextTurn();
expect(leftPlayer.getStatStage(Stat.ATK)).toBe(1);
expect(rightPlayer.getStatStage(Stat.ATK)).toBe(1);
expect(leftOpp.getStatStage(Stat.ATK)).toBe(2); // Both enemies use Howl
expect(rightOpp.getStatStage(Stat.ATK)).toBe(2);
game.move.select(Moves.FREEZY_FROST, 0, leftOpp.getBattlerIndex());
await game.phaseInterceptor.to(CommandPhase);
game.move.select(Moves.SPLASH, 1);
await game.toNextTurn();
expect(leftPlayer.getStatStage(Stat.ATK)).toBe(0);
expect(rightPlayer.getStatStage(Stat.ATK)).toBe(0);
expect(leftOpp.getStatStage(Stat.ATK)).toBe(0);
expect(rightOpp.getStatStage(Stat.ATK)).toBe(0);
}); });
}); });