Skip to content

Commit

Permalink
Add scene back to fade[in|out]() calls
Browse files Browse the repository at this point in the history
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
  • Loading branch information
DayKev and MokaStitcher committed Nov 1, 2024
1 parent 55d1b14 commit db7ca95
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/field/pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3191,9 +3191,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
fusionCry.destroy();
scene.time.delayedCall(Utils.fixedInt(Math.ceil(duration * 0.4)), () => {
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));
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) {
console.error(err);
}
Expand Down Expand Up @@ -3318,9 +3318,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
frameProgress -= frameThreshold;
}
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 }));
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;
if (cry && !cry.pendingRemove) {
Expand Down
2 changes: 1 addition & 1 deletion src/phases/egg-hatch-phase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export class EggHatchPhase extends Phase {
this.canSkip = false;
this.hatched = true;
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++) {
gScene.time.delayedCall(Utils.fixedInt(375 * e), () => gScene.playSound("se/egg_hatch", { volume: 1 - (e * 0.2) }));
Expand Down
4 changes: 2 additions & 2 deletions src/phases/evolution-phase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class EvolutionPhase extends Phase {
}
});

SoundFade.fadeOut(evolutionBgm, 100);
SoundFade.fadeOut(gScene, evolutionBgm, 100);

gScene.unshiftPhase(new EndEvolutionPhase());

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

0 comments on commit db7ca95

Please sign in to comment.