Grant a single voucher for defeating a boss trainer for subsequent times
This commit is contained in:
parent
524cd99eda
commit
51b833f779
|
@ -2378,16 +2378,18 @@ export class TrainerVictoryPhase extends BattlePhase {
|
||||||
start() {
|
start() {
|
||||||
this.scene.playBgm(this.scene.currentBattle.trainer.config.victoryBgm);
|
this.scene.playBgm(this.scene.currentBattle.trainer.config.victoryBgm);
|
||||||
|
|
||||||
const trainerType = this.scene.currentBattle.trainer.config.trainerType;
|
|
||||||
if (vouchers.hasOwnProperty(TrainerType[trainerType]))
|
|
||||||
this.scene.validateVoucher(vouchers[TrainerType[trainerType]]);
|
|
||||||
|
|
||||||
this.scene.unshiftPhase(new MoneyRewardPhase(this.scene, this.scene.currentBattle.trainer.config.moneyMultiplier));
|
this.scene.unshiftPhase(new MoneyRewardPhase(this.scene, this.scene.currentBattle.trainer.config.moneyMultiplier));
|
||||||
|
|
||||||
const modifierRewardFuncs = this.scene.currentBattle.trainer.config.modifierRewardFuncs;
|
const modifierRewardFuncs = this.scene.currentBattle.trainer.config.modifierRewardFuncs;
|
||||||
for (let modifierRewardFunc of modifierRewardFuncs)
|
for (let modifierRewardFunc of modifierRewardFuncs)
|
||||||
this.scene.unshiftPhase(new ModifierRewardPhase(this.scene, modifierRewardFunc));
|
this.scene.unshiftPhase(new ModifierRewardPhase(this.scene, modifierRewardFunc));
|
||||||
|
|
||||||
|
const trainerType = this.scene.currentBattle.trainer.config.trainerType;
|
||||||
|
if (vouchers.hasOwnProperty(TrainerType[trainerType])) {
|
||||||
|
if (!this.scene.validateVoucher(vouchers[TrainerType[trainerType]]) && this.scene.currentBattle.trainer.config.isBoss)
|
||||||
|
this.scene.pushPhase(new ModifierRewardPhase(this.scene, modifierTypes.VOUCHER));
|
||||||
|
}
|
||||||
|
|
||||||
this.scene.ui.showText(`You defeated\n${this.scene.currentBattle.trainer.getName()}!`, null, () => {
|
this.scene.ui.showText(`You defeated\n${this.scene.currentBattle.trainer.getName()}!`, null, () => {
|
||||||
const defeatMessages = this.scene.currentBattle.trainer.config.victoryMessages;
|
const defeatMessages = this.scene.currentBattle.trainer.config.victoryMessages;
|
||||||
let showMessageAndEnd = () => this.end();
|
let showMessageAndEnd = () => this.end();
|
||||||
|
|
Loading…
Reference in New Issue