diff --git a/src/egg-hatch-phase.ts b/src/egg-hatch-phase.ts index 48ab1f4d9..f85e5f824 100644 --- a/src/egg-hatch-phase.ts +++ b/src/egg-hatch-phase.ts @@ -188,6 +188,7 @@ export class EggHatchPhase extends BattlePhase { this.scene.validateAchv(achvs.HATCH_SHINY); this.eggContainer.setVisible(false); this.pokemonSprite.play(pokemon.getSpriteKey(true)); + this.pokemonSprite.pipelineData['ignoreTimeTint'] = true; this.pokemonSprite.setVisible(true); this.scene.time.delayedCall(Utils.fixedInt(1000), () => { pokemon.cry(); diff --git a/src/evolution-phase.ts b/src/evolution-phase.ts index 4f4971e2e..9d5d8b662 100644 --- a/src/evolution-phase.ts +++ b/src/evolution-phase.ts @@ -84,6 +84,7 @@ export class EvolutionPhase extends BattlePhase { [ this.pokemonSprite, this.pokemonTintSprite, this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => { sprite.play(pokemon.getSpriteKey(true)); + sprite.pipelineData['ignoreTimeTint'] = true; sprite.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], hasShadow: false }); [ 'spriteColors', 'fusionSpriteColors' ].map(k => { if (pokemon.summonData?.speciesForm) @@ -98,8 +99,8 @@ export class EvolutionPhase extends BattlePhase { pokemon.getPossibleEvolution(this.evolution).then(evolvedPokemon => { [ this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => { - console.log(evolvedPokemon.getSpriteKey(true)) sprite.play(evolvedPokemon.getSpriteKey(true)); + sprite.pipelineData['ignoreTimeTint'] = true; [ 'spriteColors', 'fusionSpriteColors' ].map(k => { if (evolvedPokemon.summonData?.speciesForm) k += 'Base'; diff --git a/src/pipelines/field-sprite.ts b/src/pipelines/field-sprite.ts index 0b1c8bd77..a0885307d 100644 --- a/src/pipelines/field-sprite.ts +++ b/src/pipelines/field-sprite.ts @@ -16,6 +16,7 @@ varying float outTintEffect; varying vec4 outTint; uniform float time; +uniform int ignoreTimeTint; uniform int isOutside; uniform vec3 dayTint; uniform vec3 duskTint; @@ -53,7 +54,7 @@ void main() } /* Apply day/night tint */ - if (color.a > 0.0) { + if (color.a > 0.0 && ignoreTimeTint == 0) { vec3 dayNightTint; if (time < 0.25) { @@ -124,6 +125,7 @@ export default class FieldSpritePipeline extends Phaser.Renderer.WebGL.Pipelines onPreRender(): void { this.set1f('time', 0); + this.set1i('ignoreTimeTint', 0); } onBind(gameObject: Phaser.GameObjects.GameObject): void { @@ -132,10 +134,14 @@ export default class FieldSpritePipeline extends Phaser.Renderer.WebGL.Pipelines const sprite = (gameObject as Phaser.GameObjects.Sprite); const scene = sprite.scene as BattleScene; + const data = sprite.pipelineData; + const ignoreTimeTint = data['ignoreTimeTint'] as boolean; + let time = scene.currentBattle?.waveIndex ? ((scene.currentBattle.waveIndex + scene.getWaveCycleOffset()) % 40) / 40 // ((new Date().getSeconds() * 1000 + new Date().getMilliseconds()) % 10000) / 10000 : Utils.getCurrentTime(); - this.set1f('time', time); + this.set1f('time', time); + this.set1i('ignoreTimeTint', ignoreTimeTint ? 1 : 0); this.set1i('isOutside', scene.arena.isOutside() ? 1 : 0); this.set3fv('dayTint', scene.arena.getDayTint().map(c => c / 255)); this.set3fv('duskTint', scene.arena.getDuskTint().map(c => c / 255)); diff --git a/src/pipelines/sprite.ts b/src/pipelines/sprite.ts index efc08c4be..07a14ec57 100644 --- a/src/pipelines/sprite.ts +++ b/src/pipelines/sprite.ts @@ -18,6 +18,7 @@ varying float outTintEffect; varying vec4 outTint; uniform float time; +uniform int ignoreTimeTint; uniform int isOutside; uniform vec3 dayTint; uniform vec3 duskTint; @@ -87,7 +88,7 @@ void main() color.rgb += tone.rgb * (color.a / 255.0); /* Apply day/night tint */ - if (color.a > 0.0) { + if (color.a > 0.0 && ignoreTimeTint == 0) { vec3 dayNightTint; if (time < 0.25) { diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index 0a7e06781..b6645a778 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -197,6 +197,7 @@ export default class SummaryUiHandler extends UiHandler { this.numberText.setShadowColor(getTextColor(!this.pokemon.isShiny() ? TextStyle.SUMMARY : TextStyle.SUMMARY_GOLD, true)); this.pokemonSprite.play(this.pokemon.getSpriteKey(true)); + this.pokemonSprite.pipelineData['ignoreTimeTint'] = true; [ 'spriteColors', 'fusionSpriteColors' ].map(k => { delete this.pokemonSprite.pipelineData[`${k}Base`]; if (this.pokemon.summonData?.speciesForm)