mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 17:29:30 +02:00
Add icons for future Gacha targets
egg
This commit is contained in:
parent
50bbae7577
commit
5a6ec181a2
@ -14,6 +14,8 @@ import { GachaType } from "#app/enums/gacha-types";
|
|||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { EggTier } from "#enums/egg-type";
|
import { EggTier } from "#enums/egg-type";
|
||||||
|
|
||||||
|
const showFuture: boolean = true;
|
||||||
|
|
||||||
export default class EggGachaUiHandler extends MessageUiHandler {
|
export default class EggGachaUiHandler extends MessageUiHandler {
|
||||||
private eggGachaContainer: Phaser.GameObjects.Container;
|
private eggGachaContainer: Phaser.GameObjects.Container;
|
||||||
private eggGachaMessageBox: Phaser.GameObjects.NineSlice;
|
private eggGachaMessageBox: Phaser.GameObjects.NineSlice;
|
||||||
@ -145,7 +147,23 @@ export default class EggGachaUiHandler extends MessageUiHandler {
|
|||||||
pokemonIcon.setScale(0.5);
|
pokemonIcon.setScale(0.5);
|
||||||
pokemonIcon.setOrigin(0, 0.5);
|
pokemonIcon.setOrigin(0, 0.5);
|
||||||
|
|
||||||
|
const pokemonIcon_3 = this.scene.add.sprite(5, pokemonIconY + 13, "pokemon_icons_0");
|
||||||
|
const pokemonIcon_2 = this.scene.add.sprite(-7, pokemonIconY + 15, "pokemon_icons_0");
|
||||||
|
const pokemonIcon_1 = this.scene.add.sprite(-19, pokemonIconY + 13, "pokemon_icons_0");
|
||||||
|
pokemonIcon_1.setScale(0.4);
|
||||||
|
pokemonIcon_1.setOrigin(0, 0.5);
|
||||||
|
pokemonIcon_1.setVisible(showFuture);
|
||||||
|
pokemonIcon_2.setScale(0.4);
|
||||||
|
pokemonIcon_2.setOrigin(0, 0.5);
|
||||||
|
pokemonIcon_2.setVisible(showFuture);
|
||||||
|
pokemonIcon_3.setScale(0.4);
|
||||||
|
pokemonIcon_3.setOrigin(0, 0.5);
|
||||||
|
pokemonIcon_3.setVisible(showFuture);
|
||||||
|
|
||||||
gachaInfoContainer.add(pokemonIcon);
|
gachaInfoContainer.add(pokemonIcon);
|
||||||
|
gachaInfoContainer.add(pokemonIcon_1);
|
||||||
|
gachaInfoContainer.add(pokemonIcon_2);
|
||||||
|
gachaInfoContainer.add(pokemonIcon_3);
|
||||||
break;
|
break;
|
||||||
case GachaType.MOVE:
|
case GachaType.MOVE:
|
||||||
if (["de", "es", "fr", "pt-BR"].includes(currentLanguage)) {
|
if (["de", "es", "fr", "pt-BR"].includes(currentLanguage)) {
|
||||||
@ -547,13 +565,21 @@ export default class EggGachaUiHandler extends MessageUiHandler {
|
|||||||
const infoContainer = this.gachaInfoContainers[gachaType];
|
const infoContainer = this.gachaInfoContainers[gachaType];
|
||||||
switch (gachaType as GachaType) {
|
switch (gachaType as GachaType) {
|
||||||
case GachaType.LEGENDARY:
|
case GachaType.LEGENDARY:
|
||||||
const species = getPokemonSpecies(getLegendaryGachaSpeciesForTimestamp(this.scene, new Date().getTime()));
|
this.updateGachaIcon(infoContainer)
|
||||||
const pokemonIcon = infoContainer.getAt(1) as Phaser.GameObjects.Sprite;
|
if (showFuture) {
|
||||||
pokemonIcon.setTexture(species.getIconAtlasKey(), species.getIconId(false));
|
this.updateGachaIcon(infoContainer, 1)
|
||||||
break;
|
this.updateGachaIcon(infoContainer, 2)
|
||||||
|
this.updateGachaIcon(infoContainer, 3)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateGachaIcon(infoContainer: Phaser.GameObjects.Container, offset: integer = 0): void {
|
||||||
|
const species = getPokemonSpecies(getLegendaryGachaSpeciesForTimestamp(this.scene, new Date().getTime() + offset*86400000));
|
||||||
|
const pokemonIcon = infoContainer.getAt(1 + offset) as Phaser.GameObjects.Sprite;
|
||||||
|
pokemonIcon.setTexture(species.getIconAtlasKey(), species.getIconId(false));
|
||||||
|
}
|
||||||
|
|
||||||
consumeVouchers(voucherType: VoucherType, count: integer): void {
|
consumeVouchers(voucherType: VoucherType, count: integer): void {
|
||||||
this.scene.gameData.voucherCounts[voucherType] = Math.max(this.scene.gameData.voucherCounts[voucherType] - count, 0);
|
this.scene.gameData.voucherCounts[voucherType] = Math.max(this.scene.gameData.voucherCounts[voucherType] - count, 0);
|
||||||
this.updateVoucherCounts();
|
this.updateVoucherCounts();
|
||||||
|
Loading…
Reference in New Issue
Block a user