Fix enemy trainers staying on screen

pull/2/head
Flashfyre 2023-10-22 22:45:48 -04:00
parent 08364d9060
commit ae795e0e6e
1 changed files with 5 additions and 1 deletions

View File

@ -401,6 +401,8 @@ export class NextEncounterPhase extends EncounterPhase {
this.scene.arenaEnemy.setX(this.scene.arenaNextEnemy.x); this.scene.arenaEnemy.setX(this.scene.arenaNextEnemy.x);
this.scene.arenaEnemy.setAlpha(1); this.scene.arenaEnemy.setAlpha(1);
this.scene.arenaNextEnemy.setX(this.scene.arenaNextEnemy.x - 300); this.scene.arenaNextEnemy.setX(this.scene.arenaNextEnemy.x - 300);
if (this.scene.lastEnemyTrainer)
this.scene.lastEnemyTrainer.destroy();
this.doEncounterCommon(); this.doEncounterCommon();
} }
@ -521,7 +523,7 @@ export class SwitchBiomePhase extends BattlePhase {
this.scene.time.delayedCall(1000, () => this.scene.playBgm()); this.scene.time.delayedCall(1000, () => this.scene.playBgm());
this.scene.tweens.add({ this.scene.tweens.add({
targets: [ this.scene.arenaPlayer, this.scene.arenaBgTransition, this.scene.arenaPlayerTransition ], targets: [ this.scene.arenaPlayer, this.scene.arenaBgTransition, this.scene.arenaPlayerTransition, this.scene.lastEnemyTrainer ],
duration: 1000, duration: 1000,
delay: 1000, delay: 1000,
ease: 'Sine.easeInOut', ease: 'Sine.easeInOut',
@ -535,6 +537,8 @@ export class SwitchBiomePhase extends BattlePhase {
this.scene.arenaNextEnemy.setBiome(this.nextBiome); this.scene.arenaNextEnemy.setBiome(this.nextBiome);
this.scene.arenaBgTransition.setVisible(false); this.scene.arenaBgTransition.setVisible(false);
this.scene.arenaPlayerTransition.setVisible(false); this.scene.arenaPlayerTransition.setVisible(false);
if (this.scene.lastEnemyTrainer)
this.scene.lastEnemyTrainer.destroy();
this.end(); this.end();
} }