From f923f5198e5462fd3a3f84d98b6eb919d1157aac Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 16 Jul 2020 09:48:25 -0600 Subject: [PATCH] add oval charm --- graphics/items/icon_palettes/oval_charm.pal | 19 ++++++++++++++++ graphics/items/icons/oval_charm.png | Bin 0 -> 232 bytes include/constants/items.h | 3 ++- include/graphics.h | 2 ++ src/data/graphics/items.h | 2 ++ src/data/item_icon_table.h | 1 + src/data/items.h | 13 +++++++++++ src/data/text/item_descriptions.h | 6 +++++ src/daycare.c | 23 +++++++++++++++++++- 9 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 graphics/items/icon_palettes/oval_charm.pal create mode 100644 graphics/items/icons/oval_charm.png 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 0000000000000000000000000000000000000000..25809907a535ea080ac574869379843c5f60efa3 GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaN3?zjj6;1;wg8-ip*Y{607#JA*IPjn$;KquK z9}O1{{P=O>M#q935eYygn4r38OD|Bg*we)^L}F@k!U2}1CZ+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; +} +