Show icon in dex for HA mons, like shiny (#117)

* Show icon in dex for HA mons, like shiny

* Swaps the star with the HA capsule

* Removes the unwanted icon
pull/121/head
shayebeadling 2024-04-13 23:20:54 -04:00 committed by GitHub
parent cdab38abda
commit f068b53d44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

View File

@ -58,6 +58,7 @@ export class LoadingScene extends SceneBase {
this.loadImage('achv_bar_3', 'ui');
this.loadImage('achv_bar_4', 'ui');
this.loadImage('shiny_star', 'ui', 'shiny.png');
this.loadImage('ha_capsule', 'ui', 'ha_capsule.png');
this.loadImage('icon_spliced', 'ui');
this.loadImage('icon_tera', 'ui');
this.loadImage('type_tera', 'ui');

View File

@ -163,6 +163,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
private startCursorObj: Phaser.GameObjects.NineSlice;
private starterValueLabels: Phaser.GameObjects.Text[];
private shinyIcons: Phaser.GameObjects.Image[];
private hiddenAbilityIcons: Phaser.GameObjects.Image[];
private iconAnimHandler: PokemonIconAnimHandler;
@ -382,6 +383,17 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
return ret;
});
this.hiddenAbilityIcons = new Array(81).fill(null).map((_, i) => {
const x = (i % 9) * 18;
const y = Math.floor(i / 9) * 18;
const ret = this.scene.add.image(x + 163, y + 16, 'ha_capsule');
ret.setOrigin(0, 0);
ret.setScale(0.5);
ret.setVisible(false);
this.starterSelectContainer.add(ret);
return ret;
});
this.pokemonSprite = this.scene.add.sprite(53, 63, `pkmn__sub`);
this.starterSelectContainer.add(this.pokemonSprite);
@ -1106,6 +1118,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.updateStarterValueLabel(s);
this.starterValueLabels[s].setVisible(slotVisible);
this.shinyIcons[s].setVisible(slotVisible && !!this.scene.gameData.dexData[speciesId].caughtAttr && !!(this.scene.gameData.dexData[speciesId].caughtAttr & DexAttr.SHINY));
this.hiddenAbilityIcons[s].setVisible(slotVisible && !!this.scene.gameData.dexData[speciesId].caughtAttr && !!(this.scene.gameData.dexData[speciesId].caughtAttr & DexAttr.ABILITY_HIDDEN));
}
} else {
changed = super.setCursor(cursor);