Add scene back to fade[in|out]() calls

Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
This commit is contained in:
NightKev 2024-10-31 23:54:02 -07:00
parent 55d1b1402a
commit db7ca95be4
3 changed files with 7 additions and 7 deletions

View File

@ -3191,9 +3191,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
fusionCry.destroy(); fusionCry.destroy();
scene.time.delayedCall(Utils.fixedInt(Math.ceil(duration * 0.4)), () => { scene.time.delayedCall(Utils.fixedInt(Math.ceil(duration * 0.4)), () => {
try { try {
SoundFade.fadeOut(cry, Utils.fixedInt(Math.ceil(duration * 0.2))); SoundFade.fadeOut(gScene, cry, Utils.fixedInt(Math.ceil(duration * 0.2)));
fusionCry = this.getFusionSpeciesForm().cry(Object.assign({ seek: Math.max(fusionCry.totalDuration * 0.4, 0) }, soundConfig)); fusionCry = this.getFusionSpeciesForm().cry(Object.assign({ seek: Math.max(fusionCry.totalDuration * 0.4, 0) }, soundConfig));
SoundFade.fadeIn(fusionCry, Utils.fixedInt(Math.ceil(duration * 0.2)), scene.masterVolume * scene.seVolume, 0); SoundFade.fadeIn(gScene, fusionCry, Utils.fixedInt(Math.ceil(duration * 0.2)), scene.masterVolume * scene.seVolume, 0);
} catch (err) { } catch (err) {
console.error(err); console.error(err);
} }
@ -3318,9 +3318,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
frameProgress -= frameThreshold; frameProgress -= frameThreshold;
} }
if (i === transitionIndex) { if (i === transitionIndex) {
SoundFade.fadeOut(cry, Utils.fixedInt(Math.ceil((duration / rate) * 0.2))); SoundFade.fadeOut(gScene, cry, Utils.fixedInt(Math.ceil((duration / rate) * 0.2)));
fusionCry = gScene.playSound(fusionCryKey, Object.assign({ seek: Math.max(fusionCry.totalDuration * 0.4, 0), rate: rate })); fusionCry = gScene.playSound(fusionCryKey, Object.assign({ seek: Math.max(fusionCry.totalDuration * 0.4, 0), rate: rate }));
SoundFade.fadeIn(fusionCry, Utils.fixedInt(Math.ceil((duration / rate) * 0.2)), gScene.masterVolume * gScene.seVolume, 0); SoundFade.fadeIn(gScene, fusionCry, Utils.fixedInt(Math.ceil((duration / rate) * 0.2)), gScene.masterVolume * gScene.seVolume, 0);
} }
rate *= 0.99; rate *= 0.99;
if (cry && !cry.pendingRemove) { if (cry && !cry.pendingRemove) {

View File

@ -285,7 +285,7 @@ export class EggHatchPhase extends Phase {
this.canSkip = false; this.canSkip = false;
this.hatched = true; this.hatched = true;
if (this.evolutionBgm) { if (this.evolutionBgm) {
SoundFade.fadeOut(this.evolutionBgm, Utils.fixedInt(100)); SoundFade.fadeOut(gScene, this.evolutionBgm, Utils.fixedInt(100));
} }
for (let e = 0; e < 5; e++) { for (let e = 0; e < 5; e++) {
gScene.time.delayedCall(Utils.fixedInt(375 * e), () => gScene.playSound("se/egg_hatch", { volume: 1 - (e * 0.2) })); gScene.time.delayedCall(Utils.fixedInt(375 * e), () => gScene.playSound("se/egg_hatch", { volume: 1 - (e * 0.2) }));

View File

@ -189,7 +189,7 @@ export class EvolutionPhase extends Phase {
} }
}); });
SoundFade.fadeOut(evolutionBgm, 100); SoundFade.fadeOut(gScene, evolutionBgm, 100);
gScene.unshiftPhase(new EndEvolutionPhase()); gScene.unshiftPhase(new EndEvolutionPhase());
@ -249,7 +249,7 @@ export class EvolutionPhase extends Phase {
alpha: 0, alpha: 0,
duration: 250, duration: 250,
onComplete: () => { onComplete: () => {
SoundFade.fadeOut(evolutionBgm, 100); SoundFade.fadeOut(gScene, evolutionBgm, 100);
gScene.time.delayedCall(250, () => { gScene.time.delayedCall(250, () => {
this.pokemon.cry(); this.pokemon.cry();
gScene.time.delayedCall(1250, () => { gScene.time.delayedCall(1250, () => {