Skip to content

Commit

Permalink
Merged from official repos
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeyTheA committed Jul 9, 2024
2 parents 50fe2e3 + 18dcef5 commit 6b8cbbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ui/starter-select-ui-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2322,10 +2322,13 @@ export default class StarterSelectUiHandler extends MessageUiHandler {


const isValidForChallenge = new Utils.BooleanHolder(true);
const currentPartyValue = this.starterGens.reduce((total: number, gen: number, i: number) => total += this.scene.gameData.getSpeciesStarterValue(this.genSpecies[gen][this.starterCursors[i]].speciesId), 0);
const cursorCost = this.scene.gameData.getSpeciesStarterValue(species.speciesId);
const isValidNextPartyValue = (currentPartyValue + cursorCost) <= this.getValueLimit();
Challenge.applyChallenges(this.scene.gameMode, Challenge.ChallengeType.STARTER_CHOICE, species, isValidForChallenge, this.scene.gameData.getSpeciesDexAttrProps(species, this.dexAttrCursor), this.starterGens.length);
const starterSprite = this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite;
starterSprite.setTexture(species.getIconAtlasKey(formIndex, shiny, variant), species.getIconId(female, formIndex, shiny, variant));
starterSprite.setAlpha(isValidForChallenge.value ? 1 : 0.375);
starterSprite.setAlpha(isValidForChallenge.value && isValidNextPartyValue ? 1 : 0.375);
this.checkIconId((this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite), species, female, formIndex, shiny, variant);
this.canCycleShiny = !!(dexEntry.caughtAttr & DexAttr.NON_SHINY && dexEntry.caughtAttr & DexAttr.SHINY);
this.canCycleGender = !!(dexEntry.caughtAttr & DexAttr.MALE && dexEntry.caughtAttr & DexAttr.FEMALE);
Expand Down

0 comments on commit 6b8cbbe

Please sign in to comment.