[Misc] Fix circular dep (#6361)

This commit is contained in:
Sirz Benjie 2025-08-23 10:00:00 -05:00 committed by GitHub
parent e63effa311
commit 3dd1948634
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,3 @@
import { pokemonEvolutions } from "#balance/pokemon-evolutions";
import { SpeciesId } from "#enums/species-id"; import { SpeciesId } from "#enums/species-id";
/** The maximum size of the player's party */ /** The maximum size of the player's party */
@ -54,15 +53,6 @@ export const defaultStarterSpecies: SpeciesId[] = [
SpeciesId.QUAXLY, SpeciesId.QUAXLY,
]; ];
/**
* The default species and all their evolutions
*/
export const defaultStarterSpeciesAndEvolutions: SpeciesId[] = defaultStarterSpecies.flatMap(id => {
const stage2ids = pokemonEvolutions[id]?.map(e => e.speciesId) ?? [];
const stage3ids = stage2ids.flatMap(s2id => pokemonEvolutions[s2id]?.map(e => e.speciesId) ?? []);
return [id, ...stage2ids, ...stage3ids];
});
export const saveKey = "x0i2O7WRiANTqPmZ"; // Temporary; secure encryption is not yet necessary export const saveKey = "x0i2O7WRiANTqPmZ"; // Temporary; secure encryption is not yet necessary
/** /**

View File

@ -1,3 +1,4 @@
import { defaultStarterSpecies } from "#app/constants";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
import { speciesStarterCosts } from "#balance/starters"; import { speciesStarterCosts } from "#balance/starters";
import { allMoves } from "#data/data-lists"; import { allMoves } from "#data/data-lists";
@ -1883,6 +1884,15 @@ export function initPokemonPrevolutions(): void {
// TODO: This may cause funny business for double starters such as Pichu/Pikachu // TODO: This may cause funny business for double starters such as Pichu/Pikachu
export const pokemonStarters: PokemonPrevolutions = {}; export const pokemonStarters: PokemonPrevolutions = {};
/**
* The default species and all their evolutions
*/
export const defaultStarterSpeciesAndEvolutions: SpeciesId[] = defaultStarterSpecies.flatMap(id => {
const stage2ids = pokemonEvolutions[id]?.map(e => e.speciesId) ?? [];
const stage3ids = stage2ids.flatMap(s2id => pokemonEvolutions[s2id]?.map(e => e.speciesId) ?? []);
return [id, ...stage2ids, ...stage3ids];
});
export function initPokemonStarters(): void { export function initPokemonStarters(): void {
const starterKeys = Object.keys(pokemonPrevolutions); const starterKeys = Object.keys(pokemonPrevolutions);
starterKeys.forEach(pk => { starterKeys.forEach(pk => {

View File

@ -1,6 +1,6 @@
import type { FixedBattleConfig } from "#app/battle"; import type { FixedBattleConfig } from "#app/battle";
import { getRandomTrainerFunc } from "#app/battle"; import { getRandomTrainerFunc } from "#app/battle";
import { defaultStarterSpeciesAndEvolutions } from "#app/constants"; import { defaultStarterSpeciesAndEvolutions } from "#balance/pokemon-evolutions";
import { speciesStarterCosts } from "#balance/starters"; import { speciesStarterCosts } from "#balance/starters";
import type { PokemonSpecies } from "#data/pokemon-species"; import type { PokemonSpecies } from "#data/pokemon-species";
import { AbilityAttr } from "#enums/ability-attr"; import { AbilityAttr } from "#enums/ability-attr";