Skip to content

Commit

Permalink
Fix S/M rival music
Browse files Browse the repository at this point in the history
Due to a bug, it wasn't in the rotation of possible BGM at all.
  • Loading branch information
Zarel committed Aug 26, 2018
1 parent 8562b2f commit 9d17e2b
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions src/battle-animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ class BattleScene {
//this.preloadImage(Tools.fxPrefix + 'bg.jpg');
}
preloadBgm(bgmNum = 0) {
if (!bgmNum) bgmNum = 1 + this.numericId % 14;
if (!bgmNum) bgmNum = 1 + this.numericId % 15;
this.bgmNum = bgmNum;

let ext = window.nodewebkit ? '.ogg' : '.mp3';
Expand All @@ -1232,32 +1232,32 @@ class BattleScene {
this.bgm = 'audio/colosseum-miror-b' + ext;
break;
case 1:
BattleSound.loadBgm('audio/hgss-kanto-trainer' + ext, 13003, 94656);
this.bgm = 'audio/hgss-kanto-trainer' + ext;
BattleSound.loadBgm('audio/dpp-trainer' + ext, 13440, 96959);
this.bgm = 'audio/dpp-trainer' + ext;
break;
case 2:
BattleSound.loadBgm('audio/bw-subway-trainer' + ext, 15503, 110984);
this.bgm = 'audio/bw-subway-trainer' + ext;
BattleSound.loadBgm('audio/dpp-rival' + ext, 13888, 66352);
this.bgm = 'audio/dpp-rival' + ext;
break;
case 3:
BattleSound.loadBgm('audio/bw-trainer' + ext, 14629, 110109);
this.bgm = 'audio/bw-trainer' + ext;
BattleSound.loadBgm('audio/hgss-johto-trainer' + ext, 23731, 125086);
this.bgm = 'audio/hgss-johto-trainer' + ext;
break;
case 4:
BattleSound.loadBgm('audio/bw-rival' + ext, 19180, 57373);
this.bgm = 'audio/bw-rival' + ext;
BattleSound.loadBgm('audio/hgss-kanto-trainer' + ext, 13003, 94656);
this.bgm = 'audio/hgss-kanto-trainer' + ext;
break;
case 5:
BattleSound.loadBgm('audio/dpp-trainer' + ext, 13440, 96959);
this.bgm = 'audio/dpp-trainer' + ext;
BattleSound.loadBgm('audio/bw-trainer' + ext, 14629, 110109);
this.bgm = 'audio/bw-trainer' + ext;
break;
case 6:
BattleSound.loadBgm('audio/hgss-johto-trainer' + ext, 23731, 125086);
this.bgm = 'audio/hgss-johto-trainer' + ext;
BattleSound.loadBgm('audio/bw-rival' + ext, 19180, 57373);
this.bgm = 'audio/bw-rival' + ext;
break;
case 7:
BattleSound.loadBgm('audio/dpp-rival' + ext, 13888, 66352);
this.bgm = 'audio/dpp-rival' + ext;
BattleSound.loadBgm('audio/bw-subway-trainer' + ext, 15503, 110984);
this.bgm = 'audio/bw-subway-trainer' + ext;
break;
case 8:
BattleSound.loadBgm('audio/bw2-kanto-gym-leader' + ext, 14626, 58986);
Expand All @@ -1280,17 +1280,18 @@ class BattleScene {
this.bgm = 'audio/oras-trainer' + ext;
break;
case 13:
BattleSound.loadBgm('audio/oras-rival' + ext, 14303, 69149);
this.bgm = 'audio/oras-rival' + ext;
break;
case 14:
BattleSound.loadBgm('audio/sm-trainer' + ext, 8323, 89230);
this.bgm = 'audio/sm-trainer' + ext;
break;
case 14:
case 15:
default:
BattleSound.loadBgm('audio/sm-rival' + ext, 11389, 62158);
this.bgm = 'audio/sm-rival' + ext;
break;
default:
BattleSound.loadBgm('audio/oras-rival' + ext, 14303, 69149);
this.bgm = 'audio/oras-rival' + ext;
break;
}
}
soundStart() {
Expand Down

0 comments on commit 9d17e2b

Please sign in to comment.