darken pkmn icon when nullified

This commit is contained in:
muscode13 2024-11-19 20:10:38 -06:00
parent 4674fc23c9
commit b70bc05ae7
2 changed files with 7 additions and 2 deletions

View File

@ -949,7 +949,7 @@ export default class BattleScene extends SceneBase {
this.updateModifiers(true); 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); const container = this.add.container(x, y);
container.setName(`${pokemon.name}-icon`); container.setName(`${pokemon.name}-icon`);
@ -966,6 +966,11 @@ export default class BattleScene extends SceneBase {
pokemon.shiny = temp; pokemon.shiny = temp;
} }
icon.setOrigin(0.5, 0); icon.setOrigin(0.5, 0);
if (tint) {
icon.setTint(0x838383);
} else {
icon.clearTint();
}
container.add(icon); container.add(icon);

View File

@ -707,7 +707,7 @@ export abstract class PokemonHeldItemModifier extends PersistentModifier {
if (!forSummary) { if (!forSummary) {
const pokemon = this.getPokemon(scene); const pokemon = this.getPokemon(scene);
if (pokemon) { 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.add(pokemonIcon);
container.setName(pokemon.id.toString()); container.setName(pokemon.id.toString());
} }