From 12b1d2311007b8f1fd3ac88423f51e2a4b85a2b2 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Mon, 26 Feb 2024 13:50:55 -0500 Subject: [PATCH] Replaces instances of SpeciesEvolution with SpeciesFormEvolution --- src/data/biomes.ts | 6 +++--- src/data/pokemon-evolutions.ts | 2 +- src/evolution-phase.ts | 6 +++--- src/pokemon.ts | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/data/biomes.ts b/src/data/biomes.ts index 9d15dcb7a..7bb3b5831 100644 --- a/src/data/biomes.ts +++ b/src/data/biomes.ts @@ -5,7 +5,7 @@ import beautify from 'json-beautify'; import { TrainerType } from "./enums/trainer-type"; import { TimeOfDay } from "./enums/time-of-day"; import { Biome } from "./enums/biome"; -import { SpeciesEvolution } from "./pokemon-evolutions"; +import { SpeciesFormEvolution } from "./pokemon-evolutions"; export function getBiomeName(biome: Biome | -1) { if (biome === -1) @@ -7659,7 +7659,7 @@ export const biomeTrainerPools: BiomeTrainerPools = { const speciesId = pb[0] as Species; const biomeEntries = pb[3] as (Biome | BiomePoolTier)[][]; - const speciesEvolutions: SpeciesEvolution[] = pokemonEvolutions.hasOwnProperty(speciesId) + const speciesEvolutions: SpeciesFormEvolution[] = pokemonEvolutions.hasOwnProperty(speciesId) ? pokemonEvolutions[speciesId] : []; @@ -7688,7 +7688,7 @@ export const biomeTrainerPools: BiomeTrainerPools = { const existingSpeciesIds = biomeTierPool[t] as unknown as Species[]; for (let es = 0; es < existingSpeciesIds.length; es++) { const existingSpeciesId = existingSpeciesIds[es]; - if (pokemonEvolutions.hasOwnProperty(existingSpeciesId) && (pokemonEvolutions[existingSpeciesId] as SpeciesEvolution[]).find(ese => ese.speciesId === speciesId)) { + if (pokemonEvolutions.hasOwnProperty(existingSpeciesId) && (pokemonEvolutions[existingSpeciesId] as SpeciesFormEvolution[]).find(ese => ese.speciesId === speciesId)) { treeIndex = t; arrayIndex = es + 1; break; diff --git a/src/data/pokemon-evolutions.ts b/src/data/pokemon-evolutions.ts index 9401099d8..dfcb860c3 100644 --- a/src/data/pokemon-evolutions.ts +++ b/src/data/pokemon-evolutions.ts @@ -100,7 +100,7 @@ export class SpeciesFriendshipEvolutionCondition extends SpeciesEvolutionConditi } interface PokemonEvolutions { - [key: string]: SpeciesEvolution[] + [key: string]: SpeciesFormEvolution[] } export const pokemonEvolutions: PokemonEvolutions = { diff --git a/src/evolution-phase.ts b/src/evolution-phase.ts index 5c476aed2..a9b2fe9ba 100644 --- a/src/evolution-phase.ts +++ b/src/evolution-phase.ts @@ -1,7 +1,7 @@ import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; import { Phase } from "./phase"; import BattleScene from "./battle-scene"; -import { SpeciesEvolution } from "./data/pokemon-evolutions"; +import { SpeciesFormEvolution } from "./data/pokemon-evolutions"; import EvolutionSceneHandler from "./ui/evolution-scene-handler"; import * as Utils from "./utils"; import { Mode } from "./ui/ui"; @@ -14,7 +14,7 @@ export class EvolutionPhase extends Phase { protected pokemon: PlayerPokemon; protected lastLevel: integer; - private evolution: SpeciesEvolution; + private evolution: SpeciesFormEvolution; protected evolutionContainer: Phaser.GameObjects.Container; protected evolutionBaseBg: Phaser.GameObjects.Image; @@ -26,7 +26,7 @@ export class EvolutionPhase extends Phase { protected pokemonEvoSprite: Phaser.GameObjects.Sprite; protected pokemonEvoTintSprite: Phaser.GameObjects.Sprite; - constructor(scene: BattleScene, pokemon: PlayerPokemon, evolution: SpeciesEvolution, lastLevel: integer) { + constructor(scene: BattleScene, pokemon: PlayerPokemon, evolution: SpeciesFormEvolution, lastLevel: integer) { super(scene); this.pokemon = pokemon; diff --git a/src/pokemon.ts b/src/pokemon.ts index e662376e9..1fe8f7dbc 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -14,7 +14,7 @@ import { Gender } from './data/gender'; import { initMoveAnim, loadMoveAnimAssets } from './data/battle-anims'; import { Status, StatusEffect } from './data/status-effect'; import { reverseCompatibleTms, tmSpecies } from './data/tms'; -import { pokemonEvolutions, pokemonPrevolutions, SpeciesEvolution, SpeciesEvolutionCondition } from './data/pokemon-evolutions'; +import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEvolutionCondition } from './data/pokemon-evolutions'; import { DamagePhase, FaintPhase, StatChangePhase, SwitchSummonPhase } from './phases'; import { BattleStat } from './data/battle-stat'; import { BattlerTag, BattlerTagLapseType, EncoreTag, TypeBoostTag, getBattlerTag } from './data/battler-tags'; @@ -726,7 +726,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return (atkScore + defScore) * hpDiffRatio; } - getEvolution(): SpeciesEvolution { + getEvolution(): SpeciesFormEvolution { if (!pokemonEvolutions.hasOwnProperty(this.species.speciesId)) return null; @@ -1950,7 +1950,7 @@ export class PlayerPokemon extends Pokemon { }); } - getPossibleEvolution(evolution: SpeciesEvolution): Promise { + getPossibleEvolution(evolution: SpeciesFormEvolution): Promise { return new Promise(resolve => { const species = getPokemonSpecies(evolution.speciesId); const formIndex = evolution.evoFormKey !== null ? Math.max(this.species.forms.findIndex(f => f.formKey === evolution.evoFormKey), 0) : this.formIndex; @@ -1959,7 +1959,7 @@ export class PlayerPokemon extends Pokemon { }); } - evolve(evolution: SpeciesEvolution): Promise { + evolve(evolution: SpeciesFormEvolution): Promise { return new Promise(resolve => { this.pauseEvolutions = false; this.handleSpecialEvolutions(evolution); @@ -1981,7 +1981,7 @@ export class PlayerPokemon extends Pokemon { }); } - private handleSpecialEvolutions(evolution: SpeciesEvolution) { + private handleSpecialEvolutions(evolution: SpeciesFormEvolution) { if (this.species.speciesId === Species.NINCADA && evolution.speciesId === Species.NINJASK) { const newEvolution = pokemonEvolutions[this.species.speciesId][1]; if (newEvolution.condition.predicate(this)) {