From b70bc05ae78a181260ce78036514a791d2593c05 Mon Sep 17 00:00:00 2001 From: muscode13 Date: Tue, 19 Nov 2024 20:10:38 -0600 Subject: [PATCH] darken pkmn icon when nullified --- src/battle-scene.ts | 7 ++++++- src/modifier/modifier.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 2f062667808..da11fdf2d9d 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -949,7 +949,7 @@ export default class BattleScene extends SceneBase { this.updateModifiers(true); } - addPokemonIcon(pokemon: Pokemon, x: number, y: number, originX: number = 0.5, originY: number = 0.5, ignoreOverride: boolean = false): Phaser.GameObjects.Container { + addPokemonIcon(pokemon: Pokemon, x: number, y: number, originX: number = 0.5, originY: number = 0.5, ignoreOverride: boolean = false, tint?: boolean): Phaser.GameObjects.Container { const container = this.add.container(x, y); container.setName(`${pokemon.name}-icon`); @@ -966,6 +966,11 @@ export default class BattleScene extends SceneBase { pokemon.shiny = temp; } icon.setOrigin(0.5, 0); + if (tint) { + icon.setTint(0x838383); + } else { + icon.clearTint(); + } container.add(icon); diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 3e4f1b20f5d..f1f43695375 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -707,7 +707,7 @@ export abstract class PokemonHeldItemModifier extends PersistentModifier { if (!forSummary) { const pokemon = this.getPokemon(scene); if (pokemon) { - const pokemonIcon = scene.addPokemonIcon(pokemon, -2, 10, 0, 0.5); + const pokemonIcon = scene.addPokemonIcon(pokemon, -2, 10, 0, 0.5, false, this.isNullified); container.add(pokemonIcon); container.setName(pokemon.id.toString()); }