Frontier ban refactor (#3465)
Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
This commit is contained in:
parent
cb38f3bee6
commit
bb9d3208b0
@ -624,8 +624,28 @@ static const u8 sFrontierBrainObjEventGfx[NUM_FRONTIER_FACILITIES][2] =
|
||||
|
||||
const u16 gFrontierBannedSpecies[] =
|
||||
{
|
||||
SPECIES_MEW, SPECIES_MEWTWO, SPECIES_HO_OH, SPECIES_LUGIA, SPECIES_CELEBI,
|
||||
SPECIES_KYOGRE, SPECIES_GROUDON, SPECIES_RAYQUAZA, SPECIES_JIRACHI, SPECIES_DEOXYS, 0xFFFF
|
||||
SPECIES_MEW, SPECIES_MEWTWO,
|
||||
SPECIES_HO_OH, SPECIES_LUGIA, SPECIES_CELEBI,
|
||||
SPECIES_KYOGRE, SPECIES_GROUDON, SPECIES_RAYQUAZA, SPECIES_JIRACHI, SPECIES_DEOXYS,
|
||||
#if P_GEN_4_POKEMON == TRUE
|
||||
SPECIES_DIALGA, SPECIES_PALKIA, SPECIES_GIRATINA, SPECIES_MANAPHY, SPECIES_PHIONE, SPECIES_DARKRAI, SPECIES_SHAYMIN, SPECIES_ARCEUS,
|
||||
#endif
|
||||
#if P_GEN_5_POKEMON == TRUE
|
||||
SPECIES_VICTINI, SPECIES_RESHIRAM, SPECIES_ZEKROM, SPECIES_KYUREM, SPECIES_KELDEO, SPECIES_MELOETTA, SPECIES_GENESECT,
|
||||
#endif
|
||||
#if P_GEN_6_POKEMON == TRUE
|
||||
SPECIES_XERNEAS, SPECIES_YVELTAL, SPECIES_ZYGARDE, SPECIES_DIANCIE, SPECIES_HOOPA, SPECIES_VOLCANION,
|
||||
#endif
|
||||
#if P_GEN_7_POKEMON == TRUE
|
||||
SPECIES_COSMOG, SPECIES_COSMOEM, SPECIES_SOLGALEO, SPECIES_LUNALA, SPECIES_NECROZMA, SPECIES_MAGEARNA, SPECIES_MARSHADOW, SPECIES_ZERAORA, SPECIES_MELTAN, SPECIES_MELMETAL,
|
||||
#endif
|
||||
#if P_GEN_8_POKEMON == TRUE
|
||||
SPECIES_ZACIAN, SPECIES_ZAMAZENTA, SPECIES_ETERNATUS, SPECIES_CALYREX, SPECIES_ZARUDE,
|
||||
#endif
|
||||
#if P_GEN_9_POKEMON == TRUE
|
||||
SPECIES_KORAIDON, SPECIES_MIRAIDON,
|
||||
#endif
|
||||
0xFFFF
|
||||
};
|
||||
|
||||
static const u8 *const sRecordsWindowChallengeTexts[][2] =
|
||||
@ -1878,38 +1898,23 @@ static void CheckBattleTypeFlag(void)
|
||||
gSpecialVar_Result = FALSE;
|
||||
}
|
||||
|
||||
#define SPECIES_PER_LINE 3
|
||||
|
||||
static u8 AppendCaughtBannedMonSpeciesName(u16 species, u8 count, s32 numBannedMonsCaught)
|
||||
{
|
||||
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_CAUGHT))
|
||||
{
|
||||
count++;
|
||||
switch (count)
|
||||
if (numBannedMonsCaught == count)
|
||||
StringAppend(gStringVar1, gText_SpaceAndSpace);
|
||||
else if (numBannedMonsCaught > count)
|
||||
StringAppend(gStringVar1, gText_CommaSpace);
|
||||
if ((count % SPECIES_PER_LINE) == 0)
|
||||
{
|
||||
case 1:
|
||||
case 3:
|
||||
case 5:
|
||||
case 7:
|
||||
case 9:
|
||||
case 11:
|
||||
if (numBannedMonsCaught == count)
|
||||
StringAppend(gStringVar1, gText_SpaceAndSpace);
|
||||
else if (numBannedMonsCaught > count)
|
||||
StringAppend(gStringVar1, gText_CommaSpace);
|
||||
break;
|
||||
case 2:
|
||||
if (count == numBannedMonsCaught)
|
||||
StringAppend(gStringVar1, gText_SpaceAndSpace);
|
||||
if (count == SPECIES_PER_LINE)
|
||||
StringAppend(gStringVar1, gText_NewLine);
|
||||
else
|
||||
StringAppend(gStringVar1, gText_CommaSpace);
|
||||
StringAppend(gStringVar1, gText_NewLine);
|
||||
break;
|
||||
default:
|
||||
if (count == numBannedMonsCaught)
|
||||
StringAppend(gStringVar1, gText_SpaceAndSpace);
|
||||
else
|
||||
StringAppend(gStringVar1, gText_CommaSpace);
|
||||
StringAppend(gStringVar1, gText_LineBreak);
|
||||
break;
|
||||
StringAppend(gStringVar1, gText_LineBreak);
|
||||
}
|
||||
StringAppend(gStringVar1, GetSpeciesName(species));
|
||||
}
|
||||
@ -1924,7 +1929,7 @@ static void AppendIfValid(u16 species, u16 heldItem, u16 hp, u8 lvlMode, u8 monL
|
||||
if (species == SPECIES_EGG || species == SPECIES_NONE)
|
||||
return;
|
||||
|
||||
for (i = 0; gFrontierBannedSpecies[i] != 0xFFFF && gFrontierBannedSpecies[i] != species; i++)
|
||||
for (i = 0; gFrontierBannedSpecies[i] != 0xFFFF && gFrontierBannedSpecies[i] != GET_BASE_SPECIES_ID(species); i++)
|
||||
;
|
||||
|
||||
if (gFrontierBannedSpecies[i] != 0xFFFF)
|
||||
@ -2034,7 +2039,7 @@ static void CheckPartyIneligibility(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (count & 1)
|
||||
if (count % SPECIES_PER_LINE == SPECIES_PER_LINE - 1)
|
||||
StringAppend(gStringVar1, gText_LineBreak);
|
||||
else
|
||||
StringAppend(gStringVar1, gText_Space2);
|
||||
@ -2049,6 +2054,8 @@ static void CheckPartyIneligibility(void)
|
||||
#undef numEligibleMons
|
||||
}
|
||||
|
||||
#undef SPECIES_PER_LINE
|
||||
|
||||
static void ValidateVisitingTrainer(void)
|
||||
{
|
||||
ValidateEReaderTrainer();
|
||||
|
||||
@ -6195,7 +6195,7 @@ static bool8 GetBattleEntryEligibility(struct Pokemon *mon)
|
||||
species = GetMonData(mon, MON_DATA_SPECIES);
|
||||
for (; gFrontierBannedSpecies[i] != 0xFFFF; i++)
|
||||
{
|
||||
if (gFrontierBannedSpecies[i] == species)
|
||||
if (gFrontierBannedSpecies[i] == GET_BASE_SPECIES_ID(species))
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user