From 706a85ed5b1e6614962b978d07061ab7671ef98b Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 19 Apr 2024 23:37:23 -0400 Subject: [PATCH] Add missing pipeline data for shiny recolors in certain screens --- src/data/enums/species.ts | 14 +++++++++++++- src/egg-hatch-phase.ts | 3 +++ src/evolution-phase.ts | 5 ++++- src/form-change-phase.ts | 5 ++++- src/system/game-data.ts | 20 ++++---------------- 5 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/data/enums/species.ts b/src/data/enums/species.ts index 1f449258a..0197a09ff 100644 --- a/src/data/enums/species.ts +++ b/src/data/enums/species.ts @@ -1081,4 +1081,16 @@ export enum Species { PALDEA_TAUROS = 8128, PALDEA_WOOPER = 8194, BLOODMOON_URSALUNA = 8901, -}; \ No newline at end of file +}; + +export const defaultStarterSpecies: Species[] = [ + Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE, + Species.CHIKORITA, Species.CYNDAQUIL, Species.TOTODILE, + Species.TREECKO, Species.TORCHIC, Species.MUDKIP, + Species.TURTWIG, Species.CHIMCHAR, Species.PIPLUP, + Species.SNIVY, Species.TEPIG, Species.OSHAWOTT, + Species.CHESPIN, Species.FENNEKIN, Species.FROAKIE, + Species.ROWLET, Species.LITTEN, Species.POPPLIO, + Species.GROOKEY, Species.SCORBUNNY, Species.SOBBLE, + Species.SPRIGATITO, Species.FUECOCO, Species.QUAXLY +]; \ No newline at end of file diff --git a/src/egg-hatch-phase.ts b/src/egg-hatch-phase.ts index 36539e9c6..9259e7b10 100644 --- a/src/egg-hatch-phase.ts +++ b/src/egg-hatch-phase.ts @@ -246,6 +246,9 @@ export class EggHatchPhase extends Phase { this.eggContainer.setVisible(false); this.pokemonSprite.play(this.pokemon.getSpriteKey(true)); this.pokemonSprite.pipelineData['ignoreTimeTint'] = true; + this.pokemonSprite.setPipelineData('spriteKey', this.pokemon.getSpriteKey()); + this.pokemonSprite.setPipelineData('shiny', this.pokemon.shiny); + this.pokemonSprite.setPipelineData('variant', this.pokemon.variant); this.pokemonSprite.setVisible(true); this.scene.time.delayedCall(Utils.fixedInt(250), () => { this.pokemon.cry(); diff --git a/src/evolution-phase.ts b/src/evolution-phase.ts index c71ae5da3..fc58d1413 100644 --- a/src/evolution-phase.ts +++ b/src/evolution-phase.ts @@ -115,7 +115,10 @@ export class EvolutionPhase extends Phase { [ this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => { sprite.play(evolvedPokemon.getSpriteKey(true)); - sprite.pipelineData['ignoreTimeTint'] = true; + sprite.setPipelineData('ignoreTimeTint', true); + sprite.setPipelineData('spriteKey', evolvedPokemon.getSpriteKey()); + sprite.setPipelineData('shiny', evolvedPokemon.shiny); + sprite.setPipelineData('variant', evolvedPokemon.variant); [ 'spriteColors', 'fusionSpriteColors' ].map(k => { if (evolvedPokemon.summonData?.speciesForm) k += 'Base'; diff --git a/src/form-change-phase.ts b/src/form-change-phase.ts index 28ef39d4c..db325bd3d 100644 --- a/src/form-change-phase.ts +++ b/src/form-change-phase.ts @@ -39,7 +39,10 @@ export class FormChangePhase extends EvolutionPhase { [ this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => { sprite.play(transformedPokemon.getSpriteKey(true)); - sprite.pipelineData['ignoreTimeTint'] = true; + sprite.setPipelineData('ignoreTimeTint', true); + sprite.setPipelineData('spriteKey', transformedPokemon.getSpriteKey()); + sprite.setPipelineData('shiny', transformedPokemon.shiny); + sprite.setPipelineData('variant', transformedPokemon.variant); [ 'spriteColors', 'fusionSpriteColors' ].map(k => { if (transformedPokemon.summonData?.speciesForm) k += 'Base'; diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 1c4dbaed2..fe2b7ec1b 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -2,7 +2,7 @@ import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene"; import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon"; import { pokemonPrevolutions } from "../data/pokemon-evolutions"; import PokemonSpecies, { SpeciesFormKey, allSpecies, getPokemonSpecies, noStarterFormKeys, speciesStarters } from "../data/pokemon-species"; -import { Species } from "../data/enums/species"; +import { Species, defaultStarterSpecies } from "../data/enums/species"; import * as Utils from "../utils"; import PokemonData from "./pokemon-data"; import PersistentModifierData from "./modifier-data"; @@ -922,30 +922,18 @@ export class GameData { }; } - const defaultStarters: Species[] = [ - Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE, - Species.CHIKORITA, Species.CYNDAQUIL, Species.TOTODILE, - Species.TREECKO, Species.TORCHIC, Species.MUDKIP, - Species.TURTWIG, Species.CHIMCHAR, Species.PIPLUP, - Species.SNIVY, Species.TEPIG, Species.OSHAWOTT, - Species.CHESPIN, Species.FENNEKIN, Species.FROAKIE, - Species.ROWLET, Species.LITTEN, Species.POPPLIO, - Species.GROOKEY, Species.SCORBUNNY, Species.SOBBLE, - Species.SPRIGATITO, Species.FUECOCO, Species.QUAXLY - ]; - const defaultStarterAttr = DexAttr.NON_SHINY | DexAttr.MALE | DexAttr.DEFAULT_VARIANT | DexAttr.DEFAULT_FORM; const defaultStarterNatures: Nature[] = []; this.scene.executeWithSeedOffset(() => { const neutralNatures = [ Nature.HARDY, Nature.DOCILE, Nature.SERIOUS, Nature.BASHFUL, Nature.QUIRKY ]; - for (let s = 0; s < defaultStarters.length; s++) + for (let s = 0; s < defaultStarterSpecies.length; s++) defaultStarterNatures.push(Utils.randSeedItem(neutralNatures)); }, 0, 'default'); - for (let ds = 0; ds < defaultStarters.length; ds++) { - let entry = data[defaultStarters[ds]] as DexEntry; + for (let ds = 0; ds < defaultStarterSpecies.length; ds++) { + let entry = data[defaultStarterSpecies[ds]] as DexEntry; entry.seenAttr = defaultStarterAttr; entry.caughtAttr = defaultStarterAttr; entry.natureAttr = Math.pow(2, defaultStarterNatures[ds] + 1);