Fixed the test and such

This commit is contained in:
Bertie690 2025-06-17 19:17:39 -04:00
parent 69d329a460
commit c021f3206e
5 changed files with 6 additions and 7 deletions

View File

@ -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;

View File

@ -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()!;

View File

@ -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()!;

View File

@ -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();

View File

@ -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();