Fix logic for checking starter attributes
parent
b4f2700a59
commit
83b85acd8a
|
@ -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;
|
||||
|
|
|
@ -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++;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue