diff --git a/src/data/balance/pokemon-evolutions.ts b/src/data/balance/pokemon-evolutions.ts index 17f71f3c3c9..f09f25096b3 100644 --- a/src/data/balance/pokemon-evolutions.ts +++ b/src/data/balance/pokemon-evolutions.ts @@ -3,7 +3,7 @@ import { Gender } from "#app/data/gender"; import { PokeballType } from "#enums/pokeball"; import type Pokemon from "#app/field/pokemon"; import { PokemonType } from "#enums/pokemon-type"; -import { randSeedInt } from "#app/utils"; +import { isNullOrUndefined, randSeedInt } from "#app/utils"; import { WeatherType } from "#enums/weather-type"; import { Nature } from "#enums/nature"; import { Biome } from "#enums/biome"; @@ -14,6 +14,8 @@ import { DamageMoneyRewardModifier, ExtraModifierModifier, MoneyMultiplierModifi import { SpeciesFormKey } from "#enums/species-form-key"; import { speciesStarterCosts } from "./starters"; import i18next from "i18next"; +import { allMoves } from "../moves/move"; +import { getPokemonSpecies } from "../pokemon-species"; export enum SpeciesWildEvolutionDelay { @@ -81,8 +83,150 @@ export enum EvolutionItem { */ export type EvolutionLevel = [species: Species, level: number]; -export type EvolutionConditionPredicate = (p: Pokemon) => boolean; -export type EvolutionConditionEnforceFunc = (p: Pokemon) => void; +export enum EvoCondKey { + NONE, + FRIENDSHIP, + TIME, + MOVE, + MOVE_TYPE, + PARTY_TYPE, + WEATHER, + BIOME, + TYROGUE, + SHEDINJA, + EVO_COUNTER, + RANDOM_FORM, + SPECIES_CAUGHT, + GENDER, + NATURE +} + +export interface EvolutionConditionData { + key: EvoCondKey | EvoCondKey[]; + friendship?: number; + move?: Moves; + time?: TimeOfDay[]; + moveType?: PokemonType; + partyType?: PokemonType; + evoCount?: number; + weather?: WeatherType[]; + biome?: Biome[]; + randomFormChance?: number; + speciesCaught?: Species; + gender?: Gender; + nature?: Nature[]; +} + +export class SpeciesEvolutionCondition { + public data: EvolutionConditionData; + + constructor(data: EvolutionConditionData) { + this.data = data; + + // Validate data + const keys = Array.isArray(this.data.key) ? this.data.key : [this.data.key]; + keys.map(cond => { + if ( + (cond === EvoCondKey.FRIENDSHIP && isNullOrUndefined(this.data.friendship)) || + ((cond === EvoCondKey.MOVE || cond === EvoCondKey.TYROGUE) && isNullOrUndefined(this.data.move)) || + (cond === EvoCondKey.TIME && (isNullOrUndefined(this.data.time) || this.data.time.length === 0)) || + (cond === EvoCondKey.WEATHER && (isNullOrUndefined(this.data.weather) || this.data.weather.length === 0)) || + (cond === EvoCondKey.BIOME && (isNullOrUndefined(this.data.biome) || this.data.biome.length === 0)) || + (cond === EvoCondKey.NATURE && (isNullOrUndefined(this.data.nature) || this.data.nature.length === 0)) || + (cond === EvoCondKey.MOVE_TYPE && isNullOrUndefined(this.data.moveType)) || + (cond === EvoCondKey.PARTY_TYPE && isNullOrUndefined(this.data.partyType)) || + (cond === EvoCondKey.GENDER && isNullOrUndefined(this.data.gender)) || + (cond === EvoCondKey.EVO_COUNTER && isNullOrUndefined(this.data.evoCount)) || + (cond === EvoCondKey.RANDOM_FORM && isNullOrUndefined(this.data.randomFormChance)) || + (cond === EvoCondKey.GENDER && isNullOrUndefined(this.data.gender)) || + (cond === EvoCondKey.SPECIES_CAUGHT && isNullOrUndefined(this.data.speciesCaught)) + ) { + console.log("Error! Missing data for evo condition: ", EvoCondKey[cond]); + } + }); + } + + public get description(): string { + const str: string[] = []; + const keys = Array.isArray(this.data.key) ? this.data.key : [this.data.key]; + keys.map(cond => { + switch(cond) { + case EvoCondKey.FRIENDSHIP: + str.push(i18next.t("pokemonEvolutions:friendship")); + case EvoCondKey.TIME: + str.push(i18next.t(`pokemonEvolutions:timeOfDay.${TimeOfDay[this.data.time![0]]}`)); + case EvoCondKey.MOVE_TYPE: + str.push(i18next.t("pokemonEvolutions:moveType", {type: i18next.t(`pokemonInfo:Type.${this.data.moveType!}`)})); + case EvoCondKey.PARTY_TYPE: + str.push(i18next.t("pokemonEvolutions:partyType", {type: i18next.t(`pokemonInfo:Type.${this.data.partyType!}`)})); + case EvoCondKey.GENDER: + str.push(i18next.t(`pokemonEvolutions:gender.${Gender[this.data.gender!]}`)); + case EvoCondKey.MOVE: + case EvoCondKey.TYROGUE: + str.push(i18next.t("pokemonEvolutions:move", {move: allMoves[this.data.move!].name})); + case EvoCondKey.BIOME: + str.push(i18next.t("pokemonEvolutions:biome")); + case EvoCondKey.NATURE: + str.push(i18next.t("pokemonEvolutions:nature")); + case EvoCondKey.WEATHER: + str.push(i18next.t("pokemonEvolutions:weather")); + case EvoCondKey.SHEDINJA: + str.push(i18next.t("pokemonEvolutions:shedinja")); + case EvoCondKey.EVO_COUNTER: + str.push(i18next.t("pokemonEvolutions:treasure")); + case EvoCondKey.SPECIES_CAUGHT: + str.push(i18next.t("pokemonEvolutions:caught", {species: getPokemonSpecies(this.data.speciesCaught!).name})); + } + }); + return str.join(i18next.t("pokemonEvolutions:connector")); + } + + public conditionsFulfilled(pokemon: Pokemon): boolean { + const keys = Array.isArray(this.data.key) ? this.data.key : [this.data.key]; + return keys.every(cond => { + switch (cond) { + case EvoCondKey.FRIENDSHIP: + return pokemon.friendship >= this.data.friendship!; + case EvoCondKey.TIME: + return this.data.time?.includes(globalScene.arena.getTimeOfDay()); + case EvoCondKey.MOVE: + return pokemon.moveset.some(m => m.moveId === this.data.move); + case EvoCondKey.MOVE_TYPE: + return pokemon.moveset.some(m => m.getMove().type === this.data.moveType); + case EvoCondKey.PARTY_TYPE: + return !!globalScene.getPlayerParty().find(p => p.getTypes(false, false, true).indexOf(this.data.partyType!) > -1) + case EvoCondKey.EVO_COUNTER: + return pokemon.evoCounter + + pokemon.getHeldItems().filter(m => m instanceof DamageMoneyRewardModifier).length + + globalScene.findModifiers(m => + m instanceof MoneyMultiplierModifier + || m instanceof ExtraModifierModifier + || m instanceof TempExtraModifierModifier + ).length >= this.data.evoCount!; + case EvoCondKey.GENDER: + return pokemon.gender === this.data.gender; + case EvoCondKey.SHEDINJA: + return globalScene.getPlayerParty().length < 6 && globalScene.pokeballCounts[PokeballType.POKEBALL] > 0; + case EvoCondKey.BIOME: + return this.data.biome?.includes(globalScene.arena.biomeType); + case EvoCondKey.WEATHER: + return this.data.weather?.includes(globalScene.arena.getWeatherType()); + case EvoCondKey.TYROGUE: + return pokemon.getMoveset(true).find(m => + m && [ Moves.LOW_SWEEP, Moves.MACH_PUNCH, Moves.RAPID_SPIN ].includes(m.moveId) + )?.moveId === this.data.move; + case EvoCondKey.NATURE: + return this.data.nature?.includes(pokemon.getNature()); + case EvoCondKey.RANDOM_FORM: + let ret = false; + globalScene.executeWithSeedOffset(() => ret = !randSeedInt(this.data.randomFormChance!), pokemon.id); + return ret; + case EvoCondKey.SPECIES_CAUGHT: + return !!globalScene.gameData.dexData[this.data.speciesCaught!].caughtAttr; + } + }); + } +} export class SpeciesFormEvolution { public speciesId: Species; @@ -92,17 +236,24 @@ export class SpeciesFormEvolution { public item: EvolutionItem | null; public condition: SpeciesEvolutionCondition | null; public wildDelay: SpeciesWildEvolutionDelay; - public description = ""; + public desc = ""; - constructor(speciesId: Species, preFormKey: string | null, evoFormKey: string | null, level: number, item: EvolutionItem | null, condition: SpeciesEvolutionCondition | null, wildDelay?: SpeciesWildEvolutionDelay) { + constructor(speciesId: Species, preFormKey: string | null, evoFormKey: string | null, level: number, item: EvolutionItem | null, condition: EvolutionConditionData | null, wildDelay?: SpeciesWildEvolutionDelay) { this.speciesId = speciesId; this.preFormKey = preFormKey; this.evoFormKey = evoFormKey; this.level = level; this.item = item || EvolutionItem.NONE; - this.condition = condition; + if (!isNullOrUndefined(condition)) { + this.condition = new SpeciesEvolutionCondition(condition); + } this.wildDelay = wildDelay ?? SpeciesWildEvolutionDelay.NONE; + } + get description(): string { + if (this.desc.length > 0) { + return this.desc; + } const strings: string[] = []; if (this.level > 1) { strings.push(i18next.t("pokemonEvolutions:level") + ` ${this.level}`); @@ -115,15 +266,49 @@ export class SpeciesFormEvolution { if (this.condition) { strings.push(this.condition.description); } - this.description = strings + return strings .filter(str => str !== "") .map((str, index) => index > 0 ? str[0].toLowerCase() + str.slice(1) : str) .join(i18next.t("pokemonEvolutions:connector")); + + } + + /** + * Checks if a Pokemon fulfills the requirements of this evolution. + * @param pokemon {@linkcode Pokemon} who wants to evolve + * @param forFusion defaults to False. Whether this evolution is meant for the secondary fused mon. In that case, use their form key. + * @param item {@linkcode EvolutionItem} optional, check if the evolution uses a certain item + * @returns whether this evolution can apply to the Pokemon + */ + public validate(pokemon: Pokemon, forFusion: boolean = false, item?: EvolutionItem): boolean { + return ( + // If an item is given, check if it's the right one + item === this.item && + pokemon.level >= this.level && + // Check form key, using the fusion's form key if we're checking the fusion + (isNullOrUndefined(this.preFormKey) || (forFusion ? pokemon.getFormKey() : pokemon.getFusionFormKey()) === this.preFormKey) && + (this.condition === null || this.condition.conditionsFulfilled(pokemon)) + ); + } + + public isValidItemEvolution(pokemon: Pokemon, forFusion: boolean = false): boolean { + return ( + // If an item is given, check if it's the right one + !isNullOrUndefined(this.item) && + pokemon.level >= this.level && + // Check form key, using the fusion's form key if we're checking the fusion + (isNullOrUndefined(this.preFormKey) || (forFusion ? pokemon.getFormKey() : pokemon.getFusionFormKey()) === this.preFormKey) && + (this.condition === null || this.condition.conditionsFulfilled(pokemon)) + ); + } + + public get evoItem(): EvolutionItem { + return this.item ?? EvolutionItem.NONE; } } export class SpeciesEvolution extends SpeciesFormEvolution { - constructor(speciesId: Species, level: number, item: EvolutionItem | null, condition: SpeciesEvolutionCondition | null, wildDelay?: SpeciesWildEvolutionDelay) { + constructor(speciesId: Species, level: number, item: EvolutionItem | null, condition: EvolutionConditionData | null, wildDelay?: SpeciesWildEvolutionDelay) { super(speciesId, null, null, level, item, condition, wildDelay); } } @@ -132,226 +317,12 @@ export class FusionSpeciesFormEvolution extends SpeciesFormEvolution { public primarySpeciesId: Species; constructor(primarySpeciesId: Species, evolution: SpeciesFormEvolution) { - super(evolution.speciesId, evolution.preFormKey, evolution.evoFormKey, evolution.level, evolution.item, evolution.condition, evolution.wildDelay); + super(evolution.speciesId, evolution.preFormKey, evolution.evoFormKey, evolution.level, evolution.item, evolution.condition?.data ?? null, evolution.wildDelay); this.primarySpeciesId = primarySpeciesId; } } -export class SpeciesEvolutionCondition { - public predicate: EvolutionConditionPredicate; - public enforceFunc?: EvolutionConditionEnforceFunc; - public description: string; - - constructor(predicate: EvolutionConditionPredicate, enforceFunc?: EvolutionConditionEnforceFunc) { - this.predicate = predicate; - this.enforceFunc = enforceFunc; - this.description = ""; - } -} - -class GenderEvolutionCondition extends SpeciesEvolutionCondition { - public gender: Gender; - constructor(gender: Gender) { - super(p => p.gender === gender, p => p.gender = gender); - this.gender = gender; - this.description = i18next.t("pokemonEvolutions:gender", { gender: i18next.t(`pokemonEvolutions:${Gender[gender]}`) }); - } -} - -class TimeOfDayEvolutionCondition extends SpeciesEvolutionCondition { - public timesOfDay: TimeOfDay[]; - constructor(tod: "day" | "night") { - if (tod === "day") { - super(() => globalScene.arena.getTimeOfDay() === TimeOfDay.DAWN || globalScene.arena.getTimeOfDay() === TimeOfDay.DAY); - this.timesOfDay = [ TimeOfDay.DAWN, TimeOfDay.DAY ]; - } else if (tod === "night") { - super(() => globalScene.arena.getTimeOfDay() === TimeOfDay.DUSK || globalScene.arena.getTimeOfDay() === TimeOfDay.NIGHT); - this.timesOfDay = [ TimeOfDay.DUSK, TimeOfDay.NIGHT ]; - } else { - super(() => false); - this.timesOfDay = []; - } - this.description = i18next.t("pokemonEvolutions:timeOfDay", { tod: i18next.t(`pokemonEvolutions:${tod}`) }); - } -} - -class MoveEvolutionCondition extends SpeciesEvolutionCondition { - public move: Moves; - constructor(move: Moves) { - super(p => p.moveset.filter(m => m.moveId === move).length > 0); - this.move = move; - const moveKey = Moves[this.move].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join(""); - this.description = i18next.t("pokemonEvolutions:move", { move: i18next.t(`move:${moveKey}.name`) }); - } -} - -class FriendshipEvolutionCondition extends SpeciesEvolutionCondition { - public amount: number; - constructor(amount: number) { - super(p => p.friendship >= amount); - this.amount = amount; - this.description = i18next.t("pokemonEvolutions:friendship"); - } -} - -class FriendshipTimeOfDayEvolutionCondition extends SpeciesEvolutionCondition { - public amount: number; - public timesOfDay: TimeOfDay[]; - constructor(amount: number, tod: "day" | "night") { - if (tod === "day") { - super(p => p.friendship >= amount && (globalScene.arena.getTimeOfDay() === TimeOfDay.DAWN || globalScene.arena.getTimeOfDay() === TimeOfDay.DAY)); - this.timesOfDay = [ TimeOfDay.DAWN, TimeOfDay.DAY ]; - } else if (tod === "night") { - super(p => p.friendship >= amount && (globalScene.arena.getTimeOfDay() === TimeOfDay.DUSK || globalScene.arena.getTimeOfDay() === TimeOfDay.NIGHT)); - this.timesOfDay = [ TimeOfDay.DUSK, TimeOfDay.NIGHT ]; - } else { - super(_p => false); - this.timesOfDay = []; - } - this.amount = amount; - this.description = i18next.t("pokemonEvolutions:friendshipTimeOfDay", { tod: i18next.t(`pokemonEvolutions:${tod}`) }); - } -} - -class FriendshipMoveTypeEvolutionCondition extends SpeciesEvolutionCondition { - public amount: number; - public type: PokemonType; - constructor(amount: number, type: PokemonType) { - super(p => p.friendship >= amount && !!p.getMoveset().find(m => m?.getMove().type === type)); - this.amount = amount; - this.type = type; - this.description = i18next.t("pokemonEvolutions:friendshipMoveType", { type: i18next.t(`pokemonInfo:Type.${PokemonType[this.type]}`) }); - } -} - -class ShedinjaEvolutionCondition extends SpeciesEvolutionCondition { - constructor() { - super(() => globalScene.getPlayerParty().length < 6 && globalScene.pokeballCounts[PokeballType.POKEBALL] > 0); - this.description = i18next.t("pokemonEvolutions:shedinja"); - } -} - -class PartyTypeEvolutionCondition extends SpeciesEvolutionCondition { - public type: PokemonType; - constructor(type: PokemonType) { - super(() => !!globalScene.getPlayerParty().find(p => p.getTypes(false, false, true).indexOf(type) > -1)); - this.type = type; - this.description = i18next.t("pokemonEvolutions:partyType", { type: i18next.t(`pokemonInfo:Type.${PokemonType[this.type]}`) }); - } -} - -class CaughtEvolutionCondition extends SpeciesEvolutionCondition { - public species: Species; - constructor(species: Species) { - super(() => !!globalScene.gameData.dexData[species].caughtAttr); - this.species = species; - this.description = i18next.t("pokemonEvolutions:caught", { species: i18next.t(`pokemon:${Species[this.species].toLowerCase()}`) }); - } -} - -class WeatherEvolutionCondition extends SpeciesEvolutionCondition { - public weatherTypes: WeatherType[]; - constructor(weatherTypes: WeatherType[]) { - super(() => weatherTypes.indexOf(globalScene.arena.weather?.weatherType || WeatherType.NONE) > -1); - this.weatherTypes = weatherTypes; - this.description = i18next.t("pokemonEvolutions:weather"); - } -} - -class MoveTypeEvolutionCondition extends SpeciesEvolutionCondition { - public type: PokemonType; - constructor(type: PokemonType) { - super(p => p.moveset.filter(m => m?.getMove().type === type).length > 0); - this.type = type; - this.description = i18next.t("pokemonEvolutions:moveType", { type: i18next.t(`pokemonInfo:Type.${PokemonType[this.type]}`) }); - } -} - -class TreasureEvolutionCondition extends SpeciesEvolutionCondition { - constructor() { - super(p => p.evoCounter - + p.getHeldItems().filter(m => m instanceof DamageMoneyRewardModifier).length - + globalScene.findModifiers(m => m instanceof MoneyMultiplierModifier - || m instanceof ExtraModifierModifier || m instanceof TempExtraModifierModifier).length > 9); - this.description = i18next.t("pokemonEvolutions:treasure"); - } -} - -class TyrogueEvolutionCondition extends SpeciesEvolutionCondition { - public move: Moves; - constructor(move: Moves) { - super(p => - p.getMoveset(true).find(m => m && [ Moves.LOW_SWEEP, Moves.MACH_PUNCH, Moves.RAPID_SPIN ].includes(m.moveId))?.moveId === move); - this.move = move; - const moveKey = Moves[this.move].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join(""); - this.description = i18next.t("pokemonEvolutions:move", { move: i18next.t(`move:${moveKey}.name`) }); - } -} - -class NatureEvolutionCondition extends SpeciesEvolutionCondition { - public natures: Nature[]; - constructor(natures: Nature[]) { - super(p => natures.indexOf(p.getNature()) > -1); - this.natures = natures; - this.description = i18next.t("pokemonEvolutions:nature"); - } -} - -class MoveTimeOfDayEvolutionCondition extends SpeciesEvolutionCondition { - public move: Moves; - public timesOfDay: TimeOfDay[]; - constructor(move: Moves, tod: "day" | "night") { - if (tod === "day") { - super(p => p.moveset.filter(m => m.moveId === move).length > 0 && (globalScene.arena.getTimeOfDay() === TimeOfDay.DAWN || globalScene.arena.getTimeOfDay() === TimeOfDay.DAY)); - this.move = move; - this.timesOfDay = [ TimeOfDay.DAWN, TimeOfDay.DAY ]; - } else if (tod === "night") { - super(p => p.moveset.filter(m => m.moveId === move).length > 0 && (globalScene.arena.getTimeOfDay() === TimeOfDay.DUSK || globalScene.arena.getTimeOfDay() === TimeOfDay.NIGHT)); - this.move = move; - this.timesOfDay = [ TimeOfDay.DUSK, TimeOfDay.NIGHT ]; - } else { - super(() => false); - this.timesOfDay = []; - } - const moveKey = Moves[this.move].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join(""); - this.description = i18next.t("pokemonEvolutions:moveTimeOfDay", { move: i18next.t(`move:${moveKey}.name`), tod: i18next.t(`pokemonEvolutions:${tod}`) }); - } -} - -class BiomeEvolutionCondition extends SpeciesEvolutionCondition { - public biomes: Biome[]; - constructor(biomes: Biome[]) { - super(() => biomes.filter(b => b === globalScene.arena.biomeType).length > 0); - this.biomes = biomes; - this.description = i18next.t("pokemonEvolutions:biome"); - } -} - -class DunsparceEvolutionCondition extends SpeciesEvolutionCondition { - constructor() { - super(p => { - let ret = false; - if (p.moveset.filter(m => m.moveId === Moves.HYPER_DRILL).length > 0) { - globalScene.executeWithSeedOffset(() => ret = !randSeedInt(4), p.id); - } - return ret; - }); - const moveKey = Moves[Moves.HYPER_DRILL].split("_").filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join(""); - this.description = i18next.t("pokemonEvolutions:move", { move: i18next.t(`move:${moveKey}.name`) }); - } -} - -class TandemausEvolutionCondition extends SpeciesEvolutionCondition { - constructor() { - super(p => { - let ret = false; - globalScene.executeWithSeedOffset(() => ret = !randSeedInt(4), p.id); - return ret; - }); - } -} - interface PokemonEvolutions { [key: string]: SpeciesFormEvolution[] } @@ -485,8 +456,8 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.ELECTRODE, 30, null, null) ], [Species.CUBONE]: [ - new SpeciesEvolution(Species.ALOLA_MAROWAK, 28, null, new TimeOfDayEvolutionCondition("night")), - new SpeciesEvolution(Species.MAROWAK, 28, null, new TimeOfDayEvolutionCondition("day")) + new SpeciesEvolution(Species.ALOLA_MAROWAK, 28, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}), + new SpeciesEvolution(Species.MAROWAK, 28, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}) ], [Species.TYROGUE]: [ /** @@ -495,13 +466,13 @@ export const pokemonEvolutions: PokemonEvolutions = { * If Tyrogue knows multiple of these moves, its evolution is based on * the first qualifying move in its moveset. */ - new SpeciesEvolution(Species.HITMONLEE, 20, null, new TyrogueEvolutionCondition(Moves.LOW_SWEEP)), - new SpeciesEvolution(Species.HITMONCHAN, 20, null, new TyrogueEvolutionCondition(Moves.MACH_PUNCH)), - new SpeciesEvolution(Species.HITMONTOP, 20, null, new TyrogueEvolutionCondition(Moves.RAPID_SPIN)), + new SpeciesEvolution(Species.HITMONLEE, 20, null, {key: EvoCondKey.TYROGUE, move: Moves.LOW_SWEEP}), + new SpeciesEvolution(Species.HITMONCHAN, 20, null, {key: EvoCondKey.TYROGUE, move: Moves.MACH_PUNCH}), + new SpeciesEvolution(Species.HITMONTOP, 20, null, {key: EvoCondKey.TYROGUE, move: Moves.RAPID_SPIN}), ], [Species.KOFFING]: [ - new SpeciesEvolution(Species.GALAR_WEEZING, 35, null, new TimeOfDayEvolutionCondition("night")), - new SpeciesEvolution(Species.WEEZING, 35, null, new TimeOfDayEvolutionCondition("day")) + new SpeciesEvolution(Species.GALAR_WEEZING, 35, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}), + new SpeciesEvolution(Species.WEEZING, 35, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}) ], [Species.RHYHORN]: [ new SpeciesEvolution(Species.RHYDON, 42, null, null) @@ -546,8 +517,8 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.QUILAVA, 14, null, null) ], [Species.QUILAVA]: [ - new SpeciesEvolution(Species.HISUI_TYPHLOSION, 36, null, new TimeOfDayEvolutionCondition("night")), - new SpeciesEvolution(Species.TYPHLOSION, 36, null, new TimeOfDayEvolutionCondition("day")) + new SpeciesEvolution(Species.HISUI_TYPHLOSION, 36, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}), + new SpeciesEvolution(Species.TYPHLOSION, 36, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}) ], [Species.TOTODILE]: [ new SpeciesEvolution(Species.CROCONAW, 18, null, null) @@ -649,8 +620,8 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.LINOONE, 20, null, null) ], [Species.WURMPLE]: [ - new SpeciesEvolution(Species.SILCOON, 7, null, new TimeOfDayEvolutionCondition("day")), - new SpeciesEvolution(Species.CASCOON, 7, null, new TimeOfDayEvolutionCondition("night")) + new SpeciesEvolution(Species.SILCOON, 7, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}), + new SpeciesEvolution(Species.CASCOON, 7, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}) ], [Species.SILCOON]: [ new SpeciesEvolution(Species.BEAUTIFLY, 10, null, null) @@ -674,8 +645,8 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.KIRLIA, 20, null, null) ], [Species.KIRLIA]: [ - new SpeciesEvolution(Species.GARDEVOIR, 30, null, new GenderEvolutionCondition(Gender.FEMALE)), - new SpeciesEvolution(Species.GALLADE, 30, null, new GenderEvolutionCondition(Gender.MALE)) + new SpeciesEvolution(Species.GARDEVOIR, 30, null, {key: EvoCondKey.GENDER, gender: Gender.FEMALE}), + new SpeciesEvolution(Species.GALLADE, 30, null, {key: EvoCondKey.GENDER, gender: Gender.MALE}) ], [Species.SURSKIT]: [ new SpeciesEvolution(Species.MASQUERAIN, 22, null, null) @@ -691,7 +662,7 @@ export const pokemonEvolutions: PokemonEvolutions = { ], [Species.NINCADA]: [ new SpeciesEvolution(Species.NINJASK, 20, null, null), - new SpeciesEvolution(Species.SHEDINJA, 20, null, new ShedinjaEvolutionCondition()) + new SpeciesEvolution(Species.SHEDINJA, 20, null, {key: EvoCondKey.SHEDINJA}) ], [Species.WHISMUR]: [ new SpeciesEvolution(Species.LOUDRED, 20, null, null) @@ -763,8 +734,8 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.DUSCLOPS, 37, null, null) ], [Species.SNORUNT]: [ - new SpeciesEvolution(Species.GLALIE, 42, null, new GenderEvolutionCondition(Gender.MALE)), - new SpeciesEvolution(Species.FROSLASS, 42, null, new GenderEvolutionCondition(Gender.FEMALE)) + new SpeciesEvolution(Species.GLALIE, 42, null, {key: EvoCondKey.GENDER, gender: Gender.MALE}), + new SpeciesEvolution(Species.FROSLASS, 42, null, {key: EvoCondKey.GENDER, gender: Gender.FEMALE}) ], [Species.SPHEAL]: [ new SpeciesEvolution(Species.SEALEO, 32, null, null) @@ -827,11 +798,11 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.BASTIODON, 30, null, null) ], [Species.BURMY]: [ - new SpeciesEvolution(Species.MOTHIM, 20, null, new GenderEvolutionCondition(Gender.MALE)), - new SpeciesEvolution(Species.WORMADAM, 20, null, new GenderEvolutionCondition(Gender.FEMALE)) + new SpeciesEvolution(Species.MOTHIM, 20, null, {key: EvoCondKey.GENDER, gender: Gender.MALE}), + new SpeciesEvolution(Species.WORMADAM, 20, null, {key: EvoCondKey.GENDER, gender: Gender.FEMALE}) ], [Species.COMBEE]: [ - new SpeciesEvolution(Species.VESPIQUEN, 21, null, new GenderEvolutionCondition(Gender.FEMALE)) + new SpeciesEvolution(Species.VESPIQUEN, 21, null, {key: EvoCondKey.GENDER, gender: Gender.FEMALE}) ], [Species.BUIZEL]: [ new SpeciesEvolution(Species.FLOATZEL, 26, null, null) @@ -873,7 +844,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.LUMINEON, 31, null, null) ], [Species.MANTYKE]: [ - new SpeciesEvolution(Species.MANTINE, 32, null, new CaughtEvolutionCondition(Species.REMORAID), SpeciesWildEvolutionDelay.MEDIUM) + new SpeciesEvolution(Species.MANTINE, 32, null, {key: EvoCondKey.SPECIES_CAUGHT, speciesCaught: Species.REMORAID}, SpeciesWildEvolutionDelay.MEDIUM) ], [Species.SNOVER]: [ new SpeciesEvolution(Species.ABOMASNOW, 40, null, null) @@ -894,8 +865,8 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.DEWOTT, 17, null, null) ], [Species.DEWOTT]: [ - new SpeciesEvolution(Species.HISUI_SAMUROTT, 36, null, new TimeOfDayEvolutionCondition("night")), - new SpeciesEvolution(Species.SAMUROTT, 36, null, new TimeOfDayEvolutionCondition("day")) + new SpeciesEvolution(Species.HISUI_SAMUROTT, 36, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}), + new SpeciesEvolution(Species.SAMUROTT, 36, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}) ], [Species.PATRAT]: [ new SpeciesEvolution(Species.WATCHOG, 20, null, null) @@ -1045,8 +1016,8 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.KINGAMBIT, 1, EvolutionItem.LEADERS_CREST, null, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.RUFFLET]: [ - new SpeciesEvolution(Species.HISUI_BRAVIARY, 54, null, new TimeOfDayEvolutionCondition("night")), - new SpeciesEvolution(Species.BRAVIARY, 54, null, new TimeOfDayEvolutionCondition("day")) + new SpeciesEvolution(Species.HISUI_BRAVIARY, 54, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}), + new SpeciesEvolution(Species.BRAVIARY, 54, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}) ], [Species.VULLABY]: [ new SpeciesEvolution(Species.MANDIBUZZ, 54, null, null) @@ -1103,11 +1074,11 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.GOGOAT, 32, null, null) ], [Species.PANCHAM]: [ - new SpeciesEvolution(Species.PANGORO, 32, null, new PartyTypeEvolutionCondition(PokemonType.DARK), SpeciesWildEvolutionDelay.MEDIUM) + new SpeciesEvolution(Species.PANGORO, 32, null, {key: EvoCondKey.PARTY_TYPE, partyType: PokemonType.DARK}, SpeciesWildEvolutionDelay.MEDIUM) ], [Species.ESPURR]: [ - new SpeciesFormEvolution(Species.MEOWSTIC, "", "female", 25, null, new GenderEvolutionCondition(Gender.FEMALE)), - new SpeciesFormEvolution(Species.MEOWSTIC, "", "", 25, null, new GenderEvolutionCondition(Gender.MALE)) + new SpeciesFormEvolution(Species.MEOWSTIC, "", "female", 25, null, {key: EvoCondKey.GENDER, gender: Gender.FEMALE}), + new SpeciesFormEvolution(Species.MEOWSTIC, "", "", 25, null, {key: EvoCondKey.GENDER, gender: Gender.MALE}) ], [Species.HONEDGE]: [ new SpeciesEvolution(Species.DOUBLADE, 35, null, null) @@ -1125,21 +1096,21 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.CLAWITZER, 37, null, null) ], [Species.TYRUNT]: [ - new SpeciesEvolution(Species.TYRANTRUM, 39, null, new TimeOfDayEvolutionCondition("day")) + new SpeciesEvolution(Species.TYRANTRUM, 39, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}) ], [Species.AMAURA]: [ - new SpeciesEvolution(Species.AURORUS, 39, null, new TimeOfDayEvolutionCondition("night")) + new SpeciesEvolution(Species.AURORUS, 39, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}) ], [Species.GOOMY]: [ - new SpeciesEvolution(Species.HISUI_SLIGGOO, 40, null, new TimeOfDayEvolutionCondition("night")), - new SpeciesEvolution(Species.SLIGGOO, 40, null, new TimeOfDayEvolutionCondition("day")) + new SpeciesEvolution(Species.HISUI_SLIGGOO, 40, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}), + new SpeciesEvolution(Species.SLIGGOO, 40, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}) ], [Species.SLIGGOO]: [ - new SpeciesEvolution(Species.GOODRA, 50, null, new WeatherEvolutionCondition([ WeatherType.RAIN, WeatherType.FOG, WeatherType.HEAVY_RAIN ]), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.GOODRA, 50, null, {key: EvoCondKey.WEATHER, weather: [ WeatherType.RAIN, WeatherType.FOG, WeatherType.HEAVY_RAIN ]}, SpeciesWildEvolutionDelay.LONG) ], [Species.BERGMITE]: [ - new SpeciesEvolution(Species.HISUI_AVALUGG, 37, null, new TimeOfDayEvolutionCondition("night")), - new SpeciesEvolution(Species.AVALUGG, 37, null, new TimeOfDayEvolutionCondition("day")) + new SpeciesEvolution(Species.HISUI_AVALUGG, 37, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}), + new SpeciesEvolution(Species.AVALUGG, 37, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}) ], [Species.NOIBAT]: [ new SpeciesEvolution(Species.NOIVERN, 48, null, null) @@ -1148,8 +1119,8 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.DARTRIX, 17, null, null) ], [Species.DARTRIX]: [ - new SpeciesEvolution(Species.HISUI_DECIDUEYE, 36, null, new TimeOfDayEvolutionCondition("night")), - new SpeciesEvolution(Species.DECIDUEYE, 34, null, new TimeOfDayEvolutionCondition("day")) + new SpeciesEvolution(Species.HISUI_DECIDUEYE, 36, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}), + new SpeciesEvolution(Species.DECIDUEYE, 34, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}) ], [Species.LITTEN]: [ new SpeciesEvolution(Species.TORRACAT, 17, null, null) @@ -1170,7 +1141,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.TOUCANNON, 28, null, null) ], [Species.YUNGOOS]: [ - new SpeciesEvolution(Species.GUMSHOOS, 20, null, new TimeOfDayEvolutionCondition("day")) + new SpeciesEvolution(Species.GUMSHOOS, 20, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}) ], [Species.GRUBBIN]: [ new SpeciesEvolution(Species.CHARJABUG, 20, null, null) @@ -1188,13 +1159,13 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.ARAQUANID, 22, null, null) ], [Species.FOMANTIS]: [ - new SpeciesEvolution(Species.LURANTIS, 34, null, new TimeOfDayEvolutionCondition("day")) + new SpeciesEvolution(Species.LURANTIS, 34, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}) ], [Species.MORELULL]: [ new SpeciesEvolution(Species.SHIINOTIC, 24, null, null) ], [Species.SALANDIT]: [ - new SpeciesEvolution(Species.SALAZZLE, 33, null, new GenderEvolutionCondition(Gender.FEMALE)) + new SpeciesEvolution(Species.SALAZZLE, 33, null, {key: EvoCondKey.GENDER, gender: Gender.FEMALE}) ], [Species.STUFFUL]: [ new SpeciesEvolution(Species.BEWEAR, 27, null, null) @@ -1225,7 +1196,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.MELMETAL, 48, null, null) ], [Species.ALOLA_RATTATA]: [ - new SpeciesEvolution(Species.ALOLA_RATICATE, 20, null, new TimeOfDayEvolutionCondition("night")) + new SpeciesEvolution(Species.ALOLA_RATICATE, 20, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}) ], [Species.ALOLA_DIGLETT]: [ new SpeciesEvolution(Species.ALOLA_DUGTRIO, 26, null, null) @@ -1298,7 +1269,7 @@ export const pokemonEvolutions: PokemonEvolutions = { ], [Species.TOXEL]: [ new SpeciesFormEvolution(Species.TOXTRICITY, "", "lowkey", 30, null, - new NatureEvolutionCondition([ Nature.LONELY, Nature.BOLD, Nature.RELAXED, Nature.TIMID, Nature.SERIOUS, Nature.MODEST, Nature.MILD, Nature.QUIET, Nature.BASHFUL, Nature.CALM, Nature.GENTLE, Nature.CAREFUL ]) + {key: EvoCondKey.NATURE, nature: [ Nature.LONELY, Nature.BOLD, Nature.RELAXED, Nature.TIMID, Nature.SERIOUS, Nature.MODEST, Nature.MILD, Nature.QUIET, Nature.BASHFUL, Nature.CALM, Nature.GENTLE, Nature.CAREFUL ]} ), new SpeciesFormEvolution(Species.TOXTRICITY, "", "amped", 30, null, null) ], @@ -1349,7 +1320,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.GALAR_LINOONE, 20, null, null) ], [Species.GALAR_LINOONE]: [ - new SpeciesEvolution(Species.OBSTAGOON, 35, null, new TimeOfDayEvolutionCondition("night")) + new SpeciesEvolution(Species.OBSTAGOON, 35, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}) ], [Species.GALAR_YAMASK]: [ new SpeciesEvolution(Species.RUNERIGUS, 34, null, null) @@ -1358,7 +1329,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.HISUI_ZOROARK, 30, null, null) ], [Species.HISUI_SLIGGOO]: [ - new SpeciesEvolution(Species.HISUI_GOODRA, 50, null, new WeatherEvolutionCondition([ WeatherType.RAIN, WeatherType.FOG, WeatherType.HEAVY_RAIN ]), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.HISUI_GOODRA, 50, null, {key: EvoCondKey.WEATHER, weather: [ WeatherType.RAIN, WeatherType.FOG, WeatherType.HEAVY_RAIN ]}, SpeciesWildEvolutionDelay.LONG) ], [Species.SPRIGATITO]: [ new SpeciesEvolution(Species.FLORAGATO, 16, null, null) @@ -1379,8 +1350,8 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.QUAQUAVAL, 36, null, null) ], [Species.LECHONK]: [ - new SpeciesFormEvolution(Species.OINKOLOGNE, "", "female", 18, null, new GenderEvolutionCondition(Gender.FEMALE)), - new SpeciesFormEvolution(Species.OINKOLOGNE, "", "", 18, null, new GenderEvolutionCondition(Gender.MALE)) + new SpeciesFormEvolution(Species.OINKOLOGNE, "", "female", 18, null, {key: EvoCondKey.GENDER, gender: Gender.FEMALE}), + new SpeciesFormEvolution(Species.OINKOLOGNE, "", "", 18, null, {key: EvoCondKey.GENDER, gender: Gender.MALE}) ], [Species.TAROUNTULA]: [ new SpeciesEvolution(Species.SPIDOPS, 15, null, null) @@ -1395,7 +1366,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.PAWMOT, 32, null, null) ], [Species.TANDEMAUS]: [ - new SpeciesFormEvolution(Species.MAUSHOLD, "", "three", 25, null, new TandemausEvolutionCondition()), + new SpeciesFormEvolution(Species.MAUSHOLD, "", "three", 25, null, {key: EvoCondKey.RANDOM_FORM, randomFormChance: 4}), new SpeciesFormEvolution(Species.MAUSHOLD, "", "four", 25, null, null) ], [Species.FIDOUGH]: [ @@ -1453,7 +1424,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.GLIMMORA, 35, null, null) ], [Species.GREAVARD]: [ - new SpeciesEvolution(Species.HOUNDSTONE, 30, null, new TimeOfDayEvolutionCondition("night")) + new SpeciesEvolution(Species.HOUNDSTONE, 30, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}) ], [Species.FRIGIBAX]: [ new SpeciesEvolution(Species.ARCTIBAX, 35, null, null) @@ -1510,21 +1481,21 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.EXEGGUTOR, 1, EvolutionItem.LEAF_STONE, null, SpeciesWildEvolutionDelay.LONG) ], [Species.TANGELA]: [ - new SpeciesEvolution(Species.TANGROWTH, 34, null, new MoveEvolutionCondition(Moves.ANCIENT_POWER), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.TANGROWTH, 34, null, {key: EvoCondKey.MOVE, move: Moves.ANCIENT_POWER}, SpeciesWildEvolutionDelay.LONG) ], [Species.LICKITUNG]: [ - new SpeciesEvolution(Species.LICKILICKY, 32, null, new MoveEvolutionCondition(Moves.ROLLOUT), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.LICKILICKY, 32, null, {key: EvoCondKey.MOVE, move: Moves.ROLLOUT}, SpeciesWildEvolutionDelay.LONG) ], [Species.STARYU]: [ new SpeciesEvolution(Species.STARMIE, 1, EvolutionItem.WATER_STONE, null, SpeciesWildEvolutionDelay.LONG) ], [Species.EEVEE]: [ - new SpeciesFormEvolution(Species.SYLVEON, "", "", 1, null, new FriendshipMoveTypeEvolutionCondition(120, PokemonType.FAIRY), SpeciesWildEvolutionDelay.LONG), - new SpeciesFormEvolution(Species.SYLVEON, "partner", "", 1, null, new FriendshipMoveTypeEvolutionCondition(120, PokemonType.FAIRY), SpeciesWildEvolutionDelay.LONG), - new SpeciesFormEvolution(Species.ESPEON, "", "", 1, null, new FriendshipTimeOfDayEvolutionCondition(120, "day"), SpeciesWildEvolutionDelay.LONG), - new SpeciesFormEvolution(Species.ESPEON, "partner", "", 1, null, new FriendshipTimeOfDayEvolutionCondition(120, "day"), SpeciesWildEvolutionDelay.LONG), - new SpeciesFormEvolution(Species.UMBREON, "", "", 1, null, new FriendshipTimeOfDayEvolutionCondition(120, "night"), SpeciesWildEvolutionDelay.LONG), - new SpeciesFormEvolution(Species.UMBREON, "partner", "", 1, null, new FriendshipTimeOfDayEvolutionCondition(120, "night"), SpeciesWildEvolutionDelay.LONG), + new SpeciesFormEvolution(Species.SYLVEON, "", "", 1, null, {key: [EvoCondKey.FRIENDSHIP, EvoCondKey.MOVE_TYPE], friendship: 120, moveType: PokemonType.FAIRY}, SpeciesWildEvolutionDelay.LONG), + new SpeciesFormEvolution(Species.SYLVEON, "partner", "", 1, null, {key: [EvoCondKey.FRIENDSHIP, EvoCondKey.MOVE_TYPE], friendship: 120, moveType: PokemonType.FAIRY}, SpeciesWildEvolutionDelay.LONG), + new SpeciesFormEvolution(Species.ESPEON, "", "", 1, null, {key: [EvoCondKey.FRIENDSHIP, EvoCondKey.TIME], friendship: 120, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}, SpeciesWildEvolutionDelay.LONG), + new SpeciesFormEvolution(Species.ESPEON, "partner", "", 1, null, {key: [EvoCondKey.FRIENDSHIP, EvoCondKey.TIME], friendship: 120, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}, SpeciesWildEvolutionDelay.LONG), + new SpeciesFormEvolution(Species.UMBREON, "", "", 1, null, {key: [EvoCondKey.FRIENDSHIP, EvoCondKey.TIME], friendship: 120, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}, SpeciesWildEvolutionDelay.LONG), + new SpeciesFormEvolution(Species.UMBREON, "partner", "", 1, null, {key: [EvoCondKey.FRIENDSHIP, EvoCondKey.TIME], friendship: 120, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}, SpeciesWildEvolutionDelay.LONG), new SpeciesFormEvolution(Species.VAPOREON, "", "", 1, EvolutionItem.WATER_STONE, null, SpeciesWildEvolutionDelay.LONG), new SpeciesFormEvolution(Species.VAPOREON, "partner", "", 1, EvolutionItem.WATER_STONE, null, SpeciesWildEvolutionDelay.LONG), new SpeciesFormEvolution(Species.JOLTEON, "", "", 1, EvolutionItem.THUNDER_STONE, null, SpeciesWildEvolutionDelay.LONG), @@ -1540,13 +1511,13 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.TOGEKISS, 1, EvolutionItem.SHINY_STONE, null, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.AIPOM]: [ - new SpeciesEvolution(Species.AMBIPOM, 32, null, new MoveEvolutionCondition(Moves.DOUBLE_HIT), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.AMBIPOM, 32, null, {key: EvoCondKey.MOVE, move: Moves.DOUBLE_HIT}, SpeciesWildEvolutionDelay.LONG) ], [Species.SUNKERN]: [ new SpeciesEvolution(Species.SUNFLORA, 1, EvolutionItem.SUN_STONE, null, SpeciesWildEvolutionDelay.LONG) ], [Species.YANMA]: [ - new SpeciesEvolution(Species.YANMEGA, 33, null, new MoveEvolutionCondition(Moves.ANCIENT_POWER), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.YANMEGA, 33, null, {key: EvoCondKey.MOVE, move: Moves.ANCIENT_POWER}, SpeciesWildEvolutionDelay.LONG) ], [Species.MURKROW]: [ new SpeciesEvolution(Species.HONCHKROW, 1, EvolutionItem.DUSK_STONE, null, SpeciesWildEvolutionDelay.VERY_LONG) @@ -1555,26 +1526,26 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.MISMAGIUS, 1, EvolutionItem.DUSK_STONE, null, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.GIRAFARIG]: [ - new SpeciesEvolution(Species.FARIGIRAF, 32, null, new MoveEvolutionCondition(Moves.TWIN_BEAM), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.FARIGIRAF, 32, null, {key: EvoCondKey.MOVE, move: Moves.TWIN_BEAM}, SpeciesWildEvolutionDelay.LONG) ], [Species.DUNSPARCE]: [ - new SpeciesFormEvolution(Species.DUDUNSPARCE, "", "three-segment", 32, null, new DunsparceEvolutionCondition(), SpeciesWildEvolutionDelay.LONG), - new SpeciesFormEvolution(Species.DUDUNSPARCE, "", "two-segment", 32, null, new MoveEvolutionCondition(Moves.HYPER_DRILL), SpeciesWildEvolutionDelay.LONG) + new SpeciesFormEvolution(Species.DUDUNSPARCE, "", "three-segment", 32, null, {key: [EvoCondKey.MOVE, EvoCondKey.RANDOM_FORM], move: Moves.HYPER_DRILL, randomFormChance: 4}, SpeciesWildEvolutionDelay.LONG), + new SpeciesFormEvolution(Species.DUDUNSPARCE, "", "two-segment", 32, null, {key: EvoCondKey.MOVE, move: Moves.HYPER_DRILL}, SpeciesWildEvolutionDelay.LONG) ], [Species.GLIGAR]: [ - new SpeciesEvolution(Species.GLISCOR, 1, EvolutionItem.RAZOR_FANG, new TimeOfDayEvolutionCondition("night") /* Razor fang at night*/, SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesEvolution(Species.GLISCOR, 1, EvolutionItem.RAZOR_FANG, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]} /* Razor fang at night*/, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.SNEASEL]: [ - new SpeciesEvolution(Species.WEAVILE, 1, EvolutionItem.RAZOR_CLAW, new TimeOfDayEvolutionCondition("night") /* Razor claw at night*/, SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesEvolution(Species.WEAVILE, 1, EvolutionItem.RAZOR_CLAW, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]} /* Razor claw at night*/, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.URSARING]: [ new SpeciesEvolution(Species.URSALUNA, 1, EvolutionItem.PEAT_BLOCK, null, SpeciesWildEvolutionDelay.VERY_LONG) //Ursaring does not evolve into Bloodmoon Ursaluna ], [Species.PILOSWINE]: [ - new SpeciesEvolution(Species.MAMOSWINE, 1, null, new MoveEvolutionCondition(Moves.ANCIENT_POWER), SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesEvolution(Species.MAMOSWINE, 1, null, {key: EvoCondKey.MOVE, move: Moves.ANCIENT_POWER}, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.STANTLER]: [ - new SpeciesEvolution(Species.WYRDEER, 25, null, new MoveEvolutionCondition(Moves.PSYSHIELD_BASH), SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesEvolution(Species.WYRDEER, 25, null, {key: EvoCondKey.MOVE, move: Moves.PSYSHIELD_BASH}, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.LOMBRE]: [ new SpeciesEvolution(Species.LUDICOLO, 1, EvolutionItem.WATER_STONE, null, SpeciesWildEvolutionDelay.LONG) @@ -1592,11 +1563,11 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.ROSERADE, 1, EvolutionItem.SHINY_STONE, null, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.BONSLY]: [ - new SpeciesEvolution(Species.SUDOWOODO, 1, null, new MoveEvolutionCondition(Moves.MIMIC), SpeciesWildEvolutionDelay.MEDIUM) + new SpeciesEvolution(Species.SUDOWOODO, 1, null, {key: EvoCondKey.MOVE, move: Moves.MIMIC}, SpeciesWildEvolutionDelay.MEDIUM) ], [Species.MIME_JR]: [ - new SpeciesEvolution(Species.GALAR_MR_MIME, 1, null, new MoveTimeOfDayEvolutionCondition(Moves.MIMIC, "night"), SpeciesWildEvolutionDelay.MEDIUM), - new SpeciesEvolution(Species.MR_MIME, 1, null, new MoveTimeOfDayEvolutionCondition(Moves.MIMIC, "day"), SpeciesWildEvolutionDelay.MEDIUM) + new SpeciesEvolution(Species.GALAR_MR_MIME, 1, null, {key: [EvoCondKey.MOVE, EvoCondKey.TIME], move: Moves.MIMIC, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}, SpeciesWildEvolutionDelay.MEDIUM), + new SpeciesEvolution(Species.MR_MIME, 1, null, {key: [EvoCondKey.MOVE, EvoCondKey.TIME], move: Moves.MIMIC, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}, SpeciesWildEvolutionDelay.MEDIUM) ], [Species.PANSAGE]: [ new SpeciesEvolution(Species.SIMISAGE, 1, EvolutionItem.LEAF_STONE, null, SpeciesWildEvolutionDelay.LONG) @@ -1618,8 +1589,8 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.LILLIGANT, 1, EvolutionItem.SUN_STONE, null, SpeciesWildEvolutionDelay.LONG) ], [Species.BASCULIN]: [ - new SpeciesFormEvolution(Species.BASCULEGION, "white-striped", "female", 40, null, new GenderEvolutionCondition(Gender.FEMALE), SpeciesWildEvolutionDelay.VERY_LONG), - new SpeciesFormEvolution(Species.BASCULEGION, "white-striped", "male", 40, null, new GenderEvolutionCondition(Gender.MALE), SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesFormEvolution(Species.BASCULEGION, "white-striped", "female", 40, null, {key: EvoCondKey.GENDER, gender: Gender.FEMALE}, SpeciesWildEvolutionDelay.VERY_LONG), + new SpeciesFormEvolution(Species.BASCULEGION, "white-striped", "male", 40, null, {key: EvoCondKey.GENDER, gender: Gender.MALE}, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.MINCCINO]: [ new SpeciesEvolution(Species.CINCCINO, 1, EvolutionItem.SHINY_STONE, null, SpeciesWildEvolutionDelay.LONG) @@ -1647,14 +1618,14 @@ export const pokemonEvolutions: PokemonEvolutions = { ], [Species.ROCKRUFF]: [ new SpeciesFormEvolution(Species.LYCANROC, "own-tempo", "dusk", 25, null, null), - new SpeciesFormEvolution(Species.LYCANROC, "", "midday", 25, null, new TimeOfDayEvolutionCondition("day")), - new SpeciesFormEvolution(Species.LYCANROC, "", "midnight", 25, null, new TimeOfDayEvolutionCondition("night")) + new SpeciesFormEvolution(Species.LYCANROC, "", "midday", 25, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}), + new SpeciesFormEvolution(Species.LYCANROC, "", "midnight", 25, null, {key: EvoCondKey.TIME, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}) ], [Species.STEENEE]: [ - new SpeciesEvolution(Species.TSAREENA, 28, null, new MoveEvolutionCondition(Moves.STOMP), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.TSAREENA, 28, null, {key: EvoCondKey.MOVE, move: Moves.STOMP}, SpeciesWildEvolutionDelay.LONG) ], [Species.POIPOLE]: [ - new SpeciesEvolution(Species.NAGANADEL, 1, null, new MoveEvolutionCondition(Moves.DRAGON_PULSE), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.NAGANADEL, 1, null, {key: EvoCondKey.MOVE, move: Moves.DRAGON_PULSE}, SpeciesWildEvolutionDelay.LONG) ], [Species.ALOLA_SANDSHREW]: [ new SpeciesEvolution(Species.ALOLA_SANDSLASH, 1, EvolutionItem.ICE_STONE, null, SpeciesWildEvolutionDelay.LONG) @@ -1668,7 +1639,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.APPLETUN, 1, EvolutionItem.SWEET_APPLE, null, SpeciesWildEvolutionDelay.LONG) ], [Species.CLOBBOPUS]: [ - new SpeciesEvolution(Species.GRAPPLOCT, 35, null, new MoveEvolutionCondition(Moves.TAUNT)/*Once Taunt is implemented, change evo level to 1 and delay to LONG*/) + new SpeciesEvolution(Species.GRAPPLOCT, 35, null, {key: EvoCondKey.MOVE, move: Moves.TAUNT}/*Once Taunt is implemented, change evo level to 1 and delay to LONG*/) ], [Species.SINISTEA]: [ new SpeciesFormEvolution(Species.POLTEAGEIST, "phony", "phony", 1, EvolutionItem.CRACKED_POT, null, SpeciesWildEvolutionDelay.LONG), @@ -1676,31 +1647,31 @@ export const pokemonEvolutions: PokemonEvolutions = { ], [Species.MILCERY]: [ new SpeciesFormEvolution(Species.ALCREMIE, "", "vanilla-cream", 1, EvolutionItem.STRAWBERRY_SWEET, - new BiomeEvolutionCondition([ Biome.TOWN, Biome.PLAINS, Biome.GRASS, Biome.TALL_GRASS, Biome.METROPOLIS ]), + {key: EvoCondKey.BIOME, biome: [ Biome.TOWN, Biome.PLAINS, Biome.GRASS, Biome.TALL_GRASS, Biome.METROPOLIS ]}, SpeciesWildEvolutionDelay.LONG), new SpeciesFormEvolution(Species.ALCREMIE, "", "ruby-cream", 1, EvolutionItem.STRAWBERRY_SWEET, - new BiomeEvolutionCondition([ Biome.BADLANDS, Biome.VOLCANO, Biome.GRAVEYARD, Biome.FACTORY, Biome.SLUM ]), + {key: EvoCondKey.BIOME, biome: [ Biome.BADLANDS, Biome.VOLCANO, Biome.GRAVEYARD, Biome.FACTORY, Biome.SLUM ]}, SpeciesWildEvolutionDelay.LONG), new SpeciesFormEvolution(Species.ALCREMIE, "", "matcha-cream", 1, EvolutionItem.STRAWBERRY_SWEET, - new BiomeEvolutionCondition([ Biome.FOREST, Biome.SWAMP, Biome.MEADOW, Biome.JUNGLE ]), + {key: EvoCondKey.BIOME, biome: [ Biome.FOREST, Biome.SWAMP, Biome.MEADOW, Biome.JUNGLE ]}, SpeciesWildEvolutionDelay.LONG), new SpeciesFormEvolution(Species.ALCREMIE, "", "mint-cream", 1, EvolutionItem.STRAWBERRY_SWEET, - new BiomeEvolutionCondition([ Biome.SEA, Biome.BEACH, Biome.LAKE, Biome.SEABED ]), + {key: EvoCondKey.BIOME, biome: [ Biome.SEA, Biome.BEACH, Biome.LAKE, Biome.SEABED ]}, SpeciesWildEvolutionDelay.LONG), new SpeciesFormEvolution(Species.ALCREMIE, "", "lemon-cream", 1, EvolutionItem.STRAWBERRY_SWEET, - new BiomeEvolutionCondition([ Biome.DESERT, Biome.POWER_PLANT, Biome.DOJO, Biome.RUINS, Biome.CONSTRUCTION_SITE ]), + {key: EvoCondKey.BIOME, biome: [ Biome.DESERT, Biome.POWER_PLANT, Biome.DOJO, Biome.RUINS, Biome.CONSTRUCTION_SITE ]}, SpeciesWildEvolutionDelay.LONG), new SpeciesFormEvolution(Species.ALCREMIE, "", "salted-cream", 1, EvolutionItem.STRAWBERRY_SWEET, - new BiomeEvolutionCondition([ Biome.MOUNTAIN, Biome.CAVE, Biome.ICE_CAVE, Biome.FAIRY_CAVE, Biome.SNOWY_FOREST ]), + {key: EvoCondKey.BIOME, biome: [ Biome.MOUNTAIN, Biome.CAVE, Biome.ICE_CAVE, Biome.FAIRY_CAVE, Biome.SNOWY_FOREST ]}, SpeciesWildEvolutionDelay.LONG), new SpeciesFormEvolution(Species.ALCREMIE, "", "ruby-swirl", 1, EvolutionItem.STRAWBERRY_SWEET, - new BiomeEvolutionCondition([ Biome.WASTELAND, Biome.LABORATORY ]), + {key: EvoCondKey.BIOME, biome: [ Biome.WASTELAND, Biome.LABORATORY ]}, SpeciesWildEvolutionDelay.LONG), new SpeciesFormEvolution(Species.ALCREMIE, "", "caramel-swirl", 1, EvolutionItem.STRAWBERRY_SWEET, - new BiomeEvolutionCondition([ Biome.TEMPLE, Biome.ISLAND ]), + {key: EvoCondKey.BIOME, biome: [ Biome.TEMPLE, Biome.ISLAND ]}, SpeciesWildEvolutionDelay.LONG), new SpeciesFormEvolution(Species.ALCREMIE, "", "rainbow-swirl", 1, EvolutionItem.STRAWBERRY_SWEET, - new BiomeEvolutionCondition([ Biome.ABYSS, Biome.SPACE, Biome.END ]), + {key: EvoCondKey.BIOME, biome: [ Biome.ABYSS, Biome.SPACE, Biome.END ]}, SpeciesWildEvolutionDelay.LONG) ], [Species.DURALUDON]: [ @@ -1720,10 +1691,10 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.HISUI_ELECTRODE, 1, EvolutionItem.LEAF_STONE, null, SpeciesWildEvolutionDelay.LONG) ], [Species.HISUI_QWILFISH]: [ - new SpeciesEvolution(Species.OVERQWIL, 28, null, new MoveEvolutionCondition(Moves.BARB_BARRAGE), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.OVERQWIL, 28, null, {key: EvoCondKey.MOVE, move: Moves.BARB_BARRAGE}, SpeciesWildEvolutionDelay.LONG) ], [Species.HISUI_SNEASEL]: [ - new SpeciesEvolution(Species.SNEASLER, 1, EvolutionItem.RAZOR_CLAW, new TimeOfDayEvolutionCondition("day") /* Razor claw at day*/, SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesEvolution(Species.SNEASLER, 1, EvolutionItem.RAZOR_CLAW, {key: EvoCondKey.TIME, time: [TimeOfDay.DAWN, TimeOfDay.DAY]} /* Razor claw at day*/, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.CHARCADET]: [ new SpeciesEvolution(Species.ARMAROUGE, 1, EvolutionItem.AUSPICIOUS_ARMOR, null, SpeciesWildEvolutionDelay.LONG), @@ -1743,7 +1714,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesFormEvolution(Species.SINISTCHA, "artisan", "masterpiece", 1, EvolutionItem.MASTERPIECE_TEACUP, null, SpeciesWildEvolutionDelay.LONG) ], [Species.DIPPLIN]: [ - new SpeciesEvolution(Species.HYDRAPPLE, 1, null, new MoveEvolutionCondition(Moves.DRAGON_CHEER), SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesEvolution(Species.HYDRAPPLE, 1, null, {key: EvoCondKey.MOVE, move: Moves.DRAGON_CHEER}, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.KADABRA]: [ new SpeciesEvolution(Species.ALAKAZAM, 1, EvolutionItem.LINKING_CORD, null, SpeciesWildEvolutionDelay.VERY_LONG) @@ -1758,7 +1729,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.GENGAR, 1, EvolutionItem.LINKING_CORD, null, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.ONIX]: [ - new SpeciesEvolution(Species.STEELIX, 1, EvolutionItem.LINKING_CORD, new MoveTypeEvolutionCondition(PokemonType.STEEL), SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesEvolution(Species.STEELIX, 1, EvolutionItem.LINKING_CORD, {key: EvoCondKey.MOVE_TYPE, moveType: PokemonType.STEEL}, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.RHYDON]: [ new SpeciesEvolution(Species.RHYPERIOR, 1, EvolutionItem.PROTECTOR, null, SpeciesWildEvolutionDelay.VERY_LONG) @@ -1767,7 +1738,7 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.KINGDRA, 1, EvolutionItem.DRAGON_SCALE, null, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.SCYTHER]: [ - new SpeciesEvolution(Species.SCIZOR, 1, EvolutionItem.LINKING_CORD, new MoveTypeEvolutionCondition(PokemonType.STEEL), SpeciesWildEvolutionDelay.VERY_LONG), + new SpeciesEvolution(Species.SCIZOR, 1, EvolutionItem.LINKING_CORD, {key: EvoCondKey.MOVE_TYPE, moveType: PokemonType.STEEL}, SpeciesWildEvolutionDelay.VERY_LONG), new SpeciesEvolution(Species.KLEAVOR, 1, EvolutionItem.BLACK_AUGURITE, null, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.ELECTABUZZ]: [ @@ -1789,8 +1760,8 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.DUSKNOIR, 1, EvolutionItem.REAPER_CLOTH, null, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.CLAMPERL]: [ - new SpeciesEvolution(Species.HUNTAIL, 1, EvolutionItem.LINKING_CORD, new GenderEvolutionCondition(Gender.MALE /* Deep Sea Tooth */), SpeciesWildEvolutionDelay.VERY_LONG), - new SpeciesEvolution(Species.GOREBYSS, 1, EvolutionItem.LINKING_CORD, new GenderEvolutionCondition(Gender.FEMALE /* Deep Sea Scale */), SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesEvolution(Species.HUNTAIL, 1, EvolutionItem.LINKING_CORD, {key: EvoCondKey.GENDER, gender: Gender.MALE/* Deep Sea Tooth */}, SpeciesWildEvolutionDelay.VERY_LONG), + new SpeciesEvolution(Species.GOREBYSS, 1, EvolutionItem.LINKING_CORD, {key: EvoCondKey.GENDER, gender: Gender.FEMALE/* Deep Sea Scale */}, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.BOLDORE]: [ new SpeciesEvolution(Species.GIGALITH, 1, EvolutionItem.LINKING_CORD, null, SpeciesWildEvolutionDelay.VERY_LONG) @@ -1799,10 +1770,10 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.CONKELDURR, 1, EvolutionItem.LINKING_CORD, null, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.KARRABLAST]: [ - new SpeciesEvolution(Species.ESCAVALIER, 1, EvolutionItem.LINKING_CORD, new CaughtEvolutionCondition(Species.SHELMET), SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesEvolution(Species.ESCAVALIER, 1, EvolutionItem.LINKING_CORD, {key: EvoCondKey.SPECIES_CAUGHT, speciesCaught: Species.SHELMET}, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.SHELMET]: [ - new SpeciesEvolution(Species.ACCELGOR, 1, EvolutionItem.LINKING_CORD, new CaughtEvolutionCondition(Species.KARRABLAST), SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesEvolution(Species.ACCELGOR, 1, EvolutionItem.LINKING_CORD, {key: EvoCondKey.SPECIES_CAUGHT, speciesCaught: Species.SHELMET}, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.SPRITZEE]: [ new SpeciesEvolution(Species.AROMATISSE, 1, EvolutionItem.SACHET, null, SpeciesWildEvolutionDelay.VERY_LONG) @@ -1820,66 +1791,66 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.ALOLA_GOLEM, 1, EvolutionItem.LINKING_CORD, null, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.PRIMEAPE]: [ - new SpeciesEvolution(Species.ANNIHILAPE, 35, null, new MoveEvolutionCondition(Moves.RAGE_FIST), SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesEvolution(Species.ANNIHILAPE, 35, null, {key: EvoCondKey.MOVE, move: Moves.RAGE_FIST}, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.GOLBAT]: [ - new SpeciesEvolution(Species.CROBAT, 1, null, new FriendshipEvolutionCondition(120), SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesEvolution(Species.CROBAT, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 120}, SpeciesWildEvolutionDelay.VERY_LONG) ], [Species.CHANSEY]: [ - new SpeciesEvolution(Species.BLISSEY, 1, null, new FriendshipEvolutionCondition(200), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.BLISSEY, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 200}, SpeciesWildEvolutionDelay.LONG) ], [Species.PICHU]: [ - new SpeciesFormEvolution(Species.PIKACHU, "spiky", "partner", 1, null, new FriendshipEvolutionCondition(90), SpeciesWildEvolutionDelay.SHORT), - new SpeciesFormEvolution(Species.PIKACHU, "", "", 1, null, new FriendshipEvolutionCondition(90), SpeciesWildEvolutionDelay.SHORT), + new SpeciesFormEvolution(Species.PIKACHU, "spiky", "partner", 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 90}, SpeciesWildEvolutionDelay.SHORT), + new SpeciesFormEvolution(Species.PIKACHU, "", "", 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 90}, SpeciesWildEvolutionDelay.SHORT), ], [Species.CLEFFA]: [ - new SpeciesEvolution(Species.CLEFAIRY, 1, null, new FriendshipEvolutionCondition(160), SpeciesWildEvolutionDelay.SHORT) + new SpeciesEvolution(Species.CLEFAIRY, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 160}, SpeciesWildEvolutionDelay.SHORT) ], [Species.IGGLYBUFF]: [ - new SpeciesEvolution(Species.JIGGLYPUFF, 1, null, new FriendshipEvolutionCondition(70), SpeciesWildEvolutionDelay.SHORT) + new SpeciesEvolution(Species.JIGGLYPUFF, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 70}, SpeciesWildEvolutionDelay.SHORT) ], [Species.TOGEPI]: [ - new SpeciesEvolution(Species.TOGETIC, 1, null, new FriendshipEvolutionCondition(70), SpeciesWildEvolutionDelay.SHORT) + new SpeciesEvolution(Species.TOGETIC, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 70}, SpeciesWildEvolutionDelay.SHORT) ], [Species.AZURILL]: [ - new SpeciesEvolution(Species.MARILL, 1, null, new FriendshipEvolutionCondition(70), SpeciesWildEvolutionDelay.SHORT) + new SpeciesEvolution(Species.MARILL, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 70}, SpeciesWildEvolutionDelay.SHORT) ], [Species.BUDEW]: [ - new SpeciesEvolution(Species.ROSELIA, 1, null, new FriendshipTimeOfDayEvolutionCondition(70, "day"), SpeciesWildEvolutionDelay.SHORT) + new SpeciesEvolution(Species.ROSELIA, 1, null, {key: [EvoCondKey.FRIENDSHIP, EvoCondKey.TIME], friendship: 70, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}, SpeciesWildEvolutionDelay.SHORT) ], [Species.BUNEARY]: [ - new SpeciesEvolution(Species.LOPUNNY, 1, null, new FriendshipEvolutionCondition(70), SpeciesWildEvolutionDelay.MEDIUM) + new SpeciesEvolution(Species.LOPUNNY, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 70}, SpeciesWildEvolutionDelay.MEDIUM) ], [Species.CHINGLING]: [ - new SpeciesEvolution(Species.CHIMECHO, 1, null, new FriendshipTimeOfDayEvolutionCondition(90, "night"), SpeciesWildEvolutionDelay.MEDIUM) + new SpeciesEvolution(Species.CHIMECHO, 1, null,{key: [EvoCondKey.FRIENDSHIP, EvoCondKey.TIME], friendship: 90, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}, SpeciesWildEvolutionDelay.MEDIUM) ], [Species.HAPPINY]: [ - new SpeciesEvolution(Species.CHANSEY, 1, null, new FriendshipEvolutionCondition(160), SpeciesWildEvolutionDelay.SHORT) + new SpeciesEvolution(Species.CHANSEY, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 160}, SpeciesWildEvolutionDelay.SHORT) ], [Species.MUNCHLAX]: [ - new SpeciesEvolution(Species.SNORLAX, 1, null, new FriendshipEvolutionCondition(120), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.SNORLAX, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 120}, SpeciesWildEvolutionDelay.LONG) ], [Species.RIOLU]: [ - new SpeciesEvolution(Species.LUCARIO, 1, null, new FriendshipTimeOfDayEvolutionCondition(120, "day"), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.LUCARIO, 1, null, {key: [EvoCondKey.FRIENDSHIP, EvoCondKey.TIME], friendship: 120, time: [TimeOfDay.DAWN, TimeOfDay.DAY]}, SpeciesWildEvolutionDelay.LONG) ], [Species.WOOBAT]: [ - new SpeciesEvolution(Species.SWOOBAT, 1, null, new FriendshipEvolutionCondition(90), SpeciesWildEvolutionDelay.MEDIUM) + new SpeciesEvolution(Species.SWOOBAT, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 90}, SpeciesWildEvolutionDelay.MEDIUM) ], [Species.SWADLOON]: [ - new SpeciesEvolution(Species.LEAVANNY, 1, null, new FriendshipEvolutionCondition(120), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.LEAVANNY, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 120}, SpeciesWildEvolutionDelay.LONG) ], [Species.TYPE_NULL]: [ - new SpeciesEvolution(Species.SILVALLY, 1, null, new FriendshipEvolutionCondition(100), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.SILVALLY, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 100}, SpeciesWildEvolutionDelay.LONG) ], [Species.ALOLA_MEOWTH]: [ - new SpeciesEvolution(Species.ALOLA_PERSIAN, 1, null, new FriendshipEvolutionCondition(120), SpeciesWildEvolutionDelay.LONG) + new SpeciesEvolution(Species.ALOLA_PERSIAN, 1, null, {key: EvoCondKey.FRIENDSHIP, friendship: 120}, SpeciesWildEvolutionDelay.LONG) ], [Species.SNOM]: [ - new SpeciesEvolution(Species.FROSMOTH, 1, null, new FriendshipTimeOfDayEvolutionCondition(90, "night"), SpeciesWildEvolutionDelay.MEDIUM) + new SpeciesEvolution(Species.FROSMOTH, 1, null, {key: [EvoCondKey.FRIENDSHIP, EvoCondKey.TIME], friendship: 90, time: [TimeOfDay.DUSK, TimeOfDay.NIGHT]}, SpeciesWildEvolutionDelay.MEDIUM) ], [Species.GIMMIGHOUL]: [ - new SpeciesFormEvolution(Species.GHOLDENGO, "chest", "", 1, null, new TreasureEvolutionCondition(), SpeciesWildEvolutionDelay.VERY_LONG), - new SpeciesFormEvolution(Species.GHOLDENGO, "roaming", "", 1, null, new TreasureEvolutionCondition(), SpeciesWildEvolutionDelay.VERY_LONG) + new SpeciesFormEvolution(Species.GHOLDENGO, "chest", "", 1, null, {key: EvoCondKey.EVO_COUNTER, evoCount: 10}, SpeciesWildEvolutionDelay.VERY_LONG), + new SpeciesFormEvolution(Species.GHOLDENGO, "roaming", "", 1, null, {key: EvoCondKey.EVO_COUNTER, evoCount: 10}, SpeciesWildEvolutionDelay.VERY_LONG) ] }; diff --git a/src/data/mystery-encounters/mystery-encounter-requirements.ts b/src/data/mystery-encounters/mystery-encounter-requirements.ts index 948e3e96ef0..0a67e081587 100644 --- a/src/data/mystery-encounters/mystery-encounter-requirements.ts +++ b/src/data/mystery-encounters/mystery-encounter-requirements.ts @@ -838,72 +838,6 @@ export class CanFormChangeWithItemRequirement extends EncounterPokemonRequiremen } } -export class CanEvolveWithItemRequirement extends EncounterPokemonRequirement { - requiredEvolutionItem: EvolutionItem[]; - minNumberOfPokemon: number; - invertQuery: boolean; - - constructor(evolutionItems: EvolutionItem | EvolutionItem[], minNumberOfPokemon = 1, invertQuery = false) { - super(); - this.minNumberOfPokemon = minNumberOfPokemon; - this.invertQuery = invertQuery; - this.requiredEvolutionItem = Array.isArray(evolutionItems) ? evolutionItems : [evolutionItems]; - } - - override meetsRequirement(): boolean { - const partyPokemon = globalScene.getPlayerParty(); - if (isNullOrUndefined(partyPokemon) || this.requiredEvolutionItem?.length < 0) { - return false; - } - return this.queryParty(partyPokemon).length >= this.minNumberOfPokemon; - } - - filterByEvo(pokemon, evolutionItem) { - if ( - pokemonEvolutions.hasOwnProperty(pokemon.species.speciesId) && - pokemonEvolutions[pokemon.species.speciesId].filter( - e => e.item === evolutionItem && (!e.condition || e.condition.predicate(pokemon)), - ).length && - pokemon.getFormKey() !== SpeciesFormKey.GIGANTAMAX - ) { - return true; - } - if ( - pokemon.isFusion() && - pokemonEvolutions.hasOwnProperty(pokemon.fusionSpecies.speciesId) && - pokemonEvolutions[pokemon.fusionSpecies.speciesId].filter( - e => e.item === evolutionItem && (!e.condition || e.condition.predicate(pokemon)), - ).length && - pokemon.getFusionFormKey() !== SpeciesFormKey.GIGANTAMAX - ) { - return true; - } - return false; - } - - override queryParty(partyPokemon: PlayerPokemon[]): PlayerPokemon[] { - if (!this.invertQuery) { - return partyPokemon.filter( - pokemon => - this.requiredEvolutionItem.filter(evolutionItem => this.filterByEvo(pokemon, evolutionItem)).length > 0, - ); - } - // for an inverted query, we only want to get the pokemon that don't have ANY of the listed evolutionItemss - return partyPokemon.filter( - pokemon => - this.requiredEvolutionItem.filter(evolutionItems => this.filterByEvo(pokemon, evolutionItems)).length === 0, - ); - } - - override getDialogueToken(pokemon?: PlayerPokemon): [string, string] { - const requiredItems = this.requiredEvolutionItem.filter(evoItem => this.filterByEvo(pokemon, evoItem)); - if (requiredItems.length > 0) { - return ["evolutionItem", EvolutionItem[requiredItems[0]]]; - } - return ["evolutionItem", ""]; - } -} - export class HeldItemRequirement extends EncounterPokemonRequirement { requiredHeldItemModifiers: string[]; minNumberOfPokemon: number; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index ce36a40697b..8a459468a5d 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -97,7 +97,6 @@ import { Gender } from "#app/data/gender"; import { Status, getRandomStatus } from "#app/data/status-effect"; import type { SpeciesFormEvolution, - SpeciesEvolutionCondition, } from "#app/data/balance/pokemon-evolutions"; import { pokemonEvolutions, @@ -2874,18 +2873,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (pokemonEvolutions.hasOwnProperty(this.species.speciesId)) { const evolutions = pokemonEvolutions[this.species.speciesId]; for (const e of evolutions) { - if ( - !e.item && - this.level >= e.level && - (isNullOrUndefined(e.preFormKey) || - this.getFormKey() === e.preFormKey) - ) { - if ( - e.condition === null || - (e.condition as SpeciesEvolutionCondition).predicate(this) - ) { - return e; - } + if (e.validate(this)) { + return e; } } } @@ -2899,18 +2888,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.fusionSpecies.speciesId ].map(e => new FusionSpeciesFormEvolution(this.species.speciesId, e)); for (const fe of fusionEvolutions) { - if ( - !fe.item && - this.level >= fe.level && - (isNullOrUndefined(fe.preFormKey) || - this.getFusionFormKey() === fe.preFormKey) - ) { - if ( - fe.condition === null || - (fe.condition as SpeciesEvolutionCondition).predicate(this) - ) { - return fe; - } + if (fe.validate(this)) { + return fe; } } } @@ -6843,7 +6822,7 @@ export class PlayerPokemon extends Pokemon { ) { const newEvolution = pokemonEvolutions[evoSpecies.speciesId][1]; - if (newEvolution.condition?.predicate(this)) { + if (newEvolution.validate(this, evoSpecies.speciesId === this.species.speciesId)) { const newPokemon = globalScene.addPlayerPokemon( this.species, this.level, @@ -7144,9 +7123,6 @@ export class EnemyPokemon extends Pokemon { pe.speciesId === speciesId && (!pe.evoFormKey || pe.evoFormKey === this.getFormKey()), ); - if (evolution?.condition?.enforceFunc) { - evolution.condition.enforceFunc(this); - } speciesId = prevolution; } } diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 8feb60c7778..73afa1727df 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -1214,9 +1214,7 @@ export class EvolutionItemModifierType extends PokemonModifierType implements Ge pokemonEvolutions.hasOwnProperty(pokemon.species.speciesId) && pokemonEvolutions[pokemon.species.speciesId].filter( e => - e.item === this.evolutionItem && - (!e.condition || e.condition.predicate(pokemon)) && - (e.preFormKey === null || e.preFormKey === pokemon.getFormKey()), + e.validate(pokemon, false, this.evolutionItem), ).length && pokemon.getFormKey() !== SpeciesFormKey.GIGANTAMAX ) { @@ -1228,9 +1226,7 @@ export class EvolutionItemModifierType extends PokemonModifierType implements Ge pokemonEvolutions.hasOwnProperty(pokemon.fusionSpecies.speciesId) && pokemonEvolutions[pokemon.fusionSpecies.speciesId].filter( e => - e.item === this.evolutionItem && - (!e.condition || e.condition.predicate(pokemon)) && - (e.preFormKey === null || e.preFormKey === pokemon.getFusionFormKey()), + e.validate(pokemon, true, this.evolutionItem), ).length && pokemon.getFusionFormKey() !== SpeciesFormKey.GIGANTAMAX ) { @@ -1566,9 +1562,7 @@ class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator { const evolutions = pokemonEvolutions[p.species.speciesId]; return evolutions.filter( e => - e.item !== EvolutionItem.NONE && - (e.evoFormKey === null || (e.preFormKey || "") === p.getFormKey()) && - (!e.condition || e.condition.predicate(p)), + e.isValidItemEvolution(p), ); }), party @@ -1585,14 +1579,12 @@ class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator { const evolutions = pokemonEvolutions[p.fusionSpecies!.speciesId]; return evolutions.filter( e => - e.item !== EvolutionItem.NONE && - (e.evoFormKey === null || (e.preFormKey || "") === p.getFusionFormKey()) && - (!e.condition || e.condition.predicate(p)), + e.validate(p, true), ); }), ] .flat() - .flatMap(e => e.item) + .flatMap(e => e.evoItem) .filter(i => (!!i && i > 50) === rare); if (!evolutionItemPool.length) { diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 851fa33cedc..d82f86d74e1 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -2378,18 +2378,14 @@ export class EvolutionItemModifier extends ConsumablePokemonModifier { let matchingEvolution = pokemonEvolutions.hasOwnProperty(playerPokemon.species.speciesId) ? pokemonEvolutions[playerPokemon.species.speciesId].find( e => - e.item === this.type.evolutionItem && - (e.evoFormKey === null || (e.preFormKey || "") === playerPokemon.getFormKey()) && - (!e.condition || e.condition.predicate(playerPokemon)), + e.evoItem === this.type.evolutionItem && e.validate(playerPokemon, false, e.item!), ) : null; if (!matchingEvolution && playerPokemon.isFusion()) { matchingEvolution = pokemonEvolutions[playerPokemon.fusionSpecies!.speciesId].find( e => - e.item === this.type.evolutionItem && // TODO: is the bang correct? - (e.evoFormKey === null || (e.preFormKey || "") === playerPokemon.getFusionFormKey()) && - (!e.condition || e.condition.predicate(playerPokemon)), + e.evoItem === this.type.evolutionItem && e.validate(playerPokemon, true, e.item!), ); if (matchingEvolution) { matchingEvolution = new FusionSpeciesFormEvolution(playerPokemon.species.speciesId, matchingEvolution);