Fix fusion palette swaps not showing on evolution screen

pull/7/head
Flashfyre 2023-11-24 09:19:18 -05:00
parent 8ad08edd53
commit 3b72878e47
2 changed files with 11 additions and 9 deletions

View File

@ -59,9 +59,7 @@ export class EvolutionPhase extends BattlePhase {
this.evolutionBgOverlay.setAlpha(0); this.evolutionBgOverlay.setAlpha(0);
this.evolutionContainer.add(this.evolutionBgOverlay); this.evolutionContainer.add(this.evolutionBgOverlay);
const getPokemonSprite = () => { const getPokemonSprite = () => this.scene.add.sprite(this.evolutionBaseBg.displayWidth / 2, this.evolutionBaseBg.displayHeight / 2, `pkmn__sub`);
return this.scene.add.sprite(this.evolutionBaseBg.displayWidth / 2, this.evolutionBaseBg.displayHeight / 2, `pkmn__sub`);
};
this.evolutionContainer.add((this.pokemonSprite = getPokemonSprite())); this.evolutionContainer.add((this.pokemonSprite = getPokemonSprite()));
this.evolutionContainer.add((this.pokemonTintSprite = getPokemonSprite())); this.evolutionContainer.add((this.pokemonTintSprite = getPokemonSprite()));
@ -82,17 +80,20 @@ export class EvolutionPhase extends BattlePhase {
const pokemon = this.scene.getParty()[this.partyMemberIndex]; const pokemon = this.scene.getParty()[this.partyMemberIndex];
const preName = pokemon.name; const preName = pokemon.name;
this.pokemonSprite.play(pokemon.getSpriteKey()); [ this.pokemonSprite, this.pokemonTintSprite, this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => {
this.pokemonTintSprite.play(pokemon.getSpriteKey()); sprite.play(pokemon.getSpriteKey());
this.pokemonEvoSprite.play(pokemon.getSpriteKey()); sprite.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], hasShadow: false });
this.pokemonEvoTintSprite.play(pokemon.getSpriteKey()); [ 'spriteColors', 'fusionSpriteColors' ].map(k => sprite.pipelineData[k] = pokemon.getSprite().pipelineData[k]);
});
this.scene.ui.showText(`What?\n${preName} is evolving!`, null, () => { this.scene.ui.showText(`What?\n${preName} is evolving!`, null, () => {
pokemon.cry(); pokemon.cry();
pokemon.evolve(this.evolution).then(() => { pokemon.evolve(this.evolution).then(() => {
this.pokemonEvoSprite.play(pokemon.getSpriteKey()); [ this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => {
this.pokemonEvoTintSprite.play(pokemon.getSpriteKey()); sprite.play(pokemon.getSpriteKey());
[ 'spriteColors', 'fusionSpriteColors' ].map(k => sprite.pipelineData[k] = pokemon.getSprite().pipelineData[k]);
});
}); });
const levelMoves = pokemon.getLevelMoves(this.lastLevel + 1); const levelMoves = pokemon.getLevelMoves(this.lastLevel + 1);

View File

@ -636,6 +636,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
&& !species.pseudoLegendary && !species.pseudoLegendary
&& !species.legendary && !species.legendary
&& !species.mythical && !species.mythical
&& species.speciesId !== this.species.speciesId
}; };
this.fusionSpecies = this.scene.randomSpecies(this.scene.currentBattle?.waveIndex || 0, this.level, false, filter, true); this.fusionSpecies = this.scene.randomSpecies(this.scene.currentBattle?.waveIndex || 0, this.level, false, filter, true);