Skip to content

Commit

Permalink
Merge branch 'pagefaultgames:main' into aj-main
Browse files Browse the repository at this point in the history
  • Loading branch information
ajhyperbit authored Aug 17, 2024
2 parents b78ea2f + 5446040 commit 2cc9aa5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ui/starter-select-ui-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2975,7 +2975,14 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
starterSprite.setTexture(species.getIconAtlasKey(formIndex, shiny, variant), species.getIconId(female!, formIndex, shiny, variant));
currentFilteredContainer.checkIconId(female, formIndex, shiny, variant);
}
this.canCycleShiny = !!(dexEntry.caughtAttr & DexAttr.NON_SHINY && dexEntry.caughtAttr & DexAttr.SHINY);
// First, ensure you have the caught attributes for the species else default to bigint 0
const caughtVariants = this.scene.gameData.dexData[species.speciesId]?.caughtAttr || BigInt(0);
// Define the variables based on whether their respective variants have been caught
const isVariant3Caught = !!(caughtVariants & DexAttr.VARIANT_3);
const isVariant2Caught = !!(caughtVariants & DexAttr.VARIANT_2);
const isVariantCaught = !!(caughtVariants & DexAttr.SHINY);

this.canCycleShiny = isVariantCaught || isVariant2Caught || isVariant3Caught;
this.canCycleGender = !!(dexEntry.caughtAttr & DexAttr.MALE && dexEntry.caughtAttr & DexAttr.FEMALE);
this.canCycleAbility = [ abilityAttr & AbilityAttr.ABILITY_1, (abilityAttr & AbilityAttr.ABILITY_2) && species.ability2, abilityAttr & AbilityAttr.ABILITY_HIDDEN ].filter(a => a).length > 1;
this.canCycleForm = species.forms.filter(f => f.isStarterSelectable || !pokemonFormChanges[species.speciesId]?.find(fc => fc.formKey))
Expand Down

0 comments on commit 2cc9aa5

Please sign in to comment.