diff --git a/src/pokemon.ts b/src/pokemon.ts index 4ce9c8a6b..10efb8e47 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -222,7 +222,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return !this.isFainted() && !!this.scene && (!onField || this.isOnField()); } - getDexAttrs(): bigint { + getDexAttr(): bigint { let ret = 0n; ret |= this.gender !== Gender.FEMALE ? DexAttr.MALE : DexAttr.FEMALE; ret |= !this.shiny ? DexAttr.NON_SHINY : DexAttr.SHINY; diff --git a/src/system/game-data.ts b/src/system/game-data.ts index c9d13110a..06632e2e9 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -356,7 +356,7 @@ export class GameData { setPokemonSeen(pokemon: Pokemon, incrementCount: boolean = true): void { const dexEntry = this.dexData[pokemon.species.speciesId]; - dexEntry.seenAttr |= pokemon.getDexAttrs(); + dexEntry.seenAttr |= pokemon.getDexAttr(); if (incrementCount) dexEntry.seenCount++; } @@ -369,7 +369,7 @@ export class GameData { return new Promise((resolve) => { const dexEntry = this.dexData[species.speciesId]; const caughtAttr = dexEntry.caughtAttr; - dexEntry.caughtAttr |= pokemon.getDexAttrs(); + dexEntry.caughtAttr |= pokemon.getDexAttr(); if (incrementCount) dexEntry.seenCount++; diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index 3f4e3ed2a..b16f64049 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -131,7 +131,8 @@ export default class BattleInfo extends Phaser.GameObjects.Container { if (!this.player) { const dexEntry = pokemon.scene.gameData.dexData[pokemon.species.speciesId]; this.ownedIcon.setVisible(!!dexEntry.caughtAttr); - if (!(dexEntry.caughtAttr & pokemon.getDexAttrs())) + const dexAttr = pokemon.getDexAttr(); + if ((dexEntry.caughtAttr & dexAttr) < dexAttr) this.ownedIcon.setTint(0x808080); }