summaryrefslogtreecommitdiff
path: root/src/battle_dome.c
diff options
context:
space:
mode:
authorGriffinR <griffin.richards@comcast.net>2019-12-20 18:52:29 -0500
committerGriffinR <griffin.richards@comcast.net>2019-12-20 21:14:05 -0500
commitff2d8a9c4e0e3e4614bc50c21d40d4a8270b2ff4 (patch)
treef8e0a8ad1b1010925b2021ab7c4a640fa49d62e8 /src/battle_dome.c
parent63c8cf97d1e47573ba8c5bcdf23543013a0f2a14 (diff)
Add frontier trainer constants
Diffstat (limited to 'src/battle_dome.c')
-rw-r--r--src/battle_dome.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/battle_dome.c b/src/battle_dome.c
index e49bada67..2f3479b9f 100644
--- a/src/battle_dome.c
+++ b/src/battle_dome.c
@@ -2454,7 +2454,7 @@ static void InitDomeTrainers(void)
{
do
{
- trainerId = sub_8162548(GetCurrentFacilityWinStreak(), 0);
+ trainerId = GetRandomScaledFrontierTrainerId(GetCurrentFacilityWinStreak(), 0);
for (j = 1; j < i; j++)
{
if (DOME_TRAINERS[j].trainerId == trainerId)
@@ -2467,7 +2467,7 @@ static void InitDomeTrainers(void)
{
do
{
- trainerId = sub_8162548(GetCurrentFacilityWinStreak() + 1, 0);
+ trainerId = GetRandomScaledFrontierTrainerId(GetCurrentFacilityWinStreak() + 1, 0);
for (j = 1; j < i; j++)
{
if (DOME_TRAINERS[j].trainerId == trainerId)
@@ -3250,24 +3250,27 @@ _08190156:\n\
}
#endif // NONMATCHING
+// Duplicate of GetFrontierTrainerFixedIvs
+// NOTE: In CreateDomeOpponentMon a tournament trainer ID (0-15) is passed instead, resulting in all IVs of 3
static u8 GetDomeTrainerMonIvs(u16 trainerId)
{
u8 fixedIv;
- if (trainerId <= 99)
+
+ if (trainerId <= FRONTIER_TRAINER_JILL) // 0 - 99
fixedIv = 3;
- else if (trainerId <= 119)
+ else if (trainerId <= FRONTIER_TRAINER_CHLOE) // 100 - 119
fixedIv = 6;
- else if (trainerId <= 139)
+ else if (trainerId <= FRONTIER_TRAINER_SOFIA) // 120 - 139
fixedIv = 9;
- else if (trainerId <= 159)
+ else if (trainerId <= FRONTIER_TRAINER_JAZLYN) // 140 - 159
fixedIv = 12;
- else if (trainerId <= 179)
+ else if (trainerId <= FRONTIER_TRAINER_ALISON) // 160 - 179
fixedIv = 15;
- else if (trainerId <= 199)
+ else if (trainerId <= FRONTIER_TRAINER_LAMAR) // 180 - 199
fixedIv = 18;
- else if (trainerId <= 219)
+ else if (trainerId <= FRONTIER_TRAINER_TESS) // 200 - 219
fixedIv = 21;
- else
+ else // 220+ (- 299)
fixedIv = 31;
return fixedIv;
@@ -6304,7 +6307,7 @@ static void CopyDomeTrainerName(u8 *str, u16 trainerId)
for (i = 0; i < PLAYER_NAME_LENGTH; i++)
str[i] = gSaveBlock2Ptr->playerName[i];
}
- else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
+ else if (trainerId < FRONTIER_TRAINERS_COUNT)
{
for (i = 0; i < PLAYER_NAME_LENGTH; i++)
str[i] = gFacilityTrainers[trainerId].trainerName[i];