Add frontier trainer constants

This commit is contained in:
GriffinR 2019-12-20 18:52:29 -05:00
parent 63c8cf97d1
commit ff2d8a9c4e
18 changed files with 757 additions and 423 deletions

View File

@ -13,7 +13,7 @@ Route110_TrickHouseEnd_OnResume: @ 826ACC4
Route110_TrickHouseEnd_OnTransition: @ 826ACD0
setvar VAR_TEMP_1, 0
setvar VAR_TEMP_2, 0
special SetTrickHouseEndRoomFlag
special SetTrickHouseNuggetFlag
end
Route110_TrickHouseEnd_OnWarp: @ 826ACDE
@ -171,7 +171,7 @@ Route110_TrickHouseEnd_EventScript_CompletedPuzzle8:: @ 826AF28
call_if_eq Route110_TrickHouseEnd_EventScript_NoRoomForTent
msgbox Route110_TrickHouseEnd_Text_LeavingOnJourney, MSGBOX_DEFAULT
call Route110_TrickHouseEnd_EventScript_TrickMasterExit
special ResetTrickHouseEndRoomFlag
special ResetTrickHouseNuggetFlag
release
end

View File

@ -271,8 +271,8 @@ gSpecials:: @ 81DBA64
def_special RetrieveLotteryNumber
def_special PickLotteryCornerTicket
def_special ShowBerryBlenderRecordWindow
def_special ResetTrickHouseEndRoomFlag
def_special SetTrickHouseEndRoomFlag
def_special ResetTrickHouseNuggetFlag
def_special SetTrickHouseNuggetFlag
def_special ScriptMenu_CreatePCMultichoice
def_special AccessHallOfFamePC
def_special Special_ShowDiploma

View File

@ -49,7 +49,7 @@ extern const struct BattleFrontierTrainer *gFacilityTrainers;
extern const struct FacilityMon *gFacilityTrainerMons;
void CallBattleTowerFunc(void);
u16 sub_8162548(u8 challengeNum, u8 battleNum);
u16 GetRandomScaledFrontierTrainerId(u8 challengeNum, u8 battleNum);
void SetBattleFacilityTrainerGfxId(u16 trainerId, u8 tempVarId);
void SetEReaderTrainerGfxId(void);
u8 GetBattleFacilityTrainerGfxId(u16 trainerId);

View File

