[QoL] Create default overrides class and export that with custom overrides (#2999)

* Create default overrides class and export that with custom overrides

* add comment to mock import and replace typecast with type narrowing

* change modifier override type to pick keys from modifierTypes
This commit is contained in:
Dmitriy K 2024-07-12 16:18:52 -04:00 committed by GitHub
parent 683c337164
commit 2314d34907
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
85 changed files with 298 additions and 267 deletions

View File

@ -49,7 +49,7 @@ import { SceneBase } from "./scene-base";
import CandyBar from "./ui/candy-bar";
import { Variant, variantData } from "./data/variant";
import { Localizable } from "#app/interfaces/locales";
import * as Overrides from "./overrides";
import Overrides from "#app/overrides";
import {InputsController} from "./inputs-controller";
import {UiInputs} from "./ui-inputs";
import { NewArenaEvent } from "./events/battle-scene";

View File

@ -2,7 +2,7 @@ import BattleScene from "../battle-scene";
import PokemonSpecies, { getPokemonSpecies, speciesStarters } from "./pokemon-species";
import { VariantTier } from "../enums/variant-tiers";
import * as Utils from "../utils";
import * as Overrides from "../overrides";
import Overrides from "../overrides";
import { pokemonPrevolutions } from "./pokemon-evolutions";
import { PlayerPokemon } from "#app/field/pokemon";
import i18next from "i18next";

View File

@ -13,7 +13,7 @@ import { BattlerIndex } from "../battle";
import { Terrain, TerrainType } from "../data/terrain";
import { PostTerrainChangeAbAttr, PostWeatherChangeAbAttr, applyPostTerrainChangeAbAttrs, applyPostWeatherChangeAbAttrs } from "../data/ability";
import Pokemon from "./pokemon";
import * as Overrides from "../overrides";
import Overrides from "../overrides";
import { WeatherChangedEvent, TerrainChangedEvent, TagAddedEvent, TagRemovedEvent } from "../events/arena";
import { ArenaTagType } from "#enums/arena-tag-type";
import { Biome } from "#enums/biome";

View File

@ -37,7 +37,7 @@ import { Nature, getNatureStatMultiplier } from "../data/nature";
import { SpeciesFormChange, SpeciesFormChangeActiveTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangePostMoveTrigger, SpeciesFormChangeStatusEffectTrigger } from "../data/pokemon-forms";
import { TerrainType } from "../data/terrain";
import { TrainerSlot } from "../data/trainer-config";
import * as Overrides from "../overrides";
import Overrides from "../overrides";
import i18next from "i18next";
import { speciesEggMoves } from "../data/egg-moves";
import { ModifierTier } from "../modifier/modifier-tier";

View File

@ -4,7 +4,7 @@ import BattleScene from "./battle-scene";
import { allChallenges, applyChallenges, Challenge, ChallengeType, copyChallenge } from "./data/challenge";
import PokemonSpecies, { allSpecies } from "./data/pokemon-species";
import { Arena } from "./field/arena";
import * as Overrides from "./overrides";
import Overrides from "./overrides";
import * as Utils from "./utils";
import { Biome } from "#enums/biome";
import { Species } from "#enums/species";

View File

@ -20,7 +20,7 @@ import { ModifierTier } from "./modifier-tier";
import { Nature, getNatureName, getNatureStatMultiplier } from "#app/data/nature";
import i18next from "i18next";
import { getModifierTierTextTint } from "#app/ui/text";
import * as Overrides from "../overrides";
import Overrides from "#app/overrides";
import { MoneyMultiplierModifier } from "./modifier";
import { Abilities } from "#enums/abilities";
import { BattlerTagType } from "#enums/battler-tag-type";
@ -1164,7 +1164,57 @@ class WeightedModifierType {
}
}
export type ModifierTypes = keyof typeof modifierTypes;
type BaseModifierOverride = {
name: Exclude<ModifierTypeKeys, GeneratorModifierOverride["name"]>;
count?: number;
};
/** Type for modifiers and held items that are constructed via {@linkcode ModifierTypeGenerator}. */
export type GeneratorModifierOverride = {
count?: number;
} & (
| {
name: keyof Pick<typeof modifierTypes, "SPECIES_STAT_BOOSTER">;
type?: SpeciesStatBoosterItem;
}
| {
name: keyof Pick<typeof modifierTypes, "TEMP_STAT_BOOSTER">;
type?: TempBattleStat;
}
| {
name: keyof Pick<typeof modifierTypes, "BASE_STAT_BOOSTER">;
type?: Stat;
}
| {
name: keyof Pick<typeof modifierTypes, "MINT">;
type?: Nature;
}
| {
name: keyof Pick<typeof modifierTypes, "ATTACK_TYPE_BOOSTER" | "TERA_SHARD">;
type?: Type;
}
| {
name: keyof Pick<typeof modifierTypes, "BERRY">;
type?: BerryType;
}
| {
name: keyof Pick<typeof modifierTypes, "EVOLUTION_ITEM" | "RARE_EVOLUTION_ITEM">;
type?: EvolutionItem;
}
| {
name: keyof Pick<typeof modifierTypes, "FORM_CHANGE_ITEM">;
type?: FormChangeItem;
}
| {
name: keyof Pick<typeof modifierTypes, "TM_COMMON" | "TM_GREAT" | "TM_ULTRA">;
type?: Moves;
}
);
/** Type used to construct modifiers and held items for overriding purposes. */
export type ModifierOverride = GeneratorModifierOverride | BaseModifierOverride;
export type ModifierTypeKeys = keyof typeof modifierTypes;
export const modifierTypes = {
POKEBALL: () => new AddPokeballModifierType("pb", PokeballType.POKEBALL, 5),
@ -1831,8 +1881,7 @@ export function getPlayerModifierTypeOptions(count: integer, party: PlayerPokemo
// OVERRIDE IF NECESSARY
if (Overrides.ITEM_REWARD_OVERRIDE?.length) {
options.forEach((mod, i) => {
// @ts-ignore: keeps throwing don't use string as index error in typedoc run
const override = modifierTypes[Overrides.ITEM_REWARD_OVERRIDE[i]]?.();
const override = modifierTypes[Overrides.ITEM_REWARD_OVERRIDE[i]]();
mod.type = (override instanceof ModifierTypeGenerator ? override.generateType(party) : override) || mod.type;
});
}

View File

@ -20,7 +20,7 @@ import { achvs } from "../system/achv";
import { VoucherType } from "../system/voucher";
import { FormChangeItem, SpeciesFormChangeItemTrigger } from "../data/pokemon-forms";
import { Nature } from "#app/data/nature";
import * as Overrides from "../overrides";
import Overrides from "../overrides";
import { ModifierType, modifierTypes } from "./modifier-type";
import { Command } from "#app/ui/command-ui-handler.js";
import { Species } from "#enums/species";
@ -2665,7 +2665,8 @@ export function overrideHeldItems(scene: BattleScene, pokemon: Pokemon, player:
const modifierType: ModifierType = modifierTypes[itemName](); // we retrieve the item in the list
let itemModifier: PokemonHeldItemModifier;
if (modifierType instanceof ModifierTypes.ModifierTypeGenerator) {
itemModifier = modifierType.generateType(null, [item.type]).withIdFromFunc(modifierTypes[itemName]).newModifier(pokemon) as PokemonHeldItemModifier;
const pregenArgs = "type" in item ? [item.type] : null;
itemModifier = modifierType.generateType(null, pregenArgs).withIdFromFunc(modifierTypes[itemName]).newModifier(pokemon) as PokemonHeldItemModifier;
} else {
itemModifier = modifierType.withIdFromFunc(modifierTypes[itemName]).newModifier(pokemon) as PokemonHeldItemModifier;
}

View File

@ -1,12 +1,9 @@
import { Abilities } from "#enums/abilities";
import { type BerryType } from "#enums/berry-type";
import { Biome } from "#enums/biome";
import { EggTier } from "#enums/egg-type";
import { Moves } from "#enums/moves";
import { Nature } from "#enums/nature";
import { PokeballType } from "#enums/pokeball";
import { Species } from "#enums/species";
import { type Stat } from "#enums/stat";
import { StatusEffect } from "#enums/status-effect";
import { TimeOfDay } from "#enums/time-of-day";
import { VariantTier } from "#enums/variant-tiers";
@ -14,135 +11,166 @@ import { WeatherType } from "#enums/weather-type";
import { type PokeballCounts } from "./battle-scene";
import { Gender } from "./data/gender";
import { allSpecies } from "./data/pokemon-species"; // eslint-disable-line @typescript-eslint/no-unused-vars
import { type TempBattleStat } from "./data/temp-battle-stat";
import { type Type } from "./data/type";
import { type Variant } from "./data/variant";
import { type ModifierTypes, type SpeciesStatBoosterItem } from "./modifier/modifier-type";
import { Variant } from "./data/variant";
import { type ModifierOverride, type ModifierTypeKeys } from "./modifier/modifier-type";
/**
* Overrides for testing different in game situations
* if an override name starts with "STARTING", it will apply when a new run begins
*/
/**
* OVERALL OVERRIDES
*/
// a specific seed (default: a random string of 24 characters)
export const SEED_OVERRIDE: string = "";
export const WEATHER_OVERRIDE: WeatherType = WeatherType.NONE;
export const DOUBLE_BATTLE_OVERRIDE: boolean = false;
export const SINGLE_BATTLE_OVERRIDE: boolean = false;
export const STARTING_WAVE_OVERRIDE: integer = 0;
export const STARTING_BIOME_OVERRIDE: Biome = Biome.TOWN;
export const ARENA_TINT_OVERRIDE: TimeOfDay = null;
// Multiplies XP gained by this value including 0. Set to null to ignore the override
export const XP_MULTIPLIER_OVERRIDE: number = null;
// default 1000
export const STARTING_MONEY_OVERRIDE: integer = 0;
export const FREE_CANDY_UPGRADE_OVERRIDE: boolean = false;
export const POKEBALL_OVERRIDE: { active: boolean, pokeballs: PokeballCounts } = {
active: false,
pokeballs: {
[PokeballType.POKEBALL]: 5,
[PokeballType.GREAT_BALL]: 0,
[PokeballType.ULTRA_BALL]: 0,
[PokeballType.ROGUE_BALL]: 0,
[PokeballType.MASTER_BALL]: 0,
}
};
/**
* PLAYER OVERRIDES
*/
/**
* Set the form index of any starter in the party whose `speciesId` is inside this override
* @see {@link allSpecies} in `src/data/pokemon-species.ts` for form indexes
* Overrides that are using when testing different in game situations
*
* Any override added here will be used instead of the value in {@linkcode DefaultOverrides}
*
* If an override name starts with "STARTING", it will apply when a new run begins
*
* @example
* ```
* const STARTER_FORM_OVERRIDES = {
* [Species.DARMANITAN]: 1
* const overrides = {
* ABILITY_OVERRIDE: Abilities.PROTEAN,
* PASSIVE_ABILITY_OVERRIDE: Abilities.PIXILATE,
* }
* ```
*/
export const STARTER_FORM_OVERRIDES: Partial<Record<Species, number>> = {};
// default 5 or 20 for Daily
export const STARTING_LEVEL_OVERRIDE: integer = 0;
/**
* SPECIES OVERRIDE
* will only apply to the first starter in your party or each enemy pokemon
* default is 0 to not override
* @example SPECIES_OVERRIDE = Species.Bulbasaur;
*/
export const STARTER_SPECIES_OVERRIDE: Species | integer = 0;
export const ABILITY_OVERRIDE: Abilities = Abilities.NONE;
export const PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
export const STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
export const GENDER_OVERRIDE: Gender = null;
export const MOVESET_OVERRIDE: Array<Moves> = [];
export const SHINY_OVERRIDE: boolean = false;
export const VARIANT_OVERRIDE: Variant = 0;
const overrides = {} satisfies Partial<InstanceType<typeof DefaultOverrides>>;
/**
* OPPONENT / ENEMY OVERRIDES
*/
export const OPP_SPECIES_OVERRIDE: Species | integer = 0;
export const OPP_LEVEL_OVERRIDE: number = 0;
export const OPP_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
export const OPP_PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
export const OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
export const OPP_GENDER_OVERRIDE: Gender = null;
export const OPP_MOVESET_OVERRIDE: Array<Moves> = [];
export const OPP_SHINY_OVERRIDE: boolean = false;
export const OPP_VARIANT_OVERRIDE: Variant = 0;
export const OPP_IVS_OVERRIDE: integer | integer[] = [];
/**
* EGG OVERRIDES
*/
export const EGG_IMMEDIATE_HATCH_OVERRIDE: boolean = false;
export const EGG_TIER_OVERRIDE: EggTier = null;
export const EGG_SHINY_OVERRIDE: boolean = false;
export const EGG_VARIANT_OVERRIDE: VariantTier = null;
export const EGG_FREE_GACHA_PULLS_OVERRIDE: boolean = false;
export const EGG_GACHA_PULL_COUNT_OVERRIDE: number = 0;
/**
* MODIFIER / ITEM OVERRIDES
* if count is not provided, it will default to 1
* @example Modifier Override [{name: "EXP_SHARE", count: 2}]
* @example Held Item Override [{name: "LUCKY_EGG"}]
* If you need to add Overrides values for local testing do that inside {@linkcode overrides}
* ---
* Defaults for Overrides that are used when testing different in game situations
*
* Some items are generated based on a sub-type (i.e. berries), to override those:
* @example [{name: "BERRY", count: 5, type: BerryType.SITRUS}]
* types are listed in interface below
* - TempBattleStat is for TEMP_STAT_BOOSTER / X Items (Dire hit is separate)
* - Stat is for BASE_STAT_BOOSTER / Vitamin
* - Nature is for MINT
* - Type is for TERA_SHARD or ATTACK_TYPE_BOOSTER (type boosting items i.e Silk Scarf)
* - BerryType is for BERRY
* - SpeciesStatBoosterItem is for SPECIES_STAT_BOOSTER
* If an override name starts with "STARTING", it will apply when a new run begins
*/
interface ModifierOverride {
name: ModifierTypes & string,
count?: integer
type?: TempBattleStat|Stat|Nature|Type|BerryType|SpeciesStatBoosterItem
class DefaultOverrides {
// -----------------
// OVERALL OVERRIDES
// -----------------
/** a specific seed (default: a random string of 24 characters) */
readonly SEED_OVERRIDE: string = "";
readonly WEATHER_OVERRIDE: WeatherType = WeatherType.NONE;
readonly DOUBLE_BATTLE_OVERRIDE: boolean = false;
readonly SINGLE_BATTLE_OVERRIDE: boolean = false;
readonly STARTING_WAVE_OVERRIDE: integer = 0;
readonly STARTING_BIOME_OVERRIDE: Biome = Biome.TOWN;
readonly ARENA_TINT_OVERRIDE: TimeOfDay = null;
/** Multiplies XP gained by this value including 0. Set to null to ignore the override */
readonly XP_MULTIPLIER_OVERRIDE: number = null;
/** default 1000 */
readonly STARTING_MONEY_OVERRIDE: integer = 0;
readonly FREE_CANDY_UPGRADE_OVERRIDE: boolean = false;
readonly POKEBALL_OVERRIDE: { active: boolean; pokeballs: PokeballCounts } = {
active: false,
pokeballs: {
[PokeballType.POKEBALL]: 5,
[PokeballType.GREAT_BALL]: 0,
[PokeballType.ULTRA_BALL]: 0,
[PokeballType.ROGUE_BALL]: 0,
[PokeballType.MASTER_BALL]: 0,
},
};
// ----------------
// PLAYER OVERRIDES
// ----------------
/**
* Set the form index of any starter in the party whose `speciesId` is inside this override
* @see {@link allSpecies} in `src/data/pokemon-species.ts` for form indexes
* @example
* ```
* const STARTER_FORM_OVERRIDES = {
* [Species.DARMANITAN]: 1
* }
* ```
*/
readonly STARTER_FORM_OVERRIDES: Partial<Record<Species, number>> = {};
/** default 5 or 20 for Daily */
readonly STARTING_LEVEL_OVERRIDE: integer = 0;
/**
* SPECIES OVERRIDE
* will only apply to the first starter in your party or each enemy pokemon
* default is 0 to not override
* @example SPECIES_OVERRIDE = Species.Bulbasaur;
*/
readonly STARTER_SPECIES_OVERRIDE: Species | integer = 0;
readonly ABILITY_OVERRIDE: Abilities = Abilities.NONE;
readonly PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
readonly STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
readonly GENDER_OVERRIDE: Gender = null;
readonly MOVESET_OVERRIDE: Array<Moves> = [];
readonly SHINY_OVERRIDE: boolean = false;
readonly VARIANT_OVERRIDE: Variant = 0;
// --------------------------
// OPPONENT / ENEMY OVERRIDES
// --------------------------
readonly OPP_SPECIES_OVERRIDE: Species | integer = 0;
readonly OPP_LEVEL_OVERRIDE: number = 0;
readonly OPP_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
readonly OPP_PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
readonly OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
readonly OPP_GENDER_OVERRIDE: Gender = null;
readonly OPP_MOVESET_OVERRIDE: Array<Moves> = [];
readonly OPP_SHINY_OVERRIDE: boolean = false;
readonly OPP_VARIANT_OVERRIDE: Variant = 0;
readonly OPP_IVS_OVERRIDE: integer | integer[] = [];
// -------------
// EGG OVERRIDES
// -------------
readonly EGG_IMMEDIATE_HATCH_OVERRIDE: boolean = false;
readonly EGG_TIER_OVERRIDE: EggTier = null;
readonly EGG_SHINY_OVERRIDE: boolean = false;
readonly EGG_VARIANT_OVERRIDE: VariantTier = null;
readonly EGG_FREE_GACHA_PULLS_OVERRIDE: boolean = false;
readonly EGG_GACHA_PULL_COUNT_OVERRIDE: number = 0;
// -------------------------
// MODIFIER / ITEM OVERRIDES
// -------------------------
/**
* Overrides labeled `MODIFIER` deal with any modifier so long as it doesn't require a party
* member to hold it (typically this is, extends, or generates a {@linkcode ModifierType}),
* like `EXP_SHARE`, `CANDY_JAR`, etc.
*
* Overrides labeled `HELD_ITEM` specifically pertain to any entry in {@linkcode modifierTypes} that
* extends, or generates a {@linkcode PokemonHeldItemModifierType}, like `SOUL_DEW`, `TOXIC_ORB`, etc.
*
* Note that, if count is not provided, it will default to 1.
*
* Additionally, note that some held items and modifiers are grouped together via
* a {@linkcode ModifierTypeGenerator} and require pre-generation arguments to get
* a specific item from that group. If a type is not set, the generator will either
* use the party to weight item choice or randomly pick an item.
*
* @example
* ```
* // Will have a quantity of 2 in-game
* STARTING_MODIFIER_OVERRIDE = [{name: "EXP_SHARE", count: 2}]
* // Will have a quantity of 1 in-game
* STARTING_HELD_ITEM_OVERRIDE = [{name: "LUCKY_EGG"}]
* // Type must be given to get a specific berry
* STARTING_HELD_ITEM_OVERRIDE = [{name: "BERRY", type: BerryType.SITRUS}]
* // A random berry will be generated at runtime
* STARTING_HELD_ITEM_OVERRIDE = [{name: "BERRY"}]
* ```
*/
readonly STARTING_MODIFIER_OVERRIDE: Array<ModifierOverride> = [];
readonly OPP_MODIFIER_OVERRIDE: Array<ModifierOverride> = [];
readonly STARTING_HELD_ITEMS_OVERRIDE: Array<ModifierOverride> = [];
readonly OPP_HELD_ITEMS_OVERRIDE: Array<ModifierOverride> = [];
readonly NEVER_CRIT_OVERRIDE: boolean = false;
/**
* An array of items by keys as defined in the "modifierTypes" object in the "modifier/modifier-type.ts" file.
* Items listed will replace the normal rolls.
* If less items are listed than rolled, only some items will be replaced
* If more items are listed than rolled, only the first X items will be shown, where X is the number of items rolled.
*/
readonly ITEM_REWARD_OVERRIDE: Array<ModifierTypeKeys> = [];
}
export const STARTING_MODIFIER_OVERRIDE: Array<ModifierOverride> = [];
export const OPP_MODIFIER_OVERRIDE: Array<ModifierOverride> = [];
export const STARTING_HELD_ITEMS_OVERRIDE: Array<ModifierOverride> = [];
export const OPP_HELD_ITEMS_OVERRIDE: Array<ModifierOverride> = [];
export const NEVER_CRIT_OVERRIDE: boolean = false;
export const defaultOverrides = new DefaultOverrides();
/**
* An array of items by keys as defined in the "modifierTypes" object in the "modifier/modifier-type.ts" file.
* Items listed will replace the normal rolls.
* If less items are listed than rolled, only some items will be replaced
* If more items are listed than rolled, only the first X items will be shown, where X is the number of items rolled.
*/
export const ITEM_REWARD_OVERRIDE: Array<String> = [];
export default {
...defaultOverrides,
...overrides
} satisfies InstanceType<typeof DefaultOverrides>;

View File

@ -50,7 +50,7 @@ import { fetchDailyRunSeed, getDailyRunStarters } from "./data/daily-run";
import { GameMode, GameModes, getGameMode } from "./game-mode";
import PokemonSpecies, { getPokemonSpecies, speciesStarters } from "./data/pokemon-species";
import i18next from "./plugins/i18n";
import * as Overrides from "./overrides";
import Overrides from "./overrides";
import { TextStyle, addTextObject } from "./ui/text";
import { Type } from "./data/type";
import { BerryUsedEvent, EncounterPhaseEvent, MoveUsedEvent, TurnEndEvent, TurnInitEvent } from "./events/battle-scene";

View File

@ -4,7 +4,7 @@ import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon";
import { pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutions";
import PokemonSpecies, { allSpecies, getPokemonSpecies, noStarterFormKeys, speciesStarters } from "../data/pokemon-species";
import * as Utils from "../utils";
import * as Overrides from "../overrides";
import Overrides from "../overrides";
import PokemonData from "./pokemon-data";
import PersistentModifierData from "./modifier-data";
import ArenaData from "./arena-data";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import { MoveEffectPhase } from "#app/phases";
import { Moves } from "#enums/moves";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Moves } from "#enums/moves";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "#test/utils/gameManager";
import { getMovePosition } from "#test/utils/gameManagerUtils";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Moves } from "#enums/moves";
import { Abilities } from "#enums/abilities";
import { Species } from "#enums/species";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "../utils/gameManager";
import Phaser from "phaser";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { BattleStat } from "#app/data/battle-stat.js";
import { CommandPhase, MessagePhase } from "#app/phases.js";
import { getMovePosition } from "../utils/gameManagerUtils";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "#test/utils/gameManager";
import { getMovePosition } from "#test/utils/gameManagerUtils";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Moves } from "#enums/moves";
import { Abilities } from "#enums/abilities";
import { Species } from "#enums/species";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { TurnEndPhase } from "#app/phases";
import { Moves } from "#enums/moves";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import {
MoveEffectPhase,

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
CommandPhase, DamagePhase, EncounterPhase,
EnemyCommandPhase, SelectStarterPhase,

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {Abilities} from "#enums/abilities";
import {Species} from "#enums/species";
import {

View File

@ -1,7 +1,7 @@
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "../utils/gameManager";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
CommandPhase,
EnemyCommandPhase,

View File

@ -1,7 +1,7 @@
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "../utils/gameManager";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "#test/utils/gameManager";
import { getMovePosition } from "#test/utils/gameManagerUtils";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Moves } from "#enums/moves";
import { Abilities } from "#enums/abilities";
import { Species } from "#enums/species";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Moves } from "#enums/moves";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";

View File

@ -1,7 +1,7 @@
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "../utils/gameManager";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";

View File

@ -1,6 +1,6 @@
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Abilities } from "#enums/abilities";
import { Species } from "#enums/species";
import { FaintPhase } from "#app/phases";

View File

@ -1,7 +1,7 @@
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "../utils/gameManager";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
MoveEndPhase, TurnEndPhase,
} from "#app/phases";
@ -139,10 +139,9 @@ describe("Abilities - Sap Sipper", () => {
expect(game.phaseInterceptor.log).not.toContain("ShowAbilityPhase");
});
/*
// TODO Add METRONOME outcome override
// To run this testcase, manually modify the METRONOME move to always give SAP_SIPPER, then uncomment
it("activate once against multi-hit grass attacks (metronome)", async() => {
it.todo("activate once against multi-hit grass attacks (metronome)", async() => {
const moveToUse = Moves.METRONOME;
const enemyAbility = Abilities.SAP_SIPPER;
@ -162,5 +161,4 @@ describe("Abilities - Sap Sipper", () => {
expect(startingOppHp - game.scene.getEnemyParty()[0].hp).toBe(0);
expect(game.scene.getEnemyParty()[0].summonData.battleStats[BattleStat.ATK]).toBe(1);
});
*/
});

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "#test/utils/gameManager";
import { getMovePosition } from "#test/utils/gameManagerUtils";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Moves } from "#enums/moves";
import { Abilities } from "#enums/abilities";
import { Species } from "#enums/species";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import { PostSummonPhase, TurnEndPhase, } from "#app/phases";
import { Moves } from "#enums/moves";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {Abilities} from "#enums/abilities";
import {applyAbAttrs ,MoveEffectChanceMultiplierAbAttr} from "#app/data/ability";
import {Species} from "#enums/species";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {Abilities} from "#enums/abilities";
import {applyAbAttrs ,applyPreAttackAbAttrs,applyPostDefendAbAttrs, MoveEffectChanceMultiplierAbAttr, MovePowerBoostAbAttr, PostDefendTypeChangeAbAttr} from "#app/data/ability";
import {Species} from "#enums/species";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Abilities } from "#enums/abilities";
import {applyAbAttrs ,applyPreDefendAbAttrs,IgnoreMoveEffectsAbAttr,MoveEffectChanceMultiplierAbAttr} from "#app/data/ability";
import {Species} from "#enums/species";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "#test/utils/gameManager";
import { getMovePosition } from "#test/utils/gameManagerUtils";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Moves } from "#enums/moves";
import { Abilities } from "#enums/abilities";
import { Species } from "#enums/species";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Moves } from "#enums/moves";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
DamagePhase,
MoveEndPhase,

