Add icons for Mega Rayquaza and Eternamax Eternatus
This commit is contained in:
1 parent
0ab7f1b018
commit
50cbad3af3
11 files changed
+69
-19
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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()}`);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user