Fix Miror B Easter Egg Themes (#1472)

The themes would not play because we were tracking what theme to set
to with BattleSound.bgmNum. When loading a new bgm, BattleSound.setBgm
will simply return if the existing bgm (BattleSound.bgm) is the same
as the one were trying to set the bgm to.
This commit is contained in:
HoeenHero
2020-03-07 21:29:31 -05:00
committed by GitHub
parent a36e3ab6fb
commit 03f72aae96

View File

@@ -712,6 +712,7 @@ class BattleScene {
}
}
teamPreview() {
let newBGNum = 0;
for (let siden = 0; siden < 2; siden++) {
let side = this.battle.sides[siden];
let textBuf = '';
@@ -766,14 +767,16 @@ class BattleScene {
}
this.$sprites[siden].html(buf + buf2);
if (ludicoloCount >= 2) {
this.bgmNum = -3;
} else if (ludicoloCount + lombreCount >= 2) {
this.bgmNum = -2;
if (!newBGNum) {
if (ludicoloCount >= 2) {
newBGNum = -3;
} else if (ludicoloCount + lombreCount >= 2) {
newBGNum = -2;
}
}
}
if (this.bgmNum < 0) {
this.setBgm(this.bgmNum);
if (newBGNum !== 0) {
this.setBgm(newBGNum);
}
this.wait(1000);
this.updateSidebars();