Fix logic for checking starter attributes

pull/2/head
Flashfyre 2023-11-13 08:20:31 -05:00
parent b4f2700a59
commit 83b85acd8a
3 changed files with 5 additions and 4 deletions

View File

@ -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;

View File

@ -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<void>((resolve) => {
const dexEntry = this.dexData[species.speciesId];
const caughtAttr = dexEntry.caughtAttr;
dexEntry.caughtAttr |= pokemon.getDexAttrs();
dexEntry.caughtAttr |= pokemon.getDexAttr();
if (incrementCount)
dexEntry.seenCount++;

View File

@ -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);
}