@ -0,0 +1,309 @@
#ifndef GUARD_CONSTANTS_BATTLE_FRONTIER_TRAINERS_H
#define GUARD_CONSTANTS_BATTLE_FRONTIER_TRAINERS_H
#define FRONTIER_TRAINER_BRADY 0
#define FRONTIER_TRAINER_CONNER 1
#define FRONTIER_TRAINER_BRADLEY 2
#define FRONTIER_TRAINER_CYBIL 3
#define FRONTIER_TRAINER_RODETTE 4
#define FRONTIER_TRAINER_PEGGY 5
#define FRONTIER_TRAINER_KEITH 6
#define FRONTIER_TRAINER_GRAYSON 7
#define FRONTIER_TRAINER_GLENN 8
#define FRONTIER_TRAINER_LILIANA 9
#define FRONTIER_TRAINER_ELISE 10
#define FRONTIER_TRAINER_ZOEY 11
#define FRONTIER_TRAINER_MANUEL 12
#define FRONTIER_TRAINER_RUSS 13
#define FRONTIER_TRAINER_DUSTIN 14
#define FRONTIER_TRAINER_TINA 15
#define FRONTIER_TRAINER_GILLIAN1 16
#define FRONTIER_TRAINER_ZOE 17
#define FRONTIER_TRAINER_CHEN 18
#define FRONTIER_TRAINER_AL 19
#define FRONTIER_TRAINER_MITCH 20
#define FRONTIER_TRAINER_ANNE 21
#define FRONTIER_TRAINER_ALIZE 22
#define FRONTIER_TRAINER_LAUREN 23
#define FRONTIER_TRAINER_KIPP 24
#define FRONTIER_TRAINER_JASON 25
#define FRONTIER_TRAINER_JOHN 26
#define FRONTIER_TRAINER_ANN 27
#define FRONTIER_TRAINER_EILEEN 28
#define FRONTIER_TRAINER_CARLIE 29
#define FRONTIER_TRAINER_GORDON 30
#define FRONTIER_TRAINER_AYDEN 31
#define FRONTIER_TRAINER_MARCO 32
#define FRONTIER_TRAINER_CIERRA 33
#define FRONTIER_TRAINER_MARCY 34
#define FRONTIER_TRAINER_KATHY 35
#define FRONTIER_TRAINER_PEYTON 36
#define FRONTIER_TRAINER_JULIAN 37
#define FRONTIER_TRAINER_QUINN 38
#define FRONTIER_TRAINER_HAYLEE 39
#define FRONTIER_TRAINER_AMANDA 40
#define FRONTIER_TRAINER_STACY 41
#define FRONTIER_TRAINER_RAFAEL 42
#define FRONTIER_TRAINER_OLIVER 43
#define FRONTIER_TRAINER_PAYTON 44
#define FRONTIER_TRAINER_PAMELA 45
#define FRONTIER_TRAINER_ELIZA 46
#define FRONTIER_TRAINER_MARISA 47
#define FRONTIER_TRAINER_LEWIS 48
#define FRONTIER_TRAINER_YOSHI 49
#define FRONTIER_TRAINER_DESTIN 50
#define FRONTIER_TRAINER_KEON 51
#define FRONTIER_TRAINER_STUART 52
#define FRONTIER_TRAINER_NESTOR 53
#define FRONTIER_TRAINER_DERRICK 54
#define FRONTIER_TRAINER_BRYSON 55
#define FRONTIER_TRAINER_CLAYTON 56
#define FRONTIER_TRAINER_TRENTON 57
#define FRONTIER_TRAINER_JENSON 58
#define FRONTIER_TRAINER_WESLEY 59
#define FRONTIER_TRAINER_ANTON 60
#define FRONTIER_TRAINER_LAWSON 61
#define FRONTIER_TRAINER_SAMMY 62
#define FRONTIER_TRAINER_ARNIE 63
#define FRONTIER_TRAINER_ADRIAN 64
#define FRONTIER_TRAINER_TRISTAN 65
#define FRONTIER_TRAINER_JULIANA 66
#define FRONTIER_TRAINER_RYLEE 67
#define FRONTIER_TRAINER_CHELSEA 68
#define FRONTIER_TRAINER_DANELA 69
#define FRONTIER_TRAINER_LIZBETH 70
#define FRONTIER_TRAINER_AMELIA 71
#define FRONTIER_TRAINER_JILLIAN 72
#define FRONTIER_TRAINER_ABBIE 73
#define FRONTIER_TRAINER_BRIANA 74
#define FRONTIER_TRAINER_ANTONIO 75
#define FRONTIER_TRAINER_JADEN 76
#define FRONTIER_TRAINER_DAKOTA 77
#define FRONTIER_TRAINER_BRAYDEN 78
#define FRONTIER_TRAINER_CORSON 79
#define FRONTIER_TRAINER_TREVIN 80
#define FRONTIER_TRAINER_PATRICK 81
#define FRONTIER_TRAINER_KADEN 82
#define FRONTIER_TRAINER_MAXWELL 83
#define FRONTIER_TRAINER_DARYL 84
#define FRONTIER_TRAINER_KENNETH 85
#define FRONTIER_TRAINER_RICH 86
#define FRONTIER_TRAINER_CADEN 87
#define FRONTIER_TRAINER_MARLON 88
#define FRONTIER_TRAINER_NASH 89
#define FRONTIER_TRAINER_ROBBY 90
#define FRONTIER_TRAINER_REECE 91
#define FRONTIER_TRAINER_KATHRYN 92
#define FRONTIER_TRAINER_ELLEN 93
#define FRONTIER_TRAINER_RAMON 94
#define FRONTIER_TRAINER_ARTHUR 95
#define FRONTIER_TRAINER_ALONDRA 96
#define FRONTIER_TRAINER_ADRIANA 97
#define FRONTIER_TRAINER_MALIK 98
#define FRONTIER_TRAINER_JILL 99
#define FRONTIER_TRAINER_ERIK 100
#define FRONTIER_TRAINER_YAZMIN 101
#define FRONTIER_TRAINER_JAMAL 102
#define FRONTIER_TRAINER_LESLIE 103
#define FRONTIER_TRAINER_DAVE 104
#define FRONTIER_TRAINER_CARLO 105
#define FRONTIER_TRAINER_EMILIA 106
#define FRONTIER_TRAINER_DALIA 107
#define FRONTIER_TRAINER_HITOMI 108
#define FRONTIER_TRAINER_RICARDO 109
#define FRONTIER_TRAINER_SHIZUKA 110
#define FRONTIER_TRAINER_JOANA 111
#define FRONTIER_TRAINER_KELLY 112
#define FRONTIER_TRAINER_RAYNA 113
#define FRONTIER_TRAINER_EVAN 114
#define FRONTIER_TRAINER_JORDAN 115
#define FRONTIER_TRAINER_JOEL 116
#define FRONTIER_TRAINER_KRISTEN 117
#define FRONTIER_TRAINER_SELPHY 118
#define FRONTIER_TRAINER_CHLOE 119
#define FRONTIER_TRAINER_NORTON 120
#define FRONTIER_TRAINER_LUKAS 121
#define FRONTIER_TRAINER_ZACH 122
#define FRONTIER_TRAINER_KAITLYN 123
#define FRONTIER_TRAINER_BREANNA 124
#define FRONTIER_TRAINER_KENDRA 125
#define FRONTIER_TRAINER_MOLLY 126
#define FRONTIER_TRAINER_JAZMIN 127
#define FRONTIER_TRAINER_KELSEY 128
#define FRONTIER_TRAINER_JALEN 129
#define FRONTIER_TRAINER_GRIFFEN 130
#define FRONTIER_TRAINER_XANDER 131
#define FRONTIER_TRAINER_MARVIN 132
#define FRONTIER_TRAINER_BRENNAN 133
#define FRONTIER_TRAINER_BALEY 134
#define FRONTIER_TRAINER_ZACKARY 135
#define FRONTIER_TRAINER_GABRIEL 136
#define FRONTIER_TRAINER_EMILY 137
#define FRONTIER_TRAINER_JORDYN 138
#define FRONTIER_TRAINER_SOFIA 139
#define FRONTIER_TRAINER_BRADEN 140
#define FRONTIER_TRAINER_KAYDEN 141
#define FRONTIER_TRAINER_COOPER 142
#define FRONTIER_TRAINER_JULIA 143
#define FRONTIER_TRAINER_AMARA 144
#define FRONTIER_TRAINER_LYNN 145
#define FRONTIER_TRAINER_JOVAN 146
#define FRONTIER_TRAINER_DOMINIC 147
#define FRONTIER_TRAINER_NIKOLAS 148
#define FRONTIER_TRAINER_VALERIA 149
#define FRONTIER_TRAINER_DELANEY 150
#define FRONTIER_TRAINER_MEGHAN 151
#define FRONTIER_TRAINER_ROBERTO 152
#define FRONTIER_TRAINER_DAMIAN 153
#define FRONTIER_TRAINER_BRODY 154
#define FRONTIER_TRAINER_GRAHAM 155
#define FRONTIER_TRAINER_TYLOR 156
#define FRONTIER_TRAINER_JAREN 157
#define FRONTIER_TRAINER_CORDELL 158
#define FRONTIER_TRAINER_JAZLYN 159
#define FRONTIER_TRAINER_ZACHERY 160
#define FRONTIER_TRAINER_JOHAN 161
#define FRONTIER_TRAINER_SHEA 162
#define FRONTIER_TRAINER_KAILA 163
#define FRONTIER_TRAINER_ISIAH 164
#define FRONTIER_TRAINER_GARRETT 165
#define FRONTIER_TRAINER_HAYLIE 166
#define FRONTIER_TRAINER_MEGAN 167
#define FRONTIER_TRAINER_ISSAC 168
#define FRONTIER_TRAINER_QUINTON 169
#define FRONTIER_TRAINER_SALMA 170
#define FRONTIER_TRAINER_ANSLEY 171
#define FRONTIER_TRAINER_HOLDEN 172
#define FRONTIER_TRAINER_LUCA 173
#define FRONTIER_TRAINER_JAMISON 174
#define FRONTIER_TRAINER_GUNNAR 175
#define FRONTIER_TRAINER_CRAIG 176
#define FRONTIER_TRAINER_PIERCE 177
#define FRONTIER_TRAINER_REGINA 178
#define FRONTIER_TRAINER_ALISON 179
#define FRONTIER_TRAINER_HANK 180
#define FRONTIER_TRAINER_EARL 181
#define FRONTIER_TRAINER_RAMIRO 182
#define FRONTIER_TRAINER_HUNTER 183
#define FRONTIER_TRAINER_AIDEN 184
#define FRONTIER_TRAINER_XAVIER 185
#define FRONTIER_TRAINER_CLINTON 186
#define FRONTIER_TRAINER_JESSE 187
#define FRONTIER_TRAINER_EDUARDO 188
#define FRONTIER_TRAINER_HAL 189
#define FRONTIER_TRAINER_GAGE 190
#define FRONTIER_TRAINER_ARNOLD 191
#define FRONTIER_TRAINER_JARRETT 192
#define FRONTIER_TRAINER_GARETT 193
#define FRONTIER_TRAINER_EMANUEL 194
#define FRONTIER_TRAINER_GUSTAVO 195
#define FRONTIER_TRAINER_KAMERON 196
#define FRONTIER_TRAINER_ALFREDO 197
#define FRONTIER_TRAINER_RUBEN 198
#define FRONTIER_TRAINER_LAMAR 199
#define FRONTIER_TRAINER_JAXON 200
#define FRONTIER_TRAINER_LOGAN 201
#define FRONTIER_TRAINER_EMILEE 202
#define FRONTIER_TRAINER_JOSIE 203
#define FRONTIER_TRAINER_ARMANDO 204
#define FRONTIER_TRAINER_SKYLER 205
#define FRONTIER_TRAINER_RUTH 206
#define FRONTIER_TRAINER_MELODY 207
#define FRONTIER_TRAINER_PEDRO 208
#define FRONTIER_TRAINER_ERICK 209
#define FRONTIER_TRAINER_ELAINE 210
#define FRONTIER_TRAINER_JOYCE 211
#define FRONTIER_TRAINER_TODD 212
#define FRONTIER_TRAINER_GAVIN 213
#define FRONTIER_TRAINER_MALORY 214
#define FRONTIER_TRAINER_ESTHER 215
#define FRONTIER_TRAINER_OSCAR 216
#define FRONTIER_TRAINER_WILSON 217
#define FRONTIER_TRAINER_CLARE 218
#define FRONTIER_TRAINER_TESS 219
#define FRONTIER_TRAINER_LEON 220
#define FRONTIER_TRAINER_ALONZO 221
#define FRONTIER_TRAINER_VINCE 222
#define FRONTIER_TRAINER_BRYON 223
#define FRONTIER_TRAINER_AVA 224
#define FRONTIER_TRAINER_MIRIAM 225
#define FRONTIER_TRAINER_CARRIE 226
#define FRONTIER_TRAINER_GILLIAN2 227
#define FRONTIER_TRAINER_TYLER 228
#define FRONTIER_TRAINER_CHAZ 229
#define FRONTIER_TRAINER_NELSON 230
#define FRONTIER_TRAINER_SHANIA 231
#define FRONTIER_TRAINER_STELLA 232
#define FRONTIER_TRAINER_DORINE 233
#define FRONTIER_TRAINER_MADDOX 234
#define FRONTIER_TRAINER_DAVIN 235
#define FRONTIER_TRAINER_TREVON 236
#define FRONTIER_TRAINER_MATEO 237
#define FRONTIER_TRAINER_BRET 238
#define FRONTIER_TRAINER_RAUL 239
#define FRONTIER_TRAINER_KAY 240
#define FRONTIER_TRAINER_ELENA 241
#define FRONTIER_TRAINER_ALANA 242
#define FRONTIER_TRAINER_ALEXAS 243
#define FRONTIER_TRAINER_WESTON 244
#define FRONTIER_TRAINER_JASPER 245
#define FRONTIER_TRAINER_NADIA 246
#define FRONTIER_TRAINER_MIRANDA 247
#define FRONTIER_TRAINER_EMMA 248
#define FRONTIER_TRAINER_ROLANDO 249
#define FRONTIER_TRAINER_STANLY 250
#define FRONTIER_TRAINER_DARIO 251
#define FRONTIER_TRAINER_KARLEE 252
#define FRONTIER_TRAINER_JAYLIN 253
#define FRONTIER_TRAINER_INGRID 254
#define FRONTIER_TRAINER_DELILAH 255
#define FRONTIER_TRAINER_CARLY 256
#define FRONTIER_TRAINER_LEXIE 257
#define FRONTIER_TRAINER_MILLER 258
#define FRONTIER_TRAINER_MARV 259
#define FRONTIER_TRAINER_LAYTON 260
#define FRONTIER_TRAINER_BROOKS 261
#define FRONTIER_TRAINER_GREGORY 262
#define FRONTIER_TRAINER_REESE 263
#define FRONTIER_TRAINER_MASON 264
#define FRONTIER_TRAINER_TOBY 265
#define FRONTIER_TRAINER_DOROTHY 266
#define FRONTIER_TRAINER_PIPER 267
#define FRONTIER_TRAINER_FINN 268
#define FRONTIER_TRAINER_SAMIR 269
#define FRONTIER_TRAINER_FIONA 270
#define FRONTIER_TRAINER_GLORIA 271
#define FRONTIER_TRAINER_NICO 272
#define FRONTIER_TRAINER_JEREMY 273
#define FRONTIER_TRAINER_CAITLIN 274
#define FRONTIER_TRAINER_REENA 275
#define FRONTIER_TRAINER_AVERY 276
#define FRONTIER_TRAINER_LIAM 277
#define FRONTIER_TRAINER_THEO 278
#define FRONTIER_TRAINER_BAILEY 279
#define FRONTIER_TRAINER_HUGO 280
#define FRONTIER_TRAINER_BRYCE 281
#define FRONTIER_TRAINER_GIDEON 282
#define FRONTIER_TRAINER_TRISTON 283
#define FRONTIER_TRAINER_CHARLES 284
#define FRONTIER_TRAINER_RAYMOND 285
#define FRONTIER_TRAINER_DIRK 286
#define FRONTIER_TRAINER_HAROLD 287
#define FRONTIER_TRAINER_OMAR 288
#define FRONTIER_TRAINER_PETER 289
#define FRONTIER_TRAINER_DEV 290
#define FRONTIER_TRAINER_COREY 291
#define FRONTIER_TRAINER_ANDRE 292
#define FRONTIER_TRAINER_FERRIS 293
#define FRONTIER_TRAINER_ALIVIA 294
#define FRONTIER_TRAINER_PAIGE 295
#define FRONTIER_TRAINER_ANYA 296
#define FRONTIER_TRAINER_DAWN 297
#define FRONTIER_TRAINER_ABBY 298
#define FRONTIER_TRAINER_GRETEL 299
#define FRONTIER_TRAINERS_COUNT 300
// special trainer IDs begin at 300, see constants/trainers.h
#endif // GUARD_CONSTANTS_BATTLE_FRONTIER_TRAINERS_H

