mirror of
https://github.com/pret/pokeheartgold.git
synced 2026-05-05 20:46:28 -05:00
Rename according to suggestions
This commit is contained in:
parent
c927deac28
commit
1ddf2ca6fe
|
|
@ -148,7 +148,7 @@ struct FieldSystem {
|
|||
BagCursor *bagCursor;
|
||||
u8 filler_98[0x4];
|
||||
void *unk9C;
|
||||
FrontierFieldSystem *frontier;
|
||||
FrontierFieldSystem *frontierFsys;
|
||||
Save_LinkBattleRuleset *linkBattleRuleset;
|
||||
UnkStruct_02092BB8 *unkA8;
|
||||
u32 unkAC;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ FrontierFieldSystem *FrontierFieldSystem_New(SaveData *saveData, BOOL resumeFrom
|
|||
void FrontierFieldSystem_Free(FrontierFieldSystem *frontierFsys);
|
||||
void FrontierFieldSystem_0204AA58(FrontierFieldSystem *frontierFsys, TaskManager *taskManager, void *a2);
|
||||
BOOL FrontierFieldSystem_0204AA78(FrontierFieldSystem *frontierFsys, void **a1, SaveData *saveData);
|
||||
u32 FrontierFieldSystem_SelectedPartyHasDuplicateSpeciesOrItem(FrontierFieldSystem *frontierFsys, SaveData *saveData);
|
||||
u32 FrontierFieldSystem_PartyHasDuplicateSpeciesOrItems(FrontierFieldSystem *frontierFsys, SaveData *saveData);
|
||||
void FrontierFieldSystem_SetRandomFrontierTrainers(FrontierFieldSystem *frontierFsys, SaveData *saveData);
|
||||
u8 FrontierFieldSystem_GetFrontierBattleNumber(FrontierFieldSystem *frontierFsys);
|
||||
BOOL FrontierFieldSystem_0204AC7C(FrontierFieldSystem *frontierFsys);
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ static BOOL Task_020509F0(TaskManager *taskManager) {
|
|||
break;
|
||||
case 3:
|
||||
sub_02052444(encounter->setup, fieldSystem);
|
||||
if (fieldSystem->frontier != NULL) {
|
||||
if (fieldSystem->frontierFsys != NULL) {
|
||||
sub_02067484(fieldSystem, &encounter->setup->unk138);
|
||||
}
|
||||
Encounter_GetResult(encounter, fieldSystem);
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ BOOL ScrCmd_442(ScriptContext *ctx) {
|
|||
|
||||
BOOL ScrCmd_443(ScriptContext *ctx) {
|
||||
u8 index = ScriptReadByte(ctx);
|
||||
FrontierFieldSystem *frontierFsys = ctx->fieldSystem->frontier;
|
||||
FrontierFieldSystem *frontierFsys = ctx->fieldSystem->frontierFsys;
|
||||
if (frontierFsys == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ void TrainerHouse_StartBattle(FieldSystem *fieldSystem, u32 trainerNum) {
|
|||
} else {
|
||||
setup = TrainerHouse_NewBattleSetup(fieldSystem, &trainerHouse->sets[trainerNum]);
|
||||
}
|
||||
fieldSystem->frontier = NULL;
|
||||
fieldSystem->frontierFsys = NULL;
|
||||
u32 effect = BattleSetup_GetWildTransitionEffect(setup);
|
||||
u32 bgm = BattleSetup_GetWildBattleMusic(setup);
|
||||
u32 *winFlag = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_BATTLE_WIN_FLAG);
|
||||
|
|
|
|||
|
|
@ -43,18 +43,18 @@ static const u16 StatTrainerOverworlds[] = { SPRITE_SEVEN1, SPRITE_SEVEN5, SPRIT
|
|||
BOOL ScrCmd_410(ScriptContext *ctx) {
|
||||
u16 resumeFromPrevious = ScriptReadHalfword(ctx);
|
||||
u16 towerMode = ScriptReadHalfword(ctx);
|
||||
ctx->fieldSystem->frontier = FrontierFieldSystem_New(FieldSystem_GetSaveData(ctx->fieldSystem), resumeFromPrevious, towerMode);
|
||||
ctx->fieldSystem->frontierFsys = FrontierFieldSystem_New(FieldSystem_GetSaveData(ctx->fieldSystem), resumeFromPrevious, towerMode);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL ScrCmd_409(ScriptContext *ctx) {
|
||||
FrontierFieldSystem_0204A810(&ctx->fieldSystem->frontier);
|
||||
FrontierFieldSystem_0204A810(&ctx->fieldSystem->frontierFsys);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL ScrCmd_411(ScriptContext *ctx) {
|
||||
FrontierFieldSystem_Free(ctx->fieldSystem->frontier);
|
||||
ctx->fieldSystem->frontier = NULL;
|
||||
FrontierFieldSystem_Free(ctx->fieldSystem->frontierFsys);
|
||||
ctx->fieldSystem->frontierFsys = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ BOOL ScrCmd_412(ScriptContext *ctx) {
|
|||
u16 arg = ScriptGetVar(ctx);
|
||||
u16 resultVarId = ScriptReadHalfword(ctx);
|
||||
u16 *result = GetVarPointer(ctx->fieldSystem, resultVarId);
|
||||
FrontierFieldSystem *frontierFsys = ctx->fieldSystem->frontier;
|
||||
FrontierFieldSystem *frontierFsys = ctx->fieldSystem->frontierFsys;
|
||||
switch (id) {
|
||||
case 1:
|
||||
if (arg == 0) {
|
||||
|
|
@ -121,7 +121,7 @@ BOOL ScrCmd_412(ScriptContext *ctx) {
|
|||
*result = FrontierFieldSystem_0204AA78(frontierFsys, unk, ctx->fieldSystem->saveData);
|
||||
break;
|
||||
case 32:
|
||||
*result = FrontierFieldSystem_SelectedPartyHasDuplicateSpeciesOrItem(frontierFsys, ctx->fieldSystem->saveData);
|
||||
*result = FrontierFieldSystem_PartyHasDuplicateSpeciesOrItems(frontierFsys, ctx->fieldSystem->saveData);
|
||||
break;
|
||||
case 35:
|
||||
*result = FrontierFieldSystem_0204AC7C(frontierFsys);
|
||||
|
|
@ -196,7 +196,7 @@ BOOL ScrCmd_412(ScriptContext *ctx) {
|
|||
}
|
||||
|
||||
BOOL ScrCmd_413(ScriptContext *ctx) {
|
||||
FrontierFieldSystem *frontierFsys = ctx->fieldSystem->frontier;
|
||||
FrontierFieldSystem *frontierFsys = ctx->fieldSystem->frontierFsys;
|
||||
u16 multiBattleAllyIndex = ScriptGetVar(ctx);
|
||||
u16 allyMonIndex = ScriptGetVar(ctx);
|
||||
u16 *speciesPtr = ScriptGetVarPointer(ctx);
|
||||
|
|
@ -222,21 +222,21 @@ BOOL ScrCmd_416(ScriptContext *ctx) {
|
|||
u16 unk7 = ScriptGetVar(ctx);
|
||||
u16 unk4 = ScriptGetVar(ctx);
|
||||
u16 *unkPtr = ScriptGetVarPointer(ctx);
|
||||
FrontierFieldSystem *frontierFsys = ctx->fieldSystem->frontier;
|
||||
FrontierFieldSystem *frontierFsys = ctx->fieldSystem->frontierFsys;
|
||||
*unkPtr = FALSE;
|
||||
u32 unk0;
|
||||
switch (unk7) {
|
||||
case 0:
|
||||
unk0 = 62;
|
||||
FrontierFieldSystem_0204B6AC(ctx->fieldSystem->frontier, ctx->fieldSystem->saveData);
|
||||
FrontierFieldSystem_0204B6AC(ctx->fieldSystem->frontierFsys, ctx->fieldSystem->saveData);
|
||||
break;
|
||||
case 1:
|
||||
unk0 = 63;
|
||||
FrontierFieldSystem_0204B708(ctx->fieldSystem->frontier);
|
||||
FrontierFieldSystem_0204B708(ctx->fieldSystem->frontierFsys);
|
||||
break;
|
||||
case 2:
|
||||
unk0 = 64;
|
||||
FrontierFieldSystem_0204B720(ctx->fieldSystem->frontier, unk4);
|
||||
FrontierFieldSystem_0204B720(ctx->fieldSystem->frontierFsys, unk4);
|
||||
break;
|
||||
}
|
||||
if (sub_0205C298(ctx->fieldSystem->saveData) == 1) {
|
||||
|
|
@ -255,7 +255,7 @@ BOOL ScrCmd_416(ScriptContext *ctx) {
|
|||
}
|
||||
|
||||
BOOL ScrCmd_417(ScriptContext *ctx) {
|
||||
FrontierFieldSystem *frontierFsys = ctx->fieldSystem->frontier;
|
||||
FrontierFieldSystem *frontierFsys = ctx->fieldSystem->frontierFsys;
|
||||
u16 unk6 = ScriptGetVar(ctx);
|
||||
u16 unk7 = ScriptReadHalfword(ctx);
|
||||
if (sub_0205C298(ctx->fieldSystem->saveData) == 1) {
|
||||
|
|
@ -269,7 +269,7 @@ BOOL ScrCmd_417(ScriptContext *ctx) {
|
|||
}
|
||||
|
||||
static BOOL sub_0204A1E8(ScriptContext *ctx) {
|
||||
FrontierFieldSystem *frontierFsys = ctx->fieldSystem->frontier;
|
||||
FrontierFieldSystem *frontierFsys = ctx->fieldSystem->frontierFsys;
|
||||
u16 *unkPtr = GetVarPointer(ctx->fieldSystem, frontierFsys->unk8DA);
|
||||
u32 unk = frontierFsys->unk8D5 == 1 ? 1 : 2;
|
||||
if (frontierFsys->unk8D4 == unk) {
|
||||
|
|
|
|||
|
|
@ -4152,7 +4152,7 @@ BOOL ScrCmd_627(ScriptContext *ctx) {
|
|||
MI_CpuClear8(args, sizeof(FrontierLaunchArgs));
|
||||
*pArgs = args;
|
||||
if (r6 == 5 || r6 == 6) {
|
||||
args->unk0 = ctx->fieldSystem->frontier;
|
||||
args->unk0 = ctx->fieldSystem->frontierFsys;
|
||||
} else {
|
||||
args->unk0 = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ static u32 NumMonsForTowerMode(u32 towerMode) {
|
|||
}
|
||||
}
|
||||
|
||||
static BOOL PlayerHasDuplicateItem(SpeciesAndItem *validMons, u32 species, u32 item, s32 partySize) {
|
||||
static BOOL SpeciesAndItem_Contains(SpeciesAndItem *validMons, u32 species, u32 item, s32 partySize) {
|
||||
for (s32 i = 0; i < partySize; i++) {
|
||||
if (species == validMons[i].species
|
||||
&& item != ITEM_NONE
|
||||
|
|
@ -65,7 +65,7 @@ static BOOL PlayerHasDuplicateItem(SpeciesAndItem *validMons, u32 species, u32 i
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL PlayerSpeciesAndItemsAreUnique(SpeciesAndItem *mons, s32 size) {
|
||||
static BOOL SpeciesAndItem_ValidateUnique(SpeciesAndItem *mons, s32 size) {
|
||||
for (s32 i = 0; i < size - 1; i++) {
|
||||
for (s32 j = i + 1; j < size; j++) {
|
||||
if (mons[i].species == mons[j].species) {
|
||||
|
|
@ -79,7 +79,7 @@ static BOOL PlayerSpeciesAndItemsAreUnique(SpeciesAndItem *mons, s32 size) {
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL PlayerHasEnoughValidUniqueSpeciesAndItems(SpeciesAndItem *validMons, u32 numRequired, s32 numValid, s32 n) {
|
||||
static BOOL SpeciesAndItem_ValidateAllUnique(SpeciesAndItem *validMons, u32 numRequired, s32 numValid, s32 n) {
|
||||
SpeciesAndItem mons[4];
|
||||
MI_CpuClear8(mons, sizeof(SpeciesAndItem) * NELEMS(mons));
|
||||
for (s32 i = 0; i < n; i++) {
|
||||
|
|
@ -87,7 +87,7 @@ static BOOL PlayerHasEnoughValidUniqueSpeciesAndItems(SpeciesAndItem *validMons,
|
|||
for (s32 j = i + 1; j < numValid; j++) {
|
||||
mons[1] = validMons[j];
|
||||
if (numRequired == 2) {
|
||||
if (PlayerSpeciesAndItemsAreUnique(mons, numRequired)) {
|
||||
if (SpeciesAndItem_ValidateUnique(mons, numRequired)) {
|
||||
return TRUE;
|
||||
}
|
||||
continue;
|
||||
|
|
@ -95,14 +95,14 @@ static BOOL PlayerHasEnoughValidUniqueSpeciesAndItems(SpeciesAndItem *validMons,
|
|||
for (s32 k = j + 1; k < numValid; k++) {
|
||||
mons[2] = validMons[k];
|
||||
if (numRequired == 3) {
|
||||
if (PlayerSpeciesAndItemsAreUnique(mons, numRequired)) {
|
||||
if (SpeciesAndItem_ValidateUnique(mons, numRequired)) {
|
||||
return TRUE;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
for (s32 l = k + 1; l < numValid; l++) {
|
||||
mons[3] = validMons[l];
|
||||
if (PlayerSpeciesAndItemsAreUnique(mons, numRequired)) {
|
||||
if (SpeciesAndItem_ValidateUnique(mons, numRequired)) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@ BOOL PartyIsValidForFrontier(u16 numRequired, SaveData *saveData, BOOL checkDupl
|
|||
if (IsPokemonBannedFromBattleFrontier(species, form) == TRUE) {
|
||||
continue;
|
||||
}
|
||||
if (checkDuplicateItems == TRUE && PlayerHasDuplicateItem(validMons, species, item, numValid) == TRUE) {
|
||||
if (checkDuplicateItems == TRUE && SpeciesAndItem_Contains(validMons, species, item, numValid) == TRUE) {
|
||||
continue;
|
||||
}
|
||||
validMons[numValid].species = species;
|
||||
|
|
@ -147,7 +147,7 @@ BOOL PartyIsValidForFrontier(u16 numRequired, SaveData *saveData, BOOL checkDupl
|
|||
if (numValid < numRequired) {
|
||||
return FALSE;
|
||||
}
|
||||
return PlayerHasEnoughValidUniqueSpeciesAndItems(validMons, numRequired, numValid, numValid - numRequired + 1);
|
||||
return SpeciesAndItem_ValidateAllUnique(validMons, numRequired, numValid, numValid - numRequired + 1);
|
||||
}
|
||||
|
||||
void ResetSystem(void) {
|
||||
|
|
@ -332,7 +332,7 @@ BOOL FrontierFieldSystem_0204AA78(FrontierFieldSystem *frontierFsys, void **a1,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
u32 FrontierFieldSystem_SelectedPartyHasDuplicateSpeciesOrItem(FrontierFieldSystem *frontierFsys, SaveData *saveData) {
|
||||
u32 FrontierFieldSystem_PartyHasDuplicateSpeciesOrItems(FrontierFieldSystem *frontierFsys, SaveData *saveData) {
|
||||
u16 species[4];
|
||||
u16 items[4];
|
||||
Party *party = SaveArray_Party_Get(saveData);
|
||||
|
|
|
|||
|
|
@ -127,7 +127,6 @@ static const u16 FrontierTrainerBracketBosses[][2] = {
|
|||
{ 200, 299 }, // Bracket 7: All trainers are no longer special. This appears to be unused.
|
||||
};
|
||||
|
||||
|
||||
MessageFormat *sub_0204B538(SaveData *saveData, u16 numEligiblePokemon, u16 a2, u8 a3, u8 *numLegendaryPokemonSeen) {
|
||||
String *speciesName, *unused;
|
||||
Pokedex *pokedex;
|
||||
|
|
@ -165,7 +164,7 @@ u32 GetFrontierTrainerOverworld(u8 trainerClass) {
|
|||
|
||||
u16 sub_0204B610(FieldSystem *fieldSystem, u16 *linkAllyData) { // SetLinkAllyData?
|
||||
u16 match = 0;
|
||||
FrontierFieldSystem *frontierFsys = fieldSystem->frontier;
|
||||
FrontierFieldSystem *frontierFsys = fieldSystem->frontierFsys;
|
||||
frontierFsys->linkAllyGender = linkAllyData[0];
|
||||
frontierFsys->linkAllyMonSpecies[0] = linkAllyData[1];
|
||||
frontierFsys->linkAllyMonSpecies[1] = linkAllyData[2];
|
||||
|
|
@ -181,7 +180,7 @@ u16 sub_0204B610(FieldSystem *fieldSystem, u16 *linkAllyData) { // SetLinkAllyDa
|
|||
}
|
||||
|
||||
BOOL sub_0204B66C(FieldSystem *fieldSystem, u16 *a1) {
|
||||
FrontierFieldSystem *frontierFsys = fieldSystem->frontier;
|
||||
FrontierFieldSystem *frontierFsys = fieldSystem->frontierFsys;
|
||||
if (sub_0203769C() == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -190,7 +189,7 @@ BOOL sub_0204B66C(FieldSystem *fieldSystem, u16 *a1) {
|
|||
}
|
||||
|
||||
BOOL sub_0204B690(FieldSystem *fieldSystem, u16 *a1) {
|
||||
return fieldSystem->frontier->unk10_3 || a1[0] != 0;
|
||||
return fieldSystem->frontierFsys->unk10_3 || a1[0] != 0;
|
||||
}
|
||||
|
||||
void FrontierFieldSystem_0204B6AC(FrontierFieldSystem *frontierFsys, SaveData *saveData) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user