diff --git a/include/config/overworld.h b/include/config/overworld.h index 77ad62f652..6f6aa5cc67 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -82,8 +82,11 @@ #define OW_POPUP_BW_COLOR_WHITE 1 // White pop-up from W2 // Configuration -#define OW_POPUP_BW_COLOR OW_POPUP_BW_COLOR_BLACK // B2W2 use different colors for their map pop-ups. +#define OW_POPUP_BW_COLOR OW_POPUP_BW_COLOR_BLACK // B2W2 use different colors for their map pop-ups. #define OW_POPUP_BW_TIME_MODE OW_POPUP_BW_TIME_NONE // Determines what type of time is shown. #define OW_POPUP_BW_ALPHA_BLEND FALSE // Enables alpha blending/transparency for the pop-ups. Mainly intended to be used with the black color option. +// Pokémon Center +#define OW_IGNORE_EGGS_ON_HEAL GEN_LATEST // In Gen 4+, the nurse in the Pokémon Center does not heal Eggs on healing machine. + #endif // GUARD_CONFIG_OVERWORLD_H diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 5ab1b4cb8f..c2825bf779 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -75,5 +75,6 @@ void SetWaldaPhrase(const u8 *src); bool32 IsWaldaPhraseEmpty(void); void EnterPokeStorage(u8 boxOption); +u32 CountPartyNonEggMons(void); #endif // GUARD_POKEMON_STORAGE_SYSTEM_H diff --git a/src/field_effect.c b/src/field_effect.c index 1bd9ece5aa..898f19c291 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -20,6 +20,7 @@ #include "palette.h" #include "party_menu.h" #include "pokemon.h" +#include "pokemon_storage_system.h" #include "script.h" #include "sound.h" #include "sprite.h" @@ -1015,10 +1016,10 @@ void MultiplyPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b) bool8 FldEff_PokecenterHeal(void) { - u8 nPokemon; + u32 nPokemon; struct Task *task; - nPokemon = CalculatePlayerPartyCount(); + nPokemon = (OW_IGNORE_EGGS_ON_HEAL <= GEN_3) ? CalculatePlayerPartyCount() : CountPartyNonEggMons(); task = &gTasks[CreateTask(Task_PokecenterHeal, 0xff)]; task->tNumMons = nPokemon; task->tFirstBallX = 93; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index afd1dce482..c846e8facf 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1436,9 +1436,9 @@ s16 GetFirstFreeBoxSpot(u8 boxId) return -1; // all spots are taken } -u8 CountPartyNonEggMons(void) +u32 CountPartyNonEggMons(void) { - u16 i, count; + u32 i, count; for (i = 0, count = 0; i < PARTY_SIZE; i++) { @@ -6538,7 +6538,7 @@ static void ReleaseMon(void) if (OW_PC_RELEASE_ITEM >= GEN_8) item = GetBoxMonDataAt(boxId, sCursorPosition, MON_DATA_HELD_ITEM); } - + PurgeMonOrBoxMon(boxId, sCursorPosition); if (item != ITEM_NONE) AddBagItem(item, 1);