Remove arena tags before a trainer battle or new biome
parent
c27db5603a
commit
01a5fe18dd
|
@ -353,6 +353,13 @@ export class Arena {
|
|||
});
|
||||
}
|
||||
|
||||
removeAllTags(): void {
|
||||
for (let t of this.tags) {
|
||||
t.onRemove(this);
|
||||
this.tags.splice(this.tags.indexOf(t), 1);
|
||||
}
|
||||
}
|
||||
|
||||
preloadBgm(): void {
|
||||
this.scene.loadBgm(this.bgm);
|
||||
}
|
||||
|
|
|
@ -694,11 +694,12 @@ export default class BattleScene extends Phaser.Scene {
|
|||
|
||||
if (!waveIndex) {
|
||||
const isNewBiome = !lastBattle || !(lastBattle.waveIndex % 10);
|
||||
const showTrainer = isNewBiome || this.currentBattle.battleType === BattleType.TRAINER;
|
||||
const resetArenaState = isNewBiome || this.currentBattle.battleType === BattleType.TRAINER;
|
||||
if (lastBattle) {
|
||||
this.getEnemyParty().forEach(enemyPokemon => enemyPokemon.destroy());
|
||||
this.trySpreadPokerus();
|
||||
if (showTrainer) {
|
||||
if (resetArenaState) {
|
||||
this.arena.removeAllTags();
|
||||
playerField.forEach((_, p) => this.unshiftPhase(new ReturnPhase(this, p)));
|
||||
this.unshiftPhase(new ShowTrainerPhase(this));
|
||||
for (let pokemon of this.getParty()) {
|
||||
|
|
Loading…
Reference in New Issue