View File

@ -1,6 +1,8 @@
#ifndef GUARD_CONSTANTS_FLAGS_H
#define GUARD_CONSTANTS_FLAGS_H
#include "constants/opponents.h"
// Temporary Flags
// These temporary flags are are cleared every time a map is loaded. They are used
// for things like shortening an NPCs introduction text if the player already spoke
@ -533,8 +535,6 @@
#define FLAG_MYSTERY_EVENT_14 0x1F2
#define FLAG_MYSTERY_EVENT_15 0x1F3
#define FLAG_TRICK_HOUSE_END_ROOM 0x1F5 // Trick House End Room Flag
// Hidden Items -- sorted by location
#define FLAG_HIDDEN_ITEMS_START 0x1F4
#define FLAG_HIDDEN_ITEM_TRICK_HOUSE_NUGGET (FLAG_HIDDEN_ITEMS_START + 0x01)
@ -1342,13 +1342,17 @@
#define FLAG_UNUSED_0x4FF 0x4FF // Unused Flag
#define FLAG_TRAINER_FLAG_START 0x500
#define TRAINERS_FLAG_NO 0x356
// Trainer Flags
// Trainer flags occupy 0x500 - 0x85F, the last 9 of which are unused
// See constants/opponents.h. The values there + FLAG_TRAINER_FLAG_START are the flag IDs
#define SYSTEM_FLAGS (FLAG_TRAINER_FLAG_START + TRAINERS_FLAG_NO + 0xA) // 0x860
#define TRAINER_FLAGS_START 0x500
#define TRAINER_FLAGS_END (TRAINER_FLAGS_START + MAX_TRAINERS_COUNT - 1) // 0x85F
// System Flags
#define SYSTEM_FLAGS (TRAINER_FLAGS_END + 1) // 0x860
#define FLAG_SYS_POKEMON_GET (SYSTEM_FLAGS + 0) // FLAG_0x860
#define FLAG_SYS_POKEDEX_GET (SYSTEM_FLAGS + 1)
#define FLAG_SYS_POKENAV_GET (SYSTEM_FLAGS + 2)

