pokerogue/src/phases/show-ability-phase.ts
2024-08-19 03:23:52 +01:00

30 lines
659 B
TypeScript

import BattleScene from "#app/battle-scene.js";
import { BattlerIndex } from "#app/battle.js";
import { PokemonPhase } from "./pokemon-phase";
export class ShowAbilityPhase extends PokemonPhase {
private passive: boolean;
constructor(scene: BattleScene, battlerIndex: BattlerIndex, passive: boolean = false) {
super(scene, battlerIndex);
this.passive = passive;
}
start() {
super.start();
const pokemon = this.getPokemon();
if (pokemon) {
this.scene.abilityBar.showAbility(pokemon, this.passive);
if (pokemon?.battleData) {
pokemon.battleData.abilityRevealed = true;
}
}
this.end();
}
}