Add icons for Mega Rayquaza and Eternamax Eternatus

This commit is contained in:
Flashfyre 2023-10-24 15:17:41 -04:00
parent 0ab7f1b018
commit 50cbad3af3
11 changed files with 69 additions and 19 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -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$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -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,

View File

@ -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);

View File

@ -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);
}

View File

@ -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()}`);

View File

@ -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);

View File

@ -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();