show luck after reroll

This commit is contained in:
Matthew Olker 2024-05-30 13:45:30 -04:00
parent 3b852c5bf2
commit ed7a4045d8
3 changed files with 16 additions and 8 deletions

View File

@ -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));
}
});
}

View File

@ -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());

View File

@ -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);