From 0644ca85b7f6aef1a4ab7191594945ac44015f35 Mon Sep 17 00:00:00 2001 From: Jon Studders Date: Fri, 17 May 2024 14:05:19 +0100 Subject: [PATCH] Bit of refactoring, added check for classic mode. --- src/ui/battle-info.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index 669c35ce0e8..32b9cb4d848 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -270,11 +270,13 @@ export default class BattleInfo extends Phaser.GameObjects.Container { this.ownedIcon.setVisible(!!dexEntry.caughtAttr); const opponentPokemonDexAttr = pokemon.getDexAttr(); - if ((dexEntry.caughtAttr & opponentPokemonDexAttr) < opponentPokemonDexAttr || !(pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId()].abilityAttr & Math.pow(2, pokemon.abilityIndex))) { - if (!dexEntry.caughtAttr) { - this.championRibbon.setPositionRelative(this.nameText, 0, 11.75); + if (pokemon.scene.gameMode.isClassic) { + if(pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId()].classicWinCount > 0 && pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId(true)].classicWinCount > 0) { + if (!dexEntry.caughtAttr) { + this.championRibbon.setPositionRelative(this.nameText, 0, 11.75); + } + this.championRibbon.setVisible(true); } - this.championRibbon.setVisible(true); } // Check if Player owns all genders and forms of the Pokemon @@ -294,13 +296,6 @@ export default class BattleInfo extends Phaser.GameObjects.Container { if (missingDexAttrs || !rootFormHasHiddenAbility) this.ownedIcon.setTint(0x808080); - if(pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId()].classicWinCount > 0 && pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId(true)].classicWinCount > 0) { - if (!dexEntry.caughtAttr) { - this.championRibbon.setPositionRelative(this.nameText, 0, 11.75); - } - this.championRibbon.setVisible(true); - } - if (this.boss) this.updateBossSegmentDividers(pokemon as EnemyPokemon); }