Skip to content

Commit

Permalink
[Feature] Make 31IVs show up as Gold (pagefaultgames#1380)
Browse files Browse the repository at this point in the history
* Make 31IVs show as gold on summary & when caught.

* Add comments to change.
  • Loading branch information
HighMans authored May 30, 2024
1 parent 3f6e43a commit af20712
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ui/stats-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ export class StatsContainer extends Phaser.GameObjects.Container {
this.statsIvsCache = ivChartData.slice(0);

this.ivStatValueTexts.map((t: BBCodeText, i: integer) => {
let label = ivs[i].toString();
let label = "";

// Check to see if IVs are 31, if so change the text style to gold, otherwise leave them be.
if (ivs[i] === 31) {
label += `[color=${getTextColor(TextStyle.SUMMARY_GOLD, false, (this.scene as BattleScene).uiTheme)}][shadow]${ivs[i].toString()}[/shadow][/color]`;
} else {
label = ivs[i].toString();
}
if (this.showDiff && originalIvs) {
if (originalIvs[i] < ivs[i]) {
label += ` ([color=${getTextColor(TextStyle.SUMMARY_BLUE, false, (this.scene as BattleScene).uiTheme)}][shadow=${getTextColor(TextStyle.SUMMARY_BLUE, true, (this.scene as BattleScene).uiTheme)}]+${ivs[i] - originalIvs[i]}[/shadow][/color])`;
Expand Down

0 comments on commit af20712

Please sign in to comment.