Hide ability bar in TurnEndPhase

This commit is contained in:
Dean 2025-04-01 23:01:07 -07:00
parent b6761bb9b7
commit 2a73582cf1
3 changed files with 12 additions and 4 deletions

View File

@ -2941,6 +2941,15 @@ export default class BattleScene extends SceneBase {
this.clearPhaseQueueSplice(); this.clearPhaseQueueSplice();
} }
/**
* Hides the ability bar if it is currently visible
*/
public hideAbilityBar(): void {
if (this.abilityBar.isVisible()) {
this.unshiftPhase(new HideAbilityPhase());
}
}
/** /**
* Moves everything from nextCommandPhaseQueue to phaseQueue (keeping order) * Moves everything from nextCommandPhaseQueue to phaseQueue (keeping order)
*/ */

View File

@ -31,7 +31,6 @@ import ChallengeData from "#app/system/challenge-data";
import TrainerData from "#app/system/trainer-data"; import TrainerData from "#app/system/trainer-data";
import ArenaData from "#app/system/arena-data"; import ArenaData from "#app/system/arena-data";
import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
import { HideAbilityPhase } from "#app/phases/hide-ability-phase";
export class GameOverPhase extends BattlePhase { export class GameOverPhase extends BattlePhase {
private isVictory: boolean; private isVictory: boolean;
@ -46,9 +45,7 @@ export class GameOverPhase extends BattlePhase {
start() { start() {
super.start(); super.start();
if (globalScene.abilityBar.isVisible()) { globalScene.hideAbilityBar();
globalScene.unshiftPhase(new HideAbilityPhase());
}
// Failsafe if players somehow skip floor 200 in classic mode // Failsafe if players somehow skip floor 200 in classic mode
if (globalScene.gameMode.isClassic && globalScene.currentBattle.waveIndex > 200) { if (globalScene.gameMode.isClassic && globalScene.currentBattle.waveIndex > 200) {

View File

@ -28,6 +28,8 @@ export class TurnEndPhase extends FieldPhase {
globalScene.currentBattle.incrementTurn(); globalScene.currentBattle.incrementTurn();
globalScene.eventTarget.dispatchEvent(new TurnEndEvent(globalScene.currentBattle.turn)); globalScene.eventTarget.dispatchEvent(new TurnEndEvent(globalScene.currentBattle.turn));
globalScene.hideAbilityBar();
const handlePokemon = (pokemon: Pokemon) => { const handlePokemon = (pokemon: Pokemon) => {
if (!pokemon.switchOutStatus) { if (!pokemon.switchOutStatus) {
pokemon.lapseTags(BattlerTagLapseType.TURN_END); pokemon.lapseTags(BattlerTagLapseType.TURN_END);