diff --git a/src/battle-scene.ts b/src/battle-scene.ts index ac3687669..2d19a0276 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1640,6 +1640,10 @@ export default class BattleScene extends SceneBase { this.updateModifiers(false).then(() => this.updateUIPositions()); } + setModifiersVisible(visible: boolean) { + [ this.modifierBar, this.enemyModifierBar ].map(m => m.setVisible(visible)); + } + updateModifiers(player?: boolean, instant?: boolean): Promise { if (player === undefined) player = true; diff --git a/src/egg-hatch-phase.ts b/src/egg-hatch-phase.ts index 39b98b66a..cfeb4749a 100644 --- a/src/egg-hatch-phase.ts +++ b/src/egg-hatch-phase.ts @@ -113,36 +113,36 @@ export class EggHatchPhase extends Phase { this.canSkip = true; this.scene.time.delayedCall(1000, () => { - if (!this.skipped) + if (!this.hatched) this.evolutionBgm = this.scene.playSoundWithoutBgm('evolution'); }); this.scene.time.delayedCall(2000, () => { - if (this.skipped) + if (this.hatched) return; this.eggCrackSprite.setVisible(true); this.doSpray(1, this.eggSprite.displayHeight / -2); this.doEggShake(2).then(() => { - if (this.skipped) - return; + if (this.hatched) + return; this.scene.time.delayedCall(1000, () => { - if (this.skipped) + if (this.hatched) return; this.doSpray(2, this.eggSprite.displayHeight / -4); this.eggCrackSprite.setFrame('1'); this.scene.time.delayedCall(125, () => this.eggCrackSprite.setFrame('2')); this.doEggShake(4).then(() => { - if (this.skipped) + if (this.hatched) return; this.scene.time.delayedCall(1000, () => { - if (this.skipped) + if (this.hatched) return; this.scene.playSound('egg_crack'); this.doSpray(4); this.eggCrackSprite.setFrame('3'); this.scene.time.delayedCall(125, () => this.eggCrackSprite.setFrame('4')); this.doEggShake(8, 2).then(() => { - if (!this.skipped) + if (!this.hatched) this.doHatch(); }); }); @@ -153,9 +153,12 @@ export class EggHatchPhase extends Phase { }); }); } + end() { if (this.scene.findPhase((p) => p instanceof EggHatchPhase)) this.eggHatchHandler.clear(); + else + this.scene.time.delayedCall(250, () => this.scene.setModifiersVisible(true)); super.end(); } diff --git a/src/ui/egg-hatch-scene-handler.ts b/src/ui/egg-hatch-scene-handler.ts index 7e6e72897..358b8c13b 100644 --- a/src/ui/egg-hatch-scene-handler.ts +++ b/src/ui/egg-hatch-scene-handler.ts @@ -27,6 +27,8 @@ export default class EggHatchSceneHandler extends UiHandler { this.getUi().showText(null, 0); + this.scene.setModifiersVisible(false); + return true; }