View File

@ -857,6 +857,10 @@
#define TRAINER_BRENDAN_16 853
#define TRAINER_MAY_16 854
// NOTE: Because each Trainer uses a flag to determine when they are defeated, there is only space for 9 additional trainers before trainer flag space overflows
// More space can be made by shifting flags around in constants/flags.h or changing how trainer flags are handled
#define TRAINERS_COUNT 855
#define MAX_TRAINERS_COUNT 864
#endif // GUARD_CONSTANTS_OPPONENTS_H

View File

@ -2,9 +2,11 @@
#define GUARD_TRAINERS_H
#include "constants/opponents.h"
#include "constants/battle_frontier_trainers.h"
// Special Trainer Ids.
#define TRAINER_RECORD_MIXING_FRIEND 300
// 0-299 are frontier trainers
#define TRAINER_RECORD_MIXING_FRIEND FRONTIER_TRAINERS_COUNT
#define TRAINER_RECORD_MIXING_APPRENTICE 400
#define TRAINER_EREADER 500
#define TRAINER_FRONTIER_BRAIN 1022

View File

@ -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];

View File

@ -304,7 +304,7 @@ static void GenerateOpponentMons(void)
do
{
trainerId = sub_8162548(challengeNum, gSaveBlock2Ptr->frontier.curChallengeBattleNum);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, gSaveBlock2Ptr->frontier.curChallengeBattleNum);
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)

View File

