From 3b72878e477fcd1a682a5fc6ba187f0975dba017 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 24 Nov 2023 09:19:18 -0500 Subject: [PATCH] Fix fusion palette swaps not showing on evolution screen --- src/evolution-phase.ts | 19 ++++++++++--------- src/pokemon.ts | 1 + 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/evolution-phase.ts b/src/evolution-phase.ts index d934d4572..746f9c2a7 100644 --- a/src/evolution-phase.ts +++ b/src/evolution-phase.ts @@ -59,9 +59,7 @@ export class EvolutionPhase extends BattlePhase { this.evolutionBgOverlay.setAlpha(0); this.evolutionContainer.add(this.evolutionBgOverlay); - const getPokemonSprite = () => { - return this.scene.add.sprite(this.evolutionBaseBg.displayWidth / 2, this.evolutionBaseBg.displayHeight / 2, `pkmn__sub`); - }; + const getPokemonSprite = () => this.scene.add.sprite(this.evolutionBaseBg.displayWidth / 2, this.evolutionBaseBg.displayHeight / 2, `pkmn__sub`); this.evolutionContainer.add((this.pokemonSprite = getPokemonSprite())); this.evolutionContainer.add((this.pokemonTintSprite = getPokemonSprite())); @@ -82,17 +80,20 @@ export class EvolutionPhase extends BattlePhase { const pokemon = this.scene.getParty()[this.partyMemberIndex]; const preName = pokemon.name; - this.pokemonSprite.play(pokemon.getSpriteKey()); - this.pokemonTintSprite.play(pokemon.getSpriteKey()); - this.pokemonEvoSprite.play(pokemon.getSpriteKey()); - this.pokemonEvoTintSprite.play(pokemon.getSpriteKey()); + [ this.pokemonSprite, this.pokemonTintSprite, this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => { + sprite.play(pokemon.getSpriteKey()); + sprite.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], hasShadow: false }); + [ 'spriteColors', 'fusionSpriteColors' ].map(k => sprite.pipelineData[k] = pokemon.getSprite().pipelineData[k]); + }); this.scene.ui.showText(`What?\n${preName} is evolving!`, null, () => { pokemon.cry(); pokemon.evolve(this.evolution).then(() => { - this.pokemonEvoSprite.play(pokemon.getSpriteKey()); - this.pokemonEvoTintSprite.play(pokemon.getSpriteKey()); + [ this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => { + sprite.play(pokemon.getSpriteKey()); + [ 'spriteColors', 'fusionSpriteColors' ].map(k => sprite.pipelineData[k] = pokemon.getSprite().pipelineData[k]); + }); }); const levelMoves = pokemon.getLevelMoves(this.lastLevel + 1); diff --git a/src/pokemon.ts b/src/pokemon.ts index 8d61a3818..30dcb1f69 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -636,6 +636,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { && !species.pseudoLegendary && !species.legendary && !species.mythical + && species.speciesId !== this.species.speciesId }; this.fusionSpecies = this.scene.randomSpecies(this.scene.currentBattle?.waveIndex || 0, this.level, false, filter, true);