Add I_REPEL_INCLUDE_FAINTED config and behavior (#5239)
* Add I_REPEL_INCLUDE_FAINTED config * Update src/wild_encounter.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update wild_encounter.c * Update wild_encounter.c * Update src/wild_encounter.c --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
This commit is contained in:
parent
8d47db6160
commit
03e0472cbe
2 changed files with 4 additions and 7 deletions
|
@ -20,6 +20,7 @@
|
|||
#define I_POWER_ITEM_BOOST GEN_LATEST // In Gen7+, Power Items grant 8 EVs instead of 4 EVs.
|
||||
#define I_PREMIER_BALL_BONUS GEN_LATEST // In LGPE onwards (Gen8+ here), you are given a Premier Ball for every 10 Poké Balls of any type and in the same purchase. Previously, it only applied to regular Poké Balls and only 1 could be obtained per purchase.
|
||||
#define I_ROTOM_CATALOG_THUNDER_SHOCK GEN_LATEST // In Gen9+, reverting Rotom to its base form will teach it Thunder Shock even if it knows another move.
|
||||
#define I_REPEL_INCLUDE_FAINTED GEN_LATEST // In Gen1 and Gen6+, Repels always use the level of the first member of the party to check which wild Pokémon to prevent encounters with, even if that member is fainted. In Gen2-5, it only uses the level of the first non-fainted Pokémon.
|
||||
|
||||
// TM config
|
||||
#define I_REUSABLE_TMS FALSE // In Gen5-8, TMs are reusable. Setting this to TRUE will make all vanilla TMs reusable, though they can also be cherry-picked by setting their importance to 1.
|
||||
|
|
|
@ -1002,14 +1002,10 @@ static bool8 IsWildLevelAllowedByRepel(u8 wildLevel)
|
|||
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&gPlayerParty[i], MON_DATA_HP) && !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG))
|
||||
if (I_REPEL_INCLUDE_FAINTED == GEN_1 || I_REPEL_INCLUDE_FAINTED >= GEN_6 || GetMonData(&gPlayerParty[i], MON_DATA_HP))
|
||||
{
|
||||
u8 ourLevel = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL);
|
||||
|
||||
if (wildLevel < ourLevel)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG))
|
||||
return wildLevel >= GetMonData(&gPlayerParty[i], MON_DATA_LEVEL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue