diff --git a/public/images/ui/egg_summary_bg.aseprite b/public/images/ui/egg_summary_bg.aseprite deleted file mode 100644 index 9befa1bfe64..00000000000 Binary files a/public/images/ui/egg_summary_bg.aseprite and /dev/null differ diff --git a/public/images/ui/egg_summary_bg.png b/public/images/ui/egg_summary_bg.png index d37f3497861..27e367212aa 100644 Binary files a/public/images/ui/egg_summary_bg.png and b/public/images/ui/egg_summary_bg.png differ diff --git a/public/images/ui/legacy/egg_summary_bg.png b/public/images/ui/legacy/egg_summary_bg.png new file mode 100644 index 00000000000..27e367212aa Binary files /dev/null and b/public/images/ui/legacy/egg_summary_bg.png differ diff --git a/public/images/ui/legacy/icon_egg_move.png b/public/images/ui/legacy/icon_egg_move.png new file mode 100644 index 00000000000..6af186e9b0c Binary files /dev/null and b/public/images/ui/legacy/icon_egg_move.png differ diff --git a/src/phases/egg-summary-phase.ts b/src/phases/egg-summary-phase.ts index 6a1ec3a630c..4b5491abeb8 100644 --- a/src/phases/egg-summary-phase.ts +++ b/src/phases/egg-summary-phase.ts @@ -29,6 +29,7 @@ export class EggSummaryPhase extends Phase { }); } else { + this.eggHatchData[i].setDex(); this.eggHatchData[i].updatePokemon().then(() => { console.log("updating next pokemon"); if (i < this.eggHatchData.length) { diff --git a/src/ui/egg-summary-ui-handler.ts b/src/ui/egg-summary-ui-handler.ts index c034e6d3a86..6ff3cfb644a 100644 --- a/src/ui/egg-summary-ui-handler.ts +++ b/src/ui/egg-summary-ui-handler.ts @@ -10,6 +10,7 @@ import { EggTier } from "#app/enums/egg-type.js"; import PokemonHatchInfoContainer from "./pokemon-hatch-info-container"; import { EggHatchData } from "#app/phases/egg-hatch-phase.js"; import { EggSummaryPhase } from "#app/phases/egg-summary-phase.js"; +import { DexAttr } from "#app/system/game-data.js"; export default class EggSummaryUiHandler extends MessageUiHandler { private pokemonListContainer: Phaser.GameObjects.Container; @@ -51,6 +52,7 @@ export default class EggSummaryUiHandler extends MessageUiHandler { this.eggHatchContainer = this.scene.add.container(0, -this.scene.game.canvas.height / 6); this.eggHatchContainer.setVisible(false); ui.add(this.eggHatchContainer); + // this.scene.fieldUI.add(this.eggHatchContainer); // const bgColor = this.scene.add.rectangle(0, 0, this.scene.game.canvas.width / 6, this.scene.game.canvas.height / 6, 0x006860); @@ -62,6 +64,8 @@ export default class EggSummaryUiHandler extends MessageUiHandler { this.eggHatchBg = this.scene.add.image(0, 0, "egg_summary_bg"); this.eggHatchBg.setOrigin(0, 0); this.eggHatchContainer.add(this.eggHatchBg); + // this.eggHatchContainer.add(addWindow(this.scene, 107, 1, 212, 178)); + this.pokemonIconsContainer = this.scene.add.container(115, 9); this.pokemonIconSpritesContainer = this.scene.add.container(115, 9); @@ -159,7 +163,7 @@ export default class EggSummaryUiHandler extends MessageUiHandler { // set tint for passive bg switch (getEggTierForSpecies(displayPokemon.species)) { case EggTier.COMMON: - bg.setTint(0xabddab); + bg.setVisible(false); break; case EggTier.GREAT: bg.setTint(0xabafff); @@ -181,8 +185,7 @@ export default class EggSummaryUiHandler extends MessageUiHandler { this.pokemonIconSpritesContainer.add(icon); this.iconAnimHandler.addOrUpdate(icon, PokemonIconAnimMode.NONE); - // add shiny - const shiny = this.scene.add.image(x + 12, y + 2, "shiny_star_small"); + const shiny = this.scene.add.image(x + 12, y + 4, "shiny_star_small"); shiny.setScale(0.5); shiny.setVisible(displayPokemon.shiny); shiny.setTint(getVariantTint(displayPokemon.variant)); @@ -196,10 +199,17 @@ export default class EggSummaryUiHandler extends MessageUiHandler { const pb = this.scene.add.image(x + 12, y + 14, "icon_owned"); pb.setOrigin(0, 0); pb.setScale(0.5); + + // add animation for new unlocks (new catch or new shiny or new form) const dexEntry = value.prevDexEntry; const caughtAttr = dexEntry.caughtAttr; - pb.setVisible(!caughtAttr); - if (!caughtAttr) { + const newShiny = BigInt(1 << (displayPokemon.shiny ? 1 : 0)); + const newVariant = BigInt(1 << (displayPokemon.variant + 4)); + const newShinyOrVariant = ((newShiny & caughtAttr) === BigInt(0)) || ((newVariant & caughtAttr) === BigInt(0)); + const newForm = (BigInt(1 << displayPokemon.formIndex) * DexAttr.DEFAULT_FORM & caughtAttr) === BigInt(0); + + pb.setVisible(!caughtAttr || newForm); + if (!caughtAttr || newShinyOrVariant || newForm) { this.iconAnimHandler.addOrUpdate(icon, PokemonIconAnimMode.PASSIVE); } this.pokemonIconsContainer.add(pb); diff --git a/src/ui/pokemon-hatch-info-container.ts b/src/ui/pokemon-hatch-info-container.ts index 5784b38d519..14025513868 100644 --- a/src/ui/pokemon-hatch-info-container.ts +++ b/src/ui/pokemon-hatch-info-container.ts @@ -11,6 +11,8 @@ import { allMoves } from "#app/data/move.js"; import { Species } from "#app/enums/species.js"; import { getEggTierForSpecies } from "#app/data/egg.js"; import { EggHatchData } from "#app/phases/egg-hatch-phase.js"; +import { starterColors } from "../battle-scene"; +import { argbFromRgba } from "@material/material-color-utilities"; export default class PokemonHatchInfoContainer extends PokemonInfoContainer { private currentPokemonSprite: Phaser.GameObjects.Sprite; @@ -22,6 +24,9 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer { private pokemonEggMoveLabels: Phaser.GameObjects.Text[]; private pokemonHatchedIcon : Phaser.GameObjects.Sprite; private pokemonListContainer: Phaser.GameObjects.Container; + private pokemonCandyIcon: Phaser.GameObjects.Sprite; + private pokemonCandyOverlayIcon: Phaser.GameObjects.Sprite; + private pokemonCandyCountText: Phaser.GameObjects.Text; constructor(scene: BattleScene, listContainer : Phaser.GameObjects.Container, x: number = 115, y: number = 9,) { super(scene, x, y); @@ -50,6 +55,20 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer { this.pokemonHatchedIcon.setScale(0.8); this.pokemonListContainer.add(this.pokemonHatchedIcon); + this.pokemonCandyIcon = this.scene.add.sprite(4.5, 40, "candy"); + this.pokemonCandyIcon.setScale(0.5); + this.pokemonCandyIcon.setOrigin(0, 0); + this.pokemonListContainer.add(this.pokemonCandyIcon); + + this.pokemonCandyOverlayIcon = this.scene.add.sprite(4.5, 40, "candy_overlay"); + this.pokemonCandyOverlayIcon.setScale(0.5); + this.pokemonCandyOverlayIcon.setOrigin(0, 0); + this.pokemonListContainer.add(this.pokemonCandyOverlayIcon); + + this.pokemonCandyCountText = addTextObject(this.scene, 14, 40, "x0", TextStyle.WINDOW_ALT, { fontSize: "56px" }); + this.pokemonCandyCountText.setOrigin(0, 0); + this.pokemonListContainer.add(this.pokemonCandyCountText); + this.pokemonEggMoveContainers = []; this.pokemonEggMoveBgs = []; this.pokemonEggMoveLabels = []; @@ -99,7 +118,14 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer { const shiny = displayPokemon.shiny; const variant = displayPokemon.variant; super.show(displayPokemon, false, 1, hatchInfo.getDex(), hatchInfo.prevStarterEntry, true); + const colorScheme = starterColors[species.speciesId]; + this.pokemonCandyIcon.setTint(argbFromRgba(Utils.rgbHexToRgba(colorScheme[0]))); + this.pokemonCandyIcon.setVisible(true); + this.pokemonCandyOverlayIcon.setTint(argbFromRgba(Utils.rgbHexToRgba(colorScheme[1]))); + this.pokemonCandyOverlayIcon.setVisible(true); + this.pokemonCandyCountText.setText(`x${this.scene.gameData.starterData[species.speciesId].candyCount}`); + this.pokemonCandyCountText.setVisible(true); species.loadAssets(this.scene, female, formIndex, shiny, variant, true).then(() => { // if (assetLoadCancelled.value) { // return;