mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 17:29:30 +02:00
Add debug evolution items
Adds the Force Evolve and Force Fusion Evolve items. They can be used by putting "FORCE_EVOLVE_ITEM" or "FORCE_FUSE_EVOLVE_ITEM" in the modifier rewards override array in overrides.ts. Force Evolve evolves a Pokemon, ignoring conditions. Force Fuse Evolve evolves the second half of a fused Pokemon, or does nothing if it isn't fused. May break on Pokemon with multiple evolutions.
This commit is contained in:
parent
41870812b4
commit
e550c71928
@ -51,7 +51,10 @@ export enum EvolutionItem {
|
||||
METAL_ALLOY,
|
||||
SCROLL_OF_DARKNESS,
|
||||
SCROLL_OF_WATERS,
|
||||
SYRUPY_APPLE
|
||||
SYRUPY_APPLE,
|
||||
|
||||
SUPER_EVO_ITEM,
|
||||
SUPER_EVO_ITEM_F
|
||||
}
|
||||
|
||||
export type EvolutionConditionPredicate = (p: Pokemon) => boolean;
|
||||
|
@ -895,11 +895,11 @@ export class EvolutionItemModifierType extends PokemonModifierType implements Ge
|
||||
constructor(evolutionItem: EvolutionItem) {
|
||||
super("", EvolutionItem[evolutionItem].toLowerCase(), (_type, args) => new Modifiers.EvolutionItemModifier(this, (args[0] as PlayerPokemon).id),
|
||||
(pokemon: PlayerPokemon) => {
|
||||
if (pokemonEvolutions.hasOwnProperty(pokemon.species.speciesId) && pokemonEvolutions[pokemon.species.speciesId].filter(e => e.item === this.evolutionItem
|
||||
&& (!e.condition || e.condition.predicate(pokemon))).length && (pokemon.getFormKey() !== SpeciesFormKey.GIGANTAMAX)) {
|
||||
if (pokemonEvolutions.hasOwnProperty(pokemon.species.speciesId) && pokemonEvolutions[pokemon.species.speciesId].filter(e => (e.item === this.evolutionItem || this.evolutionItem === EvolutionItem.SUPER_EVO_ITEM)
|
||||
&& (!e.condition || e.condition.predicate(pokemon) || this.evolutionItem === EvolutionItem.SUPER_EVO_ITEM)).length && (pokemon.getFormKey() !== SpeciesFormKey.GIGANTAMAX || this.evolutionItem === EvolutionItem.SUPER_EVO_ITEM)) {
|
||||
return null;
|
||||
} else if (pokemon.isFusion() && pokemonEvolutions.hasOwnProperty(pokemon.fusionSpecies.speciesId) && pokemonEvolutions[pokemon.fusionSpecies.speciesId].filter(e => e.item === this.evolutionItem
|
||||
&& (!e.condition || e.condition.predicate(pokemon))).length && (pokemon.getFusionFormKey() !== SpeciesFormKey.GIGANTAMAX)) {
|
||||
} else if (pokemon.isFusion() && pokemonEvolutions.hasOwnProperty(pokemon.fusionSpecies.speciesId) && pokemonEvolutions[pokemon.fusionSpecies.speciesId].filter(e => (e.item === this.evolutionItem || this.evolutionItem === EvolutionItem.SUPER_EVO_ITEM_F)
|
||||
&& (!e.condition || e.condition.predicate(pokemon) || this.evolutionItem === EvolutionItem.SUPER_EVO_ITEM_F)).length && (pokemon.getFusionFormKey() !== SpeciesFormKey.GIGANTAMAX || this.evolutionItem === EvolutionItem.SUPER_EVO_ITEM_F)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1318,6 +1318,8 @@ export const modifierTypes = {
|
||||
EVOLUTION_ITEM: () => new EvolutionItemModifierTypeGenerator(false),
|
||||
RARE_EVOLUTION_ITEM: () => new EvolutionItemModifierTypeGenerator(true),
|
||||
FORM_CHANGE_ITEM: () => new FormChangeItemModifierTypeGenerator(),
|
||||
FORCE_EVOLVE_ITEM: () => new EvolutionItemModifierType(EvolutionItem.SUPER_EVO_ITEM),
|
||||
FORCE_FUSE_EVOLVE_ITEM: () => new EvolutionItemModifierType(EvolutionItem.SUPER_EVO_ITEM_F),
|
||||
|
||||
MEGA_BRACELET: () => new ModifierType("modifierType:ModifierType.MEGA_BRACELET", "mega_bracelet", (type, _args) => new Modifiers.MegaEvolutionAccessModifier(type)),
|
||||
DYNAMAX_BAND: () => new ModifierType("modifierType:ModifierType.DYNAMAX_BAND", "dynamax_band", (type, _args) => new Modifiers.GigantamaxAccessModifier(type)),
|
||||
|
@ -8,7 +8,7 @@ import { Stat } from "../data/pokemon-stat";
|
||||
import { addTextObject, TextStyle } from "../ui/text";
|
||||
import { Type } from "../data/type";
|
||||
import { EvolutionPhase } from "../evolution-phase";
|
||||
import { FusionSpeciesFormEvolution, pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutions";
|
||||
import { EvolutionItem, FusionSpeciesFormEvolution, pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutions";
|
||||
import {getPokemonMessage, getPokemonNameWithAffix} from "../messages";
|
||||
import * as Utils from "../utils";
|
||||
import { TempBattleStat } from "../data/temp-battle-stat";
|
||||
@ -1531,16 +1531,18 @@ export class EvolutionItemModifier extends ConsumablePokemonModifier {
|
||||
apply(args: any[]): boolean {
|
||||
const pokemon = args[0] as PlayerPokemon;
|
||||
|
||||
var bypassC = EvolutionItem.SUPER_EVO_ITEM === (this.type as ModifierTypes.EvolutionItemModifierType).evolutionItem
|
||||
let matchingEvolution = pokemonEvolutions.hasOwnProperty(pokemon.species.speciesId)
|
||||
? pokemonEvolutions[pokemon.species.speciesId].find(e => e.item === (this.type as ModifierTypes.EvolutionItemModifierType).evolutionItem
|
||||
? pokemonEvolutions[pokemon.species.speciesId].find(e => (e.item === (this.type as ModifierTypes.EvolutionItemModifierType).evolutionItem || bypassC)
|
||||
&& (e.evoFormKey === null || (e.preFormKey || "") === pokemon.getFormKey())
|
||||
&& (!e.condition || e.condition.predicate(pokemon)))
|
||||
&& (!e.condition || e.condition.predicate(pokemon) || bypassC))
|
||||
: null;
|
||||
|
||||
if (!matchingEvolution && pokemon.isFusion()) {
|
||||
matchingEvolution = pokemonEvolutions[pokemon.fusionSpecies.speciesId].find(e => e.item === (this.type as ModifierTypes.EvolutionItemModifierType).evolutionItem
|
||||
var bypassC = EvolutionItem.SUPER_EVO_ITEM_F === (this.type as ModifierTypes.EvolutionItemModifierType).evolutionItem
|
||||
matchingEvolution = pokemonEvolutions[pokemon.fusionSpecies.speciesId].find(e => (e.item === (this.type as ModifierTypes.EvolutionItemModifierType).evolutionItem || bypassC)
|
||||
&& (e.evoFormKey === null || (e.preFormKey || "") === pokemon.getFusionFormKey())
|
||||
&& (!e.condition || e.condition.predicate(pokemon)));
|
||||
&& (!e.condition || e.condition.predicate(pokemon) || bypassC));
|
||||
if (matchingEvolution) {
|
||||
matchingEvolution = new FusionSpeciesFormEvolution(pokemon.species.speciesId, matchingEvolution);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user