View File

@ -1,7 +1,7 @@
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "../utils/gameManager";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
TurnEndPhase,
} from "#app/phases";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import {
TurnEndPhase,

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import {
TurnEndPhase,

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import { TurnEndPhase, } from "#app/phases";
import { Moves } from "#enums/moves";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import {
CommandPhase,
DamagePhase,

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "#test/utils/gameManager";
import { getMovePosition } from "#test/utils/gameManagerUtils";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Moves } from "#enums/moves";
import { Abilities } from "#enums/abilities";
import { Species } from "#enums/species";

View File

@ -5,7 +5,7 @@ import { IntegerHolder, NumberHolder } from "#app/utils.js";
import { TurnHeldItemTransferModifier } from "#app/modifier/modifier.js";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
describe("check some Achievement related stuff", () => {
it ("should check Achievement creation", () => {

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import {
TurnStartPhase,

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
CommandPhase, EnemyCommandPhase, SelectTargetPhase,
TurnStartPhase

View File

@ -2,7 +2,7 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest
import {generateStarter, getMovePosition,} from "#app/test/utils/gameManagerUtils";
import {Mode} from "#app/ui/ui";
import {GameModes} from "#app/game-mode";
import * as overrides from "../../overrides";
import overrides from "../../overrides";
import {Command} from "#app/ui/command-ui-handler";
import {
CommandPhase, DamagePhase,

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import GameManager from "#app/test/utils/gameManager";
import Phaser from "phaser";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";

View File

@ -1,6 +1,6 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import {Mode} from "#app/ui/ui";
import * as overrides from "../../overrides";
import overrides from "../../overrides";
import {
CommandPhase,
} from "#app/phases";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phase from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Stat } from "#app/data/pokemon-stat";
import { EvolutionStatBoosterModifier } from "#app/modifier/modifier";
import { modifierTypes } from "#app/modifier/modifier-type";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phase from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Moves } from "#app/enums/moves.js";
import { Species } from "#app/enums/species.js";
import { BerryType } from "#app/enums/berry-type.js";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phase from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Stat } from "#app/data/pokemon-stat";
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phase from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Stat } from "#app/data/pokemon-stat";
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phase from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Stat } from "#app/data/pokemon-stat";
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phase from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Stat } from "#app/data/pokemon-stat";
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
CommandPhase,
EnemyCommandPhase,

View File

@ -1,7 +1,7 @@
import { beforeAll, describe, beforeEach, afterEach, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import { TerrainType, getTerrainName } from "#app/data/terrain";
import { getTerrainStartMessage, getTerrainClearMessage, getTerrainBlockMessage } from "#app/data/weather";

View File

@ -1,7 +1,7 @@
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
import GameManager from "../utils/gameManager";
import * as Overrides from "#app/overrides";
import Overrides from "#app/overrides";
import { Species } from "#enums/species";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
TurnEndPhase,
} from "#app/phases";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
MoveEffectPhase,
TurnEndPhase

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { MoveEffectPhase } from "#app/phases";
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
import { Stat } from "#app/data/pokemon-stat";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import {
TurnEndPhase,

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
CommandPhase,
SelectTargetPhase,

View File

@ -3,7 +3,7 @@ import GameManager from "../utils/gameManager";
import {
Moves
} from "#app/enums/moves.js";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Abilities } from "#app/enums/abilities.js";
import { BattlerIndex } from "#app/battle.js";
import { getMovePosition } from "../utils/gameManagerUtils";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
CommandPhase,
EnemyCommandPhase,

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import {
MoveEffectPhase,

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
TurnEndPhase,
} from "#app/phases";

View File

@ -1,7 +1,7 @@
import {beforeAll, afterEach, beforeEach, describe, vi, it, expect} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {Moves} from "#enums/moves";
import {Species} from "#enums/species";
import {CommandPhase, TurnEndPhase} from "#app/phases.js";

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import {
CommandPhase,

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
MoveEndPhase,
} from "#app/phases";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
CommandPhase,
SelectTargetPhase,

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
TurnEndPhase,
} from "#app/phases";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#app/enums/species.js";
import { Moves } from "#app/enums/moves.js";
import { getMovePosition } from "../utils/gameManagerUtils";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
CommandPhase
} from "#app/phases";

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
CommandPhase,
SelectTargetPhase,

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
CommandPhase,
EnemyCommandPhase, TurnEndPhase,

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
CommandPhase,
EnemyCommandPhase,