@ -159,7 +159,7 @@ static void SetPalaceOpponent(void)
static void BufferOpponentIntroSpeech(void)
{
if (gTrainerBattleOpponent_A < TRAINER_RECORD_MIXING_FRIEND)
if (gTrainerBattleOpponent_A < FRONTIER_TRAINERS_COUNT)
FrontierSpeechToString(gFacilityTrainers[gTrainerBattleOpponent_A].speechBefore);
}

View File

@ -1400,7 +1400,7 @@ static void PrepareOneTrainer(bool8 difficult)
challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / 14;
do
{
trainerId = sub_8162548(challengeNum, battleNum);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, battleNum);
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
@ -1425,7 +1425,7 @@ static void PrepareTwoTrainers(void)
gFacilityTrainers = gBattleFrontierTrainers;
do
{
trainerId = sub_8162548(challengeNum, 1);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, 1);
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
@ -1440,7 +1440,7 @@ static void PrepareTwoTrainers(void)
do
{
trainerId = sub_8162548(challengeNum, 1);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, 1);
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
@ -1466,12 +1466,12 @@ static void BufferTrainerIntro(void)
{
if (gSpecialVar_0x8005 == 0)
{
if (gTrainerBattleOpponent_A < TRAINER_RECORD_MIXING_FRIEND)
if (gTrainerBattleOpponent_A < FRONTIER_TRAINERS_COUNT)
FrontierSpeechToString(gFacilityTrainers[gTrainerBattleOpponent_A].speechBefore);
}
else if (gSpecialVar_0x8005 == 1)
{
if (gTrainerBattleOpponent_B < TRAINER_RECORD_MIXING_FRIEND)
if (gTrainerBattleOpponent_B < FRONTIER_TRAINERS_COUNT)
FrontierSpeechToString(gFacilityTrainers[gTrainerBattleOpponent_B].speechBefore);
}
}

View File

