Fix egg hatch screen issues

This commit is contained in:
Flashfyre 2024-04-06 21:48:48 -04:00
parent 70ce649eec
commit 9ee9a0a86b
3 changed files with 17 additions and 8 deletions

View File

@ -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<void> {
if (player === undefined)
player = true;

View File

@ -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();
}

View File

@ -27,6 +27,8 @@ export default class EggHatchSceneHandler extends UiHandler {
this.getUi().showText(null, 0);
this.scene.setModifiersVisible(false);
return true;
}