Fix bug with rival dialogue not using gender
parent
e8d7bab4e0
commit
6daadbd81a
|
@ -581,6 +581,9 @@ export class EncounterPhase extends BattlePhase {
|
|||
doSummon();
|
||||
else {
|
||||
let message: string;
|
||||
if (trainer.config.hasGenders && trainer.config.encounterMessages.length === 2)
|
||||
message = this.scene.currentBattle.trainer.config.encounterMessages[trainer.female ? 1 : 0];
|
||||
else
|
||||
this.scene.executeWithSeedOffset(() => message = Phaser.Math.RND.pick(this.scene.currentBattle.trainer.config.encounterMessages), this.scene.currentBattle.waveIndex);
|
||||
this.scene.ui.showDialogue(message, trainer.getName(), null, doSummon, null, true);
|
||||
}
|
||||
|
@ -2748,6 +2751,9 @@ export class TrainerVictoryPhase extends BattlePhase {
|
|||
let showMessageAndEnd = () => this.end();
|
||||
if (defeatMessages.length) {
|
||||
let message: string;
|
||||
if (this.scene.currentBattle.trainer.config.hasGenders && this.scene.currentBattle.trainer.config.victoryMessages.length === 2)
|
||||
message = this.scene.currentBattle.trainer.config.encounterMessages[this.scene.currentBattle.trainer.female ? 1 : 0];
|
||||
else
|
||||
this.scene.executeWithSeedOffset(() => message = Phaser.Math.RND.pick(this.scene.currentBattle.trainer.config.victoryMessages), this.scene.currentBattle.waveIndex);
|
||||
const messagePages = message.split(/\$/g).map(m => m.trim());
|
||||
|
||||
|
|
Loading…
Reference in New Issue