Misc fixes

This commit is contained in:
NightKev 2025-06-30 06:19:15 -07:00
parent 9289183e06
commit 6f3fa3137a
22 changed files with 38 additions and 40 deletions

View File

@ -1,7 +1,7 @@
/** /*
* This script creates a test boilerplate file in the appropriate * This script creates a test boilerplate file in the appropriate
* directory based on the type selected. * directory based on the type selected.
* @example pnpm test:create * Usage: `pnpm test:create`
*/ */
import fs from "node:fs"; import fs from "node:fs";

View File

@ -1,8 +1,8 @@
// Usage: node decrypt-save.js <encrypted-file> [save-file]
// biome-ignore lint/performance/noNamespaceImport: This is how you import fs from node // biome-ignore lint/performance/noNamespaceImport: This is how you import fs from node
import * as fs from "node:fs"; import * as fs from "node:fs";
import pkg from "crypto-js"; import { AES, enc } from "crypto-js";
const { AES, enc } = pkg;
const SAVE_KEY = "x0i2O7WRiANTqPmZ"; const SAVE_KEY = "x0i2O7WRiANTqPmZ";

View File

@ -1,10 +1,9 @@
/** // Intentionally re-exports `ModifierConstructorMap` from `modifier.ts`
* Re-exports of all the types defined in the modifier module.
*/
import type { Pokemon } from "#field/pokemon"; import type { Pokemon } from "#field/pokemon";
import type { ModifierConstructorMap } from "#modifiers/modifier"; import type { ModifierConstructorMap } from "#modifiers/modifier";
import type { ModifierType, WeightedModifierType } from "#modifiers/modifier-type"; import type { ModifierType, WeightedModifierType } from "#modifiers/modifier-type";
export type ModifierTypeFunc = () => ModifierType; export type ModifierTypeFunc = () => ModifierType;
export type WeightedModifierTypeWeightFunc = (party: Pokemon[], rerollCount?: number) => number; export type WeightedModifierTypeWeightFunc = (party: Pokemon[], rerollCount?: number) => number;

View File

@ -1,7 +1,6 @@
/* biome-ignore-start lint/correctness/noUnusedImports: tsdoc imports */ /* biome-ignore-start lint/correctness/noUnusedImports: tsdoc imports */
import type { BattleScene } from "#app/battle-scene"; import type { BattleScene } from "#app/battle-scene";
import type { SpeciesFormChangeRevertWeatherFormTrigger } from "#data/form-change-triggers"; import type { SpeciesFormChangeRevertWeatherFormTrigger } from "#data/form-change-triggers";
/* biome-ignore-end lint/correctness/noUnusedImports: tsdoc imports */ /* biome-ignore-end lint/correctness/noUnusedImports: tsdoc imports */
import { applyAbAttrs } from "#abilities/apply-ab-attrs"; import { applyAbAttrs } from "#abilities/apply-ab-attrs";

View File

@ -1,6 +1,5 @@
/* biome-ignore-start lint/correctness/noUnusedImports: tsdoc imports */ /* biome-ignore-start lint/correctness/noUnusedImports: tsdoc imports */
import type { initModifierTypes } from "#modifiers/modifier-type"; import type { initModifierTypes } from "#modifiers/modifier-type";
/* biome-ignore-end lint/correctness/noUnusedImports: tsdoc imports */ /* biome-ignore-end lint/correctness/noUnusedImports: tsdoc imports */
import { timedEventManager } from "#app/global-event-manager"; import { timedEventManager } from "#app/global-event-manager";

View File

@ -1,4 +1,4 @@
/** /*
* Contains modifier pools for different contexts in the game. * Contains modifier pools for different contexts in the game.
* Can be safely imported without worrying about circular dependencies. * Can be safely imported without worrying about circular dependencies.
*/ */

View File

