Replaces instances of SpeciesEvolution with SpeciesFormEvolution

pull/16/head
Flashfyre 2024-02-26 13:50:55 -05:00
parent 74e9b95e13
commit 12b1d23110
4 changed files with 12 additions and 12 deletions

View File

@ -5,7 +5,7 @@ import beautify from 'json-beautify';
import { TrainerType } from "./enums/trainer-type"; import { TrainerType } from "./enums/trainer-type";
import { TimeOfDay } from "./enums/time-of-day"; import { TimeOfDay } from "./enums/time-of-day";
import { Biome } from "./enums/biome"; import { Biome } from "./enums/biome";
import { SpeciesEvolution } from "./pokemon-evolutions"; import { SpeciesFormEvolution } from "./pokemon-evolutions";
export function getBiomeName(biome: Biome | -1) { export function getBiomeName(biome: Biome | -1) {
if (biome === -1) if (biome === -1)
@ -7659,7 +7659,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
const speciesId = pb[0] as Species; const speciesId = pb[0] as Species;
const biomeEntries = pb[3] as (Biome | BiomePoolTier)[][]; const biomeEntries = pb[3] as (Biome | BiomePoolTier)[][];
const speciesEvolutions: SpeciesEvolution[] = pokemonEvolutions.hasOwnProperty(speciesId) const speciesEvolutions: SpeciesFormEvolution[] = pokemonEvolutions.hasOwnProperty(speciesId)
? pokemonEvolutions[speciesId] ? pokemonEvolutions[speciesId]
: []; : [];
@ -7688,7 +7688,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
const existingSpeciesIds = biomeTierPool[t] as unknown as Species[]; const existingSpeciesIds = biomeTierPool[t] as unknown as Species[];
for (let es = 0; es < existingSpeciesIds.length; es++) { for (let es = 0; es < existingSpeciesIds.length; es++) {
const existingSpeciesId = existingSpeciesIds[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; treeIndex = t;
arrayIndex = es + 1; arrayIndex = es + 1;
break; break;

View File

@ -100,7 +100,7 @@ export class SpeciesFriendshipEvolutionCondition extends SpeciesEvolutionConditi
} }
interface PokemonEvolutions { interface PokemonEvolutions {
[key: string]: SpeciesEvolution[] [key: string]: SpeciesFormEvolution[]
} }
export const pokemonEvolutions: PokemonEvolutions = { export const pokemonEvolutions: PokemonEvolutions = {

View File

@ -1,7 +1,7 @@
import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade";
import { Phase } from "./phase"; import { Phase } from "./phase";
import BattleScene from "./battle-scene"; 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 EvolutionSceneHandler from "./ui/evolution-scene-handler";
import * as Utils from "./utils"; import * as Utils from "./utils";
import { Mode } from "./ui/ui"; import { Mode } from "./ui/ui";
@ -14,7 +14,7 @@ export class EvolutionPhase extends Phase {
protected pokemon: PlayerPokemon; protected pokemon: PlayerPokemon;
protected lastLevel: integer; protected lastLevel: integer;
private evolution: SpeciesEvolution; private evolution: SpeciesFormEvolution;
protected evolutionContainer: Phaser.GameObjects.Container; protected evolutionContainer: Phaser.GameObjects.Container;
protected evolutionBaseBg: Phaser.GameObjects.Image; protected evolutionBaseBg: Phaser.GameObjects.Image;
@ -26,7 +26,7 @@ export class EvolutionPhase extends Phase {
protected pokemonEvoSprite: Phaser.GameObjects.Sprite; protected pokemonEvoSprite: Phaser.GameObjects.Sprite;
protected pokemonEvoTintSprite: 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); super(scene);
this.pokemon = pokemon; this.pokemon = pokemon;

View File

@ -14,7 +14,7 @@ import { Gender } from './data/gender';
import { initMoveAnim, loadMoveAnimAssets } from './data/battle-anims'; import { initMoveAnim, loadMoveAnimAssets } from './data/battle-anims';
import { Status, StatusEffect } from './data/status-effect'; import { Status, StatusEffect } from './data/status-effect';
import { reverseCompatibleTms, tmSpecies } from './data/tms'; 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 { DamagePhase, FaintPhase, StatChangePhase, SwitchSummonPhase } from './phases';
import { BattleStat } from './data/battle-stat'; import { BattleStat } from './data/battle-stat';
import { BattlerTag, BattlerTagLapseType, EncoreTag, TypeBoostTag, getBattlerTag } from './data/battler-tags'; 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; return (atkScore + defScore) * hpDiffRatio;
} }
getEvolution(): SpeciesEvolution { getEvolution(): SpeciesFormEvolution {
if (!pokemonEvolutions.hasOwnProperty(this.species.speciesId)) if (!pokemonEvolutions.hasOwnProperty(this.species.speciesId))
return null; return null;
@ -1950,7 +1950,7 @@ export class PlayerPokemon extends Pokemon {
}); });
} }
getPossibleEvolution(evolution: SpeciesEvolution): Promise<Pokemon> { getPossibleEvolution(evolution: SpeciesFormEvolution): Promise<Pokemon> {
return new Promise(resolve => { return new Promise(resolve => {
const species = getPokemonSpecies(evolution.speciesId); const species = getPokemonSpecies(evolution.speciesId);
const formIndex = evolution.evoFormKey !== null ? Math.max(this.species.forms.findIndex(f => f.formKey === evolution.evoFormKey), 0) : this.formIndex; 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<void> { evolve(evolution: SpeciesFormEvolution): Promise<void> {
return new Promise(resolve => { return new Promise(resolve => {
this.pauseEvolutions = false; this.pauseEvolutions = false;
this.handleSpecialEvolutions(evolution); 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) { if (this.species.speciesId === Species.NINCADA && evolution.speciesId === Species.NINJASK) {
const newEvolution = pokemonEvolutions[this.species.speciesId][1]; const newEvolution = pokemonEvolutions[this.species.speciesId][1];
if (newEvolution.condition.predicate(this)) { if (newEvolution.condition.predicate(this)) {