Run History basic Interpretation

This commit is contained in:
frutescens 2024-09-16 15:07:07 -07:00
parent 72afdcf0a0
commit d011a3fd79
2 changed files with 6 additions and 4 deletions

View File

@ -281,7 +281,7 @@ class RunEntryContainer extends Phaser.GameObjects.Container {
const genderIndex = this.scene.gameData.gender ?? PlayerGender.UNSET;
const genderStr = PlayerGender[genderIndex].toLowerCase();
// Defeats from wild Pokemon battles will show the Pokemon responsible by the text of the run result.
if (data.battleType === BattleType.WILD) {
if (data.battleType === BattleType.WILD || (data.battleType === BattleType.MYSTERY_ENCOUNTER && !data.trainer)) {
const enemyContainer = this.scene.add.container(8, 5);
const gameOutcomeLabel = addTextObject(this.scene, 0, 0, `${i18next.t("runHistory:defeatedWild", { context: genderStr })}`, TextStyle.WINDOW);
enemyContainer.add(gameOutcomeLabel);
@ -302,7 +302,7 @@ class RunEntryContainer extends Phaser.GameObjects.Container {
enemy.destroy();
});
this.add(enemyContainer);
} else if (data.battleType === BattleType.TRAINER) { // Defeats from Trainers show the trainer's title and name
} else if (data.battleType === BattleType.TRAINER || (data.battleType === BattleType.MYSTERY_ENCOUNTER && data.trainer)) { // Defeats from Trainers show the trainer's title and name
const tObj = data.trainer.toTrainer(this.scene);
// Because of the interesting mechanics behind rival names, the rival name and title have to be retrieved differently
const RIVAL_TRAINER_ID_THRESHOLD = 375;

View File

@ -93,6 +93,7 @@ export default class RunInfoUiHandler extends UiHandler {
const run = args[0];
// Assigning information necessary for the UI's creation
this.runInfo = this.scene.gameData.parseSessionData(JSON.stringify(run.entry));
console.log(this.runInfo);
this.isVictory = run.isVictory;
this.pageMode = RunInfoUiMode.MAIN;
@ -211,18 +212,19 @@ export default class RunInfoUiHandler extends UiHandler {
if (!this.isVictory) {
const enemyContainer = this.scene.add.container(0, 0);
// Wild - Single and Doubles
if (this.runInfo.battleType === BattleType.WILD) {
if (this.runInfo.battleType === BattleType.WILD || (this.runInfo.battleType === BattleType.MYSTERY_ENCOUNTER && !this.runInfo.trainer)) {
switch (this.runInfo.enemyParty.length) {
case 1:
// Wild - Singles
this.parseWildSingleDefeat(enemyContainer);
console.log("should go through here");
break;
case 2:
//Wild - Doubles
this.parseWildDoubleDefeat(enemyContainer);
break;
}
} else if (this.runInfo.battleType === BattleType.TRAINER) {
} else if (this.runInfo.battleType === BattleType.TRAINER || (this.runInfo.battleType === BattleType.MYSTERY_ENCOUNTER && this.runInfo.trainer)) {
this.parseTrainerDefeat(enemyContainer);
}
this.runResultContainer.add(enemyContainer);