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