Update modifier bar is now called in the apply of consumable held items

This commit is contained in:
Wlowscha 2025-06-01 21:24:16 +02:00
parent b885b9c62c
commit db580a6735
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
2 changed files with 4 additions and 6 deletions

View File

@ -113,11 +113,13 @@ export class ConsumableHeldItem extends HeldItem {
return true; return true;
} }
apply(pokemon: Pokemon): boolean { apply(pokemon: Pokemon, isPlayer: boolean): boolean {
const consumed = this.applyConsumable(pokemon); const consumed = this.applyConsumable(pokemon);
if (consumed) { if (consumed) {
pokemon.heldItemManager.remove(this.type, 1); pokemon.heldItemManager.remove(this.type, 1);
// TODO: Turn this into updateItemBar or something
globalScene.updateModifiers(isPlayer);
return true; return true;
} }

View File

@ -239,11 +239,7 @@ export class StatStageChangePhase extends PokemonPhase {
); );
if (!(existingPhase instanceof StatStageChangePhase)) { if (!(existingPhase instanceof StatStageChangePhase)) {
// Apply White Herb if needed // Apply White Herb if needed
const whiteHerb = applyResetNegativeStatStageHeldItem(pokemon); applyResetNegativeStatStageHeldItem(pokemon);
// If the White Herb was applied, update scene modifiers
if (whiteHerb) {
globalScene.updateModifiers(this.player);
}
} }
pokemon.updateInfo(); pokemon.updateInfo();