From eebe39e1fefea795f3226b9aa03a70737f5be623 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Thu, 18 Apr 2024 23:10:18 -0400 Subject: [PATCH] Fix base forms showing as shiny --- src/data/battle-anims.ts | 1 + src/pipelines/sprite.ts | 3 ++- src/ui/starter-select-ui-handler.ts | 1 + src/ui/summary-ui-handler.ts | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index 6781d1212c5..b6275d956b0 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -798,6 +798,7 @@ export abstract class BattleAnim { sprite = scene.addPokemonSprite(isUser ? user : target, 0, 0, spriteSource.texture, spriteSource.frame.name, true); [ 'spriteColors', 'fusionSpriteColors' ].map(k => sprite.pipelineData[k] = (isUser ? user : target).getSprite().pipelineData[k]); sprite.setPipelineData('spriteKey', (isUser ? user : target).getSpriteKey()); + sprite.setPipelineData('shiny', (isUser ? user : target).isShiny()); sprite.setPipelineData('variant', (isUser ? user : target).variant); sprite.setPipelineData('ignoreFieldPos', true); spriteSource.on('animationupdate', (_anim, frame) => sprite.setFrame(frame.textureFrame)); diff --git a/src/pipelines/sprite.ts b/src/pipelines/sprite.ts index 5135218228b..a948fba9afb 100644 --- a/src/pipelines/sprite.ts +++ b/src/pipelines/sprite.ts @@ -408,7 +408,8 @@ export default class SpritePipeline extends FieldSpritePipeline { const flatBaseColors: number[] = []; const flatVariantColors: number[] = []; - if ((variantColors = variantColorCache[sprite.parentContainer instanceof Pokemon ? sprite.parentContainer.getSprite().texture.key : data['spriteKey']]) && variantColors.hasOwnProperty(variant)) { + if ((sprite.parentContainer instanceof Pokemon ? sprite.parentContainer.isShiny() : !!data['shiny']) + && (variantColors = variantColorCache[sprite.parentContainer instanceof Pokemon ? sprite.parentContainer.getSprite().texture.key : data['spriteKey']]) && variantColors.hasOwnProperty(variant)) { const baseColors = Object.keys(variantColors[variant]); for (let c = 0; c < 32; c++) { if (c < baseColors.length) { diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index e0f36dc3a5b..afd806f8c56 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1432,6 +1432,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.assetLoadCancelled = null; this.speciesLoaded.set(species.speciesId, true); this.pokemonSprite.play(species.getSpriteKey(female, formIndex, shiny, variant)); + this.pokemonSprite.setPipelineData('shiny', shiny); this.pokemonSprite.setPipelineData('variant', variant); this.pokemonSprite.setPipelineData('spriteKey', species.getSpriteKey(female, formIndex, shiny, variant)); this.pokemonSprite.setVisible(!this.statsMode); diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index 469b18ed04b..3450113d7a7 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -225,6 +225,7 @@ export default class SummaryUiHandler extends UiHandler { this.pokemonSprite.setPipelineData('teraColor', getTypeRgb(this.pokemon.getTeraType())); this.pokemonSprite.setPipelineData('ignoreTimeTint', true); this.pokemonSprite.setPipelineData('spriteKey', this.pokemon.getSpriteKey()); + this.pokemonSprite.setPipelineData('shiny', this.pokemon.isShiny()); this.pokemonSprite.setPipelineData('variant', this.pokemon.variant); [ 'spriteColors', 'fusionSpriteColors' ].map(k => { delete this.pokemonSprite.pipelineData[`${k}Base`];