mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-30 13:33:01 +02:00
Fix Gimmighoul
This commit is contained in:
parent
9e64af2e52
commit
e23ac1de8e
@ -177,7 +177,10 @@ export class SpeciesEvolutionCondition {
|
||||
case EvoCondKey.PARTY_TYPE:
|
||||
return !!globalScene.getPlayerParty().find(p => p.getTypes(false, false, true).indexOf(cond.pkmnType) > -1)
|
||||
case EvoCondKey.EVO_TREASURE_TRACKER:
|
||||
return pokemon.getHeldItems().some(m => m.is("EvoTrackerModifier") && m.getStackCount() >= cond.value);
|
||||
return pokemon.getHeldItems().some(m =>
|
||||
m.is("EvoTrackerModifier") &&
|
||||
m.getStackCount() + pokemon.getPersistentTreasureCount() >= cond.value
|
||||
);
|
||||
case EvoCondKey.GENDER:
|
||||
return pokemon.gender === cond.gender;
|
||||
case EvoCondKey.SHEDINJA: // Shedinja cannot be evolved into directly
|
||||
|
@ -5449,6 +5449,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
this.turnData.berriesEaten.push(berryType);
|
||||
}
|
||||
|
||||
getPersistentTreasureCount(): number {
|
||||
return this.getHeldItems().filter(m => m.is("DamageMoneyRewardModifier")).length +
|
||||
globalScene.findModifiers(
|
||||
m =>
|
||||
m.is("MoneyMultiplierModifier") ||
|
||||
m.is("ExtraModifierModifier"),
|
||||
).length;
|
||||
}
|
||||
}
|
||||
|
||||
export class PlayerPokemon extends Pokemon {
|
||||
|
@ -923,21 +923,13 @@ export class EvoTrackerModifier extends PokemonHeldItemModifier {
|
||||
}
|
||||
|
||||
getIconStackText(virtual?: boolean): Phaser.GameObjects.BitmapText | null {
|
||||
const pokemon = globalScene.getPokemonById(this.pokemonId);
|
||||
const pokemon = this.getPokemon();
|
||||
|
||||
this.virtualStackCount = pokemon
|
||||
? pokemon.getHeldItems().filter(m => m instanceof DamageMoneyRewardModifier).length +
|
||||
globalScene.findModifiers(
|
||||
m =>
|
||||
m instanceof MoneyMultiplierModifier ||
|
||||
m instanceof ExtraModifierModifier ||
|
||||
m instanceof TempExtraModifierModifier,
|
||||
).length
|
||||
: 0;
|
||||
const count = (pokemon?.getPersistentTreasureCount() || 0) + this.getStackCount();
|
||||
|
||||
const text = globalScene.add.bitmapText(10, 15, "item-count", this.getStackCount().toString(), 11);
|
||||
const text = globalScene.add.bitmapText(10, 15, "item-count", count.toString(), 11);
|
||||
text.letterSpacing = -0.5;
|
||||
if (this.getStackCount() >= this.required) {
|
||||
if (count >= this.required) {
|
||||
text.setTint(0xf89890);
|
||||
}
|
||||
text.setOrigin(0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user