Record clears for failed daily runs

pull/16/head
Flashfyre 2024-03-17 20:31:09 -04:00
parent 9805329228
commit f13e1ffa47
3 changed files with 8 additions and 5 deletions

View File

@ -13,7 +13,8 @@ import { PokemonHeldItemModifier } from "./modifier/modifier";
export enum BattleType {
WILD,
TRAINER
TRAINER,
CLEAR
}
export enum BattlerIndex {

View File

@ -2960,8 +2960,10 @@ export class VictoryPhase extends PokemonPhase {
}
}
this.scene.pushPhase(new NewBattlePhase(this.scene));
} else
} else {
this.scene.currentBattle.battleType = BattleType.CLEAR;
this.scene.pushPhase(new GameOverPhase(this.scene, true));
}
}
this.end();
@ -3107,7 +3109,7 @@ export class GameOverPhase extends BattlePhase {
start() {
super.start();
(this.victory ? this.scene.gameData.tryClearSession(this.scene, this.scene.sessionSlotId) : this.scene.gameData.deleteSession(this.scene.sessionSlotId)).then((success: boolean | [boolean, boolean]) => {
this.scene.gameData.tryClearSession(this.scene, this.scene.sessionSlotId).then((success: boolean | [boolean, boolean]) => {
this.scene.time.delayedCall(1000, () => {
let firstClear = false;
if (this.victory && success[1]) {

View File

@ -21,14 +21,14 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
}
setup() {
const titleWindow = addWindow(this.scene, 0, 0, 110, 16, false, false, null, null, WindowVariant.THIN);
const titleWindow = addWindow(this.scene, 0, 0, 104, 16, false, false, null, null, WindowVariant.THIN);
this.add(titleWindow);
this.titleLabel = addTextObject(this.scene, titleWindow.displayWidth / 2, titleWindow.displayHeight / 2, 'Daily Rankings', TextStyle.WINDOW, { fontSize: '64px' });
this.titleLabel.setOrigin(0.5, 0.5);
this.add(this.titleLabel);
const window = addWindow(this.scene, 0, 15, 110, 115, false, false, null, null, WindowVariant.THIN);
const window = addWindow(this.scene, 0, 15, 104, 115, false, false, null, null, WindowVariant.THIN);
this.add(window);
this.rankingsContainer = this.scene.add.container(6, 19);