Update fight-ui-info to cast opponents to EnemyPokemon

This commit is contained in:
Sirz Benjie 2025-04-22 21:13:52 -05:00
parent e4d74d9c1c
commit 61072830a4
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -10,7 +10,7 @@ import { getLocalizedSpriteKey, fixedInt, padInt } from "#app/utils/common";
import { MoveCategory } from "#enums/MoveCategory";
import i18next from "i18next";
import { Button } from "#enums/buttons";
import type { PokemonMove } from "#app/field/pokemon";
import type { EnemyPokemon, PokemonMove } from "#app/field/pokemon";
import type Pokemon from "#app/field/pokemon";
import type { CommandPhase } from "#app/phases/command-phase";
import MoveInfoOverlay from "./move-info-overlay";
@ -279,7 +279,7 @@ export default class FightUiHandler extends UiHandler implements InfoToggle {
this.moveInfoOverlay.show(pokemonMove.getMove());
pokemon.getOpponents().forEach(opponent => {
opponent.updateEffectiveness(this.getEffectivenessText(pokemon, opponent, pokemonMove));
(opponent as EnemyPokemon).updateEffectiveness(this.getEffectivenessText(pokemon, opponent, pokemonMove));
});
}
@ -391,7 +391,7 @@ export default class FightUiHandler extends UiHandler implements InfoToggle {
const opponents = (globalScene.getCurrentPhase() as CommandPhase).getPokemon().getOpponents();
opponents.forEach(opponent => {
opponent.updateEffectiveness(undefined);
(opponent as EnemyPokemon).updateEffectiveness(undefined);
});
}