@ -1493,7 +1493,7 @@ static u16 GetUniqueTrainerId(u8 eventObjectId)
{
do
{
trainerId = sub_8162548(challengeNum + 1, battleNum);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum + 1, battleNum);
for (i = 0; i < eventObjectId; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
@ -1505,7 +1505,7 @@ static u16 GetUniqueTrainerId(u8 eventObjectId)
{
do
{
trainerId = sub_8162548(challengeNum, battleNum);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, battleNum);
for (i = 0; i < eventObjectId; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)

View File

@ -961,12 +961,12 @@ static u8 TrainerBattleLoadArg8(const u8 *ptr)
static u16 GetTrainerAFlag(void)
{
return FLAG_TRAINER_FLAG_START + gTrainerBattleOpponent_A;
return TRAINER_FLAGS_START + gTrainerBattleOpponent_A;
}
static u16 GetTrainerBFlag(void)
{
return FLAG_TRAINER_FLAG_START + gTrainerBattleOpponent_B;
return TRAINER_FLAGS_START + gTrainerBattleOpponent_B;
}
static bool32 IsPlayerDefeated(u32 battleOutcome)
@ -1193,7 +1193,7 @@ void SetUpTwoTrainersBattle(void)
bool32 GetTrainerFlagFromScriptPointer(const u8 *data)
{
u32 flag = TrainerBattleLoadArg16(data + 2);
return FlagGet(FLAG_TRAINER_FLAG_START + flag);
return FlagGet(TRAINER_FLAGS_START + flag);
}
void SetUpTrainerMovement(void)
@ -1232,17 +1232,17 @@ static void SetBattledTrainerFlag(void)
bool8 HasTrainerBeenFought(u16 trainerId)
{
return FlagGet(FLAG_TRAINER_FLAG_START + trainerId);
return FlagGet(TRAINER_FLAGS_START + trainerId);
}
void SetTrainerFlag(u16 trainerId)
{
FlagSet(FLAG_TRAINER_FLAG_START + trainerId);
FlagSet(TRAINER_FLAGS_START + trainerId);
}
void ClearTrainerFlag(u16 trainerId)
{
FlagClear(FLAG_TRAINER_FLAG_START + trainerId);
FlagClear(TRAINER_FLAGS_START + trainerId);
}
void BattleSetup_StartTrainerBattle(void)

View File

@ -134,7 +134,7 @@ static void SetVerdanturfTentTrainerGfx(void)
static void BufferVerdanturfTentTrainerIntro(void)
{
if (gTrainerBattleOpponent_A < TRAINER_RECORD_MIXING_FRIEND)
if (gTrainerBattleOpponent_A < FRONTIER_TRAINERS_COUNT)
FrontierSpeechToString(gFacilityTrainers[gTrainerBattleOpponent_A].speechBefore);
}

View File

@ -1104,32 +1104,37 @@ static const u8 sBattleTowerPartySizes2[] =
[FRONTIER_MODE_LINK_MULTIS] = FRONTIER_MULTI_PARTY_SIZE,
};
// min/max trainer id
static const u16 gUnknown_085DF9FA[][2] =
// Trainer ID ranges for possible frontier trainers to encounter on particular challenges
// Trainers are scaled by difficulty, so higher trainer IDs have better teams
static const u16 sFrontierTrainerIdRanges[][2] =
{
{0x0000, 0x0063},
{0x0050, 0x0077},
{0x0064, 0x008b},
{0x0078, 0x009f},
{0x008c, 0x00b3},
{0x00a0, 0x00c7},
{0x00b4, 0x00db},
{0x00c8, 0x012b},
{FRONTIER_TRAINER_BRADY, FRONTIER_TRAINER_JILL}, // 0 - 99
{FRONTIER_TRAINER_TREVIN, FRONTIER_TRAINER_CHLOE}, // 80 - 119
{FRONTIER_TRAINER_ERIK, FRONTIER_TRAINER_SOFIA}, // 100 - 139
{FRONTIER_TRAINER_NORTON, FRONTIER_TRAINER_JAZLYN}, // 120 - 159
{FRONTIER_TRAINER_BRADEN, FRONTIER_TRAINER_ALISON}, // 140 - 179
{FRONTIER_TRAINER_ZACHERY, FRONTIER_TRAINER_LAMAR}, // 160 - 199
{FRONTIER_TRAINER_HANK, FRONTIER_TRAINER_TESS}, // 180 - 219
{FRONTIER_TRAINER_JAXON, FRONTIER_TRAINER_GRETEL}, // 200 - 299
};
// min/max trainer id
static const u16 gUnknown_085DFA1A[][2] =
static const u16 sFrontierTrainerIdRangesHard[][2] =
{
{0x0064, 0x0077},
{0x0078, 0x008b},
{0x008c, 0x009f},
{0x00a0, 0x00b3},
{0x00b4, 0x00c7},
{0x00c8, 0x00db},
{0x00dc, 0x00ef},
{0x00c8, 0x012b},
{0x00b3, 0x008d},
{0x00c8, 0x00b7},
{FRONTIER_TRAINER_ERIK, FRONTIER_TRAINER_CHLOE}, // 100 - 119
{FRONTIER_TRAINER_NORTON, FRONTIER_TRAINER_SOFIA}, // 120 - 139
{FRONTIER_TRAINER_BRADEN, FRONTIER_TRAINER_JAZLYN}, // 140 - 159
{FRONTIER_TRAINER_ZACHERY, FRONTIER_TRAINER_ALISON}, // 160 - 179
{FRONTIER_TRAINER_HANK, FRONTIER_TRAINER_LAMAR}, // 180 - 199
{FRONTIER_TRAINER_JAXON, FRONTIER_TRAINER_TESS}, // 200 - 219
{FRONTIER_TRAINER_LEON, FRONTIER_TRAINER_RAUL}, // 220 - 239
{FRONTIER_TRAINER_JAXON, FRONTIER_TRAINER_GRETEL}, // 200 - 299
};
// Trainer IDs? Don't make sense as part of previous array, min/max relationship reversed and never accessed
static const u16 sUnused_085DFA1A[][2] =
{
{179, 141}, // FRONTIER_TRAINER_ALISON - FRONTIER_TRAINER_KAYDEN
{200, 183}, // FRONTIER_TRAINER_JAXON - FRONTIER_TRAINER_HUNTER
};
static const u8 sBattleTowerPartySizes[FRONTIER_MODE_COUNT] =
@ -1334,7 +1339,7 @@ static void SetNextFacilityOpponent(void)
s32 i;
while (1)
{
id = sub_8162548(challengeNum, gSaveBlock2Ptr->frontier.curChallengeBattleNum);
id = GetRandomScaledFrontierTrainerId(challengeNum, gSaveBlock2Ptr->frontier.curChallengeBattleNum);
// Ensure trainer wasn't previously fought in this challenge.
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
@ -1354,7 +1359,7 @@ static void SetNextFacilityOpponent(void)
}
}
u16 sub_8162548(u8 challengeNum, u8 battleNum)
u16 GetRandomScaledFrontierTrainerId(u8 challengeNum, u8 battleNum)
{
u16 trainerId;
@ -1362,49 +1367,54 @@ u16 sub_8162548(u8 challengeNum, u8 battleNum)
{
if (battleNum == 6)
{
trainerId = (gUnknown_085DFA1A[challengeNum][1] - gUnknown_085DFA1A[challengeNum][0]) + 1;
trainerId = gUnknown_085DFA1A[challengeNum][0] + (Random() % trainerId);
// The last battle in each challenge has a jump in difficulty, pulls from a table with higher ranges
trainerId = (sFrontierTrainerIdRangesHard[challengeNum][1] - sFrontierTrainerIdRangesHard[challengeNum][0]) + 1;
trainerId = sFrontierTrainerIdRangesHard[challengeNum][0] + (Random() % trainerId);
}
else
{
trainerId = (gUnknown_085DF9FA[challengeNum][1] - gUnknown_085DF9FA[challengeNum][0]) + 1;
trainerId = gUnknown_085DF9FA[challengeNum][0] + (Random() % trainerId);
trainerId = (sFrontierTrainerIdRanges[challengeNum][1] - sFrontierTrainerIdRanges[challengeNum][0]) + 1;
trainerId = sFrontierTrainerIdRanges[challengeNum][0] + (Random() % trainerId);
}
}
else
{
trainerId = (gUnknown_085DF9FA[7][1] - gUnknown_085DF9FA[7][0]) + 1;
trainerId = gUnknown_085DF9FA[7][0] + (Random() % trainerId);
// After challenge 7, trainer IDs always come from the last, hardest range, which is the same for both trainer ID tables
trainerId = (sFrontierTrainerIdRanges[7][1] - sFrontierTrainerIdRanges[7][0]) + 1;
trainerId = sFrontierTrainerIdRanges[7][0] + (Random() % trainerId);
}
return trainerId;
}
static void sub_81625B4(u8 challengeNum, u8 battleNum, u16 *trainerIdPtr, u8 *arg3) // Unused
// Unused
static void GetRandomScaledFrontierTrainerIdRange(u8 challengeNum, u8 battleNum, u16 *trainerIdPtr, u8 *rangePtr)
{
u16 trainerId, count;
u16 trainerId, range;
if (challengeNum <= 7)
{
if (battleNum == 6)
{
count = (gUnknown_085DFA1A[challengeNum][1] - gUnknown_085DFA1A[challengeNum][0]) + 1;
trainerId = gUnknown_085DFA1A[challengeNum][0];
// The last battle in each challenge has a jump in difficulty, pulls from a table with higher ranges
range = (sFrontierTrainerIdRangesHard[challengeNum][1] - sFrontierTrainerIdRangesHard[challengeNum][0]) + 1;
trainerId = sFrontierTrainerIdRangesHard[challengeNum][0];
}
else
{
count = (gUnknown_085DF9FA[challengeNum][1] - gUnknown_085DF9FA[challengeNum][0]) + 1;
trainerId = gUnknown_085DF9FA[challengeNum][0];
range = (sFrontierTrainerIdRanges[challengeNum][1] - sFrontierTrainerIdRanges[challengeNum][0]) + 1;
trainerId = sFrontierTrainerIdRanges[challengeNum][0];
}
}
else
{
count = (gUnknown_085DF9FA[7][1] - gUnknown_085DF9FA[7][0]) + 1;
trainerId = gUnknown_085DF9FA[7][0];
// After challenge 7, trainer IDs always come from the last, hardest range, which is the same for both trainer ID tables
range = (sFrontierTrainerIdRanges[7][1] - sFrontierTrainerIdRanges[7][0]) + 1;
trainerId = sFrontierTrainerIdRanges[7][0];
}
*trainerIdPtr = trainerId;
*arg3 = count;
*rangePtr = range;
}
void SetBattleFacilityTrainerGfxId(u16 trainerId, u8 tempVarId)
@ -1423,7 +1433,7 @@ void SetBattleFacilityTrainerGfxId(u16 trainerId, u8 tempVarId)
SetFrontierBrainEventObjGfx_2();
return;
}
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
{
facilityClass = gFacilityTrainers[trainerId].facilityClass;
}
@ -1515,7 +1525,7 @@ u8 GetBattleFacilityTrainerGfxId(u16 trainerId)
{
facilityClass = gSaveBlock2Ptr->frontier.ereaderTrainer.facilityClass;
}
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
{
facilityClass = gFacilityTrainers[trainerId].facilityClass;
}
@ -1657,7 +1667,7 @@ u8 GetFrontierTrainerFrontSpriteId(u16 trainerId)
{
return GetFrontierBrainTrainerPicIndex();
}
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
{
return gFacilityClassToPicIndex[gFacilityTrainers[trainerId].facilityClass];
}
@ -1694,7 +1704,7 @@ u8 GetFrontierOpponentClass(u16 trainerId)
{
trainerClass = gTrainers[TRAINER_STEVEN].trainerClass;
}
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
{
trainerClass = gFacilityClassToTrainerClass[gFacilityTrainers[trainerId].facilityClass];
}
@ -1735,7 +1745,7 @@ static u8 GetFrontierTrainerFacilityClass(u16 trainerId)
{
facilityClass = gSaveBlock2Ptr->frontier.ereaderTrainer.facilityClass;
}
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
{
facilityClass = gFacilityTrainers[trainerId].facilityClass;
}
@ -1777,7 +1787,7 @@ void GetFrontierTrainerName(u8 *dst, u16 trainerId)
for (i = 0; i < PLAYER_NAME_LENGTH; i++)
dst[i] = gTrainers[TRAINER_STEVEN].trainerName[i];
}
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
{
for (i = 0; i < PLAYER_NAME_LENGTH; i++)
dst[i] = gFacilityTrainers[trainerId].trainerName[i];
@ -1832,7 +1842,7 @@ static bool8 IsFrontierTrainerFemale(u16 trainerId)
{
return IsFrontierBrainFemale();
}
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
{
facilityClass = gFacilityTrainers[trainerId].facilityClass;
}
@ -1887,7 +1897,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
const u16 *monSets = NULL;
u32 otID = 0;
if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
if (trainerId < FRONTIER_TRAINERS_COUNT)
{
// Normal battle frontier trainer.
fixedIV = GetFrontierTrainerFixedIvs(trainerId);
@ -2070,7 +2080,7 @@ static void FillFactoryFrontierTrainerParty(u16 trainerId, u8 firstMonId)
u8 fixedIV;
u32 otID;
if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
if (trainerId < FRONTIER_TRAINERS_COUNT)
{
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; // Unused variable.
u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
@ -2179,7 +2189,7 @@ static void GetOpponentIntroSpeech(void)
if (trainerId == TRAINER_EREADER)
FrontierSpeechToString(gSaveBlock2Ptr->frontier.ereaderTrainer.greeting);
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
FrontierSpeechToString(gFacilityTrainers[trainerId].speechBefore);
else if (trainerId < TRAINER_RECORD_MIXING_APPRENTICE)
FrontierSpeechToString(gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].greeting);
@ -2407,7 +2417,7 @@ static void sub_8163EE4(void)
StringCopy7(playerRecord->name, gSaveBlock2Ptr->playerName);
playerRecord->winStreak = GetCurrentBattleTowerWinStreak(lvlMode, battleMode);
for (i = 0; i < 6; i++)
for (i = 0; i < EASY_CHAT_BATTLE_WORDS_COUNT; i++)
{
playerRecord->greeting[i] = gSaveBlock1Ptr->easyChatBattleStart[i];
playerRecord->speechWon[i] = gSaveBlock1Ptr->easyChatBattleWon[i];
@ -2529,7 +2539,7 @@ static void sub_81642A0(void)
{
do
{
trainerId = sub_8162548(challengeNum, 0);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, 0);
for (i = 0; i < j; i++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
@ -2657,7 +2667,7 @@ static void sub_81646BC(u16 trainerId, u16 monSetId)
if (trainerId != TRAINER_EREADER)
{
if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
if (trainerId < FRONTIER_TRAINERS_COUNT)
{
move = gFacilityTrainerMons[monSetId].moves[0];
species = gFacilityTrainerMons[monSetId].species;
@ -2705,7 +2715,7 @@ static void sub_8164828(void)
case 0:
if (trainerId == TRAINER_EREADER)
return;
if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
if (trainerId < FRONTIER_TRAINERS_COUNT)
{
GetFrontierTrainerName(gStringVar1, trainerId);
}
@ -2734,7 +2744,7 @@ static void sub_8164828(void)
break;
case 3:
gPartnerTrainerId = trainerId;
if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
if (trainerId < FRONTIER_TRAINERS_COUNT)
{
gSaveBlock2Ptr->frontier.trainerIds[18] = gSaveBlock2Ptr->frontier.trainerIds[8 + k * 2];
gSaveBlock2Ptr->frontier.trainerIds[19] = gSaveBlock2Ptr->frontier.trainerIds[9 + k * 2];
@ -2753,7 +2763,7 @@ static void sub_8164828(void)
{
while (1)
{
i = sub_8162548(challengeNum, k / 2);
i = GetRandomScaledFrontierTrainerId(challengeNum, k / 2);
if (gPartnerTrainerId == i)
continue;
@ -2776,7 +2786,7 @@ static void sub_8164828(void)
if (trainerId == TRAINER_EREADER)
return;
if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
if (trainerId < FRONTIER_TRAINERS_COUNT)
{
ShowFieldMessage(gUnknown_085DD500[arrId].strings[gSpecialVar_0x8005]);
}
@ -2830,7 +2840,7 @@ static void sub_8164B74(void)
{
do
{
trainerId = sub_8162548(challengeNum, i / 2);
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, i / 2);
for (j = 0; j < i; j++)
{
if (gSaveBlock2Ptr->frontier.trainerIds[j] == trainerId)
@ -3214,7 +3224,7 @@ static void FillPartnerParty(u16 trainerId)
// Scrapped, lol.
trainerName[0] = gGameLanguage;
}
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
{
level = SetFacilityPtrsGetLevel();
ivs = GetFrontierTrainerFixedIvs(trainerId);
@ -3418,7 +3428,7 @@ void GetBattleTowerTrainerLanguage(u8 *dst, u16 trainerId)
{
*dst = gGameLanguage;
}
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
{
*dst = gGameLanguage;
}
@ -3491,28 +3501,30 @@ s32 GetHighestLevelInPlayerParty(void)
return highestLevel;
}
// Frontier Trainer parties are roughly scaled in difficulty with higher trainer IDs, so scale IVs as well
// Duplicated in Battle Dome as GetDomeTrainerMonIvs
static u8 GetFrontierTrainerFixedIvs(u16 trainerId)
{
u8 fixedIV = 0;
u8 fixedIv;
if (trainerId < 100)
fixedIV = 3;
else if (trainerId < 120)
fixedIV = 6;
else if (trainerId < 140)
fixedIV = 9;
else if (trainerId < 160)
fixedIV = 12;
else if (trainerId < 180)
fixedIV = 15;
else if (trainerId < 200)
fixedIV = 18;
else if (trainerId < 220)
fixedIV = 21;
else
fixedIV = 31;
if (trainerId <= FRONTIER_TRAINER_JILL) // 0 - 99
fixedIv = 3;
else if (trainerId <= FRONTIER_TRAINER_CHLOE) // 100 - 119
fixedIv = 6;
else if (trainerId <= FRONTIER_TRAINER_SOFIA) // 120 - 139
fixedIv = 9;
else if (trainerId <= FRONTIER_TRAINER_JAZLYN) // 140 - 159
fixedIv = 12;
else if (trainerId <= FRONTIER_TRAINER_ALISON) // 160 - 179
fixedIv = 15;
else if (trainerId <= FRONTIER_TRAINER_LAMAR) // 180 - 199
fixedIv = 18;
else if (trainerId <= FRONTIER_TRAINER_TESS) // 200 - 219
fixedIv = 21;
else // 220+ (- 299)
fixedIv = 31;
return fixedIV;
return fixedIv;
}
static u16 sub_8165D40(void)

File diff suppressed because it is too large Load Diff

View File

@ -1220,18 +1220,18 @@ void EndLotteryCornerComputerEffect(void)
DrawWholeMapView();
}
void SetTrickHouseEndRoomFlag(void)
void SetTrickHouseNuggetFlag(void)
{
u16 *specVar = &gSpecialVar_0x8004;
u16 flag = FLAG_TRICK_HOUSE_END_ROOM;
u16 flag = FLAG_HIDDEN_ITEM_TRICK_HOUSE_NUGGET;
*specVar = flag;
FlagSet(flag);
}
void ResetTrickHouseEndRoomFlag(void)
void ResetTrickHouseNuggetFlag(void)
{
u16 *specVar = &gSpecialVar_0x8004;
u16 flag = FLAG_TRICK_HOUSE_END_ROOM;
u16 flag = FLAG_HIDDEN_ITEM_TRICK_HOUSE_NUGGET;
*specVar = flag;
FlagClear(flag);
}

View File

@ -1701,7 +1701,7 @@ void CopyFrontierTrainerText(u8 whichText, u16 trainerId)
FrontierSpeechToString(gSaveBlock2Ptr->frontier.ereaderTrainer.greeting);
else if (trainerId == TRAINER_FRONTIER_BRAIN)
CopyFrontierBrainText(FALSE);
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
FrontierSpeechToString(gFacilityTrainers[trainerId].speechBefore);
else if (trainerId < TRAINER_RECORD_MIXING_APPRENTICE)
FrontierSpeechToString(gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].greeting);
@ -1717,7 +1717,7 @@ void CopyFrontierTrainerText(u8 whichText, u16 trainerId)
{
CopyFrontierBrainText(FALSE);
}
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
{
FrontierSpeechToString(gFacilityTrainers[trainerId].speechWin);
}
@ -1745,7 +1745,7 @@ void CopyFrontierTrainerText(u8 whichText, u16 trainerId)
{
CopyFrontierBrainText(TRUE);
}
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
else if (trainerId < FRONTIER_TRAINERS_COUNT)
{
FrontierSpeechToString(gFacilityTrainers[trainerId].speechLose);
}