View File

@ -1,7 +1,7 @@
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { Species } from "#enums/species";
import {
TurnEndPhase,

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, test, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
MoveEffectPhase,
TurnEndPhase

View File

@ -1,7 +1,7 @@
import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest";
import Phaser from "phaser";
import GameManager from "#app/test/utils/gameManager";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import { MoveEndPhase, TurnEndPhase } from "#app/phases";
import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves";

View File

@ -1,61 +1,6 @@
import { StatusEffect } from "#app/data/status-effect";
import * as _Overrides from "#app/overrides";
import { Abilities } from "#enums/abilities";
import { Biome } from "#enums/biome";
import { WeatherType } from "#enums/weather-type";
import Overrides, { defaultOverrides } from "#app/overrides";
import { expect, test } from "vitest";
test("Overrides are default values", () => {
const defaultOverrides = {
SEED_OVERRIDE: "",
WEATHER_OVERRIDE: WeatherType.NONE,
DOUBLE_BATTLE_OVERRIDE: false,
SINGLE_BATTLE_OVERRIDE: false,
STARTING_WAVE_OVERRIDE: 0,
STARTING_BIOME_OVERRIDE: Biome.TOWN,
ARENA_TINT_OVERRIDE: null,
XP_MULTIPLIER_OVERRIDE: null,
STARTING_MONEY_OVERRIDE: 0,
FREE_CANDY_UPGRADE_OVERRIDE: false,
POKEBALL_OVERRIDE: _Overrides.POKEBALL_OVERRIDE, // Pass through pokeballs
// Player
STARTER_FORM_OVERRIDES: {},
STARTING_LEVEL_OVERRIDE: 0,
STARTER_SPECIES_OVERRIDE: 0,
ABILITY_OVERRIDE: Abilities.NONE,
PASSIVE_ABILITY_OVERRIDE: Abilities.NONE,
STATUS_OVERRIDE: StatusEffect.NONE,
GENDER_OVERRIDE: null,
MOVESET_OVERRIDE: [],
SHINY_OVERRIDE: false,
VARIANT_OVERRIDE: 0,
// Opponent
OPP_SPECIES_OVERRIDE: 0,
OPP_LEVEL_OVERRIDE: 0,
OPP_ABILITY_OVERRIDE: Abilities.NONE,
OPP_PASSIVE_ABILITY_OVERRIDE: Abilities.NONE,
OPP_STATUS_OVERRIDE: StatusEffect.NONE,
OPP_GENDER_OVERRIDE: null,
OPP_MOVESET_OVERRIDE: [],
OPP_SHINY_OVERRIDE: false,
OPP_VARIANT_OVERRIDE: 0,
OPP_IVS_OVERRIDE: [],
// Eggs
EGG_IMMEDIATE_HATCH_OVERRIDE: false,
EGG_TIER_OVERRIDE: null,
EGG_SHINY_OVERRIDE: false,
EGG_VARIANT_OVERRIDE: null,
EGG_FREE_GACHA_PULLS_OVERRIDE: false,
EGG_GACHA_PULL_COUNT_OVERRIDE: 0,
// Items
STARTING_MODIFIER_OVERRIDE: [],
OPP_MODIFIER_OVERRIDE: [],
STARTING_HELD_ITEMS_OVERRIDE: [],
OPP_HELD_ITEMS_OVERRIDE: [],
NEVER_CRIT_OVERRIDE: false,
ITEM_REWARD_OVERRIDE: [],
} satisfies typeof _Overrides;
const Overrides = Object.assign({}, _Overrides);
expect(Overrides).toEqual(defaultOverrides);
});

View File

@ -2,7 +2,7 @@ import { BerryType } from "#app/enums/berry-type";
import { Moves } from "#app/enums/moves";
import { Species } from "#app/enums/species";
import { Button } from "#app/enums/buttons";
import * as overrides from "#app/overrides";
import overrides from "#app/overrides";
import {
BattleEndPhase,
SelectModifierPhase

View File

@ -13,7 +13,17 @@ import { initAchievements } from "#app/system/achv.js";
import { initVouchers } from "#app/system/voucher.js";
import { initStatsKeys } from "#app/ui/game-stats-ui-handler";
import { beforeAll } from "vitest";
import { beforeAll, vi } from "vitest";
/** Mock the override import to always return default values, ignoring any custom overrides. */
vi.mock("#app/overrides", async (importOriginal) => {
const { defaultOverrides } = await importOriginal<typeof import("#app/overrides")>();
return {
default: defaultOverrides,
defaultOverrides
} satisfies typeof import("#app/overrides");
});
initVouchers();
initAchievements();

View File

@ -9,7 +9,7 @@ import { getPokemonSpecies } from "../data/pokemon-species";
import { addWindow } from "./ui-theme";
import { Tutorial, handleTutorial } from "../tutorial";
import {Button} from "#enums/buttons";
import * as Overrides from "../overrides";
import Overrides from "../overrides";
import { GachaType } from "#app/enums/gacha-types";
import i18next from "i18next";
import { EggTier } from "#enums/egg-type";

View File

@ -28,7 +28,7 @@ import { TextStyle, addBBCodeTextObject, addTextObject } from "./text";
import { Mode } from "./ui";
import { addWindow } from "./ui-theme";
import { Egg } from "#app/data/egg";
import * as Overrides from "../overrides";
import Overrides from "../overrides";
import {SettingKeyboard} from "#app/system/settings/settings-keyboard";
import {Passive as PassiveAttr} from "#enums/passive";
import * as Challenge from "../data/challenge";