mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-18 14:22:19 +02:00
Hide ability bar on game over
This commit is contained in:
parent
89b9ef35cc
commit
b6761bb9b7
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -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(
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user