show luck after reroll
This commit is contained in:
parent
3b852c5bf2
commit
ed7a4045d8
|
@ -90,6 +90,7 @@ export default class BattleScene extends SceneBase {
|
||||||
public seVolume: number = 1;
|
public seVolume: number = 1;
|
||||||
public gameSpeed: integer = 1;
|
public gameSpeed: integer = 1;
|
||||||
public damageNumbersMode: integer = 0;
|
public damageNumbersMode: integer = 0;
|
||||||
|
public reroll: boolean = false;
|
||||||
public showMovesetFlyout: boolean = true;
|
public showMovesetFlyout: boolean = true;
|
||||||
public showLevelUpStats: boolean = true;
|
public showLevelUpStats: boolean = true;
|
||||||
public enableTutorials: boolean = import.meta.env.VITE_BYPASS_TUTORIAL === "1";
|
public enableTutorials: boolean = import.meta.env.VITE_BYPASS_TUTORIAL === "1";
|
||||||
|
@ -1311,6 +1312,7 @@ export default class BattleScene extends SceneBase {
|
||||||
const formattedMoney =
|
const formattedMoney =
|
||||||
this.moneyFormat === MoneyFormat.ABBREVIATED ? Utils.formatFancyLargeNumber(this.money, 3) : this.money.toLocaleString();
|
this.moneyFormat === MoneyFormat.ABBREVIATED ? Utils.formatFancyLargeNumber(this.money, 3) : this.money.toLocaleString();
|
||||||
this.moneyText.setText(`₽${formattedMoney}`);
|
this.moneyText.setText(`₽${formattedMoney}`);
|
||||||
|
this.fieldUI.moveAbove(this.moneyText, this.luckText);
|
||||||
if (forceVisible) {
|
if (forceVisible) {
|
||||||
this.moneyText.setVisible(true);
|
this.moneyText.setVisible(true);
|
||||||
}
|
}
|
||||||
|
@ -1322,12 +1324,8 @@ export default class BattleScene extends SceneBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateAndShowText(duration: integer): void {
|
updateAndShowText(duration: integer): void {
|
||||||
this.fieldUI.moveBelow(this.moneyText, this.luckText);
|
|
||||||
const labels = [ this.luckLabelText, this.luckText ];
|
const labels = [ this.luckLabelText, this.luckText ];
|
||||||
labels.map(t => {
|
labels.forEach(t => t.setAlpha(0));
|
||||||
t.setAlpha(0);
|
|
||||||
t.setVisible(true);
|
|
||||||
});
|
|
||||||
const luckValue = getPartyLuckValue(this.getParty());
|
const luckValue = getPartyLuckValue(this.getParty());
|
||||||
this.luckText.setText(getLuckString(luckValue));
|
this.luckText.setText(getLuckString(luckValue));
|
||||||
if (luckValue < 14) {
|
if (luckValue < 14) {
|
||||||
|
@ -1339,18 +1337,24 @@ export default class BattleScene extends SceneBase {
|
||||||
this.tweens.add({
|
this.tweens.add({
|
||||||
targets: labels,
|
targets: labels,
|
||||||
duration: duration,
|
duration: duration,
|
||||||
alpha: 1
|
alpha: 1,
|
||||||
|
onComplete: () => {
|
||||||
|
labels.forEach(t => t.setVisible(true));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
hideLuckText(duration: integer): void {
|
hideLuckText(duration: integer): void {
|
||||||
|
if (this.reroll) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const labels = [ this.luckLabelText, this.luckText ];
|
const labels = [ this.luckLabelText, this.luckText ];
|
||||||
this.tweens.add({
|
this.tweens.add({
|
||||||
targets: labels,
|
targets: labels,
|
||||||
duration: duration,
|
duration: duration,
|
||||||
alpha: 0,
|
alpha: 0,
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
labels.map(l => l.setVisible(false));
|
labels.forEach(l => l.setVisible(false));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -4853,6 +4853,8 @@ export class SelectModifierPhase extends BattlePhase {
|
||||||
|
|
||||||
if (!this.rerollCount) {
|
if (!this.rerollCount) {
|
||||||
this.updateSeed();
|
this.updateSeed();
|
||||||
|
} else {
|
||||||
|
this.scene.reroll = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const party = this.scene.getParty();
|
const party = this.scene.getParty();
|
||||||
|
@ -4884,6 +4886,7 @@ export class SelectModifierPhase extends BattlePhase {
|
||||||
this.scene.ui.playError();
|
this.scene.ui.playError();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
this.scene.reroll = true;
|
||||||
this.scene.unshiftPhase(new SelectModifierPhase(this.scene, this.rerollCount + 1, typeOptions.map(o => o.type.tier)));
|
this.scene.unshiftPhase(new SelectModifierPhase(this.scene, this.rerollCount + 1, typeOptions.map(o => o.type.tier)));
|
||||||
this.scene.ui.clearText();
|
this.scene.ui.clearText();
|
||||||
this.scene.ui.setMode(Mode.MESSAGE).then(() => super.end());
|
this.scene.ui.setMode(Mode.MESSAGE).then(() => super.end());
|
||||||
|
|
|
@ -147,6 +147,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
|
||||||
|
|
||||||
this.scene.showFieldOverlay(750);
|
this.scene.showFieldOverlay(750);
|
||||||
this.scene.updateAndShowText(750);
|
this.scene.updateAndShowText(750);
|
||||||
|
this.scene.updateMoneyText();
|
||||||
|
|
||||||
let i = 0;
|
let i = 0;
|
||||||
|
|
||||||
|
@ -382,7 +383,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
|
||||||
this.eraseCursor();
|
this.eraseCursor();
|
||||||
|
|
||||||
this.scene.hideFieldOverlay(250);
|
this.scene.hideFieldOverlay(250);
|
||||||
this.scene.hideLuckText(750);
|
this.scene.hideLuckText(250);
|
||||||
|
|
||||||
const options = this.options.concat(this.shopOptionsRows.flat());
|
const options = this.options.concat(this.shopOptionsRows.flat());
|
||||||
this.options.splice(0, this.options.length);
|
this.options.splice(0, this.options.length);
|
||||||
|
|
Loading…
Reference in New Issue