mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 17:12:44 +02:00
Fixed tests
This commit is contained in:
parent
05f3c64cad
commit
69d329a460
@ -45,7 +45,7 @@ describe("Moves - Assist", () => {
|
|||||||
game.move.changeMoveset(feebas, [MoveId.CIRCLE_THROW, MoveId.ASSIST, MoveId.WOOD_HAMMER, MoveId.ACID_SPRAY]);
|
game.move.changeMoveset(feebas, [MoveId.CIRCLE_THROW, MoveId.ASSIST, MoveId.WOOD_HAMMER, MoveId.ACID_SPRAY]);
|
||||||
game.move.changeMoveset(shuckle, [MoveId.COPYCAT, MoveId.ASSIST, MoveId.TORCH_SONG, MoveId.TACKLE]);
|
game.move.changeMoveset(shuckle, [MoveId.COPYCAT, MoveId.ASSIST, MoveId.TORCH_SONG, MoveId.TACKLE]);
|
||||||
|
|
||||||
// Force rolling the first eligible move for both mons (ensuring the user's own moves don't count)
|
// Force rolling the first eligible move for both mons
|
||||||
vi.spyOn(feebas, "randBattleSeedInt").mockImplementation(() => 0);
|
vi.spyOn(feebas, "randBattleSeedInt").mockImplementation(() => 0);
|
||||||
vi.spyOn(shuckle, "randBattleSeedInt").mockImplementation(() => 0);
|
vi.spyOn(shuckle, "randBattleSeedInt").mockImplementation(() => 0);
|
||||||
|
|
||||||
@ -58,8 +58,8 @@ describe("Moves - Assist", () => {
|
|||||||
expect(feebas.getStatStage(Stat.SPATK)).toBe(1); // Stat raised from Assist --> Torch Song
|
expect(feebas.getStatStage(Stat.SPATK)).toBe(1); // Stat raised from Assist --> Torch Song
|
||||||
expect(shuckle.hp).toBeLessThan(shuckle.getMaxHp()); // recoil dmg taken from Assist --> Wood Hammer
|
expect(shuckle.hp).toBeLessThan(shuckle.getMaxHp()); // recoil dmg taken from Assist --> Wood Hammer
|
||||||
|
|
||||||
expect(feebas.getLastXMoves().map(tm => tm.result)).toEqual([MoveResult.SUCCESS, MoveResult.SUCCESS]);
|
expect(feebas.getLastXMoves(-1).map(tm => tm.result)).toEqual([MoveResult.SUCCESS, MoveResult.SUCCESS]);
|
||||||
expect(shuckle.getLastXMoves().map(tm => tm.result)).toEqual([MoveResult.SUCCESS, MoveResult.SUCCESS]);
|
expect(shuckle.getLastXMoves(-1).map(tm => tm.result)).toEqual([MoveResult.SUCCESS, MoveResult.SUCCESS]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should consider off-field allies", async () => {
|
it("should consider off-field allies", async () => {
|
||||||
@ -71,7 +71,7 @@ describe("Moves - Assist", () => {
|
|||||||
game.move.use(MoveId.ASSIST);
|
game.move.use(MoveId.ASSIST);
|
||||||
await game.toEndOfTurn();
|
await game.toEndOfTurn();
|
||||||
|
|
||||||
expect(feebas.getLastXMoves(-1)).toHaveLength(1);
|
expect(feebas.getLastXMoves(-1)).toHaveLength(2);
|
||||||
expect(feebas.getLastXMoves()[0]).toMatchObject({
|
expect(feebas.getLastXMoves()[0]).toMatchObject({
|
||||||
move: MoveId.HYPER_BEAM,
|
move: MoveId.HYPER_BEAM,
|
||||||
target: [BattlerIndex.ENEMY],
|
target: [BattlerIndex.ENEMY],
|
||||||
@ -98,7 +98,7 @@ describe("Moves - Assist", () => {
|
|||||||
|
|
||||||
const [feebas, shuckle] = game.scene.getPlayerParty();
|
const [feebas, shuckle] = game.scene.getPlayerParty();
|
||||||
// All of these are ineligible moves
|
// All of these are ineligible moves
|
||||||
game.move.changeMoveset(shuckle, [MoveId.METRONOME, MoveId.DIG, MoveId.FLY, MoveId.INSTRUCT]);
|
game.move.changeMoveset(shuckle, [MoveId.METRONOME, MoveId.DIG, MoveId.FLY]);
|
||||||
|
|
||||||
game.move.use(MoveId.ASSIST);
|
game.move.use(MoveId.ASSIST);
|
||||||
await game.toEndOfTurn();
|
await game.toEndOfTurn();
|
||||||
|
@ -3,7 +3,6 @@ import { RandomMoveAttr } from "#app/data/moves/move";
|
|||||||
import { Stat } from "#app/enums/stat";
|
import { Stat } from "#app/enums/stat";
|
||||||
import { MoveResult } from "#enums/move-result";
|
import { MoveResult } from "#enums/move-result";
|
||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
import { MoveUseMode } from "#enums/move-use-mode";
|
|
||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
import GameManager from "#test/testUtils/gameManager";
|
import GameManager from "#test/testUtils/gameManager";
|
||||||
@ -40,10 +39,13 @@ describe("Moves - Copycat", () => {
|
|||||||
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
||||||
|
|
||||||
game.move.select(MoveId.SWORDS_DANCE);
|
game.move.select(MoveId.SWORDS_DANCE);
|
||||||
|
await game.move.forceEnemyMove(MoveId.SPLASH);
|
||||||
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
|
|
||||||
game.move.select(MoveId.COPYCAT); // Last successful move should be Swords Dance
|
game.move.select(MoveId.COPYCAT); // Last successful move should be Swords Dance
|
||||||
await game.move.forceEnemyMove(MoveId.SUCKER_PUNCH);
|
await game.move.forceEnemyMove(MoveId.SUCKER_PUNCH);
|
||||||
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
|
|
||||||
const player = game.field.getPlayerPokemon();
|
const player = game.field.getPlayerPokemon();
|
||||||
|
Loading…
Reference in New Issue
Block a user