mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-29 21:12:45 +02:00
Apply Biome
This commit is contained in:
parent
e23ac1de8e
commit
ad89d48072
@ -1,6 +1,5 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { allAbilities } from "../data-lists";
|
||||
import { EvolutionItem, pokemonEvolutions } from "#app/data/balance/pokemon-evolutions";
|
||||
import { Nature } from "#enums/nature";
|
||||
import { pokemonFormChanges } from "#app/data/pokemon-forms";
|
||||
import { SpeciesFormChangeItemTrigger } from "../pokemon-forms/form-change-triggers";
|
||||
@ -16,7 +15,6 @@ import type { AbilityId } from "#enums/ability-id";
|
||||
import { MoveId } from "#enums/move-id";
|
||||
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||
import { TimeOfDay } from "#enums/time-of-day";
|
||||
|
||||
export interface EncounterRequirement {
|
||||
|
@ -79,9 +79,7 @@ import {
|
||||
import { PokeballType } from "#enums/pokeball";
|
||||
import { Gender } from "#app/data/gender";
|
||||
import { Status, getRandomStatus } from "#app/data/status-effect";
|
||||
import type {
|
||||
SpeciesFormEvolution,
|
||||
} from "#app/data/balance/pokemon-evolutions";
|
||||
import type { SpeciesFormEvolution } from "#app/data/balance/pokemon-evolutions";
|
||||
import {
|
||||
pokemonEvolutions,
|
||||
pokemonPrevolutions,
|
||||
@ -5451,12 +5449,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
getPersistentTreasureCount(): number {
|
||||
return this.getHeldItems().filter(m => m.is("DamageMoneyRewardModifier")).length +
|
||||
globalScene.findModifiers(
|
||||
m =>
|
||||
m.is("MoneyMultiplierModifier") ||
|
||||
m.is("ExtraModifierModifier"),
|
||||
).length;
|
||||
return (
|
||||
this.getHeldItems().filter(m => m.is("DamageMoneyRewardModifier")).length +
|
||||
globalScene.findModifiers(m => m.is("MoneyMultiplierModifier") || m.is("ExtraModifierModifier")).length
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1218,10 +1218,8 @@ export class EvolutionItemModifierType extends PokemonModifierType implements Ge
|
||||
(pokemon: PlayerPokemon) => {
|
||||
if (
|
||||
pokemonEvolutions.hasOwnProperty(pokemon.species.speciesId) &&
|
||||
pokemonEvolutions[pokemon.species.speciesId].filter(
|
||||
e =>
|
||||
e.validate(pokemon, false, this.evolutionItem),
|
||||
).length &&
|
||||
pokemonEvolutions[pokemon.species.speciesId].filter(e => e.validate(pokemon, false, this.evolutionItem))
|
||||
.length &&
|
||||
pokemon.getFormKey() !== SpeciesFormKey.GIGANTAMAX
|
||||
) {
|
||||
return null;
|
||||
@ -1230,10 +1228,8 @@ export class EvolutionItemModifierType extends PokemonModifierType implements Ge
|
||||
pokemon.isFusion() &&
|
||||
pokemon.fusionSpecies &&
|
||||
pokemonEvolutions.hasOwnProperty(pokemon.fusionSpecies.speciesId) &&
|
||||
pokemonEvolutions[pokemon.fusionSpecies.speciesId].filter(
|
||||
e =>
|
||||
e.validate(pokemon, true, this.evolutionItem),
|
||||
).length &&
|
||||
pokemonEvolutions[pokemon.fusionSpecies.speciesId].filter(e => e.validate(pokemon, true, this.evolutionItem))
|
||||
.length &&
|
||||
pokemon.getFusionFormKey() !== SpeciesFormKey.GIGANTAMAX
|
||||
) {
|
||||
return null;
|
||||
@ -1593,10 +1589,7 @@ class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator {
|
||||
)
|
||||
.flatMap(p => {
|
||||
const evolutions = pokemonEvolutions[p.species.speciesId];
|
||||
return evolutions.filter(
|
||||
e =>
|
||||
e.isValidItemEvolution(p),
|
||||
);
|
||||
return evolutions.filter(e => e.isValidItemEvolution(p));
|
||||
}),
|
||||
party
|
||||
.filter(
|
||||
@ -1610,10 +1603,7 @@ class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator {
|
||||
)
|
||||
.flatMap(p => {
|
||||
const evolutions = pokemonEvolutions[p.fusionSpecies!.speciesId];
|
||||
return evolutions.filter(
|
||||
e =>
|
||||
e.validate(p, true),
|
||||
);
|
||||
return evolutions.filter(e => e.validate(p, true));
|
||||
}),
|
||||
]
|
||||
.flat()
|
||||
@ -1884,7 +1874,8 @@ const modifierTypeInitObj = Object.freeze({
|
||||
new PokemonHeldItemModifierType(
|
||||
"modifierType:ModifierType.EVOLUTION_TRACKER_GIMMIGHOUL",
|
||||
"relic_gold",
|
||||
(type, args) => new EvoTrackerModifier(type, (args[0] as Pokemon).id, SpeciesId.GIMMIGHOUL, 10, (args[1] as number ?? 1)),
|
||||
(type, args) =>
|
||||
new EvoTrackerModifier(type, (args[0] as Pokemon).id, SpeciesId.GIMMIGHOUL, 10, (args[1] as number) ?? 1),
|
||||
),
|
||||
|
||||
MEGA_BRACELET: () =>
|
||||
|
@ -2388,15 +2388,13 @@ export class EvolutionItemModifier extends ConsumablePokemonModifier {
|
||||
override apply(playerPokemon: PlayerPokemon): boolean {
|
||||
let matchingEvolution = pokemonEvolutions.hasOwnProperty(playerPokemon.species.speciesId)
|
||||
? pokemonEvolutions[playerPokemon.species.speciesId].find(
|
||||
e =>
|
||||
e.evoItem === this.type.evolutionItem && e.validate(playerPokemon, false, e.item!),
|
||||
e => e.evoItem === this.type.evolutionItem && e.validate(playerPokemon, false, e.item!),
|
||||
)
|
||||
: null;
|
||||
|
||||
if (!matchingEvolution && playerPokemon.isFusion()) {
|
||||
matchingEvolution = pokemonEvolutions[playerPokemon.fusionSpecies!.speciesId].find(
|
||||
e =>
|
||||
e.evoItem === this.type.evolutionItem && e.validate(playerPokemon, true, e.item!),
|
||||
e => e.evoItem === this.type.evolutionItem && e.validate(playerPokemon, true, e.item!),
|
||||
);
|
||||
if (matchingEvolution) {
|
||||
matchingEvolution = new FusionSpeciesFormEvolution(playerPokemon.species.speciesId, matchingEvolution);
|
||||
@ -2919,7 +2917,7 @@ export class MoneyRewardModifier extends ConsumableModifier {
|
||||
const factor = Math.min(Math.floor(this.moneyMultiplier), 3);
|
||||
const modifier = getModifierType(modifierTypes.EVOLUTION_TRACKER_GIMMIGHOUL).newModifier(
|
||||
p,
|
||||
factor
|
||||
factor,
|
||||
) as EvoTrackerModifier;
|
||||
globalScene.addModifier(modifier);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user