Fix base forms showing as shiny

This commit is contained in:
Flashfyre 2024-04-18 23:10:18 -04:00
parent 89edcc38c6
commit eebe39e1fe
4 changed files with 5 additions and 1 deletions

View File

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

View File

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

View File

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

View File

@ -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`];