@ -8,8 +8,6 @@ import { GameManager } from "#test/testUtils/gameManager";
import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
//const TIMEOUT = 20 * 1000;
describe("Daily Mode", () => { describe("Daily Mode", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
let game: GameManager; let game: GameManager;

View File

@ -11,7 +11,7 @@ import { TurnEndPhase } from "#phases/turn-end-phase";
import { TurnInitPhase } from "#phases/turn-init-phase"; import { TurnInitPhase } from "#phases/turn-init-phase";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import type { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; import type { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Items - Dire Hit", () => { describe("Items - Dire Hit", () => {
@ -19,7 +19,7 @@ describe("Items - Dire Hit", () => {
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -3,14 +3,14 @@ import { Stat } from "#enums/stat";
import { StatBoosterModifier } from "#modifiers/modifier"; import { StatBoosterModifier } from "#modifiers/modifier";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import { NumberHolder, randItem } from "#utils/common"; import { NumberHolder, randItem } from "#utils/common";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Items - Eviolite", () => { describe("Items - Eviolite", () => {
let phaserGame: Phaser.Game; let phaserGame: Phaser.Game;
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id";
import { PokemonExpBoosterModifier } from "#modifiers/modifier"; import { PokemonExpBoosterModifier } from "#modifiers/modifier";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import { NumberHolder } from "#utils/common"; import { NumberHolder } from "#utils/common";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("EXP Modifier Items", () => { describe("EXP Modifier Items", () => {
@ -10,7 +10,7 @@ describe("EXP Modifier Items", () => {
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -6,7 +6,7 @@ import { SpeciesId } from "#enums/species-id";
import type { Pokemon } from "#field/pokemon"; import type { Pokemon } from "#field/pokemon";
import type { ContactHeldItemTransferChanceModifier } from "#modifiers/modifier"; import type { ContactHeldItemTransferChanceModifier } from "#modifiers/modifier";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Items - Grip Claw", () => { describe("Items - Grip Claw", () => {
@ -14,7 +14,7 @@ describe("Items - Grip Claw", () => {
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -3,7 +3,7 @@ import { SpeciesId } from "#enums/species-id";
import { TurnEndPhase } from "#phases/turn-end-phase"; import { TurnEndPhase } from "#phases/turn-end-phase";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import { randInt } from "#utils/common"; import { randInt } from "#utils/common";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Items - Leek", () => { describe("Items - Leek", () => {
@ -11,7 +11,7 @@ describe("Items - Leek", () => {
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -5,7 +5,7 @@ import { SpeciesStatBoosterModifier } from "#modifiers/modifier";
import i18next from "#plugins/i18n"; import i18next from "#plugins/i18n";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import { NumberHolder } from "#utils/common"; import { NumberHolder } from "#utils/common";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Items - Light Ball", () => { describe("Items - Light Ball", () => {
@ -13,7 +13,7 @@ describe("Items - Light Ball", () => {
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -4,7 +4,7 @@ import { MoveId } from "#enums/move-id";
import { UiMode } from "#enums/ui-mode"; import { UiMode } from "#enums/ui-mode";
import { SelectModifierPhase } from "#phases/select-modifier-phase"; import { SelectModifierPhase } from "#phases/select-modifier-phase";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Items - Lock Capsule", () => { describe("Items - Lock Capsule", () => {
@ -12,7 +12,7 @@ describe("Items - Lock Capsule", () => {
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -5,7 +5,7 @@ import { SpeciesStatBoosterModifier } from "#modifiers/modifier";
import i18next from "#plugins/i18n"; import i18next from "#plugins/i18n";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import { NumberHolder } from "#utils/common"; import { NumberHolder } from "#utils/common";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Items - Metal Powder", () => { describe("Items - Metal Powder", () => {
@ -13,7 +13,7 @@ describe("Items - Metal Powder", () => {
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -3,7 +3,7 @@ import { AbilityId } from "#enums/ability-id";
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";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Items - Mystical Rock", () => { describe("Items - Mystical Rock", () => {
@ -11,7 +11,7 @@ describe("Items - Mystical Rock", () => {
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -5,7 +5,7 @@ import { SpeciesStatBoosterModifier } from "#modifiers/modifier";
import i18next from "#plugins/i18n"; import i18next from "#plugins/i18n";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import { NumberHolder } from "#utils/common"; import { NumberHolder } from "#utils/common";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Items - Quick Powder", () => { describe("Items - Quick Powder", () => {
@ -13,7 +13,7 @@ describe("Items - Quick Powder", () => {
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -2,7 +2,7 @@ import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id"; import { SpeciesId } from "#enums/species-id";
import { TurnEndPhase } from "#phases/turn-end-phase"; import { TurnEndPhase } from "#phases/turn-end-phase";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Items - Scope Lens", () => { describe("Items - Scope Lens", () => {
@ -10,7 +10,7 @@ describe("Items - Scope Lens", () => {
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -9,7 +9,7 @@ import { TempStatStageBoosterModifier } from "#modifiers/modifier";
import { TurnEndPhase } from "#phases/turn-end-phase"; import { TurnEndPhase } from "#phases/turn-end-phase";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import type { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler"; import type { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Items - Temporary Stat Stage Boosters", () => { describe("Items - Temporary Stat Stage Boosters", () => {
@ -17,7 +17,7 @@ describe("Items - Temporary Stat Stage Boosters", () => {
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -5,7 +5,7 @@ import { SpeciesStatBoosterModifier } from "#modifiers/modifier";
import i18next from "#plugins/i18n"; import i18next from "#plugins/i18n";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import { NumberHolder, randInt } from "#utils/common"; import { NumberHolder, randInt } from "#utils/common";
import Phase from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Items - Thick Club", () => { describe("Items - Thick Club", () => {
@ -13,7 +13,7 @@ describe("Items - Thick Club", () => {
let game: GameManager; let game: GameManager;
beforeAll(() => { beforeAll(() => {
phaserGame = new Phase.Game({ phaserGame = new Phaser.Game({
type: Phaser.HEADLESS, type: Phaser.HEADLESS,
}); });
}); });

View File

@ -1,4 +1,3 @@
// import { apiFetch } from "#app/utils";
import { GameManager } from "#test/testUtils/gameManager"; import { GameManager } from "#test/testUtils/gameManager";
import { waitUntil } from "#test/testUtils/gameManagerUtils"; import { waitUntil } from "#test/testUtils/gameManagerUtils";
import Phaser from "phaser"; import Phaser from "phaser";

View File

@ -1,3 +1,7 @@
/** biome-ignore-start lint/correctness/noUnusedImports: tsdoc imports */
import type { NewArenaEvent } from "#app/events/battle-scene";
/** biome-ignore-end lint/correctness/noUnusedImports: tsdoc imports */
import type { BattleStyle, RandomTrainerOverride } from "#app/overrides"; import type { BattleStyle, RandomTrainerOverride } from "#app/overrides";
import Overrides, { defaultOverrides } from "#app/overrides"; import Overrides, { defaultOverrides } from "#app/overrides";
import { Weather } from "#data/weather"; import { Weather } from "#data/weather";