mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-19 06:42:20 +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 { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { FRIENDSHIP_GAIN_FROM_BATTLE } from "#app/data/balance/starters";
|
import { FRIENDSHIP_GAIN_FROM_BATTLE } from "#app/data/balance/starters";
|
||||||
import { StatusEffect } from "#enums/status-effect";
|
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 { ShowAbilityPhase } from "#app/phases/show-ability-phase";
|
||||||
import { HideAbilityPhase } from "#app/phases/hide-ability-phase";
|
import { HideAbilityPhase } from "#app/phases/hide-ability-phase";
|
||||||
import { timedEventManager } from "./global-event-manager";
|
import { timedEventManager } from "./global-event-manager";
|
||||||
@ -2665,7 +2665,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
case "mystery_encounter_delibirdy": // Firel Delibirdy
|
case "mystery_encounter_delibirdy": // Firel Delibirdy
|
||||||
return 82.28;
|
return 82.28;
|
||||||
case "title_afd": // Andr06 - PokéRogue Title Remix (AFD)
|
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)
|
case "battle_rival_3_afd": // Andr06 - Final N Battle Remix (AFD)
|
||||||
return 49.147;
|
return 49.147;
|
||||||
}
|
}
|
||||||
@ -2937,11 +2937,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
* @param show Whether to show or hide the bar
|
* @param show Whether to show or hide the bar
|
||||||
*/
|
*/
|
||||||
public queueAbilityDisplay(pokemon: Pokemon, passive: boolean, show: boolean): void {
|
public queueAbilityDisplay(pokemon: Pokemon, passive: boolean, show: boolean): void {
|
||||||
this.unshiftPhase(
|
this.unshiftPhase(show ? new ShowAbilityPhase(pokemon.getBattlerIndex(), passive) : new HideAbilityPhase());
|
||||||
show
|
|
||||||
? new ShowAbilityPhase(pokemon.getBattlerIndex(), passive)
|
|
||||||
: new HideAbilityPhase(pokemon.getBattlerIndex(), passive),
|
|
||||||
);
|
|
||||||
this.clearPhaseQueueSplice();
|
this.clearPhaseQueueSplice();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ 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;
|
||||||
@ -45,6 +46,10 @@ export class GameOverPhase extends BattlePhase {
|
|||||||
start() {
|
start() {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
|
if (globalScene.abilityBar.isVisible()) {
|
||||||
|
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) {
|
||||||
this.isVictory = true;
|
this.isVictory = true;
|
||||||
|
@ -1,27 +1,12 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { BattlerIndex } from "#app/battle";
|
import { Phase } from "#app/phase";
|
||||||
import { PokemonPhase } from "./pokemon-phase";
|
|
||||||
|
|
||||||
export class HideAbilityPhase extends PokemonPhase {
|
|
||||||
private passive: boolean;
|
|
||||||
|
|
||||||
constructor(battlerIndex: BattlerIndex, passive = false) {
|
|
||||||
super(battlerIndex);
|
|
||||||
|
|
||||||
this.passive = passive;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
export class HideAbilityPhase extends Phase {
|
||||||
start() {
|
start() {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
const pokemon = this.getPokemon();
|
globalScene.abilityBar.hide().then(() => {
|
||||||
|
|
||||||
if (pokemon) {
|
|
||||||
globalScene.abilityBar.hide().then(() => {
|
|
||||||
this.end();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.end();
|
this.end();
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -334,12 +334,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
target.getPassiveAbility().hasAttr(ReflectStatusMoveAbAttr),
|
target.getPassiveAbility().hasAttr(ReflectStatusMoveAbAttr),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
queuedPhases.push(
|
queuedPhases.push(new HideAbilityPhase());
|
||||||
new HideAbilityPhase(
|
|
||||||
target.getBattlerIndex(),
|
|
||||||
target.getPassiveAbility().hasAttr(ReflectStatusMoveAbAttr),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
queuedPhases.push(
|
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 the bar is already out, hide it before showing the new one
|
||||||
if (globalScene.abilityBar.isVisible()) {
|
if (globalScene.abilityBar.isVisible()) {
|
||||||
globalScene.unshiftPhase(new HideAbilityPhase(this.battlerIndex, this.passive));
|
globalScene.unshiftPhase(new HideAbilityPhase());
|
||||||
globalScene.unshiftPhase(new ShowAbilityPhase(this.battlerIndex, this.passive));
|
globalScene.unshiftPhase(new ShowAbilityPhase(this.battlerIndex, this.passive));
|
||||||
return this.end();
|
return this.end();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user