diff --git a/graphics/items/icon_palettes/oval_charm.pal b/graphics/items/icon_palettes/oval_charm.pal new file mode 100644 index 0000000000..5f5afd15c5 --- /dev/null +++ b/graphics/items/icon_palettes/oval_charm.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +239 228 176 +48 48 48 +248 192 224 +128 80 216 +168 104 248 +128 208 192 +248 248 216 +216 136 160 +184 88 96 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/items/icons/oval_charm.png b/graphics/items/icons/oval_charm.png new file mode 100644 index 0000000000..25809907a5 Binary files /dev/null and b/graphics/items/icons/oval_charm.png differ diff --git a/include/constants/items.h b/include/constants/items.h index 438a626bb0..aa610b0abc 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -704,8 +704,9 @@ #define ITEM_OLD_SEA_MAP 615 #define ITEM_SHINY_CHARM 616 +#define ITEM_OVAL_CHARM 617 -#define ITEMS_COUNT 617 +#define ITEMS_COUNT 618 #define ITEM_FIELD_ARROW ITEMS_COUNT #define FIRST_BERRY_INDEX ITEM_CHERI_BERRY diff --git a/include/graphics.h b/include/graphics.h index 334cb9e08d..abee656fad 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4211,6 +4211,8 @@ extern const u32 gItemIcon_PrettyWing[]; extern const u32 gItemIconPalette_PrettyWing[]; extern const u32 gItemIcon_ShinyCharm[]; extern const u32 gItemIconPalette_ShinyCharm[]; +extern const u32 gItemIcon_OvalCharm[]; +extern const u32 gItemIconPalette_OvalCharm[]; // Gen 6 Items extern const u32 gItemIcon_AssaultVest[]; extern const u32 gItemIconPalette_AssaultVest[]; diff --git a/src/data/graphics/items.h b/src/data/graphics/items.h index 3255f69680..140d3820db 100644 --- a/src/data/graphics/items.h +++ b/src/data/graphics/items.h @@ -1235,6 +1235,8 @@ const u32 gItemIconPalette_PrettyWing[] = INCBIN_U32("graphics/items/icon_palett const u32 gItemIcon_ShinyCharm[] = INCBIN_U32("graphics/items/icons/shiny_charm.4bpp.lz"); const u32 gItemIconPalette_ShinyCharm[] = INCBIN_U32("graphics/items/icon_palettes/shiny_charm.gbapal.lz"); +const u32 gItemIcon_OvalCharm[] = INCBIN_U32("graphics/items/icons/oval_charm.4bpp.lz"); +const u32 gItemIconPalette_OvalCharm[] = INCBIN_U32("graphics/items/icon_palettes/oval_charm.gbapal.lz"); // Gen 6 Items const u32 gItemIcon_AssaultVest[] = INCBIN_U32("graphics/items/icons/assault_vest.4bpp.lz"); diff --git a/src/data/item_icon_table.h b/src/data/item_icon_table.h index b54f28405c..00ae938896 100644 --- a/src/data/item_icon_table.h +++ b/src/data/item_icon_table.h @@ -495,6 +495,7 @@ const u32 *const gItemIconTable[][2] = [ITEM_SWIFT_WING] = {gItemIcon_SwiftWing, gItemIconPalette_SwiftWing}, [ITEM_PRETTY_WING] = {gItemIcon_PrettyWing, gItemIconPalette_PrettyWing}, [ITEM_SHINY_CHARM] = {gItemIcon_ShinyCharm, gItemIconPalette_ShinyCharm}, + [ITEM_OVAL_CHARM] = {gItemIcon_OvalCharm, gItemIconPalette_OvalCharm}, // Gen 6 Items [ITEM_ASSAULT_VEST] = {gItemIcon_AssaultVest, gItemIconPalette_AssaultVest}, [ITEM_PIXIE_PLATE] = {gItemIcon_PixiePlate, gItemIconPalette_PixiePlate}, diff --git a/src/data/items.h b/src/data/items.h index fc8a5e8b36..4701e57611 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -7461,4 +7461,17 @@ const struct Item gItems[] = .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 0, }, + + [ITEM_OVAL_CHARM] = + { + .name = _("Oval Charm"), + .itemId = ITEM_OVAL_CHARM, + .price = 0, + .importance = 1, + .description = sOvalCharmDesc, + .pocket = POCKET_KEY_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = 0, + }, }; diff --git a/src/data/text/item_descriptions.h b/src/data/text/item_descriptions.h index a6d0ade8cb..927e40d4ea 100644 --- a/src/data/text/item_descriptions.h +++ b/src/data/text/item_descriptions.h @@ -2793,3 +2793,9 @@ static const u8 sShinyCharmDesc[] = _( "A charm that will\n" "raise the chance\n" "of Shiny Pokémon."); + +static const u8 sOvalCharmDesc[] = _( + "Increases the\n" + "chance of finding\n" + "eggs at the daycare."); + diff --git a/src/daycare.c b/src/daycare.c index 5d44804039..0bc584acb3 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -19,6 +19,7 @@ #include "party_menu.h" #include "list_menu.h" #include "overworld.h" +#include "item.h" #include "constants/items.h" #include "constants/moves.h" #include "constants/region_map_sections.h" @@ -29,6 +30,7 @@ static void ClearDaycareMonMail(struct DayCareMail *mail); static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare); static u8 GetDaycareCompatibilityScore(struct DayCare *daycare); static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y); +static u8 ModifyBreedingScoreForOvalCharm(u8 score); // RAM buffers used to assist with BuildEggMoveset() EWRAM_DATA static u16 sHatchedEggLevelUpMoves[EGG_LVL_UP_MOVES_ARRAY_COUNT] = {0}; @@ -887,7 +889,7 @@ static bool8 TryProduceOrHatchEgg(struct DayCare *daycare) // Check if an egg should be produced if (daycare->offspringPersonality == 0 && validEggs == DAYCARE_MON_COUNT && (daycare->mons[1].steps & 0xFF) == 0xFF) { - u8 compatability = GetDaycareCompatibilityScore(daycare); + u8 compatability = ModifyBreedingScoreForOvalCharm(GetDaycareCompatibilityScore(daycare)); if (compatability > (Random() * 100u) / USHRT_MAX) TriggerPendingDaycareEgg(); } @@ -1295,3 +1297,22 @@ void ChooseSendDaycareMon(void) ChooseMonForDaycare(); gMain.savedCallback = CB2_ReturnToField; } + +static u8 ModifyBreedingScoreForOvalCharm(u8 score) +{ + if (CheckBagHasItem(ITEM_OVAL_CHARM, 1)) + { + switch (score) + { + case 20: + return 40; + case 50: + return 80; + case 70: + return 88; + } + } + + return score; +} +