diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 7ab96566ef5..9e2383f6588 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -167,7 +167,7 @@ import { ExpGainsSpeed } from "#enums/exp-gains-speed"; import { BattlerTagType } from "#enums/battler-tag-type"; import { FRIENDSHIP_GAIN_FROM_BATTLE } from "#app/data/balance/starters"; import { StatusEffect } from "#enums/status-effect"; -import { globalScene, initGlobalScene } from "#app/global-scene"; +import { initGlobalScene } from "#app/global-scene"; import { ShowAbilityPhase } from "#app/phases/show-ability-phase"; import { HideAbilityPhase } from "#app/phases/hide-ability-phase"; import { timedEventManager } from "./global-event-manager"; @@ -2665,7 +2665,7 @@ export default class BattleScene extends SceneBase { case "mystery_encounter_delibirdy": // Firel Delibirdy return 82.28; case "title_afd": // Andr06 - PokéRogue Title Remix (AFD) - return 47.660; + return 47.66; case "battle_rival_3_afd": // Andr06 - Final N Battle Remix (AFD) return 49.147; } @@ -2937,11 +2937,7 @@ export default class BattleScene extends SceneBase { * @param show Whether to show or hide the bar */ public queueAbilityDisplay(pokemon: Pokemon, passive: boolean, show: boolean): void { - this.unshiftPhase( - show - ? new ShowAbilityPhase(pokemon.getBattlerIndex(), passive) - : new HideAbilityPhase(pokemon.getBattlerIndex(), passive), - ); + this.unshiftPhase(show ? new ShowAbilityPhase(pokemon.getBattlerIndex(), passive) : new HideAbilityPhase()); this.clearPhaseQueueSplice(); } diff --git a/src/phases/game-over-phase.ts b/src/phases/game-over-phase.ts index 2090592367d..569f3f724c5 100644 --- a/src/phases/game-over-phase.ts +++ b/src/phases/game-over-phase.ts @@ -31,6 +31,7 @@ import ChallengeData from "#app/system/challenge-data"; import TrainerData from "#app/system/trainer-data"; import ArenaData from "#app/system/arena-data"; import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; +import { HideAbilityPhase } from "#app/phases/hide-ability-phase"; export class GameOverPhase extends BattlePhase { private isVictory: boolean; @@ -45,6 +46,10 @@ export class GameOverPhase extends BattlePhase { start() { super.start(); + if (globalScene.abilityBar.isVisible()) { + globalScene.unshiftPhase(new HideAbilityPhase()); + } + // Failsafe if players somehow skip floor 200 in classic mode if (globalScene.gameMode.isClassic && globalScene.currentBattle.waveIndex > 200) { this.isVictory = true; diff --git a/src/phases/hide-ability-phase.ts b/src/phases/hide-ability-phase.ts index 0745b3f832a..142bb4b251d 100644 --- a/src/phases/hide-ability-phase.ts +++ b/src/phases/hide-ability-phase.ts @@ -1,27 +1,12 @@ import { globalScene } from "#app/global-scene"; -import type { BattlerIndex } from "#app/battle"; -import { PokemonPhase } from "./pokemon-phase"; - -export class HideAbilityPhase extends PokemonPhase { - private passive: boolean; - - constructor(battlerIndex: BattlerIndex, passive = false) { - super(battlerIndex); - - this.passive = passive; - } +import { Phase } from "#app/phase"; +export class HideAbilityPhase extends Phase { start() { super.start(); - const pokemon = this.getPokemon(); - - if (pokemon) { - globalScene.abilityBar.hide().then(() => { - this.end(); - }); - } else { + globalScene.abilityBar.hide().then(() => { this.end(); - } + }); } } diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index 566d5c94d0f..bd1c9caad96 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -334,12 +334,7 @@ export class MoveEffectPhase extends PokemonPhase { target.getPassiveAbility().hasAttr(ReflectStatusMoveAbAttr), ), ); - queuedPhases.push( - new HideAbilityPhase( - target.getBattlerIndex(), - target.getPassiveAbility().hasAttr(ReflectStatusMoveAbAttr), - ), - ); + queuedPhases.push(new HideAbilityPhase()); } queuedPhases.push( diff --git a/src/phases/show-ability-phase.ts b/src/phases/show-ability-phase.ts index 1b3c6dde568..8097af33fe0 100644 --- a/src/phases/show-ability-phase.ts +++ b/src/phases/show-ability-phase.ts @@ -35,7 +35,7 @@ export class ShowAbilityPhase extends PokemonPhase { // If the bar is already out, hide it before showing the new one if (globalScene.abilityBar.isVisible()) { - globalScene.unshiftPhase(new HideAbilityPhase(this.battlerIndex, this.passive)); + globalScene.unshiftPhase(new HideAbilityPhase()); globalScene.unshiftPhase(new ShowAbilityPhase(this.battlerIndex, this.passive)); return this.end(); }