From c021f3206e99d3e32399bb4312fb59052ad2f808 Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Tue, 17 Jun 2025 19:17:39 -0400 Subject: [PATCH] Fixed the test and such --- src/battle.ts | 4 ++-- test/abilities/gorilla_tactics.test.ts | 2 +- test/moves/disable.test.ts | 2 +- test/moves/instruct.test.ts | 2 +- test/moves/metronome.test.ts | 3 +-- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/battle.ts b/src/battle.ts index 245705f4801..d29c73651e3 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -21,7 +21,7 @@ import type { EnemyPokemon, PlayerPokemon, TurnMove } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; import { ArenaTagType } from "#enums/arena-tag-type"; import { BattleSpec } from "#enums/battle-spec"; -import type { MoveId } from "#enums/move-id"; +import { MoveId } from "#enums/move-id"; import { PlayerGender } from "#enums/player-gender"; import { MusicPreference } from "#app/system/settings/settings"; import { SpeciesId } from "#enums/species-id"; @@ -73,7 +73,7 @@ export default class Battle { public battleScore = 0; public postBattleLoot: PokemonHeldItemModifier[] = []; public escapeAttempts = 0; - public lastMove: MoveId; + public lastMove: MoveId = MoveId.NONE; public battleSeed: string = randomString(16, true); private battleSeedState: string | null = null; public moneyScattered = 0; diff --git a/test/abilities/gorilla_tactics.test.ts b/test/abilities/gorilla_tactics.test.ts index a8b09461ea0..ac7df8c8825 100644 --- a/test/abilities/gorilla_tactics.test.ts +++ b/test/abilities/gorilla_tactics.test.ts @@ -83,7 +83,7 @@ describe("Abilities - Gorilla Tactics", () => { }); it("should lock into calling moves, even if also in moveset", async () => { - vi.spyOn(RandomMoveAttr.prototype, "getMoveOverride").mockReturnValue(MoveId.TACKLE); + vi.spyOn(RandomMoveAttr.prototype, "getMove").mockReturnValue(MoveId.TACKLE); await game.classicMode.startBattle([SpeciesId.GALAR_DARMANITAN]); const darmanitan = game.scene.getPlayerPokemon()!; diff --git a/test/moves/disable.test.ts b/test/moves/disable.test.ts index b113acb9525..99395110cee 100644 --- a/test/moves/disable.test.ts +++ b/test/moves/disable.test.ts @@ -129,7 +129,7 @@ describe("Moves - Disable", () => { { name: "Copycat", moveId: MoveId.COPYCAT }, { name: "Metronome", moveId: MoveId.METRONOME }, ])("should ignore virtual moves called by $name", async ({ moveId }) => { - vi.spyOn(RandomMoveAttr.prototype, "getMoveOverride").mockReturnValue(MoveId.ABSORB); + vi.spyOn(RandomMoveAttr.prototype, "getMove").mockReturnValue(MoveId.ABSORB); await game.classicMode.startBattle([SpeciesId.PIKACHU]); const playerMon = game.scene.getPlayerPokemon()!; diff --git a/test/moves/instruct.test.ts b/test/moves/instruct.test.ts index d12859301b6..f62ef72097f 100644 --- a/test/moves/instruct.test.ts +++ b/test/moves/instruct.test.ts @@ -144,7 +144,7 @@ describe("Moves - Instruct", () => { }); it("should fail on metronomed moves, even if also in moveset", async () => { - vi.spyOn(RandomMoveAttr.prototype, "getMoveOverride").mockReturnValue(MoveId.ABSORB); + vi.spyOn(RandomMoveAttr.prototype, "getMove").mockReturnValue(MoveId.ABSORB); await game.classicMode.startBattle([SpeciesId.AMOONGUSS]); const enemy = game.field.getEnemyPokemon(); diff --git a/test/moves/metronome.test.ts b/test/moves/metronome.test.ts index 4f274ceae99..15eb41b0df4 100644 --- a/test/moves/metronome.test.ts +++ b/test/moves/metronome.test.ts @@ -4,7 +4,6 @@ import { allMoves } from "#app/data/data-lists"; import { AbilityId } from "#enums/ability-id"; import { Stat } from "#app/enums/stat"; import { MoveResult } from "#enums/move-result"; -import { CommandPhase } from "#app/phases/command-phase"; import { BattlerTagType } from "#enums/battler-tag-type"; import { MoveUseMode } from "#enums/move-use-mode"; import { MoveId } from "#enums/move-id"; @@ -122,7 +121,7 @@ describe("Moves - Metronome", () => { it("should charge for charging moves while still maintaining follow-up status", async () => { game.override.moveset([]).enemyMoveset(MoveId.SPITE); - vi.spyOn(randomMoveAttr, "getMoveOverride").mockReturnValue(MoveId.SOLAR_BEAM); + vi.spyOn(randomMoveAttr, "getMove").mockReturnValue(MoveId.SOLAR_BEAM); await game.classicMode.startBattle([SpeciesId.REGIELEKI]); const player = game.field.getPlayerPokemon();