[Misc] New data structures for pokedex (#5223)

* Introducing catchableStarters in biomes.ts

* Introducing SpeciesTmMoves with a list of TM moves for each species

* speciesTmMoves now properly accounts for form-specific tms

* Removed argument from transverse function

* Adding types to passive abilities data structures

* Update tms.ts

* Update src/data/balance/passives.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

---------

Co-authored-by: damocleas <damocleas25@gmail.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
Wlowscha 2025-02-04 02:43:52 +01:00 committed by GitHub
parent 45f4bf3f13
commit 91a4333e96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 70 additions and 1 deletions

View File

@ -102,6 +102,18 @@ export interface BiomePokemonPools {
[key: integer]: BiomeTierPokemonPools
}
export interface BiomeTierTod {
biome: Biome,
tier: BiomePoolTier,
tod: TimeOfDay[]
}
export interface CatchableSpecies{
[key: integer]: BiomeTierTod[]
}
export const catchableSpecies: CatchableSpecies = {};
export interface BiomeTierTrainerPools {
[key: integer]: TrainerType[]
}
@ -7716,6 +7728,9 @@ export function initBiomes() {
uncatchableSpecies.push(speciesId);
}
// array of biome options for the current species
catchableSpecies[speciesId] = [];
for (const b of biomeEntries) {
const biome = b[0];
const tier = b[1];
@ -7725,6 +7740,12 @@ export function initBiomes() {
: [ b[2] ]
: [ TimeOfDay.ALL ];
catchableSpecies[speciesId].push({
biome: biome as Biome,
tier: tier as BiomePoolTier,
tod: timesOfDay as TimeOfDay[]
});
for (const tod of timesOfDay) {
if (!biomePokemonPools.hasOwnProperty(biome) || !biomePokemonPools[biome].hasOwnProperty(tier) || !biomePokemonPools[biome][tier].hasOwnProperty(tod)) {
continue;

View File

@ -1,7 +1,15 @@
import { Abilities } from "#app/enums/abilities";
import { Species } from "#app/enums/species";
export const starterPassiveAbilities = {
export interface PassiveAbilities {
[key: number]: Abilities
}
interface StarterPassiveAbilities {
[key: integer]: PassiveAbilities
}
export const starterPassiveAbilities: StarterPassiveAbilities = {
[Species.BULBASAUR]: { 0: Abilities.GRASSY_SURGE },
[Species.CHARMANDER]: { 0: Abilities.BEAST_BOOST },
[Species.SQUIRTLE]: { 0: Abilities.STURDY },

View File

@ -68433,6 +68433,46 @@ export const tmSpecies: TmSpecies = {
],
};
interface SpeciesTmMoves {
[key: integer]: (Moves | [string | Species, Moves])[];
}
function transposeTmSpecies(): SpeciesTmMoves {
const flipped: SpeciesTmMoves = {};
for (const move in tmSpecies) {
const moveKey = Number(move);
const speciesList = tmSpecies[move];
for (const species of speciesList) {
if (Array.isArray(species)) {
// Extract base species and all associated forms
const [ baseSpecies, ...forms ] = species;
const speciesKey = Number(baseSpecies);
if (!flipped[speciesKey]) {
flipped[speciesKey] = [];
}
for (const form of forms) {
flipped[speciesKey].push([ form, moveKey ]);
}
} else {
const speciesKey = Number(species);
if (!flipped[speciesKey]) {
flipped[speciesKey] = [];
}
flipped[speciesKey].push(moveKey);
}
}
}
return flipped;
}
export const speciesTmMoves: SpeciesTmMoves = transposeTmSpecies();
interface TmPoolTiers {
[key: integer]: ModifierTier
}