diff --git a/public/images/pokemon/icons/384mega.png b/public/images/pokemon/icons/384mega.png new file mode 100644 index 000000000..fbb3b66c4 Binary files /dev/null and b/public/images/pokemon/icons/384mega.png differ diff --git a/public/images/pokemon/icons/890eternamax.png b/public/images/pokemon/icons/890eternamax.png new file mode 100644 index 000000000..39a9f1269 Binary files /dev/null and b/public/images/pokemon/icons/890eternamax.png differ diff --git a/public/images/ui/pokemon_icons_6.json b/public/images/ui/pokemon_icons_6.json index 79e4da203..dd41f3282 100644 --- a/public/images/ui/pokemon_icons_6.json +++ b/public/images/ui/pokemon_icons_6.json @@ -4,11 +4,32 @@ "image": "pokemon_icons_6.png", "format": "RGBA8888", "size": { - "w": 63, - "h": 73 + "w": 99, + "h": 98 }, "scale": 1, "frames": [ + { + "filename": "890eternamax", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 67, + "h": 56 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 67, + "h": 56 + }, + "frame": { + "x": 0, + "y": 0, + "w": 67, + "h": 56 + } + }, { "filename": "890", "rotated": false, @@ -25,7 +46,7 @@ }, "frame": { "x": 0, - "y": 0, + "y": 56, "w": 55, "h": 42 } @@ -45,8 +66,8 @@ "h": 28 }, "frame": { - "x": 0, - "y": 42, + "x": 67, + "y": 0, "w": 32, "h": 28 } @@ -66,11 +87,32 @@ "h": 31 }, "frame": { - "x": 32, - "y": 42, + "x": 67, + "y": 28, "w": 31, "h": 31 } + }, + { + "filename": "384mega", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 38, + "h": 32 + }, + "spriteSourceSize": { + "x": 0, + "y": 3, + "w": 38, + "h": 27 + }, + "frame": { + "x": 55, + "y": 59, + "w": 38, + "h": 27 + } } ] } @@ -78,6 +120,6 @@ "meta": { "app": "https://www.codeandweb.com/texturepacker", "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:4b6a1ba281ae27408c7aa4ec0f283be1:8564d882e57b533f2d1425eff77e6e8c:96737d38f2029744a75c1ee001bc1929$" + "smartupdate": "$TexturePacker:SmartUpdate:da1c77f10b290cc824b731ed2920ec48:84485c60eaa201508ddb6ef0365267bf:96737d38f2029744a75c1ee001bc1929$" } } diff --git a/public/images/ui/pokemon_icons_6.png b/public/images/ui/pokemon_icons_6.png index aefe0c9e4..839e7194a 100644 Binary files a/public/images/ui/pokemon_icons_6.png and b/public/images/ui/pokemon_icons_6.png differ diff --git a/public/images/ui/window.png b/public/images/ui/window.png index da308a34a..5663f5c7b 100644 Binary files a/public/images/ui/window.png and b/public/images/ui/window.png differ diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 93aa52730..ccf0bcf0b 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -75,7 +75,7 @@ export abstract class PokemonSpeciesForm { } isObtainable() { - return this.generation <= 5; + return this.generation <= 5 && this.getFormSpriteKey(this.formIndex) !== 'mega'; } getSpriteAtlasPath(female: boolean, formIndex?: integer, shiny?: boolean): string { @@ -96,7 +96,9 @@ export abstract class PokemonSpeciesForm { abstract getFormSpriteKey(formIndex?: integer): string; - getIconAtlasKey(): string { + getIconAtlasKey(formIndex?: integer): string { + if (this.getFormSpriteKey(formIndex) === 'mega') + return 'pokemon_icons_6'; return `pokemon_icons_${Math.min(this.generation, 6)}`; } @@ -108,6 +110,7 @@ export abstract class PokemonSpeciesForm { switch (this.speciesId) { case Species.UNOWN: + case Species.RAYQUAZA: case Species.BURMY: case Species.WORMADAM: case Species.SHELLOS: @@ -122,6 +125,7 @@ export abstract class PokemonSpeciesForm { case Species.LANDORUS: case Species.KELDEO: case Species.MELOETTA: + case Species.ETERNATUS: ret += this.getFormSpriteKey(formIndex).replace(/-/g, ''); break; case Species.UNFEZANT: @@ -129,7 +133,6 @@ export abstract class PokemonSpeciesForm { case Species.JELLICENT: ret += !female ? 'm' : 'f'; break; - } return ret; @@ -177,7 +180,10 @@ export abstract class PokemonSpeciesForm { } generateIconAnim(scene: BattleScene, female: boolean, formIndex: integer): void { - const frameNames = scene.anims.generateFrameNames(this.getIconAtlasKey(), { prefix: `${this.getIconId(female, formIndex)}_`, zeroPad: 2, suffix: '.png', start: 1, end: 34 }); + const atlasKey = this.getIconAtlasKey(formIndex); + if (atlasKey === 'pokemon_icons_6') + return; + const frameNames = scene.anims.generateFrameNames(atlasKey, { prefix: `${this.getIconId(female, formIndex)}_`, zeroPad: 2, suffix: '.png', start: 1, end: 34 }); scene.anims.create({ key: this.getIconKey(female, formIndex), frames: frameNames, diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 21f9accd6..70fd55c03 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -349,16 +349,14 @@ export abstract class PokemonHeldItemModifier extends PersistentModifier { if (!forSummary) { const pokemon = this.getPokemon(scene); const isIconShown = pokemon instanceof PlayerPokemon || scene.currentBattle.seenEnemyPartyMemberIds.has(pokemon.id); - const iconAtlasKey = isIconShown ? pokemon.species.getIconAtlasKey() : 'pokemon_icons_0'; + const iconAtlasKey = isIconShown ? pokemon.getIconAtlasKey() : 'pokemon_icons_0'; const pokemonIcon = scene.add.sprite(0, 8, iconAtlasKey); - if (pokemon.species.isObtainable()) { + if (pokemon.getSpeciesForm().isObtainable()) { const iconKey = isIconShown ? pokemon.getIconKey() : 'pkmn_icon__000'; pokemonIcon.play(iconKey).stop(); } else { if (pokemon.species.speciesId === Species.ETERNATUS) pokemonIcon.setScale(0.5, 0.5); - else - pokemonIcon.setPosition(-8, 0); pokemonIcon.setFrame(pokemon.getIconId()); } pokemonIcon.setOrigin(0, 0.5); diff --git a/src/pokemon.ts b/src/pokemon.ts index cc55dd92f..436e9920a 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -266,6 +266,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return `pkmn__${this.getBattleSpriteId()}`; } + getIconAtlasKey(): string { + return this.getSpeciesForm().getIconAtlasKey(this.formIndex); + } + getIconId(): string { return this.getSpeciesForm().getIconId(this.gender === Gender.FEMALE, this.formIndex); } diff --git a/src/ui/party-exp-bar.ts b/src/ui/party-exp-bar.ts index 6eaca216a..4369b5ec0 100644 --- a/src/ui/party-exp-bar.ts +++ b/src/ui/party-exp-bar.ts @@ -39,7 +39,7 @@ export default class PartyExpBar extends Phaser.GameObjects.Container { if (this.shown) return resolve(); - this.pokemonIcon.setTexture(pokemon.species.getIconAtlasKey()); + this.pokemonIcon.setTexture(pokemon.getIconAtlasKey()); this.pokemonIcon.play(pokemon.getIconKey()).stop(); this.expText.setText(`+${expValue.toString()}`); diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index 0379dea05..258af8ed4 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -619,7 +619,7 @@ class PartySlot extends Phaser.GameObjects.Container { this.add(slotPb); - const pokemonIcon = this.scene.add.sprite(slotPb.x, slotPb.y, this.pokemon.species.getIconAtlasKey()); + const pokemonIcon = this.scene.add.sprite(slotPb.x, slotPb.y, this.pokemon.getIconAtlasKey()); pokemonIcon.play(this.pokemon.getIconKey()); this.add(pokemonIcon); diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 5621a569b..42561ea0b 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -151,7 +151,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { species.generateIconAnim(this.scene, dexEntry?.female, dexEntry?.formIndex); const x = (s % 9) * 18; const y = Math.floor(s / 9) * 18; - const icon = this.scene.add.sprite(x, y, species.getIconAtlasKey()); + const icon = this.scene.add.sprite(x, y, species.getIconAtlasKey(dexEntry?.formIndex)); icon.setScale(0.5); icon.setOrigin(0, 0); icon.play(species.getIconKey(dexEntry?.female, dexEntry?.formIndex)).stop();