summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-11-04 21:50:44 -0700
committerYamaArashi <shadow962@live.com>2016-11-04 21:50:44 -0700
commit356e04a104f3ac8db482cfeb511dacfa7bde5e53 (patch)
treeb4218504ef5b884d82a7acdd62312a4f4ff9fcb1
parent02d3a612870cc1d3e6fc68676301d80904f88fa4 (diff)
trainer music constants
-rw-r--r--data/specials.inc2
-rw-r--r--include/trainer.h19
-rw-r--r--src/battle_setup.c58
3 files changed, 49 insertions, 30 deletions
diff --git a/data/specials.inc b/data/specials.inc
index 48a362437..ead3d5fab 100644
--- a/data/specials.inc
+++ b/data/specials.inc
@@ -56,7 +56,7 @@ gSpecials::
.4byte sub_8082718
.4byte sub_8082564
.4byte sub_80847C8
- .4byte sub_8082728
+ .4byte PlayTrainerEncounterMusic
.4byte sub_8082C68
.4byte sub_8082C9C
.4byte sub_80826B0
diff --git a/include/trainer.h b/include/trainer.h
new file mode 100644
index 000000000..232cde608
--- /dev/null
+++ b/include/trainer.h
@@ -0,0 +1,19 @@
+#ifndef GUARD_TRAINER_H
+#define GUARD_TRAINER_H
+
+#define TRAINER_ENCOUNTER_MUSIC_MALE 0 // standard male encounter music
+#define TRAINER_ENCOUNTER_MUSIC_FEMALE 1 // standard female encounter music
+#define TRAINER_ENCOUNTER_MUSIC_GIRL 2 // used for male Tubers and Young Couples too
+#define TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS 3
+#define TRAINER_ENCOUNTER_MUSIC_INTENSE 4
+#define TRAINER_ENCOUNTER_MUSIC_COOL 5
+#define TRAINER_ENCOUNTER_MUSIC_AQUA 6
+#define TRAINER_ENCOUNTER_MUSIC_MAGMA 7
+#define TRAINER_ENCOUNTER_MUSIC_SWIMMER 8
+#define TRAINER_ENCOUNTER_MUSIC_TWINS 9 // used for other trainer classes too
+#define TRAINER_ENCOUNTER_MUSIC_ELITE_FOUR 10
+#define TRAINER_ENCOUNTER_MUSIC_HIKER 11 // used for other trainer classes too
+#define TRAINER_ENCOUNTER_MUSIC_INTERVIEWER 12
+#define TRAINER_ENCOUNTER_MUSIC_RICH 13 // Rich Boys and Gentlemen
+
+#endif // GUARD_TRAINER_H
diff --git a/src/battle_setup.c b/src/battle_setup.c
index f69596a3d..893719a43 100644
--- a/src/battle_setup.c
+++ b/src/battle_setup.c
@@ -11,6 +11,7 @@
#include "var.h"
#include "script.h"
#include "field_message_box.h"
+#include "trainer.h"
extern void prev_quest_postbuffer_cursor_backup_reset(void);
extern void overworld_poison_timer_set(void);
@@ -896,7 +897,7 @@ void sub_8082718()
ShowFieldMessage(sub_8082880());
}
-void sub_8082728(void) // sets the music to be played after a battle
+void PlayTrainerEncounterMusic(void)
{
u16 music;
@@ -904,48 +905,47 @@ void sub_8082728(void) // sets the music to be played after a battle
{
switch (sub_803FC58(gTrainerBattleOpponent))
{
- // TODO: Replace with music constants.
- case 0:
- music = 380;
+ case TRAINER_ENCOUNTER_MUSIC_MALE:
+ music = BGM_BOYEYE;
break;
- case 1:
- music = 407;
+ case TRAINER_ENCOUNTER_MUSIC_FEMALE:
+ music = BGM_GIRLEYE;
break;
- case 2:
- music = 379;
+ case TRAINER_ENCOUNTER_MUSIC_GIRL:
+ music = BGM_SYOUJOEYE;
break;
- case 4:
- music = 416;
+ case TRAINER_ENCOUNTER_MUSIC_INTENSE:
+ music = BGM_HAGESHII;
break;
- case 5:
- music = 417;
+ case TRAINER_ENCOUNTER_MUSIC_COOL:
+ music = BGM_KAKKOII;
break;
- case 6:
- music = 419;
+ case TRAINER_ENCOUNTER_MUSIC_AQUA:
+ music = BGM_AQA_0;
break;
- case 7:
- music = 441;
+ case TRAINER_ENCOUNTER_MUSIC_MAGMA:
+ music = BGM_MGM0;
break;
- case 8:
- music = 385;
+ case TRAINER_ENCOUNTER_MUSIC_SWIMMER:
+ music = BGM_SWIMEYE;
break;
- case 9:
- music = 449;
+ case TRAINER_ENCOUNTER_MUSIC_TWINS:
+ music = BGM_HUTAGO;
break;
- case 10:
- music = 450;
+ case TRAINER_ENCOUNTER_MUSIC_ELITE_FOUR:
+ music = BGM_SITENNOU;
break;
- case 11:
- music = 451;
+ case TRAINER_ENCOUNTER_MUSIC_HIKER:
+ music = BGM_YAMA_EYE;
break;
- case 12:
- music = 453;
+ case TRAINER_ENCOUNTER_MUSIC_INTERVIEWER:
+ music = BGM_INTER_V;
break;
- case 13:
- music = 397;
+ case TRAINER_ENCOUNTER_MUSIC_RICH:
+ music = BGM_TEST;
break;
default:
- music = 423;
+ music = BGM_AYASII;
}
PlayNewMapMusic(music);