From ee7e2094e1aaf97a0651b97c1167931f688a54b5 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Wed, 30 Apr 2025 14:47:36 -0500 Subject: [PATCH] Move delay in formChangePhase to first element --- src/phases/form-change-phase.ts | 2 +- src/system/game-speed.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/phases/form-change-phase.ts b/src/phases/form-change-phase.ts index 37bae6bd3c3..6d60cacd69d 100644 --- a/src/phases/form-change-phase.ts +++ b/src/phases/form-change-phase.ts @@ -131,11 +131,11 @@ export class FormChangePhase extends EvolutionPhase { private beginTweens(preName: string, transformedPokemon: Pokemon): void { globalScene.tweens.chain({ // Starts 250ms after sprites have been configured - delay: 250, targets: null, tweens: [ // Step 1: Fade in the background overlay { + delay: 250, targets: this.evolutionBgOverlay, alpha: 1, duration: 1500, diff --git a/src/system/game-speed.ts b/src/system/game-speed.ts index 17916e93a38..207a4fb44a1 100644 --- a/src/system/game-speed.ts +++ b/src/system/game-speed.ts @@ -24,7 +24,7 @@ export function initGameSpeed() { // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Complexity is necessary here const mutateProperties = (obj: any, allowArray = false) => { - // We do not mutate Tweens or TweenChains + // We do not mutate Tweens or TweenChain objects themselves. if (obj instanceof Phaser.Tweens.Tween || obj instanceof Phaser.Tweens.TweenChain) { return; } @@ -42,9 +42,9 @@ export function initGameSpeed() { obj[prop] = transformValue(objProp); } } - // If the object has a 'tweens' property, then it is a tween chain + // If the object has a 'tweens' property that is an array, then it is a tween chain // and we need to mutate its properties as well - if (obj.tweens) { + if (obj.tweens && Array.isArray(obj.tweens)) { for (const tween of obj.tweens) { mutateProperties(tween); } @@ -83,11 +83,11 @@ export function initGameSpeed() { return originalAddCounter.apply(this, [config]); } as typeof originalAddCounter; - // const originalCreate: TweenManager["create"] = this.tweens.create; - // this.tweens.create = function (config: Phaser.Types.Tweens.TweenBuilderConfig) { - // mutateProperties(config, true); - // return originalCreate.apply(this, [config]); - // } as typeof originalCreate; + const originalCreate: TweenManager["create"] = this.tweens.create; + this.tweens.create = function (config: Phaser.Types.Tweens.TweenBuilderConfig) { + mutateProperties(config, true); + return originalCreate.apply(this, [config]); + } as typeof originalCreate; const originalAddMultiple: TweenManager["addMultiple"] = this.tweens.addMultiple; this.tweens.addMultiple = function (config: Phaser.Types.Tweens.TweenBuilderConfig[]) {