Added config to prevent unobtainable Pokemon from being shiny (#4735)
* Added config to prevent unobtainable Pokemon from being shiny * Added config for disabling shinies if the player has no Poke Balls * Removed check for adventure started flag
This commit is contained in:
parent
d1ca1f667f
commit
103ed85b83
4 changed files with 32 additions and 9 deletions
|
@ -39,15 +39,17 @@
|
||||||
#define P_ARCEUS_UNIQUE_FORM_ICONS GEN_LATEST // Since Gen 9, Arceus additionally changes its icon to reflect its current form.
|
#define P_ARCEUS_UNIQUE_FORM_ICONS GEN_LATEST // Since Gen 9, Arceus additionally changes its icon to reflect its current form.
|
||||||
|
|
||||||
// Other settings
|
// Other settings
|
||||||
#define P_CUSTOM_GENDER_DIFF_ICONS TRUE // If TRUE, will give more Pokémon custom icons for their female forms, i.e. Hippopotas and Hippowdon
|
#define P_CUSTOM_GENDER_DIFF_ICONS TRUE // If TRUE, will give more Pokémon custom icons for their female forms, i.e. Hippopotas and Hippowdon
|
||||||
#define P_FOOTPRINTS TRUE // If TRUE, Pokémon will have footprints (as was the case up to Gen 5 and in BDSP). Disabling this saves some ROM space.
|
#define P_FOOTPRINTS TRUE // If TRUE, Pokémon will have footprints (as was the case up to Gen 5 and in BDSP). Disabling this saves some ROM space.
|
||||||
#define P_CRIES_ENABLED TRUE // If TRUE, Pokémon will have cries. Disabling this saves around a LOT of ROM space (over 25%!), but instead we recommend disabling individual unused Pokémon families in include/config/species_enabled.h.
|
#define P_CRIES_ENABLED TRUE // If TRUE, Pokémon will have cries. Disabling this saves around a LOT of ROM space (over 25%!), but instead we recommend disabling individual unused Pokémon families in include/config/species_enabled.h.
|
||||||
#define P_LEGENDARY_PERFECT_IVS GEN_LATEST // Since Gen 6, Legendaries, Mythicals and Ultra Beasts found in the wild or given through gifts have at least 3 perfect IVs.
|
#define P_LEGENDARY_PERFECT_IVS GEN_LATEST // Since Gen 6, Legendaries, Mythicals and Ultra Beasts found in the wild or given through gifts have at least 3 perfect IVs.
|
||||||
#define P_EV_CAP GEN_LATEST // Since Gen 6, the max EVs per stat is 252 instead of 255.
|
#define P_EV_CAP GEN_LATEST // Since Gen 6, the max EVs per stat is 252 instead of 255.
|
||||||
#define P_SHOW_TERA_TYPE GEN_8 // Since Gen 9, the Tera Type is shown on the summary screen.
|
#define P_SHOW_TERA_TYPE GEN_8 // Since Gen 9, the Tera Type is shown on the summary screen.
|
||||||
#define P_TM_LITERACY GEN_LATEST // Since Gen 6, TM illiterate Pokémon can learn TMs that teach moves that are in their level-up learnsets.
|
#define P_TM_LITERACY GEN_LATEST // Since Gen 6, TM illiterate Pokémon can learn TMs that teach moves that are in their level-up learnsets.
|
||||||
#define P_EGG_CYCLE_LENGTH GEN_LATEST // Since Gen 8, egg cycles take half as many steps as before.
|
#define P_EGG_CYCLE_LENGTH GEN_LATEST // Since Gen 8, egg cycles take half as many steps as before.
|
||||||
#define P_TWO_FRAME_FRONT_SPRITES TRUE // In Pokémon Emerald, Pokémon front sprites always consist of two frames. This config can revert it to only use the first frame, as is the case in the other Gen 3 games.
|
#define P_TWO_FRAME_FRONT_SPRITES TRUE // In Pokémon Emerald, Pokémon front sprites always consist of two frames. This config can revert it to only use the first frame, as is the case in the other Gen 3 games.
|
||||||
|
#define P_ONLY_OBTAINABLE_SHINIES FALSE // If TRUE, Pokémon encountered in the Battle Pyramid won't be shiny.
|
||||||
|
#define P_NO_SHINIES_WITHOUT_POKEBALLS FALSE // If TRUE, Pokémon encountered when the player is out of Poké Balls won't be shiny
|
||||||
|
|
||||||
// Learnset helper toggles
|
// Learnset helper toggles
|
||||||
#define P_LEARNSET_HELPER_TEACHABLE TRUE // If TRUE, teachable_learnsets.h will be populated by tools/learnset_helpers/teachable.py using the included JSON files based on available TMs and tutors.
|
#define P_LEARNSET_HELPER_TEACHABLE TRUE // If TRUE, teachable_learnsets.h will be populated by tools/learnset_helpers/teachable.py using the included JSON files based on available TMs and tutors.
|
||||||
|
|
|
@ -44,6 +44,7 @@ u8 *CopyItemNameHandlePlural(u16 itemId, u8 *dst, u32 quantity);
|
||||||
bool8 IsBagPocketNonEmpty(u8 pocket);
|
bool8 IsBagPocketNonEmpty(u8 pocket);
|
||||||
bool8 CheckBagHasItem(u16 itemId, u16 count);
|
bool8 CheckBagHasItem(u16 itemId, u16 count);
|
||||||
bool8 HasAtLeastOneBerry(void);
|
bool8 HasAtLeastOneBerry(void);
|
||||||
|
bool8 HasAtLeastOnePokeBall(void);
|
||||||
bool8 CheckBagHasSpace(u16 itemId, u16 count);
|
bool8 CheckBagHasSpace(u16 itemId, u16 count);
|
||||||
u32 GetFreeSpaceForItemInBag(u16 itemId);
|
u32 GetFreeSpaceForItemInBag(u16 itemId);
|
||||||
bool8 AddBagItem(u16 itemId, u16 count);
|
bool8 AddBagItem(u16 itemId, u16 count);
|
||||||
|
|
12
src/item.c
12
src/item.c
|
@ -164,6 +164,18 @@ bool8 HasAtLeastOneBerry(void)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool8 HasAtLeastOnePokeBall(void)
|
||||||
|
{
|
||||||
|
u16 i;
|
||||||
|
|
||||||
|
for (i = FIRST_BALL; i <= LAST_BALL; i++)
|
||||||
|
{
|
||||||
|
if (CheckBagHasItem(i, 1) == TRUE)
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
bool8 CheckBagHasSpace(u16 itemId, u16 count)
|
bool8 CheckBagHasSpace(u16 itemId, u16 count)
|
||||||
{
|
{
|
||||||
if (ItemId_GetPocket(itemId) == POCKET_NONE)
|
if (ItemId_GetPocket(itemId) == POCKET_NONE)
|
||||||
|
|
|
@ -1143,6 +1143,14 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV,
|
||||||
{
|
{
|
||||||
isShiny = TRUE;
|
isShiny = TRUE;
|
||||||
}
|
}
|
||||||
|
else if (P_ONLY_OBTAINABLE_SHINIES && InBattlePyramid())
|
||||||
|
{
|
||||||
|
isShiny = FALSE;
|
||||||
|
}
|
||||||
|
else if (P_NO_SHINIES_WITHOUT_POKEBALLS && !HasAtLeastOnePokeBall())
|
||||||
|
{
|
||||||
|
isShiny = FALSE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
u32 totalRerolls = 0;
|
u32 totalRerolls = 0;
|
||||||
|
|
Loading…
Reference in a new issue