diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 803313a023c..01b7c3949f7 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -90,6 +90,7 @@ export default class BattleScene extends SceneBase { public seVolume: number = 1; public gameSpeed: integer = 1; public damageNumbersMode: integer = 0; + public reroll: boolean = false; public showMovesetFlyout: boolean = true; public showLevelUpStats: boolean = true; public enableTutorials: boolean = import.meta.env.VITE_BYPASS_TUTORIAL === "1"; @@ -1311,6 +1312,7 @@ export default class BattleScene extends SceneBase { const formattedMoney = this.moneyFormat === MoneyFormat.ABBREVIATED ? Utils.formatFancyLargeNumber(this.money, 3) : this.money.toLocaleString(); this.moneyText.setText(`₽${formattedMoney}`); + this.fieldUI.moveAbove(this.moneyText, this.luckText); if (forceVisible) { this.moneyText.setVisible(true); } @@ -1322,12 +1324,8 @@ export default class BattleScene extends SceneBase { } updateAndShowText(duration: integer): void { - this.fieldUI.moveBelow(this.moneyText, this.luckText); const labels = [ this.luckLabelText, this.luckText ]; - labels.map(t => { - t.setAlpha(0); - t.setVisible(true); - }); + labels.forEach(t => t.setAlpha(0)); const luckValue = getPartyLuckValue(this.getParty()); this.luckText.setText(getLuckString(luckValue)); if (luckValue < 14) { @@ -1339,18 +1337,24 @@ export default class BattleScene extends SceneBase { this.tweens.add({ targets: labels, duration: duration, - alpha: 1 + alpha: 1, + onComplete: () => { + labels.forEach(t => t.setVisible(true)); + } }); } hideLuckText(duration: integer): void { + if (this.reroll) { + return; + } const labels = [ this.luckLabelText, this.luckText ]; this.tweens.add({ targets: labels, duration: duration, alpha: 0, onComplete: () => { - labels.map(l => l.setVisible(false)); + labels.forEach(l => l.setVisible(false)); } }); } diff --git a/src/phases.ts b/src/phases.ts index b9fdc095107..dd272cb28ca 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -4853,6 +4853,8 @@ export class SelectModifierPhase extends BattlePhase { if (!this.rerollCount) { this.updateSeed(); + } else { + this.scene.reroll = false; } const party = this.scene.getParty(); @@ -4884,6 +4886,7 @@ export class SelectModifierPhase extends BattlePhase { this.scene.ui.playError(); return false; } else { + this.scene.reroll = true; this.scene.unshiftPhase(new SelectModifierPhase(this.scene, this.rerollCount + 1, typeOptions.map(o => o.type.tier))); this.scene.ui.clearText(); this.scene.ui.setMode(Mode.MESSAGE).then(() => super.end()); diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index f347979aaaf..37718243b8b 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -147,6 +147,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { this.scene.showFieldOverlay(750); this.scene.updateAndShowText(750); + this.scene.updateMoneyText(); let i = 0; @@ -382,7 +383,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { this.eraseCursor(); this.scene.hideFieldOverlay(250); - this.scene.hideLuckText(750); + this.scene.hideLuckText(250); const options = this.options.concat(this.shopOptionsRows.flat()); this.options.splice(0, this.options.length);