From a517e14c064e83f053a972ecf1b1660a2baf47b5 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Wed, 29 Nov 2023 13:26:43 +0100 Subject: [PATCH 01/33] Berry Mutations --- data/scripts/berry_tree.inc | 76 ++++++++++++++++++++- include/config/overworld.h | 3 + include/global.berry.h | 16 +++-- src/berry.c | 132 +++++++++++++++++++++++++++++++++++- 4 files changed, 221 insertions(+), 6 deletions(-) diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index 8ad300df52..c302f07eb0 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -103,13 +103,25 @@ BerryTree_EventScript_CheckBerryFullyGrown:: lock faceplayer special ObjectEventInteractionGetBerryCountString +.if OW_BERRY_MUTATIONS == TRUE + goto_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_CheckBerryFullyGrown_Mutation +.endif msgbox BerryTree_Text_WantToPick, MSGBOX_YESNO goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_PickBerry goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_CancelPickingBerry +.set BERRY_NORMAL_BAG_FULL, 0 +.set BERRY_NORMAL_SPACE_IN_BAG, 1 +.set BERRY_MUTATION_BAG_FULL, 2 +.set BERRY_MUTATION_SPACE_IN_BAG, 3 + BerryTree_EventScript_PickBerry:: special ObjectEventInteractionPickBerryTree - goto_if_eq VAR_0x8004, 0, BerryTree_EventScript_BerryPocketFull + goto_if_eq VAR_0x8004, BERRY_NORMAL_BAG_FULL, BerryTree_EventScript_BerryPocketFull +.if OW_BERRY_MUTATIONS == TRUE + goto_if_eq VAR_0x8004, BERRY_MUTATION_BAG_FULL, BerryTree_EventScript_BerryPocketFull_Mutation + goto_if_eq VAR_0x8004, BERRY_MUTATION_SPACE_IN_BAG, BerryTree_EventScript_PickBerry_Mutation +.endif special IncrementDailyPickedBerries special ObjectEventInteractionRemoveBerryTree message BerryTree_Text_PickedTheBerry @@ -249,3 +261,65 @@ BerryTree_Text_PlantIsDelighted: BerryTree_Text_ExclamationPoint: .string "!$" + +.if OW_BERRY_MUTATIONS == TRUE +BerryTree_EventScript_CheckBerryFullyGrown_Mutation: + msgbox BerryTree_Text_WantToPick_Mutation, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_PickBerry + goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_CancelPickingBerry_Mutation + +BerryTree_EventScript_CancelPickingBerry_Mutation:: + message BerryTree_Text_BerryLeftUnpicked_Mutation + waitmessage + waitbuttonpress + release + end + +BerryTree_EventScript_BerryPocketFull_Mutation:: + message BerryTree_Text_BerryPocketFull_Mutation + waitmessage + waitbuttonpress + release + end + +BerryTree_EventScript_PickBerry_Mutation:: + @ add items + special IncrementDailyPickedBerries + special ObjectEventInteractionRemoveBerryTree + message BerryTree_Text_PickedTheBerry_Mutation + playfanfare MUS_OBTAIN_BERRY + waitmessage + waitfanfare + waitbuttonpress + message BerryTree_Text_PutAwayBerry_Mutation + waitmessage + waitbuttonpress + release + end + +BerryTree_Text_WantToPick_Mutation: + .string "You found {STR_VAR_2} {STR_VAR_1}\n" + .string "and 1 {STR_VAR_3}!\p" + .string "Do you want to pick them?$" + +BerryTree_Text_BerryLeftUnpicked_Mutation: + .string "{PLAYER} left the {STR_VAR_1}\n" + .string "and the {STR_VAR_3} unpicked.$" + +BerryTree_Text_BerryPocketFull_Mutation: + .string "The BAG's BERRIES POCKET is full.\p" + .string "The {STR_VAR_1} and the\n" + .string "{STR_VAR_3} couldn't be taken.$" + +BerryTree_Text_PickedTheBerry_Mutation: + .string "{PLAYER} picked the {STR_VAR_2} {STR_VAR_1}\n" + .string "and the {STR_VAR_3}.$" + +BerryTree_Text_PutAwayBerry_Mutation: + .string "{PLAYER} put away the {STR_VAR_1}\n" + .string "and the {STR_VAR_3} in the BAG's\l" + .string "BERRIES POCKET.\p" + .string "The soil returned to its soft and\n" + .string "loamy state.$" + +.endif diff --git a/include/config/overworld.h b/include/config/overworld.h index 3488064421..fb24c680b0 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -12,6 +12,9 @@ #define OW_PC_PRESS_B GEN_LATEST // In Gen4, pressing B when holding a Pokémon is equivalent to placing it. In Gen3, it gives the "You're holding a Pokémon!" error. #define OW_PC_JAPAN_WALDA_ICONS TRUE // In the US release of Emerald, the Cross, Bolt, and Plusle icons for Walda's wallpapers were left blank from the Japan release. Setting this to TRUE will restore them. +// Berry settings +#define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them. + // Out-of-battle Ability effects #define OW_SYNCHRONIZE_NATURE GEN_LATEST // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same Nature, as opposed to 50% previously. Stationary Pokémon are excluded in Gen3. In Gen6, all No Eggs Discovered gift Pokémon will have the same Nature, while in Gen7 all gift Pokémon will, regardless of Egg Group - In Gen 8, no gift Pokémon are affected. In Gen9, this ability has no out-of-battle effect. #define OW_COMPOUND_EYES GEN_LATEST // Prior to Gen9, if a Pokémon with Compound Eyes is leading the party, the wild held item rate is increased to 60%/20%. diff --git a/include/global.berry.h b/include/global.berry.h index 29f1cfe14a..cd6e18e7fb 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -62,16 +62,24 @@ struct BattleEnigmaBerry struct BerryTree { - u8 berry; - u8 stage:7; + u8 berry:7; + u8 weeds:1; + u8 stage:3; + u8 mulch:4; u8 stopGrowth:1; - u16 minutesUntilNextStage; - u8 berryYield; + u16 minutesUntilNextStage:14; + u16 mutationA:2; + u8 berryYield:5; + u8 pests:1; + u8 mutationB:2; u8 regrowthCount:4; u8 watered1:1; u8 watered2:1; u8 watered3:1; u8 watered4:1; + u16 moistureLevel:7; + u16 moistureClock:6; + u16 mutationC:3; }; #endif // GUARD_GLOBAL_BERRY_H diff --git a/src/berry.c b/src/berry.c index 88a5d0f9f3..c2698295ec 100644 --- a/src/berry.c +++ b/src/berry.c @@ -23,6 +23,8 @@ static u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water); static u8 CalcBerryYield(struct BerryTree *tree); static u8 GetBerryCountByBerryTreeId(u8 id); static u16 GetStageDurationByBerryType(u8); +static void SetTreeMutations(u8 id, u8 berry); +static u8 GetTreeMutationValue(u8 id); //.rodata static const u8 sBerryDescriptionPart1_Cheri[] = _("Blooms with delicate pretty flowers."); @@ -1627,6 +1629,8 @@ void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 allowGrowth) // allowGrowth is always true for berry trees the player has planted if (!allowGrowth) tree->stopGrowth = TRUE; + + SetTreeMutations(id, berry); } void RemoveBerryTree(u8 id) @@ -1787,6 +1791,15 @@ void ObjectEventInteractionGetBerryCountString(void) u8 berry = GetBerryTypeByBerryTreeId(treeId); u8 count = GetBerryCountByBerryTreeId(treeId); GetBerryCountStringByBerryType(berry, gStringVar1, count); + berry = GetTreeMutationValue(treeId); + if (berry > 0) + { + count = 1; + GetBerryCountStringByBerryType(berry, gStringVar3, count); + gSpecialVar_Result = TRUE; + } + else + gSpecialVar_Result = FALSE; } void Bag_ChooseBerry(void) @@ -1806,8 +1819,19 @@ void ObjectEventInteractionPickBerryTree(void) { u8 id = GetObjectEventBerryTreeId(gSelectedObjectEvent); u8 berry = GetBerryTypeByBerryTreeId(id); + u8 mutation = GetTreeMutationValue(id); - gSpecialVar_0x8004 = AddBagItem(BerryTypeToItemId(berry), GetBerryCountByBerryTreeId(id)); + if (!OW_BERRY_MUTATIONS || mutation == 0) + { + gSpecialVar_0x8004 = AddBagItem(BerryTypeToItemId(berry), GetBerryCountByBerryTreeId(id)); + return; + } + gSpecialVar_0x8004 = (CheckBagHasSpace(BerryTypeToItemId(berry), GetBerryCountByBerryTreeId(id)) && CheckBagHasSpace(BerryTypeToItemId(mutation), 1)) + 2; + if (gSpecialVar_0x8004 == 3) + { + AddBagItem(BerryTypeToItemId(berry), GetBerryCountByBerryTreeId(id)); + AddBagItem(BerryTypeToItemId(mutation), 1); + } } void ObjectEventInteractionRemoveBerryTree(void) @@ -1849,3 +1873,109 @@ void SetBerryTreesSeen(void) } } } + +// Berry mutations +#if OW_BERRY_MUTATIONS == TRUE +#define BERRY_MUTATION_CHANCE 25 + +static const u8 sBerryMutations[][3] = { + {ITEM_TO_BERRY(ITEM_IAPAPA_BERRY), ITEM_TO_BERRY(ITEM_MAGO_BERRY), ITEM_TO_BERRY(ITEM_POMEG_BERRY)}, + {ITEM_TO_BERRY(ITEM_CHESTO_BERRY), ITEM_TO_BERRY(ITEM_PERSIM_BERRY), ITEM_TO_BERRY(ITEM_KELPSY_BERRY)}, + {ITEM_TO_BERRY(ITEM_ORAN_BERRY), ITEM_TO_BERRY(ITEM_PECHA_BERRY), ITEM_TO_BERRY(ITEM_QUALOT_BERRY)}, + {ITEM_TO_BERRY(ITEM_CHESTO_BERRY), ITEM_TO_BERRY(ITEM_PERSIM_BERRY), ITEM_TO_BERRY(ITEM_KELPSY_BERRY)}, + {ITEM_TO_BERRY(ITEM_ASPEAR_BERRY), ITEM_TO_BERRY(ITEM_LEPPA_BERRY), ITEM_TO_BERRY(ITEM_HONDEW_BERRY)}, + {ITEM_TO_BERRY(ITEM_AGUAV_BERRY), ITEM_TO_BERRY(ITEM_FIGY_BERRY), ITEM_TO_BERRY(ITEM_GREPA_BERRY)}, + {ITEM_TO_BERRY(ITEM_LUM_BERRY), ITEM_TO_BERRY(ITEM_SITRUS_BERRY), ITEM_TO_BERRY(ITEM_TAMATO_BERRY)}, + {ITEM_TO_BERRY(ITEM_HONDEW_BERRY), ITEM_TO_BERRY(ITEM_YACHE_BERRY), ITEM_TO_BERRY(ITEM_LIECHI_BERRY)}, + {ITEM_TO_BERRY(ITEM_QUALOT_BERRY), ITEM_TO_BERRY(ITEM_TANGA_BERRY), ITEM_TO_BERRY(ITEM_GANLON_BERRY)}, + {ITEM_TO_BERRY(ITEM_GREPA_BERRY), ITEM_TO_BERRY(ITEM_ROSELI_BERRY), ITEM_TO_BERRY(ITEM_SALAC_BERRY)}, + {ITEM_TO_BERRY(ITEM_POMEG_BERRY), ITEM_TO_BERRY(ITEM_KASIB_BERRY), ITEM_TO_BERRY(ITEM_PETAYA_BERRY)}, + {ITEM_TO_BERRY(ITEM_KELPSY_BERRY), ITEM_TO_BERRY(ITEM_WACAN_BERRY), ITEM_TO_BERRY(ITEM_APICOT_BERRY)}, + {ITEM_TO_BERRY(ITEM_GANLON_BERRY), ITEM_TO_BERRY(ITEM_LIECHI_BERRY), ITEM_TO_BERRY(ITEM_KEE_BERRY)}, + {ITEM_TO_BERRY(ITEM_SALAC_BERRY), ITEM_TO_BERRY(ITEM_PETAYA_BERRY), ITEM_TO_BERRY(ITEM_MARANGA_BERRY)}, +}; + +static u8 GetMutationOutcome(u8 berry1, u8 berry2) +{ + u8 i; + for(i = 0; i < ARRAY_COUNT(sBerryMutations); i++) + { + if ((sBerryMutations[i][0] == berry1 && sBerryMutations[i][1] == berry2) + ||(sBerryMutations[i][0] == berry2 && sBerryMutations[i][1] == berry1)) + return sBerryMutations[i][2]; + } + return 0; +} + +static u8 TryForMutation(u8 berryTreeId, u8 berry) +{ + u8 i, j; + s16 x1, x2, y1, y2; + + // Get location of current tree + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) + { + if (gObjectEvents[i].trainerRange_berryTreeId == berryTreeId && gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH) + break; + } + if (i == OBJECT_EVENTS_COUNT) + return 0; + + x1 = gObjectEvents[i].currentCoords.x; + y1 = gObjectEvents[i].currentCoords.y; + + // Try mutation for each adjacent tree + for (j = 0; j < OBJECT_EVENTS_COUNT; j++) + { + if (gObjectEvents[j].active && gObjectEvents[j].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH && GetStageByBerryTreeId(GetObjectEventBerryTreeId(j)) != BERRY_STAGE_NO_BERRY && j != i) + { + x2 = gObjectEvents[j].currentCoords.x; + y2 = gObjectEvents[j].currentCoords.y; + if (Random() % 100 < BERRY_MUTATION_CHANCE && ( + (x1 == x2 && y1 == y2 - 1) || + (x1 == x2 && y1 == y2 + 1) || + (x1 == x2 - 1 && y1 == y2) || + (x1 == x2 + 1 && y1 == y2))) + return GetMutationOutcome(berry, gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(j)].berry); + } + } + return 0; +} +#endif + +struct TreeMutationBitfield { + u8 a: 2; + u8 b: 2; + u8 c: 3; + u8 unused: 1; +}; + +union TreeMutation { + u8 value; + struct TreeMutationBitfield asField; +}; + +static u8 GetTreeMutationValue(u8 id) +{ + struct BerryTree *tree = GetBerryTreeInfo(id); + union TreeMutation myMutation; + if (!OW_BERRY_MUTATIONS || tree->stopGrowth) // Pre-generated trees shouldn't have mutations + return 0; + myMutation.asField.a = tree->mutationA; + myMutation.asField.b = tree->mutationB; + myMutation.asField.c = tree->mutationC; + return myMutation.value; +} + +static void SetTreeMutations(u8 id, u8 berry) +{ +#if OW_BERRY_MUTATIONS == TRUE + struct BerryTree *tree = GetBerryTreeInfo(id); + union TreeMutation myMutation; + + myMutation.value = TryForMutation(id, berry); + tree->mutationA = myMutation.asField.a; + tree->mutationB = myMutation.asField.b; + tree->mutationC = myMutation.asField.c; +#endif +} From 4628af3d55a2a2a3a751288c70d869451ac30554 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 30 Nov 2023 13:34:33 +0100 Subject: [PATCH 02/33] Non-watering mulch effects --- include/constants/items.h | 1 + src/berry.c | 38 +++++++++++++++++++++++++++++--------- src/data/items.h | 24 ++++++++++++++++-------- 3 files changed, 46 insertions(+), 17 deletions(-) diff --git a/include/constants/items.h b/include/constants/items.h index 074dcd9fc5..44147443eb 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -1015,6 +1015,7 @@ #define ITEM_TO_BERRY(itemId)(((itemId) - FIRST_BERRY_INDEX) + 1) #define ITEM_TO_MAIL(itemId)((itemId) - FIRST_MAIL_INDEX) #define MAIL_NONE 0xFF +#define ITEM_TO_MULCH(itemId)(((itemId) - ITEM_GROWTH_MULCH) + 1) #define NUM_TECHNICAL_MACHINES 100 #define NUM_HIDDEN_MACHINES 8 diff --git a/src/berry.c b/src/berry.c index c2698295ec..93b1e1e21a 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1566,13 +1566,24 @@ static bool32 BerryTreeGrow(struct BerryTree *tree) tree->watered4 = 0; tree->berryYield = 0; tree->stage = BERRY_STAGE_SPROUTED; - if (++tree->regrowthCount == 10) + if (++tree->regrowthCount == ((tree->mulch == ITEM_TO_MULCH(ITEM_GOOEY_MULCH)) ? 15 : 10)) *tree = gBlankBerryTree; break; } return TRUE; } +static u16 GetMulchAffectedGrowthRate(u16 berryDuration, u8 mulch, u8 stage) +{ + if (stage == BERRY_STAGE_BERRIES) + return berryDuration; + if (mulch == ITEM_TO_MULCH(ITEM_GROWTH_MULCH)) + return berryDuration / 4 * 3; + if (mulch == ITEM_TO_MULCH(ITEM_DAMP_MULCH)) + return berryDuration / 2 * 3; + return berryDuration; +} + void BerryTreeTimeUpdate(s32 minutes) { int i; @@ -1600,11 +1611,11 @@ void BerryTreeTimeUpdate(s32 minutes) break; } time -= tree->minutesUntilNextStage; - tree->minutesUntilNextStage = GetStageDurationByBerryType(tree->berry); + tree->minutesUntilNextStage = GetMulchAffectedGrowthRate(GetStageDurationByBerryType(tree->berry), tree->mulch, tree->stage); if (!BerryTreeGrow(tree)) break; if (tree->stage == BERRY_STAGE_BERRIES) - tree->minutesUntilNextStage *= 4; + tree->minutesUntilNextStage *= ((tree->mulch == ITEM_TO_MULCH(ITEM_STABLE_MULCH)) ? 6 : 4); } } } @@ -1615,14 +1626,13 @@ void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 allowGrowth) { struct BerryTree *tree = GetBerryTreeInfo(id); - *tree = gBlankBerryTree; tree->berry = berry; - tree->minutesUntilNextStage = GetStageDurationByBerryType(berry); + tree->minutesUntilNextStage = GetMulchAffectedGrowthRate(GetStageDurationByBerryType(berry), tree->mulch, stage); tree->stage = stage; if (stage == BERRY_STAGE_BERRIES) { tree->berryYield = CalcBerryYield(tree); - tree->minutesUntilNextStage *= 4; + tree->minutesUntilNextStage *= ((tree->mulch == ITEM_TO_MULCH(ITEM_STABLE_MULCH)) ? 6 : 4); } // Stop growth, to keep tree at this stage until the player has seen it @@ -1648,6 +1658,11 @@ u8 GetStageByBerryTreeId(u8 id) return gSaveBlock1Ptr->berryTrees[id].stage; } +u8 GetMulchByBerryTreeId(u8 id) +{ + return gSaveBlock1Ptr->berryTrees[id].mulch; +} + u8 ItemIdToBerryType(u16 item) { u16 berry = item - FIRST_BERRY_INDEX; @@ -1742,8 +1757,11 @@ static u8 CalcBerryYield(struct BerryTree *tree) const struct Berry *berry = GetBerryInfo(tree->berry); u8 min = berry->minYield; u8 max = berry->maxYield; + u8 result = CalcBerryYieldInternal(max, min, BerryTreeGetNumStagesWatered(tree)); + if (tree->mulch == ITEM_TO_MULCH(ITEM_RICH_MULCH) || tree->mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH)) + result += 2; - return CalcBerryYieldInternal(max, min, BerryTreeGetNumStagesWatered(tree)); + return result; } static u8 GetBerryCountByBerryTreeId(u8 id) @@ -1909,7 +1927,7 @@ static u8 GetMutationOutcome(u8 berry1, u8 berry2) static u8 TryForMutation(u8 berryTreeId, u8 berry) { - u8 i, j; + u8 i, j, mulch; s16 x1, x2, y1, y2; // Get location of current tree @@ -1924,6 +1942,8 @@ static u8 TryForMutation(u8 berryTreeId, u8 berry) x1 = gObjectEvents[i].currentCoords.x; y1 = gObjectEvents[i].currentCoords.y; + mulch = GetMulchByBerryTreeId(GetObjectEventBerryTreeId(i)); + // Try mutation for each adjacent tree for (j = 0; j < OBJECT_EVENTS_COUNT; j++) { @@ -1931,7 +1951,7 @@ static u8 TryForMutation(u8 berryTreeId, u8 berry) { x2 = gObjectEvents[j].currentCoords.x; y2 = gObjectEvents[j].currentCoords.y; - if (Random() % 100 < BERRY_MUTATION_CHANCE && ( + if (Random() % 100 < (BERRY_MUTATION_CHANCE * (mulch == ITEM_TO_MULCH(ITEM_SURPRISE_MULCH) || mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH))) && ( (x1 == x2 && y1 == y2 - 1) || (x1 == x2 && y1 == y2 + 1) || (x1 == x2 - 1 && y1 == y2) || diff --git a/src/data/items.h b/src/data/items.h index 670d7dd2e5..74c8ac014d 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -2167,7 +2167,8 @@ const struct Item gItems[] = .description = sGrowthMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_GROWTH_MULCH), .flingPower = 30, }, @@ -2178,7 +2179,8 @@ const struct Item gItems[] = .description = sDampMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_DAMP_MULCH), .flingPower = 30, }, @@ -2189,7 +2191,8 @@ const struct Item gItems[] = .description = sStableMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_STABLE_MULCH), .flingPower = 30, }, @@ -2200,7 +2203,8 @@ const struct Item gItems[] = .description = sGooeyMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_GOOEY_MULCH), .flingPower = 30, }, @@ -2211,7 +2215,8 @@ const struct Item gItems[] = .description = sRichMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_RICH_MULCH), .flingPower = 30, }, @@ -2222,7 +2227,8 @@ const struct Item gItems[] = .description = sSurpriseMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_SURPRISE_MULCH), .flingPower = 30, }, @@ -2233,7 +2239,8 @@ const struct Item gItems[] = .description = sBoostMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_BOOST_MULCH), .flingPower = 30, }, @@ -2244,7 +2251,8 @@ const struct Item gItems[] = .description = sAmazeMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .secondaryId = ITEM_TO_MULCH(ITEM_AMAZE_MULCH), .flingPower = 30, }, From b02b3d074f7d5f33be0093170906de33ad4ef3c5 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sun, 3 Dec 2023 13:17:34 +0100 Subject: [PATCH 03/33] Add Mulch effects --- data/scripts/berry_tree.inc | 44 +++++++++++++++++++++++++++++++++ data/specials.inc | 3 +++ include/berry.h | 2 ++ include/constants/script_menu.h | 1 + include/item_menu.h | 2 ++ include/item_use.h | 1 + include/strings.h | 3 +++ src/berry.c | 34 +++++++++++++++++++++++++ src/data/script_menu.h | 8 ++++++ src/item_menu.c | 31 +++++++++++++++++++++-- src/item_use.c | 2 +- src/strings.c | 5 +++- 12 files changed, 132 insertions(+), 4 deletions(-) diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index c302f07eb0..f1ff5ba5a8 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -23,6 +23,8 @@ BerryTree_EventScript_CheckSoil:: faceplayer specialvar VAR_RESULT, PlayerHasBerries goto_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_WantToPlant + specialvar VAR_RESULT, PlayerHasMulch + goto_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_WantToMulch message BerryTree_Text_ItsSoftLoamySoil waitmessage waitbuttonpress @@ -30,11 +32,29 @@ BerryTree_EventScript_CheckSoil:: end BerryTree_EventScript_WantToPlant:: + specialvar VAR_RESULT, PlayerHasMulch + goto_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_WantToPlantMulch msgbox BerryTree_Text_WantToPlant, MSGBOX_YESNO goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_ChooseBerryToPlant goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_CancelPlanting end +BerryTree_EventScript_WantToMulch:: + msgbox BerryTree_Text_WantToMulch, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_ChooseMulchToUse + goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_CancelPlanting + end + +BerryTree_EventScript_WantToPlantMulch:: + message BerryTree_Text_ItsSoftLoamySoil + waitmessage + multichoice 0, 0, MULTI_BERRY_PLOT, FALSE + switch VAR_RESULT + case 0, BerryTree_EventScript_ChooseMulchToUse + case 1, BerryTree_EventScript_ChooseBerryToPlant + case 2, BerryTree_EventScript_CancelPlanting + case MULTI_B_PRESSED, BerryTree_EventScript_CancelPlanting + BerryTree_EventScript_ChooseBerryToPlant:: fadescreen FADE_TO_BLACK closemessage @@ -44,6 +64,15 @@ BerryTree_EventScript_ChooseBerryToPlant:: removeitem VAR_ITEM_ID call BerryTree_EventScript_PlantBerry +BerryTree_EventScript_ChooseMulchToUse:: + fadescreen FADE_TO_BLACK + closemessage + special Bag_ChooseMulch + waitstate + goto_if_eq VAR_ITEM_ID, 0, BerryTree_EventScript_CancelPlanting + removeitem VAR_ITEM_ID + call BerryTree_EventScript_UseMulch + BerryTree_EventScript_CancelPlanting:: release end @@ -194,6 +223,13 @@ BerryTree_EventScript_PlantBerry:: waitbuttonpress return +BerryTree_EventScript_UseMulch:: + special ObjectEventInteractionApplyMulch + message BerryTree_Text_ScatteredMulch + waitmessage + waitbuttonpress + return + BerryTree_Text_ItsSoftLoamySoil: .string "It's soft, loamy soil.$" @@ -201,10 +237,18 @@ BerryTree_Text_WantToPlant: .string "It's soft, loamy soil.\n" .string "Want to plant a BERRY?$" +BerryTree_Text_WantToMulch: + .string "It's soft, loamy soil.\n" + .string "Put down some fertilizer?$" + BerryTree_Text_PlantedOneBerry: .string "{PLAYER} planted one {STR_VAR_1} in\n" .string "the soft, loamy soil.$" +BerryTree_Text_ScatteredMulch: + .string "{PLAYER} scattered the {STR_VAR_1}\n" + .string "on the soft, loamy soil.$" + BerryTree_Text_BerryGrowthStage1: .string "One {STR_VAR_1} was planted here.$" diff --git a/data/specials.inc b/data/specials.inc index 34e86cad29..d001e44549 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -540,3 +540,6 @@ gSpecials:: def_special GetSprayId def_special GetLastUsedSprayType def_special TrySkyBattle + def_special PlayerHasMulch + def_special Bag_ChooseMulch + def_special ObjectEventInteractionApplyMulch diff --git a/include/berry.h b/include/berry.h index 22b9158ee2..68ac171370 100644 --- a/include/berry.h +++ b/include/berry.h @@ -19,10 +19,12 @@ u8 ItemIdToBerryType(u16 item); void GetBerryNameByBerryType(u8 berry, u8 *string); void ResetBerryTreeSparkleFlag(u8 id); void Bag_ChooseBerry(void); +void Bag_ChooseMulch(void); void ObjectEventInteractionGetBerryTreeData(void); void ObjectEventInteractionPlantBerryTree(void); void ObjectEventInteractionPickBerryTree(void); void ObjectEventInteractionRemoveBerryTree(void); +void ObjectEventInteractionApplyMulch(void); bool8 PlayerHasBerries(void); void SetBerryTreesSeen(void); diff --git a/include/constants/script_menu.h b/include/constants/script_menu.h index c58df7335f..d341a65403 100644 --- a/include/constants/script_menu.h +++ b/include/constants/script_menu.h @@ -122,6 +122,7 @@ #define MULTI_SLATEPORT_TENT_RULES 111 #define MULTI_FALLARBOR_TENT_RULES 112 #define MULTI_TAG_MATCH_TYPE 113 +#define MULTI_BERRY_PLOT 114 // Lilycove SS Tidal Multichoice Selections #define SSTIDAL_SELECTION_SLATEPORT 0 diff --git a/include/item_menu.h b/include/item_menu.h index d4ae5a4c5f..75912eca62 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -17,6 +17,7 @@ enum { ITEMMENULOCATION_APPRENTICE, ITEMMENULOCATION_WALLY, ITEMMENULOCATION_PCBOX, + ITEMMENULOCATION_BERRY_TREE_MULCH, ITEMMENULOCATION_LAST, }; @@ -101,6 +102,7 @@ void DoWallyTutorialBagMenu(void); void ResetBagScrollPositions(void); void ChooseBerryForMachine(void (*exitCallback)(void)); void CB2_ChooseBerry(void); +void CB2_ChooseMulch(void); void Task_FadeAndCloseBagMenu(u8 taskId); void BagMenu_YesNo(u8 taskId, u8 windowType, const struct YesNoFuncTable* funcTable); void UpdatePocketItemList(u8 pocketId); diff --git a/include/item_use.h b/include/item_use.h index 5abe87f057..22833f299d 100644 --- a/include/item_use.h +++ b/include/item_use.h @@ -41,6 +41,7 @@ void ItemUseInBattle_PartyMenuChooseMove(u8 taskId); void Task_UseDigEscapeRopeOnField(u8 taskId); u8 CanUseDigOrEscapeRopeOnCurMap(void); u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId); +void DisplayDadsAdviceCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField); enum { BALL_THROW_UNABLE_TWO_MONS, diff --git a/include/strings.h b/include/strings.h index 9184b4663a..8a26819c5a 100644 --- a/include/strings.h +++ b/include/strings.h @@ -3055,4 +3055,7 @@ extern const u8 gText_ExpShareOff[]; extern const u8 gText_BasePointsResetToZero[]; +extern const u8 gText_Fertilize[]; +extern const u8 gText_PlantBerry[]; + #endif // GUARD_STRINGS_H diff --git a/src/berry.c b/src/berry.c index 93b1e1e21a..98f9cc3b17 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1825,6 +1825,11 @@ void Bag_ChooseBerry(void) SetMainCallback2(CB2_ChooseBerry); } +void Bag_ChooseMulch(void) +{ + SetMainCallback2(CB2_ChooseMulch); +} + void ObjectEventInteractionPlantBerryTree(void) { u8 berry = ItemIdToBerryType(gSpecialVar_ItemId); @@ -1833,6 +1838,14 @@ void ObjectEventInteractionPlantBerryTree(void) ObjectEventInteractionGetBerryTreeData(); } +void ObjectEventInteractionApplyMulch(void) +{ + u8 mulch = ITEM_TO_MULCH(gSpecialVar_ItemId); + + gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].mulch = mulch; + StringExpandPlaceholders(gStringVar1, gItems[gSpecialVar_ItemId].name); +} + void ObjectEventInteractionPickBerryTree(void) { u8 id = GetObjectEventBerryTreeId(gSelectedObjectEvent); @@ -1892,6 +1905,27 @@ void SetBerryTreesSeen(void) } } +bool8 PlayerHasMulch(void) +{ + if (CheckBagHasItem(ITEM_GROWTH_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_DAMP_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_STABLE_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_GOOEY_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_RICH_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_SURPRISE_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_BOOST_MULCH, 1)) + return TRUE; + if (CheckBagHasItem(ITEM_AMAZE_MULCH, 1)) + return TRUE; + return FALSE; +} + // Berry mutations #if OW_BERRY_MUTATIONS == TRUE #define BERRY_MUTATION_CHANCE 25 diff --git a/src/data/script_menu.h b/src/data/script_menu.h index 79355748c7..c5afa87043 100644 --- a/src/data/script_menu.h +++ b/src/data/script_menu.h @@ -771,6 +771,13 @@ static const struct MenuAction MultichoiceList_TagMatchType[] = {gText_Exit}, }; +static const struct MenuAction MultichoiceList_BerryPlot[] = +{ + {gText_Fertilize}, + {gText_PlantBerry}, + {gText_Exit}, +}; + static const struct MenuAction MultichoiceList_Exit[] = { {gText_Exit}, @@ -898,6 +905,7 @@ static const struct MultichoiceListStruct sMultichoiceLists[] = [MULTI_SLATEPORT_TENT_RULES] = MULTICHOICE(MultichoiceList_SlateportTentRules), [MULTI_FALLARBOR_TENT_RULES] = MULTICHOICE(MultichoiceList_FallarborTentRules), [MULTI_TAG_MATCH_TYPE] = MULTICHOICE(MultichoiceList_TagMatchType), + [MULTI_BERRY_PLOT] = MULTICHOICE(MultichoiceList_BerryPlot), }; const u8 *const gStdStrings[] = diff --git a/src/item_menu.c b/src/item_menu.c index 8067742579..3753e4f2dc 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -210,6 +210,7 @@ static void ConfirmToss(u8); static void CancelToss(u8); static void ConfirmSell(u8); static void CancelSell(u8); +static void Task_FadeAndCloseBagMenuIfMulch(u8 taskId); static const struct BgTemplate sBgTemplates_ItemMenu[] = { @@ -351,7 +352,8 @@ static const TaskFunc sContextMenuFuncs[] = { [ITEMMENULOCATION_QUIZ_LADY] = Task_ItemContext_Normal, [ITEMMENULOCATION_APPRENTICE] = Task_ItemContext_Normal, [ITEMMENULOCATION_WALLY] = NULL, - [ITEMMENULOCATION_PCBOX] = Task_ItemContext_GiveToPC + [ITEMMENULOCATION_PCBOX] = Task_ItemContext_GiveToPC, + [ITEMMENULOCATION_BERRY_TREE_MULCH] = Task_FadeAndCloseBagMenuIfMulch, }; static const struct YesNoFuncTable sYesNoTossFunctions = {ConfirmToss, CancelToss}; @@ -577,6 +579,12 @@ void CB2_ChooseBerry(void) GoToBagMenu(ITEMMENULOCATION_BERRY_TREE, BERRIES_POCKET, CB2_ReturnToFieldContinueScript); } +// Choosing mulch to use +void CB2_ChooseMulch(void) +{ + GoToBagMenu(ITEMMENULOCATION_BERRY_TREE_MULCH, ITEMS_POCKET, CB2_ReturnToFieldContinueScript); +} + // Choosing berry for Berry Blender or Berry Crush void ChooseBerryForMachine(void (*exitCallback)(void)) { @@ -629,7 +637,8 @@ void GoToBagMenu(u8 location, u8 pocket, void ( *exitCallback)()) if (pocket < POCKETS_COUNT) gBagPosition.pocket = pocket; if (gBagPosition.location == ITEMMENULOCATION_BERRY_TREE || - gBagPosition.location == ITEMMENULOCATION_BERRY_BLENDER_CRUSH) + gBagPosition.location == ITEMMENULOCATION_BERRY_BLENDER_CRUSH || + gBagPosition.location == ITEMMENULOCATION_BERRY_TREE_MULCH) gBagMenu->pocketSwitchDisabled = TRUE; gBagMenu->newScreenCallback = NULL; gBagMenu->toSwapPos = NOT_SWAPPING; @@ -1078,6 +1087,23 @@ void Task_FadeAndCloseBagMenu(u8 taskId) gTasks[taskId].func = Task_CloseBagMenu; } +static void Task_FadeAndCloseBagMenuIfMulch(u8 taskId) +{ + if (gSpecialVar_ItemId == ITEM_GROWTH_MULCH || + gSpecialVar_ItemId == ITEM_DAMP_MULCH || + gSpecialVar_ItemId == ITEM_STABLE_MULCH || + gSpecialVar_ItemId == ITEM_GOOEY_MULCH || + gSpecialVar_ItemId == ITEM_RICH_MULCH || + gSpecialVar_ItemId == ITEM_SURPRISE_MULCH || + gSpecialVar_ItemId == ITEM_BOOST_MULCH || + gSpecialVar_ItemId == ITEM_AMAZE_MULCH) + { + Task_FadeAndCloseBagMenu(taskId); + return; + } + DisplayDadsAdviceCannotUseItemMessage(taskId, FALSE); +} + static void Task_CloseBagMenu(u8 taskId) { s16 *data = gTasks[taskId].data; @@ -1588,6 +1614,7 @@ static void OpenContextMenu(u8 taskId) case ITEMMENULOCATION_SHOP: case ITEMMENULOCATION_BERRY_TREE: case ITEMMENULOCATION_ITEMPC: + case ITEMMENULOCATION_BERRY_TREE_MULCH: default: if (MenuHelpers_IsLinkActive() == TRUE || InUnionRoom() == TRUE) { diff --git a/src/item_use.c b/src/item_use.c index 11d92e7427..25b5b988fb 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -158,7 +158,7 @@ static void DisplayCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyIte DisplayItemMessageOnField(taskId, gStringVar4, Task_CloseCantUseKeyItemMessage); } -static void DisplayDadsAdviceCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField) +void DisplayDadsAdviceCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField) { DisplayCannotUseItemMessage(taskId, isUsingRegisteredKeyItemOnField, gText_DadsAdvice); } diff --git a/src/strings.c b/src/strings.c index f23ad3fca5..565f0a8f62 100644 --- a/src/strings.c +++ b/src/strings.c @@ -267,7 +267,8 @@ const u8 *const gBagMenu_ReturnToStrings[] = [ITEMMENULOCATION_QUIZ_LADY] = gText_TheField, [ITEMMENULOCATION_APPRENTICE] = gText_TheField, [ITEMMENULOCATION_WALLY] = gText_TheBattle, - [ITEMMENULOCATION_PCBOX] = gText_ThePC + [ITEMMENULOCATION_PCBOX] = gText_ThePC, + [ITEMMENULOCATION_BERRY_TREE_MULCH] = gText_TheField, }; const u8 *const gPyramidBagMenu_ReturnToStrings[] = @@ -1843,3 +1844,5 @@ const u8 gText_Berries[] = _("BERRIES"); const u8 gText_ExpShareOn[] = _("The Exp. Share has been turned on.{PAUSE_UNTIL_PRESS}"); const u8 gText_ExpShareOff[] = _("The Exp. Share has been turned off.{PAUSE_UNTIL_PRESS}"); const u8 gText_BasePointsResetToZero[] = _("{STR_VAR_1}'s base points\nwere all reset to zero!{PAUSE_UNTIL_PRESS}"); +const u8 gText_Fertilize[] = _("FERTILIZE"); +const u8 gText_PlantBerry[] = _("PLANT BERRY"); From 45e19d22fad96e87532bc184e4dd5ddb2df58045 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sun, 3 Dec 2023 13:22:58 +0100 Subject: [PATCH 04/33] Remove lost comment --- data/scripts/berry_tree.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index f1ff5ba5a8..ac68dc4b96 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -327,7 +327,6 @@ BerryTree_EventScript_BerryPocketFull_Mutation:: end BerryTree_EventScript_PickBerry_Mutation:: - @ add items special IncrementDailyPickedBerries special ObjectEventInteractionRemoveBerryTree message BerryTree_Text_PickedTheBerry_Mutation From bd354f28e310893539dc9bb2e86648f9bbddd5be Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Mon, 4 Dec 2023 00:17:41 +0100 Subject: [PATCH 05/33] Allow for storing bonus Berries in Berry Yield --- src/berry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/berry.c b/src/berry.c index 98f9cc3b17..0f2091c775 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1553,7 +1553,7 @@ static bool32 BerryTreeGrow(struct BerryTree *tree) case BERRY_STAGE_NO_BERRY: return FALSE; case BERRY_STAGE_FLOWERING: - tree->berryYield = CalcBerryYield(tree); + tree->berryYield = tree->berryYield + CalcBerryYield(tree); case BERRY_STAGE_PLANTED: case BERRY_STAGE_SPROUTED: case BERRY_STAGE_TALLER: @@ -1631,7 +1631,7 @@ void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 allowGrowth) tree->stage = stage; if (stage == BERRY_STAGE_BERRIES) { - tree->berryYield = CalcBerryYield(tree); + tree->berryYield = tree->berryYield + CalcBerryYield(tree); tree->minutesUntilNextStage *= ((tree->mulch == ITEM_TO_MULCH(ITEM_STABLE_MULCH)) ? 6 : 4); } From 0d70d9951da2aeca123e1f0376ab48b914f0001b Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Mon, 4 Dec 2023 00:33:25 +0100 Subject: [PATCH 06/33] Put Mulch behind config --- data/scripts/berry_tree.inc | 55 +++++++++++++++++-------------- include/config/overworld.h | 1 + src/berry.c | 4 ++- src/data/items.h | 16 ++++----- src/data/text/item_descriptions.h | 5 +++ 5 files changed, 47 insertions(+), 34 deletions(-) diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index ac68dc4b96..bea246fde3 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -40,12 +40,15 @@ BerryTree_EventScript_WantToPlant:: end BerryTree_EventScript_WantToMulch:: +.if OW_MULCH_USAGE == TRUE msgbox BerryTree_Text_WantToMulch, MSGBOX_YESNO goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_ChooseMulchToUse goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_CancelPlanting +.endif end BerryTree_EventScript_WantToPlantMulch:: +.if OW_MULCH_USAGE == TRUE message BerryTree_Text_ItsSoftLoamySoil waitmessage multichoice 0, 0, MULTI_BERRY_PLOT, FALSE @@ -55,15 +58,6 @@ BerryTree_EventScript_WantToPlantMulch:: case 2, BerryTree_EventScript_CancelPlanting case MULTI_B_PRESSED, BerryTree_EventScript_CancelPlanting -BerryTree_EventScript_ChooseBerryToPlant:: - fadescreen FADE_TO_BLACK - closemessage - special Bag_ChooseBerry - waitstate - goto_if_eq VAR_ITEM_ID, 0, BerryTree_EventScript_CancelPlanting - removeitem VAR_ITEM_ID - call BerryTree_EventScript_PlantBerry - BerryTree_EventScript_ChooseMulchToUse:: fadescreen FADE_TO_BLACK closemessage @@ -72,6 +66,16 @@ BerryTree_EventScript_ChooseMulchToUse:: goto_if_eq VAR_ITEM_ID, 0, BerryTree_EventScript_CancelPlanting removeitem VAR_ITEM_ID call BerryTree_EventScript_UseMulch +.endif + +BerryTree_EventScript_ChooseBerryToPlant:: + fadescreen FADE_TO_BLACK + closemessage + special Bag_ChooseBerry + waitstate + goto_if_eq VAR_ITEM_ID, 0, BerryTree_EventScript_CancelPlanting + removeitem VAR_ITEM_ID + call BerryTree_EventScript_PlantBerry BerryTree_EventScript_CancelPlanting:: release @@ -223,13 +227,6 @@ BerryTree_EventScript_PlantBerry:: waitbuttonpress return -BerryTree_EventScript_UseMulch:: - special ObjectEventInteractionApplyMulch - message BerryTree_Text_ScatteredMulch - waitmessage - waitbuttonpress - return - BerryTree_Text_ItsSoftLoamySoil: .string "It's soft, loamy soil.$" @@ -237,18 +234,10 @@ BerryTree_Text_WantToPlant: .string "It's soft, loamy soil.\n" .string "Want to plant a BERRY?$" -BerryTree_Text_WantToMulch: - .string "It's soft, loamy soil.\n" - .string "Put down some fertilizer?$" - BerryTree_Text_PlantedOneBerry: .string "{PLAYER} planted one {STR_VAR_1} in\n" .string "the soft, loamy soil.$" -BerryTree_Text_ScatteredMulch: - .string "{PLAYER} scattered the {STR_VAR_1}\n" - .string "on the soft, loamy soil.$" - BerryTree_Text_BerryGrowthStage1: .string "One {STR_VAR_1} was planted here.$" @@ -364,5 +353,21 @@ BerryTree_Text_PutAwayBerry_Mutation: .string "BERRIES POCKET.\p" .string "The soil returned to its soft and\n" .string "loamy state.$" - +.endif + +.if OW_MULCH_USAGE == TRUE +BerryTree_EventScript_UseMulch:: + special ObjectEventInteractionApplyMulch + message BerryTree_Text_ScatteredMulch + waitmessage + waitbuttonpress + return + +BerryTree_Text_WantToMulch: + .string "It's soft, loamy soil.\n" + .string "Put down some fertilizer?$" + +BerryTree_Text_ScatteredMulch: + .string "{PLAYER} scattered the {STR_VAR_1}\n" + .string "on the soft, loamy soil.$" .endif diff --git a/include/config/overworld.h b/include/config/overworld.h index fb24c680b0..b15e6c3560 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -14,6 +14,7 @@ // Berry settings #define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them. +#define OW_MULCH_USAGE TRUE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. // Out-of-battle Ability effects #define OW_SYNCHRONIZE_NATURE GEN_LATEST // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same Nature, as opposed to 50% previously. Stationary Pokémon are excluded in Gen3. In Gen6, all No Eggs Discovered gift Pokémon will have the same Nature, while in Gen7 all gift Pokémon will, regardless of Egg Group - In Gen 8, no gift Pokémon are affected. In Gen9, this ability has no out-of-battle effect. diff --git a/src/berry.c b/src/berry.c index 0f2091c775..79109984b6 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1758,7 +1758,7 @@ static u8 CalcBerryYield(struct BerryTree *tree) u8 min = berry->minYield; u8 max = berry->maxYield; u8 result = CalcBerryYieldInternal(max, min, BerryTreeGetNumStagesWatered(tree)); - if (tree->mulch == ITEM_TO_MULCH(ITEM_RICH_MULCH) || tree->mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH)) + if (OW_MULCH_USAGE && (tree->mulch == ITEM_TO_MULCH(ITEM_RICH_MULCH) || tree->mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH))) result += 2; return result; @@ -1907,6 +1907,8 @@ void SetBerryTreesSeen(void) bool8 PlayerHasMulch(void) { + if (!OW_MULCH_USAGE) + return FALSE; if (CheckBagHasItem(ITEM_GROWTH_MULCH, 1)) return TRUE; if (CheckBagHasItem(ITEM_DAMP_MULCH, 1)) diff --git a/src/data/items.h b/src/data/items.h index 74c8ac014d..f1cf2c95a5 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -2164,7 +2164,7 @@ const struct Item gItems[] = { .name = _("Growth Mulch"), .price = 200, - .description = sGrowthMulchDesc, + .description = OW_MULCH_USAGE ? sGrowthMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2176,7 +2176,7 @@ const struct Item gItems[] = { .name = _("Damp Mulch"), .price = 200, - .description = sDampMulchDesc, + .description = OW_MULCH_USAGE ? sDampMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2188,7 +2188,7 @@ const struct Item gItems[] = { .name = _("Stable Mulch"), .price = 200, - .description = sStableMulchDesc, + .description = OW_MULCH_USAGE ? sStableMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2200,7 +2200,7 @@ const struct Item gItems[] = { .name = _("Gooey Mulch"), .price = 200, - .description = sGooeyMulchDesc, + .description = OW_MULCH_USAGE ? sGooeyMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2212,7 +2212,7 @@ const struct Item gItems[] = { .name = _("Rich Mulch"), .price = 200, - .description = sRichMulchDesc, + .description = OW_MULCH_USAGE ? sRichMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2224,7 +2224,7 @@ const struct Item gItems[] = { .name = _("SurprseMulch"), .price = 200, - .description = sSurpriseMulchDesc, + .description = OW_MULCH_USAGE ? sSurpriseMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2236,7 +2236,7 @@ const struct Item gItems[] = { .name = _("Boost Mulch"), .price = 200, - .description = sBoostMulchDesc, + .description = OW_MULCH_USAGE ? sBoostMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2248,7 +2248,7 @@ const struct Item gItems[] = { .name = _("Amaze Mulch"), .price = 200, - .description = sAmazeMulchDesc, + .description = OW_MULCH_USAGE ? sAmazeMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, diff --git a/src/data/text/item_descriptions.h b/src/data/text/item_descriptions.h index 422549a186..c129597f95 100644 --- a/src/data/text/item_descriptions.h +++ b/src/data/text/item_descriptions.h @@ -1008,6 +1008,11 @@ static const u8 sAmazeMulchDesc[] = _( "Surprising and\n" "Boosting as well."); +static const u8 sGenericMulchDesc[] = _( + "A fertilizer that\n" + "is unsuitable for\n" + "local soil."); + // Apricorns static const u8 sRedApricornDesc[] = _( "A red apricorn.\n" From 6da03e6cf00947e6c38327381e0e6a3f472a95d7 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Tue, 5 Dec 2023 02:16:22 +0100 Subject: [PATCH 07/33] Add Berry color and drain rate --- data/scripts/berry_tree.inc | 6 +- include/config/overworld.h | 8 +- include/constants/berry.h | 7 ++ include/global.berry.h | 9 +- src/berry.c | 169 +++++++++++++++++++++++++++++++++++- src/data/items.h | 16 ++-- 6 files changed, 197 insertions(+), 18 deletions(-) diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index bea246fde3..88d795532d 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -40,7 +40,7 @@ BerryTree_EventScript_WantToPlant:: end BerryTree_EventScript_WantToMulch:: -.if OW_MULCH_USAGE == TRUE +.if OW_BERRY_MULCH_USAGE == TRUE msgbox BerryTree_Text_WantToMulch, MSGBOX_YESNO goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_ChooseMulchToUse goto_if_eq VAR_RESULT, NO, BerryTree_EventScript_CancelPlanting @@ -48,7 +48,7 @@ BerryTree_EventScript_WantToMulch:: end BerryTree_EventScript_WantToPlantMulch:: -.if OW_MULCH_USAGE == TRUE +.if OW_BERRY_MULCH_USAGE == TRUE message BerryTree_Text_ItsSoftLoamySoil waitmessage multichoice 0, 0, MULTI_BERRY_PLOT, FALSE @@ -355,7 +355,7 @@ BerryTree_Text_PutAwayBerry_Mutation: .string "loamy state.$" .endif -.if OW_MULCH_USAGE == TRUE +.if OW_BERRY_MULCH_USAGE == TRUE BerryTree_EventScript_UseMulch:: special ObjectEventInteractionApplyMulch message BerryTree_Text_ScatteredMulch diff --git a/include/config/overworld.h b/include/config/overworld.h index b15e6c3560..9d181a3174 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -13,8 +13,12 @@ #define OW_PC_JAPAN_WALDA_ICONS TRUE // In the US release of Emerald, the Cross, Bolt, and Plusle icons for Walda's wallpapers were left blank from the Japan release. Setting this to TRUE will restore them. // Berry settings -#define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them. -#define OW_MULCH_USAGE TRUE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. +#define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them. +#define OW_BERRY_MULCH_USAGE TRUE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. +#define OW_BERRY_WEEDS FALSE // If enabled, weeds may grow on Berry plants that the player needs to take care of. +#define OW_BERRY_PESTS FALSE // If enabled, pests may approach Berry plants that the player needs to take care of. +#define OW_BERRY_MOISTURE FALSE // If enabled, Berry watering is not a matter of watering it once per stage, but rather of keeping the soil moist. +#define OW_BERRY_VARIABLE_DRAIN_RATE FALSE // If moisture is enabled, this setting uses the Gen4 drain rates for different berries // Out-of-battle Ability effects #define OW_SYNCHRONIZE_NATURE GEN_LATEST // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same Nature, as opposed to 50% previously. Stationary Pokémon are excluded in Gen3. In Gen6, all No Eggs Discovered gift Pokémon will have the same Nature, while in Gen7 all gift Pokémon will, regardless of Egg Group - In Gen 8, no gift Pokémon are affected. In Gen9, this ability has no out-of-battle effect. diff --git a/include/constants/berry.h b/include/constants/berry.h index 3ba59c0f5e..0385e57447 100644 --- a/include/constants/berry.h +++ b/include/constants/berry.h @@ -10,6 +10,13 @@ #define BERRY_FIRMNESS_VERY_HARD 4 #define BERRY_FIRMNESS_SUPER_HARD 5 +#define BERRY_COLOR_RED 0 +#define BERRY_COLOR_BLUE 1 +#define BERRY_COLOR_PURPLE 2 +#define BERRY_COLOR_GREEN 3 +#define BERRY_COLOR_YELLOW 4 +#define BERRY_COLOR_PINK 5 + #define FLAVOR_SPICY 0 #define FLAVOR_DRY 1 #define FLAVOR_SWEET 2 diff --git a/include/global.berry.h b/include/global.berry.h index cd6e18e7fb..621340ed2a 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -7,7 +7,8 @@ struct Berry { const u8 name[BERRY_NAME_LENGTH + 1]; - u8 firmness; + u8 firmness:4; + u8 color:4; u16 size; u8 maxYield; u8 minYield; @@ -20,6 +21,7 @@ struct Berry u8 bitter; u8 sour; u8 smoothness; + u8 drainRate; }; // with no const fields @@ -27,7 +29,8 @@ struct Berry struct Berry2 { u8 name[BERRY_NAME_LENGTH + 1]; - u8 firmness; + u8 firmness:4; + u8 color:4; u16 size; u8 maxYield; u8 minYield; @@ -40,7 +43,7 @@ struct Berry2 u8 bitter; u8 sour; u8 smoothness; - //u8 padding; + u8 drainRate; }; struct EnigmaBerry diff --git a/src/berry.c b/src/berry.c index 79109984b6..31d23538d3 100644 --- a/src/berry.c +++ b/src/berry.c @@ -168,6 +168,7 @@ const struct Berry gBerries[] = { .name = _("Cheri"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 20, .maxYield = 3, .minYield = 2, @@ -180,12 +181,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 25, + .drainRate = 15, }, [ITEM_CHESTO_BERRY - FIRST_BERRY_INDEX] = { .name = _("Chesto"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_PURPLE, .size = 80, .maxYield = 3, .minYield = 2, @@ -198,12 +201,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 25, + .drainRate = 15, }, [ITEM_PECHA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Pecha"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_PINK, .size = 40, .maxYield = 3, .minYield = 2, @@ -216,12 +221,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 25, + .drainRate = 15, }, [ITEM_RAWST_BERRY - FIRST_BERRY_INDEX] = { .name = _("Rawst"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_GREEN, .size = 32, .maxYield = 3, .minYield = 2, @@ -234,12 +241,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 0, .smoothness = 25, + .drainRate = 15, }, [ITEM_ASPEAR_BERRY - FIRST_BERRY_INDEX] = { .name = _("Aspear"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_YELLOW, .size = 50, .maxYield = 3, .minYield = 2, @@ -252,12 +261,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 10, .smoothness = 25, + .drainRate = 15, }, [ITEM_LEPPA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Leppa"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_RED, .size = 28, .maxYield = 3, .minYield = 2, @@ -270,12 +281,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 15, }, [ITEM_ORAN_BERRY - FIRST_BERRY_INDEX] = { .name = _("Oran"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_BLUE, .size = 35, .maxYield = 3, .minYield = 2, @@ -288,12 +301,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 15, }, [ITEM_PERSIM_BERRY - FIRST_BERRY_INDEX] = { .name = _("Persim"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PINK, .size = 47, .maxYield = 3, .minYield = 2, @@ -306,12 +321,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 15, }, [ITEM_LUM_BERRY - FIRST_BERRY_INDEX] = { .name = _("Lum"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_GREEN, .size = 34, .maxYield = 2, .minYield = 1, @@ -324,12 +341,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 8, }, [ITEM_SITRUS_BERRY - FIRST_BERRY_INDEX] = { .name = _("Sitrus"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_YELLOW, .size = 95, .maxYield = 3, .minYield = 2, @@ -342,12 +361,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 7, }, [ITEM_FIGY_BERRY - FIRST_BERRY_INDEX] = { .name = _("Figy"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 100, .maxYield = 3, .minYield = 2, @@ -360,12 +381,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 25, + .drainRate = 10, }, [ITEM_WIKI_BERRY - FIRST_BERRY_INDEX] = { .name = _("Wiki"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PURPLE, .size = 115, .maxYield = 3, .minYield = 2, @@ -378,12 +401,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 25, + .drainRate = 10, }, [ITEM_MAGO_BERRY - FIRST_BERRY_INDEX] = { .name = _("Mago"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PINK, .size = 126, .maxYield = 3, .minYield = 2, @@ -396,12 +421,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 25, + .drainRate = 10, }, [ITEM_AGUAV_BERRY - FIRST_BERRY_INDEX] = { .name = _("Aguav"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_GREEN, .size = 64, .maxYield = 3, .minYield = 2, @@ -414,12 +441,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 0, .smoothness = 25, + .drainRate = 10, }, [ITEM_IAPAPA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Iapapa"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 223, .maxYield = 3, .minYield = 2, @@ -432,12 +461,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 10, .smoothness = 25, + .drainRate = 10, }, [ITEM_RAZZ_BERRY - FIRST_BERRY_INDEX] = { .name = _("Razz"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_RED, .size = 120, .maxYield = 6, .minYield = 3, @@ -450,12 +481,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 20, + .drainRate = 35, }, [ITEM_BLUK_BERRY - FIRST_BERRY_INDEX] = { .name = _("Bluk"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_PURPLE, .size = 108, .maxYield = 6, .minYield = 3, @@ -468,12 +501,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 20, + .drainRate = 35, }, [ITEM_NANAB_BERRY - FIRST_BERRY_INDEX] = { .name = _("Nanab"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_PINK, .size = 77, .maxYield = 6, .minYield = 3, @@ -486,12 +521,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 0, .smoothness = 20, + .drainRate = 35, }, [ITEM_WEPEAR_BERRY - FIRST_BERRY_INDEX] = { .name = _("Wepear"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_GREEN, .size = 74, .maxYield = 6, .minYield = 3, @@ -504,12 +541,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 35, }, [ITEM_PINAP_BERRY - FIRST_BERRY_INDEX] = { .name = _("Pinap"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_YELLOW, .size = 80, .maxYield = 6, .minYield = 3, @@ -522,12 +561,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 10, .smoothness = 20, + .drainRate = 35, }, [ITEM_POMEG_BERRY - FIRST_BERRY_INDEX] = { .name = _("Pomeg"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_RED, .size = 135, .maxYield = 6, .minYield = 2, @@ -540,12 +581,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 0, .smoothness = 20, + .drainRate = 8, }, [ITEM_KELPSY_BERRY - FIRST_BERRY_INDEX] = { .name = _("Kelpsy"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_BLUE, .size = 150, .maxYield = 6, .minYield = 2, @@ -558,12 +601,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 10, .smoothness = 20, + .drainRate = 8, }, [ITEM_QUALOT_BERRY - FIRST_BERRY_INDEX] = { .name = _("Qualot"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_YELLOW, .size = 110, .maxYield = 6, .minYield = 2, @@ -576,12 +621,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 10, .smoothness = 20, + .drainRate = 8, }, [ITEM_HONDEW_BERRY - FIRST_BERRY_INDEX] = { .name = _("Hondew"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_GREEN, .size = 162, .maxYield = 6, .minYield = 2, @@ -594,12 +641,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 0, .smoothness = 20, + .drainRate = 8, }, [ITEM_GREPA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Grepa"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 149, .maxYield = 6, .minYield = 2, @@ -612,12 +661,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 10, .smoothness = 20, + .drainRate = 8, }, [ITEM_TAMATO_BERRY - FIRST_BERRY_INDEX] = { .name = _("Tamato"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 200, .maxYield = 4, .minYield = 2, @@ -630,12 +681,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 30, + .drainRate = 8, }, [ITEM_CORNN_BERRY - FIRST_BERRY_INDEX] = { .name = _("Cornn"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PURPLE, .size = 75, .maxYield = 4, .minYield = 2, @@ -648,12 +701,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 30, + .drainRate = 10, }, [ITEM_MAGOST_BERRY - FIRST_BERRY_INDEX] = { .name = _("Magost"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PINK, .size = 140, .maxYield = 4, .minYield = 2, @@ -666,12 +721,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 0, .smoothness = 30, + .drainRate = 10, }, [ITEM_RABUTA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Rabuta"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_GREEN, .size = 226, .maxYield = 4, .minYield = 2, @@ -684,12 +741,14 @@ const struct Berry gBerries[] = .bitter = 20, .sour = 10, .smoothness = 30, + .drainRate = 10, }, [ITEM_NOMEL_BERRY - FIRST_BERRY_INDEX] = { .name = _("Nomel"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_YELLOW, .size = 285, .maxYield = 4, .minYield = 2, @@ -702,12 +761,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 20, .smoothness = 30, + .drainRate = 10, }, [ITEM_SPELON_BERRY - FIRST_BERRY_INDEX] = { .name = _("Spelon"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 133, .maxYield = 2, .minYield = 1, @@ -720,12 +781,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 70, + .drainRate = 8, }, [ITEM_PAMTRE_BERRY - FIRST_BERRY_INDEX] = { .name = _("Pamtre"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_PURPLE, .size = 244, .maxYield = 2, .minYield = 1, @@ -738,12 +801,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 70, + .drainRate = 8, }, [ITEM_WATMEL_BERRY - FIRST_BERRY_INDEX] = { .name = _("Watmel"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_PINK, .size = 250, .maxYield = 2, .minYield = 1, @@ -756,12 +821,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 0, .smoothness = 70, + .drainRate = 8, }, [ITEM_DURIN_BERRY - FIRST_BERRY_INDEX] = { .name = _("Durin"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_GREEN, .size = 280, .maxYield = 2, .minYield = 1, @@ -774,12 +841,14 @@ const struct Berry gBerries[] = .bitter = 40, .sour = 10, .smoothness = 70, + .drainRate = 8, }, [ITEM_BELUE_BERRY - FIRST_BERRY_INDEX] = { .name = _("Belue"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_PURPLE, .size = 300, .maxYield = 2, .minYield = 1, @@ -792,12 +861,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 40, .smoothness = 70, + .drainRate = 8, }, [ITEM_CHILAN_BERRY - FIRST_BERRY_INDEX] = { .name = _("Chilan"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 34, .maxYield = 5, .minYield = 2, @@ -810,12 +881,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 35, + .drainRate = 6, }, [ITEM_OCCA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Occa"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_RED, .size = 90, .maxYield = 5, .minYield = 2, @@ -828,12 +901,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 30, + .drainRate = 6, }, [ITEM_PASSHO_BERRY - FIRST_BERRY_INDEX] = { .name = _("Passho"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_BLUE, .size = 33, .maxYield = 5, .minYield = 2, @@ -846,12 +921,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 0, .smoothness = 30, + .drainRate = 6, }, [ITEM_WACAN_BERRY - FIRST_BERRY_INDEX] = { .name = _("Wacan"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 250, .maxYield = 5, .minYield = 2, @@ -864,12 +941,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 10, .smoothness = 30, + .drainRate = 6, }, [ITEM_RINDO_BERRY - FIRST_BERRY_INDEX] = { .name = _("Rindo"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_GREEN, .size = 156, .maxYield = 5, .minYield = 2, @@ -882,12 +961,14 @@ const struct Berry gBerries[] = .bitter = 15, .sour = 0, .smoothness = 30, + .drainRate = 6, }, [ITEM_YACHE_BERRY - FIRST_BERRY_INDEX] = { .name = _("Yache"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_BLUE, .size = 135, .maxYield = 5, .minYield = 2, @@ -900,12 +981,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 15, .smoothness = 30, + .drainRate = 6, }, [ITEM_CHOPLE_BERRY - FIRST_BERRY_INDEX] = { .name = _("Chople"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 77, .maxYield = 5, .minYield = 2, @@ -918,12 +1001,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 0, .smoothness = 30, + .drainRate = 6, }, [ITEM_KEBIA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Kebia"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_GREEN, .size = 90, .maxYield = 5, .minYield = 2, @@ -936,12 +1021,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 10, .smoothness = 30, + .drainRate = 6, }, [ITEM_SHUCA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Shuca"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 42, .maxYield = 5, .minYield = 2, @@ -954,12 +1041,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 30, + .drainRate = 6, }, [ITEM_COBA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Coba"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_BLUE, .size = 278, .maxYield = 5, .minYield = 2, @@ -972,12 +1061,14 @@ const struct Berry gBerries[] = .bitter = 15, .sour = 0, .smoothness = 30, + .drainRate = 6, }, [ITEM_PAYAPA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Payapa"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_PURPLE, .size = 252, .maxYield = 5, .minYield = 2, @@ -990,12 +1081,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 15, .smoothness = 30, + .drainRate = 6, }, [ITEM_TANGA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Tanga"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_GREEN, .size = 42, .maxYield = 5, .minYield = 2, @@ -1008,12 +1101,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 10, .smoothness = 35, + .drainRate = 6, }, [ITEM_CHARTI_BERRY - FIRST_BERRY_INDEX] = { .name = _("Charti"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 28, .maxYield = 5, .minYield = 2, @@ -1026,12 +1121,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 35, + .drainRate = 6, }, [ITEM_KASIB_BERRY - FIRST_BERRY_INDEX] = { .name = _("Kasib"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PURPLE, .size = 144, .maxYield = 5, .minYield = 2, @@ -1044,12 +1141,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 35, + .drainRate = 6, }, [ITEM_HABAN_BERRY - FIRST_BERRY_INDEX] = { .name = _("Haban"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 23, .maxYield = 5, .minYield = 2, @@ -1062,12 +1161,14 @@ const struct Berry gBerries[] = .bitter = 20, .sour = 0, .smoothness = 35, + .drainRate = 6, }, [ITEM_COLBUR_BERRY - FIRST_BERRY_INDEX] = { .name = _("Colbur"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_PURPLE, .size = 39, .maxYield = 5, .minYield = 2, @@ -1080,12 +1181,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 20, .smoothness = 35, + .drainRate = 6, }, [ITEM_BABIRI_BERRY - FIRST_BERRY_INDEX] = { .name = _("Babiri"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_GREEN, .size = 265, .maxYield = 5, .minYield = 2, @@ -1098,12 +1201,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 35, + .drainRate = 6, }, [ITEM_ROSELI_BERRY - FIRST_BERRY_INDEX] = { .name = _("Roseli"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PINK, .size = 35, .maxYield = 5, .minYield = 2, @@ -1116,12 +1221,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 0, .smoothness = 35, + .drainRate = 6, }, [ITEM_LIECHI_BERRY - FIRST_BERRY_INDEX] = { .name = _("Liechi"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_RED, .size = 111, .maxYield = 2, .minYield = 1, @@ -1134,12 +1241,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 10, .smoothness = 80, + .drainRate = 4, }, [ITEM_GANLON_BERRY - FIRST_BERRY_INDEX] = { .name = _("Ganlon"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_PURPLE, .size = 33, .maxYield = 2, .minYield = 1, @@ -1152,12 +1261,14 @@ const struct Berry gBerries[] = .bitter = 40, .sour = 0, .smoothness = 80, + .drainRate = 4, }, [ITEM_SALAC_BERRY - FIRST_BERRY_INDEX] = { .name = _("Salac"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_GREEN, .size = 95, .maxYield = 2, .minYield = 1, @@ -1170,12 +1281,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 40, .smoothness = 80, + .drainRate = 4, }, [ITEM_PETAYA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Petaya"), .firmness = BERRY_FIRMNESS_VERY_HARD, + .color = BERRY_COLOR_PINK, .size = 237, .maxYield = 2, .minYield = 1, @@ -1188,12 +1301,14 @@ const struct Berry gBerries[] = .bitter = 40, .sour = 0, .smoothness = 80, + .drainRate = 4, }, [ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = { .name = _("Apicot"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_BLUE, .size = 75, .maxYield = 2, .minYield = 1, @@ -1206,12 +1321,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 40, .smoothness = 80, + .drainRate = 4, }, [ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = { .name = _("Lansat"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_RED, .size = 97, .maxYield = 2, .minYield = 1, @@ -1224,12 +1341,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 10, .smoothness = 30, + .drainRate = 4, }, [ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = { .name = _("Starf"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_GREEN, .size = 153, .maxYield = 2, .minYield = 1, @@ -1242,12 +1361,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 10, .smoothness = 30, + .drainRate = 4, }, [ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Enigma"), .firmness = BERRY_FIRMNESS_HARD, + .color = BERRY_COLOR_PURPLE, .size = 155, .maxYield = 5, .minYield = 2, @@ -1260,12 +1381,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 60, + .drainRate = 7, }, [ITEM_MICLE_BERRY - FIRST_BERRY_INDEX] = { .name = _("Micle"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_GREEN, .size = 41, .maxYield = 5, .minYield = 2, @@ -1278,12 +1401,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 0, .smoothness = 60, + .drainRate = 7, }, [ITEM_CUSTAP_BERRY - FIRST_BERRY_INDEX] = { .name = _("Custap"), .firmness = BERRY_FIRMNESS_SUPER_HARD, + .color = BERRY_COLOR_RED, .size = 267, .maxYield = 5, .minYield = 2, @@ -1296,12 +1421,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 0, .smoothness = 60, + .drainRate = 7, }, [ITEM_JABOCA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Jaboca"), .firmness = BERRY_FIRMNESS_SOFT, + .color = BERRY_COLOR_YELLOW, .size = 33, .maxYield = 5, .minYield = 2, @@ -1314,12 +1441,14 @@ const struct Berry gBerries[] = .bitter = 40, .sour = 10, .smoothness = 60, + .drainRate = 7, }, [ITEM_ROWAP_BERRY - FIRST_BERRY_INDEX] = { .name = _("Rowap"), .firmness = BERRY_FIRMNESS_VERY_SOFT, + .color = BERRY_COLOR_BLUE, .size = 52, .maxYield = 5, .minYield = 2, @@ -1332,12 +1461,14 @@ const struct Berry gBerries[] = .bitter = 0, .sour = 40, .smoothness = 60, + .drainRate = 7, }, [ITEM_KEE_BERRY - FIRST_BERRY_INDEX] = { .name = _("Kee"), .firmness = BERRY_FIRMNESS_UNKNOWN, + .color = BERRY_COLOR_YELLOW, .size = 0, .maxYield = 5, .minYield = 2, @@ -1350,12 +1481,14 @@ const struct Berry gBerries[] = .bitter = 10, .sour = 10, .smoothness = 60, + .drainRate = 7, }, [ITEM_MARANGA_BERRY - FIRST_BERRY_INDEX] = { .name = _("Marnga"), // "Maranga" is too long .firmness = BERRY_FIRMNESS_UNKNOWN, + .color = BERRY_COLOR_BLUE, .size = 0, .maxYield = 5, .minYield = 2, @@ -1368,12 +1501,14 @@ const struct Berry gBerries[] = .bitter = 30, .sour = 10, .smoothness = 60, + .drainRate = 7, }, [ITEM_ENIGMA_BERRY_E_READER - FIRST_BERRY_INDEX] = { .name = _("Enigma"), .firmness = BERRY_FIRMNESS_UNKNOWN, + .color = BERRY_COLOR_PURPLE, .size = 0, .maxYield = 2, .minYield = 1, @@ -1386,6 +1521,7 @@ const struct Berry gBerries[] = .bitter = 40, .sour = 40, .smoothness = 40, + .drainRate = 7, }, }; @@ -1758,7 +1894,7 @@ static u8 CalcBerryYield(struct BerryTree *tree) u8 min = berry->minYield; u8 max = berry->maxYield; u8 result = CalcBerryYieldInternal(max, min, BerryTreeGetNumStagesWatered(tree)); - if (OW_MULCH_USAGE && (tree->mulch == ITEM_TO_MULCH(ITEM_RICH_MULCH) || tree->mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH))) + if (OW_BERRY_MULCH_USAGE && (tree->mulch == ITEM_TO_MULCH(ITEM_RICH_MULCH) || tree->mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH))) result += 2; return result; @@ -1907,7 +2043,7 @@ void SetBerryTreesSeen(void) bool8 PlayerHasMulch(void) { - if (!OW_MULCH_USAGE) + if (!OW_BERRY_MULCH_USAGE) return FALSE; if (CheckBagHasItem(ITEM_GROWTH_MULCH, 1)) return TRUE; @@ -2035,3 +2171,32 @@ static void SetTreeMutations(u8 id, u8 berry) tree->mutationC = myMutation.asField.c; #endif } + +#if OW_BERRY_PESTS == TRUE +static u16 GetBerryPestSpecies(u8 berryId) +{ + const struct Berry *berry = GetBerryInfo(berryId); + switch(berry->color) + { + case BERRY_COLOR_RED: + return SPECIES_LEDYBA; + break; + case BERRY_COLOR_BLUE: + return SPECIES_VOLBEAT; + break; + case BERRY_COLOR_PURPLE: + return SPECIES_ILLUMISE; + break; + case BERRY_COLOR_GREEN: + return SPECIES_BURMY_PLANT_CLOAK; + break; + case BERRY_COLOR_YELLOW: + return SPECIES_COMBEE; + break; + case BERRY_COLOR_PINK: + return SPECIES_SPEWPA; + break; + } + return SPECIES_NONE; +} +#endif diff --git a/src/data/items.h b/src/data/items.h index f1cf2c95a5..62fd6a6484 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -2164,7 +2164,7 @@ const struct Item gItems[] = { .name = _("Growth Mulch"), .price = 200, - .description = OW_MULCH_USAGE ? sGrowthMulchDesc : sGenericMulchDesc, + .description = OW_BERRY_MULCH_USAGE ? sGrowthMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2176,7 +2176,7 @@ const struct Item gItems[] = { .name = _("Damp Mulch"), .price = 200, - .description = OW_MULCH_USAGE ? sDampMulchDesc : sGenericMulchDesc, + .description = OW_BERRY_MULCH_USAGE ? sDampMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2188,7 +2188,7 @@ const struct Item gItems[] = { .name = _("Stable Mulch"), .price = 200, - .description = OW_MULCH_USAGE ? sStableMulchDesc : sGenericMulchDesc, + .description = OW_BERRY_MULCH_USAGE ? sStableMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2200,7 +2200,7 @@ const struct Item gItems[] = { .name = _("Gooey Mulch"), .price = 200, - .description = OW_MULCH_USAGE ? sGooeyMulchDesc : sGenericMulchDesc, + .description = OW_BERRY_MULCH_USAGE ? sGooeyMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2212,7 +2212,7 @@ const struct Item gItems[] = { .name = _("Rich Mulch"), .price = 200, - .description = OW_MULCH_USAGE ? sRichMulchDesc : sGenericMulchDesc, + .description = OW_BERRY_MULCH_USAGE ? sRichMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2224,7 +2224,7 @@ const struct Item gItems[] = { .name = _("SurprseMulch"), .price = 200, - .description = OW_MULCH_USAGE ? sSurpriseMulchDesc : sGenericMulchDesc, + .description = OW_BERRY_MULCH_USAGE ? sSurpriseMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2236,7 +2236,7 @@ const struct Item gItems[] = { .name = _("Boost Mulch"), .price = 200, - .description = OW_MULCH_USAGE ? sBoostMulchDesc : sGenericMulchDesc, + .description = OW_BERRY_MULCH_USAGE ? sBoostMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -2248,7 +2248,7 @@ const struct Item gItems[] = { .name = _("Amaze Mulch"), .price = 200, - .description = OW_MULCH_USAGE ? sAmazeMulchDesc : sGenericMulchDesc, + .description = OW_BERRY_MULCH_USAGE ? sAmazeMulchDesc : sGenericMulchDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, From ddcd0dbb7823eba0a9d5cb629b41254c19159da2 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Tue, 5 Dec 2023 20:02:11 +0100 Subject: [PATCH 08/33] Weeds and Pests strings --- data/scripts/berry_tree.inc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index 88d795532d..b3b85abab6 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -371,3 +371,17 @@ BerryTree_Text_ScatteredMulch: .string "{PLAYER} scattered the {STR_VAR_1}\n" .string "on the soft, loamy soil.$" .endif + +.if OW_BERRY_WEEDS == TRUE +BerryTree_Text_WeedIsGrowing: + .string "A weed is growing here.\n" + .string "Do you want to pull it out?$" + +BerryTree_Text_PulledOutTheWeed: + .string "{PLAYER} pulled out the weed!$" +.endif + +.if OW_BERRY_PESTS == TRUE +BerryTree_Text_APokemonAppeared: + .string "A Pokémon appeared!$" +.endif From e4fd7845ee88007d40e0d217db5da49d2be46be0 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Tue, 5 Dec 2023 20:07:00 +0100 Subject: [PATCH 09/33] Store mutation as mutation id instead of berry id --- include/global.berry.h | 2 +- src/berry.c | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/global.berry.h b/include/global.berry.h index 621340ed2a..643adff7e6 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -82,7 +82,7 @@ struct BerryTree u8 watered4:1; u16 moistureLevel:7; u16 moistureClock:6; - u16 mutationC:3; + u16 padding:3; }; #endif // GUARD_GLOBAL_BERRY_H diff --git a/src/berry.c b/src/berry.c index 31d23538d3..bfbaf56951 100644 --- a/src/berry.c +++ b/src/berry.c @@ -2083,6 +2083,7 @@ static const u8 sBerryMutations[][3] = { {ITEM_TO_BERRY(ITEM_KELPSY_BERRY), ITEM_TO_BERRY(ITEM_WACAN_BERRY), ITEM_TO_BERRY(ITEM_APICOT_BERRY)}, {ITEM_TO_BERRY(ITEM_GANLON_BERRY), ITEM_TO_BERRY(ITEM_LIECHI_BERRY), ITEM_TO_BERRY(ITEM_KEE_BERRY)}, {ITEM_TO_BERRY(ITEM_SALAC_BERRY), ITEM_TO_BERRY(ITEM_PETAYA_BERRY), ITEM_TO_BERRY(ITEM_MARANGA_BERRY)}, + // Up to one more Mutation can be added here for a total of 15 (only 4 bits are allocated) }; static u8 GetMutationOutcome(u8 berry1, u8 berry2) @@ -2092,7 +2093,7 @@ static u8 GetMutationOutcome(u8 berry1, u8 berry2) { if ((sBerryMutations[i][0] == berry1 && sBerryMutations[i][1] == berry2) ||(sBerryMutations[i][0] == berry2 && sBerryMutations[i][1] == berry1)) - return sBerryMutations[i][2]; + return (i + 1); } return 0; } @@ -2138,8 +2139,7 @@ static u8 TryForMutation(u8 berryTreeId, u8 berry) struct TreeMutationBitfield { u8 a: 2; u8 b: 2; - u8 c: 3; - u8 unused: 1; + u8 unused: 4; }; union TreeMutation { @@ -2149,14 +2149,17 @@ union TreeMutation { static u8 GetTreeMutationValue(u8 id) { +#if OW_BERRY_MUTATIONS struct BerryTree *tree = GetBerryTreeInfo(id); union TreeMutation myMutation; - if (!OW_BERRY_MUTATIONS || tree->stopGrowth) // Pre-generated trees shouldn't have mutations + if (tree->stopGrowth) // Pre-generated trees shouldn't have mutations return 0; myMutation.asField.a = tree->mutationA; myMutation.asField.b = tree->mutationB; - myMutation.asField.c = tree->mutationC; - return myMutation.value; + return sBerryMutations[myMutation.value - 1][2]; +#else + return 0; +#endif } static void SetTreeMutations(u8 id, u8 berry) @@ -2168,7 +2171,6 @@ static void SetTreeMutations(u8 id, u8 berry) myMutation.value = TryForMutation(id, berry); tree->mutationA = myMutation.asField.a; tree->mutationB = myMutation.asField.b; - tree->mutationC = myMutation.asField.c; #endif } From 5f2c8dfb0b551eb6470fb48a403e0ce49968129b Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Tue, 5 Dec 2023 20:24:03 +0100 Subject: [PATCH 10/33] Replace watered bits with a single equivalent field --- include/global.berry.h | 5 +---- src/berry.c | 21 +++++++++------------ 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/include/global.berry.h b/include/global.berry.h index 643adff7e6..0fca1b1613 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -76,10 +76,7 @@ struct BerryTree u8 pests:1; u8 mutationB:2; u8 regrowthCount:4; - u8 watered1:1; - u8 watered2:1; - u8 watered3:1; - u8 watered4:1; + u8 watered:4; u16 moistureLevel:7; u16 moistureClock:6; u16 padding:3; diff --git a/src/berry.c b/src/berry.c index bfbaf56951..25b7e2118d 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1637,16 +1637,16 @@ bool32 ObjectEventInteractionWaterBerryTree(void) switch (tree->stage) { case BERRY_STAGE_PLANTED: - tree->watered1 = TRUE; + tree->watered |= (1 << 0); break; case BERRY_STAGE_SPROUTED: - tree->watered2 = TRUE; + tree->watered |= (1 << 1); break; case BERRY_STAGE_TALLER: - tree->watered3 = TRUE; + tree->watered |= (1 << 2); break; case BERRY_STAGE_FLOWERING: - tree->watered4 = TRUE; + tree->watered |= (1 << 3); break; default: return FALSE; @@ -1696,10 +1696,7 @@ static bool32 BerryTreeGrow(struct BerryTree *tree) tree->stage++; break; case BERRY_STAGE_BERRIES: - tree->watered1 = 0; - tree->watered2 = 0; - tree->watered3 = 0; - tree->watered4 = 0; + tree->watered = 0; tree->berryYield = 0; tree->stage = BERRY_STAGE_SPROUTED; if (++tree->regrowthCount == ((tree->mulch == ITEM_TO_MULCH(ITEM_GOOEY_MULCH)) ? 15 : 10)) @@ -1839,13 +1836,13 @@ static u8 BerryTreeGetNumStagesWatered(struct BerryTree *tree) { u8 count = 0; - if (tree->watered1) + if (tree->watered & (1 << 0)) count++; - if (tree->watered2) + if (tree->watered & (1 << 1)) count++; - if (tree->watered3) + if (tree->watered & (1 << 2)) count++; - if (tree->watered4) + if (tree->watered & (1 << 3)) count++; return count; } From 36befdcdf8ccd67fc1d3a804f492aa98fdca5693 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Tue, 5 Dec 2023 21:54:17 +0100 Subject: [PATCH 11/33] Add moisture clock, weeds and pest generation --- data/scripts/berry_tree.inc | 12 ++++++ data/specials.inc | 2 + include/global.berry.h | 6 +-- src/berry.c | 80 ++++++++++++++++++++++++++++++++++++- 4 files changed, 95 insertions(+), 5 deletions(-) diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index b3b85abab6..af8b20decb 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -373,6 +373,18 @@ BerryTree_Text_ScatteredMulch: .endif .if OW_BERRY_WEEDS == TRUE +BerryTree_EventScript_WeedIsGrowing:: + msgbox BerryTree_Text_WeedIsGrowing, MSGBOX_YESNO + goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_PullOutWeed + return + +BerryTree_EventScript_PullOutWeed:: + special ObjectEventInteractionPullBerryWeed + message BerryTree_Text_PulledOutTheWeed + waitmessage + waitbuttonpress + return + BerryTree_Text_WeedIsGrowing: .string "A weed is growing here.\n" .string "Do you want to pull it out?$" diff --git a/data/specials.inc b/data/specials.inc index d001e44549..dcab52251c 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -543,3 +543,5 @@ gSpecials:: def_special PlayerHasMulch def_special Bag_ChooseMulch def_special ObjectEventInteractionApplyMulch + def_special ObjectEventInteractionPullBerryWeed + def_special ObjectEventInteractionClearBerryPests diff --git a/include/global.berry.h b/include/global.berry.h index 0fca1b1613..bd2f6d24ee 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -76,10 +76,10 @@ struct BerryTree u8 pests:1; u8 mutationB:2; u8 regrowthCount:4; - u8 watered:4; + u8 watered:4; // Used to keep track of yield lost to drought in case of Gen4 watering u16 moistureLevel:7; - u16 moistureClock:6; - u16 padding:3; + u16 moistureClock:7; + u16 padding:2; }; #endif // GUARD_GLOBAL_BERRY_H diff --git a/src/berry.c b/src/berry.c index 25b7e2118d..8960d50530 100644 --- a/src/berry.c +++ b/src/berry.c @@ -23,8 +23,11 @@ static u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water); static u8 CalcBerryYield(struct BerryTree *tree); static u8 GetBerryCountByBerryTreeId(u8 id); static u16 GetStageDurationByBerryType(u8); +static u16 GetDrainRateByBerryType(u8); static void SetTreeMutations(u8 id, u8 berry); static u8 GetTreeMutationValue(u8 id); +static void TryForWeeds(struct BerryTree *tree); +static void TryForPests(struct BerryTree *tree); //.rodata static const u8 sBerryDescriptionPart1_Cheri[] = _("Blooms with delicate pretty flowers."); @@ -1633,7 +1636,10 @@ struct BerryTree *GetBerryTreeInfo(u8 id) bool32 ObjectEventInteractionWaterBerryTree(void) { struct BerryTree *tree = GetBerryTreeInfo(GetObjectEventBerryTreeId(gSelectedObjectEvent)); - +#if OW_BERRY_MOISTURE == TRUE + tree->moistureLevel = 100; + return TRUE; +#else switch (tree->stage) { case BERRY_STAGE_PLANTED: @@ -1652,6 +1658,7 @@ bool32 ObjectEventInteractionWaterBerryTree(void) return FALSE; } return TRUE; +#endif } bool8 IsPlayerFacingEmptyBerryTreePatch(void) @@ -1699,6 +1706,7 @@ static bool32 BerryTreeGrow(struct BerryTree *tree) tree->watered = 0; tree->berryYield = 0; tree->stage = BERRY_STAGE_SPROUTED; + tree->moistureLevel = 100; if (++tree->regrowthCount == ((tree->mulch == ITEM_TO_MULCH(ITEM_GOOEY_MULCH)) ? 15 : 10)) *tree = gBlankBerryTree; break; @@ -1720,6 +1728,7 @@ static u16 GetMulchAffectedGrowthRate(u16 berryDuration, u8 mulch, u8 stage) void BerryTreeTimeUpdate(s32 minutes) { int i; + u8 drainVal; struct BerryTree *tree; for (i = 0; i < BERRY_TREES_COUNT; i++) @@ -1736,6 +1745,35 @@ void BerryTreeTimeUpdate(s32 minutes) { s32 time = minutes; + // Check moisture gradient, pests and weeds + while (time > 0) + { + tree->moistureClock += 1; + time -= 1; + if (tree->moistureClock % 60 == 0) + { + if (OW_BERRY_MOISTURE == TRUE) + { + drainVal = OW_BERRY_VARIABLE_DRAIN_RATE ? GetDrainRateByBerryType(tree->berry) : 4; + if (tree->moistureLevel == 0 || (!OW_BERRY_VARIABLE_DRAIN_RATE && tree->moistureLevel == 4)) // Without variable drain rate, this needs to trigger after 24 hours, hence the extra check + tree->watered++; + else if (tree->moistureLevel <= drainVal) + tree->moistureLevel = 0; + else + tree->moistureLevel -= drainVal; + } + if (tree->moistureClock == 120) + { + TryForWeeds(tree); + TryForPests(tree); + tree->moistureClock = 0; + } + } + } + + // Check Berry growth + time = minutes; + while (time != 0) { if (tree->minutesUntilNextStage > time) @@ -1762,6 +1800,7 @@ void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 allowGrowth) tree->berry = berry; tree->minutesUntilNextStage = GetMulchAffectedGrowthRate(GetStageDurationByBerryType(berry), tree->mulch, stage); tree->stage = stage; + tree->moistureLevel = 100; if (stage == BERRY_STAGE_BERRIES) { tree->berryYield = tree->berryYield + CalcBerryYield(tree); @@ -1907,6 +1946,11 @@ static u16 GetStageDurationByBerryType(u8 berry) return GetBerryInfo(berry)->stageDuration * 60; } +static u16 GetDrainRateByBerryType(u8 berry) +{ + return GetBerryInfo(berry)->drainRate; +} + void ObjectEventInteractionGetBerryTreeData(void) { u8 id; @@ -2004,6 +2048,16 @@ void ObjectEventInteractionRemoveBerryTree(void) SetBerryTreeJustPicked(gSpecialVar_LastTalked, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); } +void ObjectEventInteractionPullBerryWeed(void) +{ + gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].weeds = FALSE; +} + +void ObjectEventInteractionClearBerryPests(void) +{ + gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].pests = FALSE; +} + bool8 PlayerHasBerries(void) { return IsBagPocketNonEmpty(POCKET_BERRIES); @@ -2061,7 +2115,6 @@ bool8 PlayerHasMulch(void) return FALSE; } -// Berry mutations #if OW_BERRY_MUTATIONS == TRUE #define BERRY_MUTATION_CHANCE 25 @@ -2199,3 +2252,26 @@ static u16 GetBerryPestSpecies(u8 berryId) return SPECIES_NONE; } #endif + +#define BERRY_WEEDS_CHANCE 15 +#define BERRY_PESTS_CHANCE 15 + +static void TryForWeeds(struct BerryTree *tree) +{ + if (!OW_BERRY_WEEDS) + return; + if (tree->weeds == TRUE) + return; + if (Random() % 100 < BERRY_WEEDS_CHANCE) + tree->weeds = TRUE; +} + +static void TryForPests(struct BerryTree *tree) +{ + if (!OW_BERRY_WEEDS) + return; + if (tree->pests == TRUE) + return; + if (Random() % 100 < BERRY_PESTS_CHANCE && tree->stage > BERRY_STAGE_PLANTED) + tree->pests = TRUE; +} From 3e1c04cc26057b897588b3bec624498987e8463e Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Tue, 5 Dec 2023 22:13:21 +0100 Subject: [PATCH 12/33] Allow pests and weeds interaction --- data/scripts/berry_tree.inc | 23 +++++++++++++++++++++++ data/specials.inc | 2 ++ src/berry.c | 26 +++++++++++++++++++++++--- 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index af8b20decb..37e247e4a6 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -190,6 +190,12 @@ BerryTree_EventScript_ItemUsePlantBerry:: end BerryTree_EventScript_WantToWater:: +.if OW_BERRY_PESTS == TRUE + call BerryTree_EventScript_CheckForPests +.endif +.if OW_BERRY_WEEDS == TRUE + call BerryTree_EventScript_CheckForWeed +.endif checkitem ITEM_WAILMER_PAIL goto_if_eq VAR_RESULT, FALSE, BerryTree_EventScript_DontWater special ObjectEventInteractionGetBerryName @@ -373,6 +379,11 @@ BerryTree_Text_ScatteredMulch: .endif .if OW_BERRY_WEEDS == TRUE +BerryTree_EventScript_CheckForWeed:: + specialvar VAR_RESULT, ObjectEventInteractionBerryHasWeed + call_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_WeedIsGrowing + return + BerryTree_EventScript_WeedIsGrowing:: msgbox BerryTree_Text_WeedIsGrowing, MSGBOX_YESNO goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_PullOutWeed @@ -394,6 +405,18 @@ BerryTree_Text_PulledOutTheWeed: .endif .if OW_BERRY_PESTS == TRUE +BerryTree_EventScript_CheckForPests:: + specialvar VAR_RESULT, ObjectEventInteractionBerryHasPests + call_if_eq VAR_RESULT, TRUE, BerryTree_EventScript_EncounterPests + return + +BerryTree_EventScript_EncounterPests:: + message BerryTree_Text_APokemonAppeared + waitmessage + waitbuttonpress + dowildbattle + return + BerryTree_Text_APokemonAppeared: .string "A Pokémon appeared!$" .endif diff --git a/data/specials.inc b/data/specials.inc index dcab52251c..5b01a13d01 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -545,3 +545,5 @@ gSpecials:: def_special ObjectEventInteractionApplyMulch def_special ObjectEventInteractionPullBerryWeed def_special ObjectEventInteractionClearBerryPests + def_special ObjectEventInteractionBerryHasWeed + def_special ObjectEventInteractionBerryHasPests diff --git a/src/berry.c b/src/berry.c index 8960d50530..5d751bdd67 100644 --- a/src/berry.c +++ b/src/berry.c @@ -9,6 +9,7 @@ #include "item_menu.h" #include "main.h" #include "random.h" +#include "script_pokemon_util.h" #include "string_util.h" #include "text.h" #include "constants/event_object_movement.h" @@ -26,6 +27,7 @@ static u16 GetStageDurationByBerryType(u8); static u16 GetDrainRateByBerryType(u8); static void SetTreeMutations(u8 id, u8 berry); static u8 GetTreeMutationValue(u8 id); +static u16 GetBerryPestSpecies(u8 berryId); static void TryForWeeds(struct BerryTree *tree); static void TryForPests(struct BerryTree *tree); @@ -1746,7 +1748,7 @@ void BerryTreeTimeUpdate(s32 minutes) s32 time = minutes; // Check moisture gradient, pests and weeds - while (time > 0) + while (time > 0 && tree->stage != BERRY_STAGE_BERRIES) { tree->moistureClock += 1; time -= 1; @@ -2063,6 +2065,24 @@ bool8 PlayerHasBerries(void) return IsBagPocketNonEmpty(POCKET_BERRIES); } +bool8 ObjectEventInteractionBerryHasWeed(void) +{ + return gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].weeds; +} + +bool8 ObjectEventInteractionBerryHasPests(void) +{ + u16 species; + if (!OW_BERRY_PESTS || !gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].pests) + return FALSE; + species = GetBerryPestSpecies(gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].berry); + if (species == SPECIES_NONE) + return FALSE; + CreateScriptedWildMon(species, 14 + Random() % 3, ITEM_NONE); + gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].pests = FALSE; + return TRUE; +} + // Berry tree growth is frozen at their initial stage (usually, fully grown) until the player has seen the tree // For all berry trees on screen, allow normal growth void SetBerryTreesSeen(void) @@ -2224,9 +2244,9 @@ static void SetTreeMutations(u8 id, u8 berry) #endif } -#if OW_BERRY_PESTS == TRUE static u16 GetBerryPestSpecies(u8 berryId) { +#if OW_BERRY_PESTS == TRUE const struct Berry *berry = GetBerryInfo(berryId); switch(berry->color) { @@ -2249,9 +2269,9 @@ static u16 GetBerryPestSpecies(u8 berryId) return SPECIES_SPEWPA; break; } +#endif return SPECIES_NONE; } -#endif #define BERRY_WEEDS_CHANCE 15 #define BERRY_PESTS_CHANCE 15 From 8e43b7d6968bf31516af81fe6493880c9af49a57 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Wed, 6 Dec 2023 21:08:09 +0100 Subject: [PATCH 13/33] Debug Berry functions --- data/scripts/debug.inc | 18 ++++ include/berry.h | 1 + src/berry.c | 5 +- src/debug.c | 232 ++++++++++++++++++++++++++++++++++------- 4 files changed, 218 insertions(+), 38 deletions(-) diff --git a/data/scripts/debug.inc b/data/scripts/debug.inc index 573b60d457..231f156ea7 100644 --- a/data/scripts/debug.inc +++ b/data/scripts/debug.inc @@ -228,4 +228,22 @@ Debug_ShowExpansionVersion:: Debug_ExpansionVersion: .string "pokeemerald-expansion {STR_VAR_1}$" +Debug_BerryPestsDisabled:: + msgbox DebugText_BerryPestsDisabled, MSGBOX_DEFAULT + release + end + +DebugText_BerryPestsDisabled: + .string "OW_BERRY_PESTS is disabled.\n" + .string "Unable to force pests onto berry trees.$" + +Debug_BerryWeedsDisabled:: + msgbox DebugText_BerryWeedsDisabled, MSGBOX_DEFAULT + release + end + +DebugText_BerryWeedsDisabled: + .string "OW_BERRY_WEEDS is disabled.\n" + .string "Unable to force weeds onto berry trees.$" + .endif diff --git a/include/berry.h b/include/berry.h index 68ac171370..13cf77d4dd 100644 --- a/include/berry.h +++ b/include/berry.h @@ -27,6 +27,7 @@ void ObjectEventInteractionRemoveBerryTree(void); void ObjectEventInteractionApplyMulch(void); bool8 PlayerHasBerries(void); void SetBerryTreesSeen(void); +bool32 BerryTreeGrow(struct BerryTree *tree); extern const struct Berry gBerries[]; diff --git a/src/berry.c b/src/berry.c index 5d751bdd67..e4b8cb428f 100644 --- a/src/berry.c +++ b/src/berry.c @@ -16,7 +16,6 @@ #include "constants/items.h" static u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry); -static bool32 BerryTreeGrow(struct BerryTree *tree); static u16 BerryTypeToItemId(u16 berry); static u8 BerryTreeGetNumStagesWatered(struct BerryTree *tree); static u8 GetNumStagesWateredByBerryTreeId(u8 id); @@ -1688,7 +1687,7 @@ void ClearBerryTrees(void) gSaveBlock1Ptr->berryTrees[i] = gBlankBerryTree; } -static bool32 BerryTreeGrow(struct BerryTree *tree) +bool32 BerryTreeGrow(struct BerryTree *tree) { if (tree->stopGrowth) return FALSE; @@ -2177,7 +2176,7 @@ static u8 TryForMutation(u8 berryTreeId, u8 berry) for (i = 0; i < OBJECT_EVENTS_COUNT; i++) { if (gObjectEvents[i].trainerRange_berryTreeId == berryTreeId && gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH) - break; + break; } if (i == OBJECT_EVENTS_COUNT) return 0; diff --git a/src/debug.c b/src/debug.c index 23c21f76f0..7eb4d41eba 100644 --- a/src/debug.c +++ b/src/debug.c @@ -6,9 +6,11 @@ //AsparagusEduardo: https://github.com/AsparagusEduardo/pokeemerald/tree/InfusedEmerald_v2 //Ghoulslash: https://github.com/ghoulslash/pokeemerald //Jaizu: https://jaizu.moe/ +//AND OTHER RHH POKEEMERALD-EXPANSION CONTRIBUTORS #include "global.h" #include "battle.h" #include "battle_setup.h" +#include "berry.h" #include "clock.h" #include "coins.h" #include "credits.h" @@ -100,6 +102,7 @@ enum UtilMenu DEBUG_UTIL_MENU_ITEM_CHEAT, DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG, DEBUG_UTIL_MENU_ITEM_EXPANSION_VER, + DEBUG_UTIL_MENU_ITEM_BERRY_FUNCTIONS, }; enum ScriptMenu @@ -211,6 +214,14 @@ enum SoundMenu DEBUG_SOUND_MENU_ITEM_MUS, }; +enum BerryFunctionsMenu +{ + DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL, + DEBUG_BERRY_FUNCTIONS_MENU_READY, + DEBUG_BERRY_FUNCTIONS_MENU_WEEDS, + DEBUG_BERRY_FUNCTIONS_MENU_PESTS, +}; + // ******************************* // Constants #define DEBUG_MENU_FONT FONT_NORMAL @@ -320,6 +331,7 @@ static void DebugTask_HandleMenuInput_Battle(u8 taskId); static void DebugTask_HandleMenuInput_Give(u8 taskId); static void DebugTask_HandleMenuInput_Fill(u8 taskId); static void DebugTask_HandleMenuInput_Sound(u8 taskId); +static void DebugTask_HandleMenuInput_BerryFunctions(u8 taskId); static void DebugAction_Util_HealParty(u8 taskId); static void DebugAction_Util_Fly(u8 taskId); @@ -343,6 +355,7 @@ static void DebugAction_Util_Clear_Boxes(u8 taskId); static void DebugAction_Util_CheatStart(u8 taskId); static void DebugAction_Util_HatchAnEgg(u8 taskId); static void DebugAction_Util_ExpansionVersion(u8 taskId); +static void DebugAction_Util_BerryFunctions(u8 taskId); static void DebugAction_FlagsVars_Flags(u8 taskId); static void DebugAction_FlagsVars_FlagsSelect(u8 taskId); @@ -399,6 +412,10 @@ static void DebugAction_Sound_SE_SelectId(u8 taskId); static void DebugAction_Sound_MUS(u8 taskId); static void DebugAction_Sound_MUS_SelectId(u8 taskId); +static void DebugAction_BerryFunctions_ClearAll(u8 taskId); +static void DebugAction_BerryFunctions_Ready(u8 taskId); +static void DebugAction_BerryFunctions_Pests(u8 taskId); +static void DebugAction_BerryFunctions_Weeds(u8 taskId); extern const u8 Debug_FlagsNotSetOverworldConfigMessage[]; extern const u8 Debug_FlagsNotSetBattleConfigMessage[]; @@ -425,6 +442,9 @@ extern const u8 Debug_CheckROMSpace[]; extern const u8 Debug_BoxFilledMessage[]; extern const u8 Debug_ShowExpansionVersion[]; +extern const u8 Debug_BerryPestsDisabled[]; +extern const u8 Debug_BerryWeedsDisabled[]; + #include "data/map_group_count.h" // Text @@ -478,6 +498,7 @@ static const u8 sDebugText_Util_Clear_Boxes[] = _("Clear Storage Bo static const u8 sDebugText_Util_CheatStart[] = _("CHEAT Start"); static const u8 sDebugText_Util_HatchAnEgg[] = _("Hatch an Egg"); static const u8 sDebugText_Util_ExpansionVersion[] = _("Expansion Version"); +static const u8 sDebugText_Util_BerryFunctions[] = _("Berry Functions…{CLEAR_TO 110}{RIGHT_ARROW}"); // Flags/Vars Menu static const u8 sDebugText_FlagsVars_Flags[] = _("Set Flag XYZ…{CLEAR_TO 110}{RIGHT_ARROW}"); static const u8 sDebugText_FlagsVars_Flag[] = _("Flag: {STR_VAR_1}{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}\n{STR_VAR_3}"); @@ -576,6 +597,11 @@ static const u8 sDebugText_Sound_SFX[] = _("SFX…{CLEAR_TO 110}{ static const u8 sDebugText_Sound_SFX_ID[] = _("SFX Id: {STR_VAR_3} {START_BUTTON} Stop\n{STR_VAR_1} \n{STR_VAR_2}"); static const u8 sDebugText_Sound_Music[] = _("Music…{CLEAR_TO 110}{RIGHT_ARROW}"); static const u8 sDebugText_Sound_Music_ID[] = _("Music Id: {STR_VAR_3} {START_BUTTON} Stop\n{STR_VAR_1} \n{STR_VAR_2}"); +// Berry Function Menu +static const u8 sDebugText_BerryFunctions_ClearAll[] = _("Clear map trees"); +static const u8 sDebugText_BerryFunctions_Ready[] = _("Ready map trees"); +static const u8 sDebugText_BerryFunctions_Pests[] = _("Give map trees pests"); +static const u8 sDebugText_BerryFunctions_Weeds[] = _("Give map trees weeds"); static const u8 sDebugText_Digit_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); static const u8 sDebugText_Digit_10[] = _("{LEFT_ARROW}+10{RIGHT_ARROW} "); @@ -628,23 +654,24 @@ static const struct ListMenuItem sDebugMenu_Items_Main[] = static const struct ListMenuItem sDebugMenu_Items_Utilities[] = { - [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = {sDebugText_Util_HealParty, DEBUG_UTIL_MENU_ITEM_HEAL_PARTY}, - [DEBUG_UTIL_MENU_ITEM_FLY] = {sDebugText_Util_FlyToMap, DEBUG_UTIL_MENU_ITEM_FLY}, - [DEBUG_UTIL_MENU_ITEM_WARP] = {sDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, - [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {sDebugText_Util_PoisonParty, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, - [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {sDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, - [DEBUG_UTIL_MENU_ITEM_ROM_SPACE] = {sDebugText_Util_ROMSpace, DEBUG_UTIL_MENU_ITEM_ROM_SPACE}, - [DEBUG_UTIL_MENU_ITEM_WEATHER] = {sDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, - [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {sDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, - [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {sDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, - [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {sDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, - [DEBUG_UTIL_MENU_ITEM_PLAYER_NAME] = {sDebugText_Util_Player_Name, DEBUG_UTIL_MENU_ITEM_PLAYER_NAME}, - [DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER] = {sDebugText_Util_Player_Gender, DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER}, - [DEBUG_UTIL_MENU_ITEM_PLAYER_ID] = {sDebugText_Util_Player_Id, DEBUG_UTIL_MENU_ITEM_PLAYER_ID}, - [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = {sDebugText_Util_Clear_Boxes, DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES}, - [DEBUG_UTIL_MENU_ITEM_CHEAT] = {sDebugText_Util_CheatStart, DEBUG_UTIL_MENU_ITEM_CHEAT}, - [DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG] = {sDebugText_Util_HatchAnEgg, DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG}, - [DEBUG_UTIL_MENU_ITEM_EXPANSION_VER] = {sDebugText_Util_ExpansionVersion,DEBUG_UTIL_MENU_ITEM_EXPANSION_VER}, + [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = {sDebugText_Util_HealParty, DEBUG_UTIL_MENU_ITEM_HEAL_PARTY}, + [DEBUG_UTIL_MENU_ITEM_FLY] = {sDebugText_Util_FlyToMap, DEBUG_UTIL_MENU_ITEM_FLY}, + [DEBUG_UTIL_MENU_ITEM_WARP] = {sDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, + [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {sDebugText_Util_PoisonParty, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {sDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, + [DEBUG_UTIL_MENU_ITEM_ROM_SPACE] = {sDebugText_Util_ROMSpace, DEBUG_UTIL_MENU_ITEM_ROM_SPACE}, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = {sDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {sDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {sDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {sDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, + [DEBUG_UTIL_MENU_ITEM_PLAYER_NAME] = {sDebugText_Util_Player_Name, DEBUG_UTIL_MENU_ITEM_PLAYER_NAME}, + [DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER] = {sDebugText_Util_Player_Gender, DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER}, + [DEBUG_UTIL_MENU_ITEM_PLAYER_ID] = {sDebugText_Util_Player_Id, DEBUG_UTIL_MENU_ITEM_PLAYER_ID}, + [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = {sDebugText_Util_Clear_Boxes, DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES}, + [DEBUG_UTIL_MENU_ITEM_CHEAT] = {sDebugText_Util_CheatStart, DEBUG_UTIL_MENU_ITEM_CHEAT}, + [DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG] = {sDebugText_Util_HatchAnEgg, DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG}, + [DEBUG_UTIL_MENU_ITEM_EXPANSION_VER] = {sDebugText_Util_ExpansionVersion, DEBUG_UTIL_MENU_ITEM_EXPANSION_VER}, + [DEBUG_UTIL_MENU_ITEM_BERRY_FUNCTIONS] = {sDebugText_Util_BerryFunctions, DEBUG_UTIL_MENU_ITEM_BERRY_FUNCTIONS}, }; static const struct ListMenuItem sDebugMenu_Items_Scripts[] = @@ -756,6 +783,14 @@ static const struct ListMenuItem sDebugMenu_Items_Sound[] = [DEBUG_SOUND_MENU_ITEM_MUS] = {sDebugText_Sound_Music, DEBUG_SOUND_MENU_ITEM_MUS}, }; +static const struct ListMenuItem sDebugMenu_Items_BerryFunctions[] = +{ + [DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL] = {sDebugText_BerryFunctions_ClearAll, DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL}, + [DEBUG_BERRY_FUNCTIONS_MENU_READY] = {sDebugText_BerryFunctions_Ready, DEBUG_BERRY_FUNCTIONS_MENU_READY}, + [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = {sDebugText_BerryFunctions_Pests, DEBUG_BERRY_FUNCTIONS_MENU_PESTS}, + [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = {sDebugText_BerryFunctions_Weeds, DEBUG_BERRY_FUNCTIONS_MENU_WEEDS}, +}; + // ******************************* // Menu Actions static void (*const sDebugMenu_Actions_Main[])(u8) = @@ -770,25 +805,27 @@ static void (*const sDebugMenu_Actions_Main[])(u8) = [DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, [DEBUG_MENU_ITEM_CANCEL] = DebugAction_Cancel }; + static void (*const sDebugMenu_Actions_Utilities[])(u8) = { - [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = DebugAction_Util_HealParty, - [DEBUG_UTIL_MENU_ITEM_FLY] = DebugAction_Util_Fly, - [DEBUG_UTIL_MENU_ITEM_WARP] = DebugAction_Util_Warp_Warp, - [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = DebugAction_Util_PoisonMons, - [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, - [DEBUG_UTIL_MENU_ITEM_ROM_SPACE] = DebugAction_Util_CheckROMSpace, - [DEBUG_UTIL_MENU_ITEM_WEATHER] = DebugAction_Util_Weather, - [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, - [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, - [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, - [DEBUG_UTIL_MENU_ITEM_PLAYER_NAME] = DebugAction_Util_Player_Name, - [DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER] = DebugAction_Util_Player_Gender, - [DEBUG_UTIL_MENU_ITEM_PLAYER_ID] = DebugAction_Util_Player_Id, - [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = DebugAction_Util_Clear_Boxes, - [DEBUG_UTIL_MENU_ITEM_CHEAT] = DebugAction_Util_CheatStart, - [DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG] = DebugAction_Util_HatchAnEgg, - [DEBUG_UTIL_MENU_ITEM_EXPANSION_VER] = DebugAction_Util_ExpansionVersion, + [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = DebugAction_Util_HealParty, + [DEBUG_UTIL_MENU_ITEM_FLY] = DebugAction_Util_Fly, + [DEBUG_UTIL_MENU_ITEM_WARP] = DebugAction_Util_Warp_Warp, + [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = DebugAction_Util_PoisonMons, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, + [DEBUG_UTIL_MENU_ITEM_ROM_SPACE] = DebugAction_Util_CheckROMSpace, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = DebugAction_Util_Weather, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, + [DEBUG_UTIL_MENU_ITEM_PLAYER_NAME] = DebugAction_Util_Player_Name, + [DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER] = DebugAction_Util_Player_Gender, + [DEBUG_UTIL_MENU_ITEM_PLAYER_ID] = DebugAction_Util_Player_Id, + [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = DebugAction_Util_Clear_Boxes, + [DEBUG_UTIL_MENU_ITEM_CHEAT] = DebugAction_Util_CheatStart, + [DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG] = DebugAction_Util_HatchAnEgg, + [DEBUG_UTIL_MENU_ITEM_EXPANSION_VER] = DebugAction_Util_ExpansionVersion, + [DEBUG_UTIL_MENU_ITEM_BERRY_FUNCTIONS] = DebugAction_Util_BerryFunctions, }; static void (*const sDebugMenu_Actions_Scripts[])(u8) = @@ -853,6 +890,14 @@ static void (*const sDebugMenu_Actions_Sound[])(u8) = [DEBUG_SOUND_MENU_ITEM_MUS] = DebugAction_Sound_MUS, }; +static void (*const sDebugMenu_Actions_BerryFunctions[])(u8) = +{ + [DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL] = DebugAction_BerryFunctions_ClearAll, + [DEBUG_BERRY_FUNCTIONS_MENU_READY] = DebugAction_BerryFunctions_Ready, + [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = DebugAction_BerryFunctions_Pests, + [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = DebugAction_BerryFunctions_Weeds, +}; + // ******************************* // Windows static const struct WindowTemplate sDebugMenuWindowTemplateMain = @@ -982,6 +1027,12 @@ static const struct ListMenuTemplate sDebugMenu_ListTemplate_Sound = .totalItems = ARRAY_COUNT(sDebugMenu_Items_Sound), }; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_BerryFunctions = +{ + .items = sDebugMenu_Items_BerryFunctions, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_BerryFunctions), +}; // ******************************* // Functions universal @@ -1614,6 +1665,25 @@ static void DebugTask_HandleMenuInput_Sound(u8 taskId) } } +static void DebugTask_HandleMenuInput_BerryFunctions(u8 taskId) +{ + void (*func)(u8); + u32 input = ListMenu_ProcessInput(gTasks[taskId].tMenuTaskId); + + if (JOY_NEW(A_BUTTON)) + { + PlaySE(SE_SELECT); + if ((func = sDebugMenu_Actions_BerryFunctions[input]) != NULL) + func(taskId); + } + else if (JOY_NEW(B_BUTTON)) + { + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + Debug_ReShowMainMenu(); + } +} + // ******************************* // Open sub-menus static void DebugAction_OpenUtilitiesMenu(u8 taskId) @@ -1635,7 +1705,6 @@ static void DebugAction_OpenFlagsVarsMenu(u8 taskId) Debug_ShowMenu(DebugTask_HandleMenuInput_FlagsVars, gMultiuseListMenuTemplate); } - static void DebugAction_OpenGiveMenu(u8 taskId) { Debug_DestroyMenu(taskId); @@ -1654,6 +1723,12 @@ static void DebugAction_OpenSoundMenu(u8 taskId) Debug_ShowMenu(DebugTask_HandleMenuInput_Sound, sDebugMenu_ListTemplate_Sound); } +static void DebugAction_Util_BerryFunctions(u8 taskId) +{ + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_BerryFunctions, sDebugMenu_ListTemplate_BerryFunctions); +} + // ******************************* // Actions Utilities static void DebugAction_Util_HealParty(u8 taskId) @@ -4587,6 +4662,93 @@ SOUND_LIST_SE }; #undef X +// ******************************* +// Actions BerryFunctions + +static void DebugAction_BerryFunctions_ClearAll(u8 taskId) +{ + u8 i; + + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) + { + if (gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH) + { + RemoveBerryTree(GetObjectEventBerryTreeId(i)); + SetBerryTreeJustPicked(gObjectEvents[i].localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); + } + } + + ScriptContext_Enable(); + Debug_DestroyMenu_Full(taskId); +} + +static void DebugAction_BerryFunctions_Ready(u8 taskId) +{ + u8 i; + struct BerryTree *tree; + + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) + { + if (gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH) + { + tree = &gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(i)]; + if (tree->stage != BERRY_STAGE_NO_BERRY) + { + tree->stage = BERRY_STAGE_FLOWERING; + BerryTreeGrow(tree); + } + } + } + + ScriptContext_Enable(); + Debug_DestroyMenu_Full(taskId); +} + +static void DebugAction_BerryFunctions_Pests(u8 taskId) +{ + u8 i; + + if (!OW_BERRY_PESTS) + { + Debug_DestroyMenu_Full_Script(taskId, Debug_BerryPestsDisabled); + return; + } + + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) + { + if (gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH) + { + if (gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(i)].stage != BERRY_STAGE_PLANTED) + gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(i)].pests = TRUE; + } + } + + ScriptContext_Enable(); + Debug_DestroyMenu_Full(taskId); +} + +static void DebugAction_BerryFunctions_Weeds(u8 taskId) +{ + u8 i; + + if (!OW_BERRY_WEEDS) + { + Debug_DestroyMenu_Full_Script(taskId, Debug_BerryWeedsDisabled); + return; + } + + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) + { + if (gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH) + { + gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(i)].weeds = TRUE; + } + } + + ScriptContext_Enable(); + Debug_DestroyMenu_Full(taskId); +} + // ******************************* // Actions Other From 6ba4ec744b89455693b142e95b8f0509ffe432ba Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 7 Dec 2023 11:46:44 +0100 Subject: [PATCH 14/33] Small change to debug script for clarity --- src/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug.c b/src/debug.c index 7eb4d41eba..4599d64a72 100644 --- a/src/debug.c +++ b/src/debug.c @@ -4694,7 +4694,7 @@ static void DebugAction_BerryFunctions_Ready(u8 taskId) tree = &gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(i)]; if (tree->stage != BERRY_STAGE_NO_BERRY) { - tree->stage = BERRY_STAGE_FLOWERING; + tree->stage = BERRY_STAGE_BERRIES - 1; BerryTreeGrow(tree); } } From 9fa811dd7183fafbe89aa3b3f78c85ea7bfae2a1 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 7 Dec 2023 11:54:07 +0100 Subject: [PATCH 15/33] Mulches affect gradient watering --- src/berry.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/berry.c b/src/berry.c index e4b8cb428f..ef82bcc4f6 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1756,7 +1756,16 @@ void BerryTreeTimeUpdate(s32 minutes) if (OW_BERRY_MOISTURE == TRUE) { drainVal = OW_BERRY_VARIABLE_DRAIN_RATE ? GetDrainRateByBerryType(tree->berry) : 4; - if (tree->moistureLevel == 0 || (!OW_BERRY_VARIABLE_DRAIN_RATE && tree->moistureLevel == 4)) // Without variable drain rate, this needs to trigger after 24 hours, hence the extra check + if (OW_BERRY_MULCH_USAGE) + { + if (tree->mulch == ITEM_TO_MULCH(ITEM_GROWTH_MULCH)) + drainVal *= 2; + if (tree->mulch == ITEM_TO_MULCH(ITEM_DAMP_MULCH)) + drainVal /= 2; + if (tree->mulch == ITEM_TO_MULCH(ITEM_BOOST_MULCH) || tree->mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH)) + drainVal = 25; + } + if (tree->moistureLevel == 0 || (!OW_BERRY_VARIABLE_DRAIN_RATE && tree->moistureLevel == 4)) // Without variable drain rate (and without mulches), this needs to trigger after 24 hours, hence the extra check tree->watered++; else if (tree->moistureLevel <= drainVal) tree->moistureLevel = 0; From 9be5d4fba16778c295b7b3157e5c64c92944b207 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 7 Dec 2023 12:05:12 +0100 Subject: [PATCH 16/33] Add single stage growth to debug menu --- include/config/overworld.h | 2 +- src/debug.c | 39 ++++++++++++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index 9d181a3174..ca122b782d 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -14,7 +14,7 @@ // Berry settings #define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them. -#define OW_BERRY_MULCH_USAGE TRUE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. +#define OW_BERRY_MULCH_USAGE FALSE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. Note that moisture effects only work with OW_BERRY_MOISTURE enabled! #define OW_BERRY_WEEDS FALSE // If enabled, weeds may grow on Berry plants that the player needs to take care of. #define OW_BERRY_PESTS FALSE // If enabled, pests may approach Berry plants that the player needs to take care of. #define OW_BERRY_MOISTURE FALSE // If enabled, Berry watering is not a matter of watering it once per stage, but rather of keeping the soil moist. diff --git a/src/debug.c b/src/debug.c index 4599d64a72..0fa79f56b9 100644 --- a/src/debug.c +++ b/src/debug.c @@ -218,6 +218,7 @@ enum BerryFunctionsMenu { DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL, DEBUG_BERRY_FUNCTIONS_MENU_READY, + DEBUG_BERRY_FUNCTIONS_MENU_NEXT_STAGE, DEBUG_BERRY_FUNCTIONS_MENU_WEEDS, DEBUG_BERRY_FUNCTIONS_MENU_PESTS, }; @@ -414,6 +415,7 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId); static void DebugAction_BerryFunctions_ClearAll(u8 taskId); static void DebugAction_BerryFunctions_Ready(u8 taskId); +static void DebugAction_BerryFunctions_NextStage(u8 taskId); static void DebugAction_BerryFunctions_Pests(u8 taskId); static void DebugAction_BerryFunctions_Weeds(u8 taskId); @@ -600,6 +602,7 @@ static const u8 sDebugText_Sound_Music_ID[] = _("Music Id: {STR_VAR_3} // Berry Function Menu static const u8 sDebugText_BerryFunctions_ClearAll[] = _("Clear map trees"); static const u8 sDebugText_BerryFunctions_Ready[] = _("Ready map trees"); +static const u8 sDebugText_BerryFunctions_NextStage[] = _("Grow map trees"); static const u8 sDebugText_BerryFunctions_Pests[] = _("Give map trees pests"); static const u8 sDebugText_BerryFunctions_Weeds[] = _("Give map trees weeds"); @@ -785,10 +788,11 @@ static const struct ListMenuItem sDebugMenu_Items_Sound[] = static const struct ListMenuItem sDebugMenu_Items_BerryFunctions[] = { - [DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL] = {sDebugText_BerryFunctions_ClearAll, DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL}, - [DEBUG_BERRY_FUNCTIONS_MENU_READY] = {sDebugText_BerryFunctions_Ready, DEBUG_BERRY_FUNCTIONS_MENU_READY}, - [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = {sDebugText_BerryFunctions_Pests, DEBUG_BERRY_FUNCTIONS_MENU_PESTS}, - [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = {sDebugText_BerryFunctions_Weeds, DEBUG_BERRY_FUNCTIONS_MENU_WEEDS}, + [DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL] = {sDebugText_BerryFunctions_ClearAll, DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL}, + [DEBUG_BERRY_FUNCTIONS_MENU_READY] = {sDebugText_BerryFunctions_Ready, DEBUG_BERRY_FUNCTIONS_MENU_READY}, + [DEBUG_BERRY_FUNCTIONS_MENU_NEXT_STAGE] = {sDebugText_BerryFunctions_NextStage, DEBUG_BERRY_FUNCTIONS_MENU_NEXT_STAGE}, + [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = {sDebugText_BerryFunctions_Pests, DEBUG_BERRY_FUNCTIONS_MENU_PESTS}, + [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = {sDebugText_BerryFunctions_Weeds, DEBUG_BERRY_FUNCTIONS_MENU_WEEDS}, }; // ******************************* @@ -892,10 +896,11 @@ static void (*const sDebugMenu_Actions_Sound[])(u8) = static void (*const sDebugMenu_Actions_BerryFunctions[])(u8) = { - [DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL] = DebugAction_BerryFunctions_ClearAll, - [DEBUG_BERRY_FUNCTIONS_MENU_READY] = DebugAction_BerryFunctions_Ready, - [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = DebugAction_BerryFunctions_Pests, - [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = DebugAction_BerryFunctions_Weeds, + [DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL] = DebugAction_BerryFunctions_ClearAll, + [DEBUG_BERRY_FUNCTIONS_MENU_READY] = DebugAction_BerryFunctions_Ready, + [DEBUG_BERRY_FUNCTIONS_MENU_NEXT_STAGE] = DebugAction_BerryFunctions_NextStage, + [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = DebugAction_BerryFunctions_Pests, + [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = DebugAction_BerryFunctions_Weeds, }; // ******************************* @@ -4704,6 +4709,24 @@ static void DebugAction_BerryFunctions_Ready(u8 taskId) Debug_DestroyMenu_Full(taskId); } +static void DebugAction_BerryFunctions_NextStage(u8 taskId) +{ + u8 i; + struct BerryTree *tree; + + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) + { + if (gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH) + { + tree = &gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(i)]; + BerryTreeGrow(tree); + } + } + + ScriptContext_Enable(); + Debug_DestroyMenu_Full(taskId); +} + static void DebugAction_BerryFunctions_Pests(u8 taskId) { u8 i; From 9d09b367a0b7bc9fe2d37dfa3ecafec075737a69 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 7 Dec 2023 13:22:01 +0100 Subject: [PATCH 17/33] Refactor growth time and add six stage toggle --- data/scripts/berry_tree.inc | 40 ++++++ include/config/overworld.h | 3 +- include/constants/berry.h | 2 + include/global.berry.h | 4 +- src/berry.c | 151 +++++++++++--------- src/data/object_events/object_event_anims.h | 2 + 6 files changed, 128 insertions(+), 74 deletions(-) diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index 37e247e4a6..10376d4c58 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -6,6 +6,8 @@ BerryTreeScript:: case BERRY_STAGE_PLANTED, BerryTree_EventScript_CheckBerryStage1 case BERRY_STAGE_SPROUTED, BerryTree_EventScript_CheckBerryStage2 case BERRY_STAGE_TALLER, BerryTree_EventScript_CheckBerryStage3 + case BERRY_STAGE_TRUNK, BerryTree_EventScript_CheckBerryStageTrunk + case BERRY_STAGE_BUDDING, BerryTree_EventScript_CheckBerryStageBudding case BERRY_STAGE_FLOWERING, BerryTree_EventScript_CheckBerryStage4 case BERRY_STAGE_BERRIES, BerryTree_EventScript_CheckBerryFullyGrown end @@ -105,6 +107,22 @@ BerryTree_EventScript_CheckBerryStage3:: waitbuttonpress goto BerryTree_EventScript_WantToWater +BerryTree_EventScript_CheckBerryStageTrunk:: + lockall + special ObjectEventInteractionGetBerryName + message BerryTree_Text_BerryGrowthStageTrunk + waitmessage + waitbuttonpress + goto BerryTree_EventScript_WantToWater + +BerryTree_EventScript_CheckBerryStageBudding:: + lockall + special ObjectEventInteractionGetBerryName + message BerryTree_Text_BerryGrowthStageBudding + waitmessage + waitbuttonpress + goto BerryTree_EventScript_WantToWater + BerryTree_EventScript_CheckBerryStage4:: call BerryTree_EventScript_GetCareAdverb lockall @@ -245,17 +263,39 @@ BerryTree_Text_PlantedOneBerry: .string "the soft, loamy soil.$" BerryTree_Text_BerryGrowthStage1: +.if OW_BERRY_SIX_STAGES == TRUE + .string "This is where you planted the\n{STR_VAR_1} BERRY!$" +.else .string "One {STR_VAR_1} was planted here.$" +.endif BerryTree_Text_BerryGrowthStage2: +.if OW_BERRY_SIX_STAGES == TRUE + .string "The {STR_VAR_1} is sprouting!$" +.else .string "{STR_VAR_1} has sprouted.$" +.endif BerryTree_Text_BerryGrowthStage3: +.if OW_BERRY_SIX_STAGES == TRUE + .string "The {STR_VAR_1}'s seedling is growing well!$" +.else .string "This {STR_VAR_1} plant is growing taller.$" +.endif + +BerryTree_Text_BerryGrowthStageTrunk: + .string "The {STR_VAR_1}'s trunk is getting bigger!$" + +BerryTree_Text_BerryGrowthStageBudding: + .string "The {STR_VAR_1} tree has buds!$" BerryTree_Text_BerryGrowthStage4: +.if OW_BERRY_SIX_STAGES == TRUE + .string "The {STR_VAR_1} tree is in bloom!$" +.else .string "These {STR_VAR_1} flowers are blooming\n" .string "{STR_VAR_2}.$" +.endif BerryTree_Text_CareAdverbGreat: .string "very beautifully$" diff --git a/include/config/overworld.h b/include/config/overworld.h index ca122b782d..a9c00b748e 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -18,7 +18,8 @@ #define OW_BERRY_WEEDS FALSE // If enabled, weeds may grow on Berry plants that the player needs to take care of. #define OW_BERRY_PESTS FALSE // If enabled, pests may approach Berry plants that the player needs to take care of. #define OW_BERRY_MOISTURE FALSE // If enabled, Berry watering is not a matter of watering it once per stage, but rather of keeping the soil moist. -#define OW_BERRY_VARIABLE_DRAIN_RATE FALSE // If moisture is enabled, this setting uses the Gen4 drain rates for different berries +#define OW_BERRY_VARIABLE_DRAIN_RATE FALSE // If moisture is enabled, this setting uses the Gen4 drain rates for different berries. +#define OW_BERRY_SIX_STAGES FALSE // In XY, Berries go through six stages instead of four. This toggle does not affect the time it takes for a tree to be ready for harvest. Without OW_BERRY_MOISTURE, the two extra stages count as BERRY_STAGE_TALLER for watering purposes. // Out-of-battle Ability effects #define OW_SYNCHRONIZE_NATURE GEN_LATEST // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same Nature, as opposed to 50% previously. Stationary Pokémon are excluded in Gen3. In Gen6, all No Eggs Discovered gift Pokémon will have the same Nature, while in Gen7 all gift Pokémon will, regardless of Egg Group - In Gen 8, no gift Pokémon are affected. In Gen9, this ability has no out-of-battle effect. diff --git a/include/constants/berry.h b/include/constants/berry.h index 0385e57447..bc86f44ce6 100644 --- a/include/constants/berry.h +++ b/include/constants/berry.h @@ -30,6 +30,8 @@ #define BERRY_STAGE_TALLER 3 #define BERRY_STAGE_FLOWERING 4 #define BERRY_STAGE_BERRIES 5 +#define BERRY_STAGE_TRUNK 6 // These follow BERRY_STAGE_BERRIES to preserve save compatibility +#define BERRY_STAGE_BUDDING 7 #define BERRY_STAGE_SPARKLING 255 // Berries can be watered in the following stages: diff --git a/include/global.berry.h b/include/global.berry.h index bd2f6d24ee..1fb98e56b2 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -14,7 +14,7 @@ struct Berry u8 minYield; const u8 *description1; const u8 *description2; - u8 stageDuration; + u8 growthDuration; u8 spicy; u8 dry; u8 sweet; @@ -36,7 +36,7 @@ struct Berry2 u8 minYield; u8 *description1; u8 *description2; - u8 stageDuration; + u8 growthDuration; u8 spicy; u8 dry; u8 sweet; diff --git a/src/berry.c b/src/berry.c index ef82bcc4f6..74a272673f 100644 --- a/src/berry.c +++ b/src/berry.c @@ -178,7 +178,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Cheri, .description2 = sBerryDescriptionPart2_Cheri, - .stageDuration = 3, + .growthDuration = 12, .spicy = 10, .dry = 0, .sweet = 0, @@ -198,7 +198,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Chesto, .description2 = sBerryDescriptionPart2_Chesto, - .stageDuration = 3, + .growthDuration = 12, .spicy = 0, .dry = 10, .sweet = 0, @@ -218,7 +218,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Pecha, .description2 = sBerryDescriptionPart2_Pecha, - .stageDuration = 3, + .growthDuration = 12, .spicy = 0, .dry = 0, .sweet = 10, @@ -238,7 +238,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Rawst, .description2 = sBerryDescriptionPart2_Rawst, - .stageDuration = 3, + .growthDuration = 12, .spicy = 0, .dry = 0, .sweet = 0, @@ -258,7 +258,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Aspear, .description2 = sBerryDescriptionPart2_Aspear, - .stageDuration = 3, + .growthDuration = 12, .spicy = 0, .dry = 0, .sweet = 0, @@ -278,7 +278,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Leppa, .description2 = sBerryDescriptionPart2_Leppa, - .stageDuration = 4, + .growthDuration = 16, .spicy = 10, .dry = 0, .sweet = 10, @@ -298,7 +298,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Oran, .description2 = sBerryDescriptionPart2_Oran, - .stageDuration = 3, + .growthDuration = 12, .spicy = 10, .dry = 10, .sweet = 10, @@ -318,7 +318,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Persim, .description2 = sBerryDescriptionPart2_Persim, - .stageDuration = 3, + .growthDuration = 12, .spicy = 10, .dry = 10, .sweet = 10, @@ -338,7 +338,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Lum, .description2 = sBerryDescriptionPart2_Lum, - .stageDuration = 12, + .growthDuration = 48, .spicy = 10, .dry = 10, .sweet = 10, @@ -358,7 +358,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Sitrus, .description2 = sBerryDescriptionPart2_Sitrus, - .stageDuration = 6, + .growthDuration = 24, .spicy = 10, .dry = 10, .sweet = 10, @@ -378,7 +378,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Figy, .description2 = sBerryDescriptionPart2_Figy, - .stageDuration = 6, + .growthDuration = 24, .spicy = 10, .dry = 0, .sweet = 0, @@ -398,7 +398,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Wiki, .description2 = sBerryDescriptionPart2_Wiki, - .stageDuration = 6, + .growthDuration = 24, .spicy = 0, .dry = 10, .sweet = 0, @@ -418,7 +418,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Mago, .description2 = sBerryDescriptionPart2_Mago, - .stageDuration = 6, + .growthDuration = 24, .spicy = 0, .dry = 0, .sweet = 10, @@ -438,7 +438,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Aguav, .description2 = sBerryDescriptionPart2_Aguav, - .stageDuration = 6, + .growthDuration = 24, .spicy = 0, .dry = 0, .sweet = 0, @@ -458,7 +458,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Iapapa, .description2 = sBerryDescriptionPart2_Iapapa, - .stageDuration = 6, + .growthDuration = 24, .spicy = 0, .dry = 0, .sweet = 0, @@ -478,7 +478,7 @@ const struct Berry gBerries[] = .minYield = 3, .description1 = sBerryDescriptionPart1_Razz, .description2 = sBerryDescriptionPart2_Razz, - .stageDuration = 1, + .growthDuration = 4, .spicy = 10, .dry = 10, .sweet = 0, @@ -498,7 +498,7 @@ const struct Berry gBerries[] = .minYield = 3, .description1 = sBerryDescriptionPart1_Bluk, .description2 = sBerryDescriptionPart2_Bluk, - .stageDuration = 1, + .growthDuration = 4, .spicy = 0, .dry = 10, .sweet = 10, @@ -518,7 +518,7 @@ const struct Berry gBerries[] = .minYield = 3, .description1 = sBerryDescriptionPart1_Nanab, .description2 = sBerryDescriptionPart2_Nanab, - .stageDuration = 1, + .growthDuration = 4, .spicy = 0, .dry = 0, .sweet = 10, @@ -538,7 +538,7 @@ const struct Berry gBerries[] = .minYield = 3, .description1 = sBerryDescriptionPart1_Wepear, .description2 = sBerryDescriptionPart2_Wepear, - .stageDuration = 1, + .growthDuration = 4, .spicy = 0, .dry = 0, .sweet = 0, @@ -558,7 +558,7 @@ const struct Berry gBerries[] = .minYield = 3, .description1 = sBerryDescriptionPart1_Pinap, .description2 = sBerryDescriptionPart2_Pinap, - .stageDuration = 1, + .growthDuration = 4, .spicy = 10, .dry = 0, .sweet = 0, @@ -578,7 +578,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Pomeg, .description2 = sBerryDescriptionPart2_Pomeg, - .stageDuration = 3, + .growthDuration = 12, .spicy = 10, .dry = 0, .sweet = 10, @@ -598,7 +598,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Kelpsy, .description2 = sBerryDescriptionPart2_Kelpsy, - .stageDuration = 3, + .growthDuration = 12, .spicy = 0, .dry = 10, .sweet = 0, @@ -618,7 +618,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Qualot, .description2 = sBerryDescriptionPart2_Qualot, - .stageDuration = 3, + .growthDuration = 12, .spicy = 10, .dry = 0, .sweet = 10, @@ -638,7 +638,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Hondew, .description2 = sBerryDescriptionPart2_Hondew, - .stageDuration = 3, + .growthDuration = 12, .spicy = 10, .dry = 10, .sweet = 0, @@ -658,7 +658,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Grepa, .description2 = sBerryDescriptionPart2_Grepa, - .stageDuration = 3, + .growthDuration = 12, .spicy = 0, .dry = 10, .sweet = 10, @@ -678,7 +678,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Tamato, .description2 = sBerryDescriptionPart2_Tamato, - .stageDuration = 6, + .growthDuration = 24, .spicy = 20, .dry = 10, .sweet = 0, @@ -698,7 +698,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Cornn, .description2 = sBerryDescriptionPart2_Cornn, - .stageDuration = 6, + .growthDuration = 24, .spicy = 0, .dry = 20, .sweet = 10, @@ -718,7 +718,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Magost, .description2 = sBerryDescriptionPart2_Magost, - .stageDuration = 6, + .growthDuration = 24, .spicy = 0, .dry = 0, .sweet = 20, @@ -738,7 +738,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Rabuta, .description2 = sBerryDescriptionPart2_Rabuta, - .stageDuration = 6, + .growthDuration = 24, .spicy = 0, .dry = 0, .sweet = 0, @@ -758,7 +758,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Nomel, .description2 = sBerryDescriptionPart2_Nomel, - .stageDuration = 6, + .growthDuration = 24, .spicy = 10, .dry = 0, .sweet = 0, @@ -778,7 +778,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Spelon, .description2 = sBerryDescriptionPart2_Spelon, - .stageDuration = 18, + .growthDuration = 72, .spicy = 40, .dry = 10, .sweet = 0, @@ -798,7 +798,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Pamtre, .description2 = sBerryDescriptionPart2_Pamtre, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 40, .sweet = 10, @@ -818,7 +818,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Watmel, .description2 = sBerryDescriptionPart2_Watmel, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 0, .sweet = 40, @@ -838,7 +838,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Durin, .description2 = sBerryDescriptionPart2_Durin, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 0, .sweet = 0, @@ -858,7 +858,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Belue, .description2 = sBerryDescriptionPart2_Belue, - .stageDuration = 18, + .growthDuration = 72, .spicy = 10, .dry = 0, .sweet = 0, @@ -878,7 +878,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Chilan, .description2 = sBerryDescriptionPart2_Chilan, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 25, .sweet = 10, @@ -898,7 +898,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Occa, .description2 = sBerryDescriptionPart2_Occa, - .stageDuration = 18, + .growthDuration = 72, .spicy = 15, .dry = 0, .sweet = 10, @@ -918,7 +918,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Passho, .description2 = sBerryDescriptionPart2_Passho, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 15, .sweet = 0, @@ -938,7 +938,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Wacan, .description2 = sBerryDescriptionPart2_Wacan, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 0, .sweet = 15, @@ -958,7 +958,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Rindo, .description2 = sBerryDescriptionPart2_Rindo, - .stageDuration = 18, + .growthDuration = 72, .spicy = 10, .dry = 0, .sweet = 0, @@ -978,7 +978,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Yache, .description2 = sBerryDescriptionPart2_Yache, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 10, .sweet = 0, @@ -998,7 +998,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Chople, .description2 = sBerryDescriptionPart2_Chople, - .stageDuration = 18, + .growthDuration = 72, .spicy = 15, .dry = 0, .sweet = 0, @@ -1018,7 +1018,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Kebia, .description2 = sBerryDescriptionPart2_Kebia, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 15, .sweet = 0, @@ -1038,7 +1038,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Shuca, .description2 = sBerryDescriptionPart2_Shuca, - .stageDuration = 18, + .growthDuration = 72, .spicy = 10, .dry = 0, .sweet = 15, @@ -1058,7 +1058,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Coba, .description2 = sBerryDescriptionPart2_Coba, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 10, .sweet = 0, @@ -1078,7 +1078,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Payapa, .description2 = sBerryDescriptionPart2_Payapa, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 0, .sweet = 10, @@ -1098,7 +1098,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Tanga, .description2 = sBerryDescriptionPart2_Tanga, - .stageDuration = 18, + .growthDuration = 72, .spicy = 20, .dry = 0, .sweet = 0, @@ -1118,7 +1118,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Charti, .description2 = sBerryDescriptionPart2_Charti, - .stageDuration = 18, + .growthDuration = 72, .spicy = 10, .dry = 20, .sweet = 0, @@ -1138,7 +1138,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Kasib, .description2 = sBerryDescriptionPart2_Kasib, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 10, .sweet = 20, @@ -1158,7 +1158,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Haban, .description2 = sBerryDescriptionPart2_Haban, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 0, .sweet = 10, @@ -1178,7 +1178,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Colbur, .description2 = sBerryDescriptionPart2_Colbur, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 0, .sweet = 0, @@ -1198,7 +1198,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Babiri, .description2 = sBerryDescriptionPart2_Babiri, - .stageDuration = 18, + .growthDuration = 72, .spicy = 25, .dry = 10, .sweet = 0, @@ -1218,7 +1218,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Roseli, .description2 = sBerryDescriptionPart2_Roseli, - .stageDuration = 18, + .growthDuration = 72, .spicy = 0, .dry = 0, .sweet = 25, @@ -1238,7 +1238,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Liechi, .description2 = sBerryDescriptionPart2_Liechi, - .stageDuration = 24, + .growthDuration = 96, .spicy = 40, .dry = 0, .sweet = 40, @@ -1258,7 +1258,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Ganlon, .description2 = sBerryDescriptionPart2_Ganlon, - .stageDuration = 24, + .growthDuration = 96, .spicy = 0, .dry = 40, .sweet = 0, @@ -1278,7 +1278,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Salac, .description2 = sBerryDescriptionPart2_Salac, - .stageDuration = 24, + .growthDuration = 96, .spicy = 0, .dry = 0, .sweet = 40, @@ -1298,7 +1298,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Petaya, .description2 = sBerryDescriptionPart2_Petaya, - .stageDuration = 24, + .growthDuration = 96, .spicy = 40, .dry = 0, .sweet = 0, @@ -1318,7 +1318,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Apicot, .description2 = sBerryDescriptionPart2_Apicot, - .stageDuration = 24, + .growthDuration = 96, .spicy = 0, .dry = 40, .sweet = 0, @@ -1338,7 +1338,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Lansat, .description2 = sBerryDescriptionPart2_Lansat, - .stageDuration = 24, + .growthDuration = 96, .spicy = 10, .dry = 10, .sweet = 10, @@ -1358,7 +1358,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Starf, .description2 = sBerryDescriptionPart2_Starf, - .stageDuration = 24, + .growthDuration = 96, .spicy = 10, .dry = 10, .sweet = 10, @@ -1378,7 +1378,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Enigma, .description2 = sBerryDescriptionPart2_Enigma, - .stageDuration = 24, + .growthDuration = 96, .spicy = 40, .dry = 10, .sweet = 0, @@ -1398,7 +1398,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Micle, .description2 = sBerryDescriptionPart2_Micle, - .stageDuration = 24, + .growthDuration = 96, .spicy = 0, .dry = 40, .sweet = 10, @@ -1418,7 +1418,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Custap, .description2 = sBerryDescriptionPart2_Custap, - .stageDuration = 24, + .growthDuration = 96, .spicy = 0, .dry = 0, .sweet = 40, @@ -1438,7 +1438,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Jaboca, .description2 = sBerryDescriptionPart2_Jaboca, - .stageDuration = 24, + .growthDuration = 96, .spicy = 0, .dry = 0, .sweet = 0, @@ -1458,7 +1458,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Rowap, .description2 = sBerryDescriptionPart2_Rowap, - .stageDuration = 24, + .growthDuration = 96, .spicy = 10, .dry = 0, .sweet = 0, @@ -1478,7 +1478,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Kee, .description2 = sBerryDescriptionPart2_Kee, - .stageDuration = 24, + .growthDuration = 96, .spicy = 30, .dry = 30, .sweet = 10, @@ -1498,7 +1498,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Maranga, .description2 = sBerryDescriptionPart2_Maranga, - .stageDuration = 24, + .growthDuration = 96, .spicy = 10, .dry = 10, .sweet = 30, @@ -1518,7 +1518,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Enigma, .description2 = sBerryDescriptionPart2_Enigma, - .stageDuration = 24, + .growthDuration = 96, .spicy = 40, .dry = 40, .sweet = 40, @@ -1608,7 +1608,7 @@ static u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry) bool32 IsEnigmaBerryValid(void) { - if (!gSaveBlock1Ptr->enigmaBerry.berry.stageDuration) + if (!gSaveBlock1Ptr->enigmaBerry.berry.growthDuration) return FALSE; if (!gSaveBlock1Ptr->enigmaBerry.berry.maxYield) return FALSE; @@ -1650,6 +1650,8 @@ bool32 ObjectEventInteractionWaterBerryTree(void) tree->watered |= (1 << 1); break; case BERRY_STAGE_TALLER: + case BERRY_STAGE_TRUNK: + case BERRY_STAGE_BUDDING: tree->watered |= (1 << 2); break; case BERRY_STAGE_FLOWERING: @@ -1700,9 +1702,16 @@ bool32 BerryTreeGrow(struct BerryTree *tree) tree->berryYield = tree->berryYield + CalcBerryYield(tree); case BERRY_STAGE_PLANTED: case BERRY_STAGE_SPROUTED: - case BERRY_STAGE_TALLER: + case BERRY_STAGE_TRUNK: + case BERRY_STAGE_BUDDING: tree->stage++; break; + case BERRY_STAGE_TALLER: + if (OW_BERRY_SIX_STAGES) + tree->stage = BERRY_STAGE_TRUNK; + else + tree->stage++; + break; case BERRY_STAGE_BERRIES: tree->watered = 0; tree->berryYield = 0; @@ -1953,7 +1962,7 @@ static u8 GetBerryCountByBerryTreeId(u8 id) static u16 GetStageDurationByBerryType(u8 berry) { - return GetBerryInfo(berry)->stageDuration * 60; + return GetBerryInfo(berry)->growthDuration * 60 / (OW_BERRY_SIX_STAGES ? 6 : 4); } static u16 GetDrainRateByBerryType(u8 berry) diff --git a/src/data/object_events/object_event_anims.h b/src/data/object_events/object_event_anims.h index f96e52de53..e68910d159 100755 --- a/src/data/object_events/object_event_anims.h +++ b/src/data/object_events/object_event_anims.h @@ -1105,6 +1105,8 @@ static const union AnimCmd *const sAnimTable_BerryTree[] = { [BERRY_STAGE_PLANTED - 1] = sAnim_BerryTreeStage0, [BERRY_STAGE_SPROUTED - 1] = sAnim_BerryTreeStage1, [BERRY_STAGE_TALLER - 1] = sAnim_BerryTreeStage2, + [BERRY_STAGE_TRUNK - 1] = sAnim_BerryTreeStage2, + [BERRY_STAGE_BUDDING - 1] = sAnim_BerryTreeStage2, [BERRY_STAGE_FLOWERING - 1] = sAnim_BerryTreeStage3, [BERRY_STAGE_BERRIES - 1] = sAnim_BerryTreeStage4, }; From ccb0e11235871f9a8e24a17cf29c5b697c4fbd1a Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 7 Dec 2023 14:18:54 +0100 Subject: [PATCH 18/33] Add generation-based growth rate config --- include/config/overworld.h | 6 ++ src/berry.c | 144 +++++++++++++++++++------------------ 2 files changed, 81 insertions(+), 69 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index a9c00b748e..dab8f6b153 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -13,6 +13,10 @@ #define OW_PC_JAPAN_WALDA_ICONS TRUE // In the US release of Emerald, the Cross, Bolt, and Plusle icons for Walda's wallpapers were left blank from the Japan release. Setting this to TRUE will restore them. // Berry settings +// These generational defines only make a distinction for Berries! +#define GEN_6_XY GEN_6 +#define GEN_6_ORAS (GEN_6 + 0.5) + #define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them. #define OW_BERRY_MULCH_USAGE FALSE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. Note that moisture effects only work with OW_BERRY_MOISTURE enabled! #define OW_BERRY_WEEDS FALSE // If enabled, weeds may grow on Berry plants that the player needs to take care of. @@ -21,6 +25,8 @@ #define OW_BERRY_VARIABLE_DRAIN_RATE FALSE // If moisture is enabled, this setting uses the Gen4 drain rates for different berries. #define OW_BERRY_SIX_STAGES FALSE // In XY, Berries go through six stages instead of four. This toggle does not affect the time it takes for a tree to be ready for harvest. Without OW_BERRY_MOISTURE, the two extra stages count as BERRY_STAGE_TALLER for watering purposes. +#define OW_BERRY_GROWTH_RATE GEN_3 // Presets for how long each Berry plant takes to grow. + // Out-of-battle Ability effects #define OW_SYNCHRONIZE_NATURE GEN_LATEST // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same Nature, as opposed to 50% previously. Stationary Pokémon are excluded in Gen3. In Gen6, all No Eggs Discovered gift Pokémon will have the same Nature, while in Gen7 all gift Pokémon will, regardless of Egg Group - In Gen 8, no gift Pokémon are affected. In Gen9, this ability has no out-of-battle effect. #define OW_COMPOUND_EYES GEN_LATEST // Prior to Gen9, if a Pokémon with Compound Eyes is leading the party, the wild held item rate is increased to 60%/20%. diff --git a/src/berry.c b/src/berry.c index 74a272673f..a9522fb9b0 100644 --- a/src/berry.c +++ b/src/berry.c @@ -166,6 +166,12 @@ static const u8 sBerryDescriptionPart2_Kee[] = _("first, then extremely bitter." static const u8 sBerryDescriptionPart1_Maranga[] = _("Its outside is very bitter, but its"); static const u8 sBerryDescriptionPart2_Maranga[] = _("inside tastes like a sweet drink."); +#if OW_BERRY_GROWTH_RATE < GEN_3 || OW_BERRY_GROWTH_RATE > GEN_7 +#error "OW_BERRY_GROWTH_RATE must be between GEN_3 and GEN_7!" +#endif + +#define GROWTH_DURATION(g3, g4, g5, xy, oras, g7) OW_BERRY_GROWTH_RATE == GEN_3 ? g3 : OW_BERRY_GROWTH_RATE == GEN_4 ? g4 : OW_BERRY_GROWTH_RATE == GEN_5 ? g5 : OW_BERRY_GROWTH_RATE == GEN_6_XY ? xy : OW_BERRY_GROWTH_RATE == GEN_6_ORAS ? oras : g7 + const struct Berry gBerries[] = { [ITEM_CHERI_BERRY - FIRST_BERRY_INDEX] = @@ -178,7 +184,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Cheri, .description2 = sBerryDescriptionPart2_Cheri, - .growthDuration = 12, + .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 10, .dry = 0, .sweet = 0, @@ -198,7 +204,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Chesto, .description2 = sBerryDescriptionPart2_Chesto, - .growthDuration = 12, + .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 0, .dry = 10, .sweet = 0, @@ -218,7 +224,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Pecha, .description2 = sBerryDescriptionPart2_Pecha, - .growthDuration = 12, + .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 10, @@ -238,7 +244,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Rawst, .description2 = sBerryDescriptionPart2_Rawst, - .growthDuration = 12, + .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, @@ -258,7 +264,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Aspear, .description2 = sBerryDescriptionPart2_Aspear, - .growthDuration = 12, + .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, @@ -278,7 +284,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Leppa, .description2 = sBerryDescriptionPart2_Leppa, - .growthDuration = 16, + .growthDuration = GROWTH_DURATION(16, 16, 24, 24, 16, 24), .spicy = 10, .dry = 0, .sweet = 10, @@ -298,7 +304,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Oran, .description2 = sBerryDescriptionPart2_Oran, - .growthDuration = 12, + .growthDuration = GROWTH_DURATION(12, 16, 24, 24, 16, 24), .spicy = 10, .dry = 10, .sweet = 10, @@ -318,7 +324,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Persim, .description2 = sBerryDescriptionPart2_Persim, - .growthDuration = 12, + .growthDuration = GROWTH_DURATION(12, 16, 24, 24, 16, 24), .spicy = 10, .dry = 10, .sweet = 10, @@ -338,7 +344,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Lum, .description2 = sBerryDescriptionPart2_Lum, - .growthDuration = 48, + .growthDuration = GROWTH_DURATION(48, 48, 72, 48, 32, 48), .spicy = 10, .dry = 10, .sweet = 10, @@ -358,7 +364,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Sitrus, .description2 = sBerryDescriptionPart2_Sitrus, - .growthDuration = 24, + .growthDuration = GROWTH_DURATION(24, 32, 48, 48, 32, 48), .spicy = 10, .dry = 10, .sweet = 10, @@ -378,7 +384,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Figy, .description2 = sBerryDescriptionPart2_Figy, - .growthDuration = 24, + .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 10, .dry = 0, .sweet = 0, @@ -398,7 +404,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Wiki, .description2 = sBerryDescriptionPart2_Wiki, - .growthDuration = 24, + .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 0, .dry = 10, .sweet = 0, @@ -418,7 +424,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Mago, .description2 = sBerryDescriptionPart2_Mago, - .growthDuration = 24, + .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 10, @@ -438,7 +444,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Aguav, .description2 = sBerryDescriptionPart2_Aguav, - .growthDuration = 24, + .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, @@ -458,7 +464,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Iapapa, .description2 = sBerryDescriptionPart2_Iapapa, - .growthDuration = 24, + .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, @@ -478,7 +484,7 @@ const struct Berry gBerries[] = .minYield = 3, .description1 = sBerryDescriptionPart1_Razz, .description2 = sBerryDescriptionPart2_Razz, - .growthDuration = 4, + .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 10, .dry = 10, .sweet = 0, @@ -498,7 +504,7 @@ const struct Berry gBerries[] = .minYield = 3, .description1 = sBerryDescriptionPart1_Bluk, .description2 = sBerryDescriptionPart2_Bluk, - .growthDuration = 4, + .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 0, .dry = 10, .sweet = 10, @@ -518,7 +524,7 @@ const struct Berry gBerries[] = .minYield = 3, .description1 = sBerryDescriptionPart1_Nanab, .description2 = sBerryDescriptionPart2_Nanab, - .growthDuration = 4, + .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 10, @@ -538,7 +544,7 @@ const struct Berry gBerries[] = .minYield = 3, .description1 = sBerryDescriptionPart1_Wepear, .description2 = sBerryDescriptionPart2_Wepear, - .growthDuration = 4, + .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, @@ -558,7 +564,7 @@ const struct Berry gBerries[] = .minYield = 3, .description1 = sBerryDescriptionPart1_Pinap, .description2 = sBerryDescriptionPart2_Pinap, - .growthDuration = 4, + .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 10, .dry = 0, .sweet = 0, @@ -578,7 +584,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Pomeg, .description2 = sBerryDescriptionPart2_Pomeg, - .growthDuration = 12, + .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 10, .dry = 0, .sweet = 10, @@ -598,7 +604,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Kelpsy, .description2 = sBerryDescriptionPart2_Kelpsy, - .growthDuration = 12, + .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 0, .dry = 10, .sweet = 0, @@ -618,7 +624,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Qualot, .description2 = sBerryDescriptionPart2_Qualot, - .growthDuration = 12, + .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 10, .dry = 0, .sweet = 10, @@ -638,7 +644,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Hondew, .description2 = sBerryDescriptionPart2_Hondew, - .growthDuration = 12, + .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 10, .dry = 10, .sweet = 0, @@ -658,7 +664,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Grepa, .description2 = sBerryDescriptionPart2_Grepa, - .growthDuration = 12, + .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 0, .dry = 10, .sweet = 10, @@ -678,7 +684,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Tamato, .description2 = sBerryDescriptionPart2_Tamato, - .growthDuration = 24, + .growthDuration = GROWTH_DURATION(24, 32, 48, 48, 32, 48), .spicy = 20, .dry = 10, .sweet = 0, @@ -698,7 +704,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Cornn, .description2 = sBerryDescriptionPart2_Cornn, - .growthDuration = 24, + .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), .spicy = 0, .dry = 20, .sweet = 10, @@ -718,7 +724,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Magost, .description2 = sBerryDescriptionPart2_Magost, - .growthDuration = 24, + .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 20, @@ -738,7 +744,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Rabuta, .description2 = sBerryDescriptionPart2_Rabuta, - .growthDuration = 24, + .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, @@ -758,7 +764,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Nomel, .description2 = sBerryDescriptionPart2_Nomel, - .growthDuration = 24, + .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), .spicy = 10, .dry = 0, .sweet = 0, @@ -778,7 +784,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Spelon, .description2 = sBerryDescriptionPart2_Spelon, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 40, .dry = 10, .sweet = 0, @@ -798,7 +804,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Pamtre, .description2 = sBerryDescriptionPart2_Pamtre, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 0, .dry = 40, .sweet = 10, @@ -818,7 +824,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Watmel, .description2 = sBerryDescriptionPart2_Watmel, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 40, @@ -838,7 +844,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Durin, .description2 = sBerryDescriptionPart2_Durin, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 0, .dry = 0, .sweet = 0, @@ -858,7 +864,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Belue, .description2 = sBerryDescriptionPart2_Belue, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 10, .dry = 0, .sweet = 0, @@ -878,7 +884,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Chilan, .description2 = sBerryDescriptionPart2_Chilan, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 25, .sweet = 10, @@ -898,7 +904,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Occa, .description2 = sBerryDescriptionPart2_Occa, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 15, .dry = 0, .sweet = 10, @@ -918,7 +924,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Passho, .description2 = sBerryDescriptionPart2_Passho, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 15, .sweet = 0, @@ -938,7 +944,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Wacan, .description2 = sBerryDescriptionPart2_Wacan, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, .sweet = 15, @@ -958,7 +964,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Rindo, .description2 = sBerryDescriptionPart2_Rindo, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 10, .dry = 0, .sweet = 0, @@ -978,7 +984,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Yache, .description2 = sBerryDescriptionPart2_Yache, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 10, .sweet = 0, @@ -998,7 +1004,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Chople, .description2 = sBerryDescriptionPart2_Chople, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 15, .dry = 0, .sweet = 0, @@ -1018,7 +1024,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Kebia, .description2 = sBerryDescriptionPart2_Kebia, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 15, .sweet = 0, @@ -1038,7 +1044,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Shuca, .description2 = sBerryDescriptionPart2_Shuca, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 10, .dry = 0, .sweet = 15, @@ -1058,7 +1064,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Coba, .description2 = sBerryDescriptionPart2_Coba, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 10, .sweet = 0, @@ -1078,7 +1084,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Payapa, .description2 = sBerryDescriptionPart2_Payapa, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, .sweet = 10, @@ -1098,7 +1104,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Tanga, .description2 = sBerryDescriptionPart2_Tanga, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 20, .dry = 0, .sweet = 0, @@ -1118,7 +1124,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Charti, .description2 = sBerryDescriptionPart2_Charti, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 10, .dry = 20, .sweet = 0, @@ -1138,7 +1144,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Kasib, .description2 = sBerryDescriptionPart2_Kasib, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 10, .sweet = 20, @@ -1158,7 +1164,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Haban, .description2 = sBerryDescriptionPart2_Haban, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, .sweet = 10, @@ -1178,7 +1184,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Colbur, .description2 = sBerryDescriptionPart2_Colbur, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, .sweet = 0, @@ -1198,7 +1204,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Babiri, .description2 = sBerryDescriptionPart2_Babiri, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 25, .dry = 10, .sweet = 0, @@ -1218,7 +1224,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Roseli, .description2 = sBerryDescriptionPart2_Roseli, - .growthDuration = 72, + .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, .sweet = 25, @@ -1238,7 +1244,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Liechi, .description2 = sBerryDescriptionPart2_Liechi, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 40, .dry = 0, .sweet = 40, @@ -1258,7 +1264,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Ganlon, .description2 = sBerryDescriptionPart2_Ganlon, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 0, .dry = 40, .sweet = 0, @@ -1278,7 +1284,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Salac, .description2 = sBerryDescriptionPart2_Salac, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 0, .dry = 0, .sweet = 40, @@ -1298,7 +1304,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Petaya, .description2 = sBerryDescriptionPart2_Petaya, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 40, .dry = 0, .sweet = 0, @@ -1318,7 +1324,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Apicot, .description2 = sBerryDescriptionPart2_Apicot, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 0, .dry = 40, .sweet = 0, @@ -1338,7 +1344,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Lansat, .description2 = sBerryDescriptionPart2_Lansat, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 120, 48, 72), .spicy = 10, .dry = 10, .sweet = 10, @@ -1358,7 +1364,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Starf, .description2 = sBerryDescriptionPart2_Starf, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 120, 48, 72), .spicy = 10, .dry = 10, .sweet = 10, @@ -1378,7 +1384,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Enigma, .description2 = sBerryDescriptionPart2_Enigma, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 40, .dry = 10, .sweet = 0, @@ -1398,7 +1404,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Micle, .description2 = sBerryDescriptionPart2_Micle, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 0, .dry = 40, .sweet = 10, @@ -1418,7 +1424,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Custap, .description2 = sBerryDescriptionPart2_Custap, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 0, .dry = 0, .sweet = 40, @@ -1438,7 +1444,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Jaboca, .description2 = sBerryDescriptionPart2_Jaboca, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 0, .dry = 0, .sweet = 0, @@ -1458,7 +1464,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Rowap, .description2 = sBerryDescriptionPart2_Rowap, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 10, .dry = 0, .sweet = 0, @@ -1478,7 +1484,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Kee, .description2 = sBerryDescriptionPart2_Kee, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 30, .dry = 30, .sweet = 10, @@ -1498,7 +1504,7 @@ const struct Berry gBerries[] = .minYield = 2, .description1 = sBerryDescriptionPart1_Maranga, .description2 = sBerryDescriptionPart2_Maranga, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 10, .dry = 10, .sweet = 30, @@ -1518,7 +1524,7 @@ const struct Berry gBerries[] = .minYield = 1, .description1 = sBerryDescriptionPart1_Enigma, .description2 = sBerryDescriptionPart2_Enigma, - .growthDuration = 96, + .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 40, .dry = 40, .sweet = 40, @@ -1805,7 +1811,7 @@ void BerryTreeTimeUpdate(s32 minutes) if (!BerryTreeGrow(tree)) break; if (tree->stage == BERRY_STAGE_BERRIES) - tree->minutesUntilNextStage *= ((tree->mulch == ITEM_TO_MULCH(ITEM_STABLE_MULCH)) ? 6 : 4); + tree->minutesUntilNextStage = GetStageDurationByBerryType(tree->berry) * ((tree->mulch == ITEM_TO_MULCH(ITEM_STABLE_MULCH)) ? 6 : 4); } } } From d7959879f18b87f6bddab70e713ed79b0b02bffe Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 7 Dec 2023 18:06:20 +0100 Subject: [PATCH 19/33] Preset yield config --- include/config/overworld.h | 1 + src/berry.c | 279 +++++++++++++++++++------------------ 2 files changed, 144 insertions(+), 136 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index dab8f6b153..dc4c600e21 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -26,6 +26,7 @@ #define OW_BERRY_SIX_STAGES FALSE // In XY, Berries go through six stages instead of four. This toggle does not affect the time it takes for a tree to be ready for harvest. Without OW_BERRY_MOISTURE, the two extra stages count as BERRY_STAGE_TALLER for watering purposes. #define OW_BERRY_GROWTH_RATE GEN_3 // Presets for how long each Berry plant takes to grow. +#define OW_BERRY_YIELD_RATE GEN_3 // Presets for how many Berries each plant can yield. // Out-of-battle Ability effects #define OW_SYNCHRONIZE_NATURE GEN_LATEST // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same Nature, as opposed to 50% previously. Stationary Pokémon are excluded in Gen3. In Gen6, all No Eggs Discovered gift Pokémon will have the same Nature, while in Gen7 all gift Pokémon will, regardless of Egg Group - In Gen 8, no gift Pokémon are affected. In Gen9, this ability has no out-of-battle effect. diff --git a/src/berry.c b/src/berry.c index a9522fb9b0..4e65e5be5b 100644 --- a/src/berry.c +++ b/src/berry.c @@ -170,7 +170,14 @@ static const u8 sBerryDescriptionPart2_Maranga[] = _("inside tastes like a sweet #error "OW_BERRY_GROWTH_RATE must be between GEN_3 and GEN_7!" #endif +#if OW_BERRY_YIELD_RATE < GEN_3 || OW_BERRY_YIELD_RATE > GEN_6 +#error "OW_BERRY_YIELD_RATE must be between GEN_3 and GEN_6!" +#elif OW_BERRY_YIELD_RATE == GEN_5 +#error "OW_BERRY_YIELD_RATE can not be GEN_5!" +#endif + #define GROWTH_DURATION(g3, g4, g5, xy, oras, g7) OW_BERRY_GROWTH_RATE == GEN_3 ? g3 : OW_BERRY_GROWTH_RATE == GEN_4 ? g4 : OW_BERRY_GROWTH_RATE == GEN_5 ? g5 : OW_BERRY_GROWTH_RATE == GEN_6_XY ? xy : OW_BERRY_GROWTH_RATE == GEN_6_ORAS ? oras : g7 +#define YIELD_RATE(g3, g4, xy, oras) GROWTH_DURATION(g3, g4, 0, xy, oras, 0) const struct Berry gBerries[] = { @@ -180,8 +187,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_RED, .size = 20, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), .description1 = sBerryDescriptionPart1_Cheri, .description2 = sBerryDescriptionPart2_Cheri, .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), @@ -200,8 +207,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SUPER_HARD, .color = BERRY_COLOR_PURPLE, .size = 80, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), .description1 = sBerryDescriptionPart1_Chesto, .description2 = sBerryDescriptionPart2_Chesto, .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), @@ -220,8 +227,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_SOFT, .color = BERRY_COLOR_PINK, .size = 40, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), .description1 = sBerryDescriptionPart1_Pecha, .description2 = sBerryDescriptionPart2_Pecha, .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), @@ -240,8 +247,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_GREEN, .size = 32, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), .description1 = sBerryDescriptionPart1_Rawst, .description2 = sBerryDescriptionPart2_Rawst, .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), @@ -260,8 +267,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SUPER_HARD, .color = BERRY_COLOR_YELLOW, .size = 50, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), .description1 = sBerryDescriptionPart1_Aspear, .description2 = sBerryDescriptionPart2_Aspear, .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), @@ -280,8 +287,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_HARD, .color = BERRY_COLOR_RED, .size = 28, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 22), + .minYield = YIELD_RATE(2, 2, 2, 2), .description1 = sBerryDescriptionPart1_Leppa, .description2 = sBerryDescriptionPart2_Leppa, .growthDuration = GROWTH_DURATION(16, 16, 24, 24, 16, 24), @@ -300,8 +307,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SUPER_HARD, .color = BERRY_COLOR_BLUE, .size = 35, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), .description1 = sBerryDescriptionPart1_Oran, .description2 = sBerryDescriptionPart2_Oran, .growthDuration = GROWTH_DURATION(12, 16, 24, 24, 16, 24), @@ -320,8 +327,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_PINK, .size = 47, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 20), + .minYield = YIELD_RATE(2, 2, 4, 4), .description1 = sBerryDescriptionPart1_Persim, .description2 = sBerryDescriptionPart2_Persim, .growthDuration = GROWTH_DURATION(12, 16, 24, 24, 16, 24), @@ -340,8 +347,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SUPER_HARD, .color = BERRY_COLOR_GREEN, .size = 34, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 5, 20, 18), + .minYield = YIELD_RATE(1, 2, 3, 2), .description1 = sBerryDescriptionPart1_Lum, .description2 = sBerryDescriptionPart2_Lum, .growthDuration = GROWTH_DURATION(48, 48, 72, 48, 32, 48), @@ -360,8 +367,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_HARD, .color = BERRY_COLOR_YELLOW, .size = 95, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 20, 27), + .minYield = YIELD_RATE(2, 2, 3, 3), .description1 = sBerryDescriptionPart1_Sitrus, .description2 = sBerryDescriptionPart2_Sitrus, .growthDuration = GROWTH_DURATION(24, 32, 48, 48, 32, 48), @@ -380,8 +387,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_RED, .size = 100, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 15), + .minYield = YIELD_RATE(2, 1, 3, 3), .description1 = sBerryDescriptionPart1_Figy, .description2 = sBerryDescriptionPart2_Figy, .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), @@ -400,8 +407,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_PURPLE, .size = 115, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 15), + .minYield = YIELD_RATE(2, 1, 3, 3), .description1 = sBerryDescriptionPart1_Wiki, .description2 = sBerryDescriptionPart2_Wiki, .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), @@ -420,8 +427,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_PINK, .size = 126, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 15), + .minYield = YIELD_RATE(2, 1, 3, 3), .description1 = sBerryDescriptionPart1_Mago, .description2 = sBerryDescriptionPart2_Mago, .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), @@ -440,8 +447,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SUPER_HARD, .color = BERRY_COLOR_GREEN, .size = 64, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 15), + .minYield = YIELD_RATE(2, 1, 3, 3), .description1 = sBerryDescriptionPart1_Aguav, .description2 = sBerryDescriptionPart2_Aguav, .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), @@ -460,8 +467,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_YELLOW, .size = 223, - .maxYield = 3, - .minYield = 2, + .maxYield = YIELD_RATE(3, 5, 15, 15), + .minYield = YIELD_RATE(2, 1, 3, 3), .description1 = sBerryDescriptionPart1_Iapapa, .description2 = sBerryDescriptionPart2_Iapapa, .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), @@ -480,8 +487,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_HARD, .color = BERRY_COLOR_RED, .size = 120, - .maxYield = 6, - .minYield = 3, + .maxYield = YIELD_RATE(6, 10, 15, 20), + .minYield = YIELD_RATE(3, 2, 3, 4), .description1 = sBerryDescriptionPart1_Razz, .description2 = sBerryDescriptionPart2_Razz, .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), @@ -500,8 +507,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_PURPLE, .size = 108, - .maxYield = 6, - .minYield = 3, + .maxYield = YIELD_RATE(6, 10, 15, 20), + .minYield = YIELD_RATE(3, 2, 3, 4), .description1 = sBerryDescriptionPart1_Bluk, .description2 = sBerryDescriptionPart2_Bluk, .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), @@ -520,8 +527,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_HARD, .color = BERRY_COLOR_PINK, .size = 77, - .maxYield = 6, - .minYield = 3, + .maxYield = YIELD_RATE(6, 10, 15, 20), + .minYield = YIELD_RATE(3, 2, 3, 4), .description1 = sBerryDescriptionPart1_Nanab, .description2 = sBerryDescriptionPart2_Nanab, .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), @@ -540,8 +547,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SUPER_HARD, .color = BERRY_COLOR_GREEN, .size = 74, - .maxYield = 6, - .minYield = 3, + .maxYield = YIELD_RATE(6, 10, 15, 20), + .minYield = YIELD_RATE(3, 2, 3, 4), .description1 = sBerryDescriptionPart1_Wepear, .description2 = sBerryDescriptionPart2_Wepear, .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), @@ -560,8 +567,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_YELLOW, .size = 80, - .maxYield = 6, - .minYield = 3, + .maxYield = YIELD_RATE(6, 10, 15, 20), + .minYield = YIELD_RATE(3, 2, 3, 4), .description1 = sBerryDescriptionPart1_Pinap, .description2 = sBerryDescriptionPart2_Pinap, .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), @@ -580,8 +587,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_HARD, .color = BERRY_COLOR_RED, .size = 135, - .maxYield = 6, - .minYield = 2, + .maxYield = YIELD_RATE(6, 5, 20, 26), + .minYield = YIELD_RATE(2, 1, 1, 2), .description1 = sBerryDescriptionPart1_Pomeg, .description2 = sBerryDescriptionPart2_Pomeg, .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), @@ -600,8 +607,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_BLUE, .size = 150, - .maxYield = 6, - .minYield = 2, + .maxYield = YIELD_RATE(6, 5, 20, 26), + .minYield = YIELD_RATE(2, 1, 1, 2), .description1 = sBerryDescriptionPart1_Kelpsy, .description2 = sBerryDescriptionPart2_Kelpsy, .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), @@ -620,8 +627,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_YELLOW, .size = 110, - .maxYield = 6, - .minYield = 2, + .maxYield = YIELD_RATE(6, 5, 20, 26), + .minYield = YIELD_RATE(2, 1, 1, 2), .description1 = sBerryDescriptionPart1_Qualot, .description2 = sBerryDescriptionPart2_Qualot, .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), @@ -640,8 +647,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_GREEN, .size = 162, - .maxYield = 6, - .minYield = 2, + .maxYield = YIELD_RATE(6, 5, 20, 26), + .minYield = YIELD_RATE(2, 1, 1, 2), .description1 = sBerryDescriptionPart1_Hondew, .description2 = sBerryDescriptionPart2_Hondew, .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), @@ -660,8 +667,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_YELLOW, .size = 149, - .maxYield = 6, - .minYield = 2, + .maxYield = YIELD_RATE(6, 5, 20, 26), + .minYield = YIELD_RATE(2, 1, 1, 2), .description1 = sBerryDescriptionPart1_Grepa, .description2 = sBerryDescriptionPart2_Grepa, .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), @@ -680,8 +687,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_RED, .size = 200, - .maxYield = 4, - .minYield = 2, + .maxYield = YIELD_RATE(4, 5, 20, 26), + .minYield = YIELD_RATE(2, 1, 1, 2), .description1 = sBerryDescriptionPart1_Tamato, .description2 = sBerryDescriptionPart2_Tamato, .growthDuration = GROWTH_DURATION(24, 32, 48, 48, 32, 48), @@ -700,8 +707,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_PURPLE, .size = 75, - .maxYield = 4, - .minYield = 2, + .maxYield = YIELD_RATE(4, 10, 15, 15), + .minYield = YIELD_RATE(2, 2, 3, 3), .description1 = sBerryDescriptionPart1_Cornn, .description2 = sBerryDescriptionPart2_Cornn, .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), @@ -720,8 +727,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_PINK, .size = 140, - .maxYield = 4, - .minYield = 2, + .maxYield = YIELD_RATE(4, 10, 15, 15), + .minYield = YIELD_RATE(2, 2, 3, 3), .description1 = sBerryDescriptionPart1_Magost, .description2 = sBerryDescriptionPart2_Magost, .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), @@ -740,8 +747,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_GREEN, .size = 226, - .maxYield = 4, - .minYield = 2, + .maxYield = YIELD_RATE(4, 10, 15, 15), + .minYield = YIELD_RATE(2, 2, 3, 3), .description1 = sBerryDescriptionPart1_Rabuta, .description2 = sBerryDescriptionPart2_Rabuta, .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), @@ -760,8 +767,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SUPER_HARD, .color = BERRY_COLOR_YELLOW, .size = 285, - .maxYield = 4, - .minYield = 2, + .maxYield = YIELD_RATE(4, 10, 15, 15), + .minYield = YIELD_RATE(2, 2, 3, 3), .description1 = sBerryDescriptionPart1_Nomel, .description2 = sBerryDescriptionPart2_Nomel, .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), @@ -780,8 +787,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_RED, .size = 133, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 15, 15, 15), + .minYield = YIELD_RATE(1, 2, 3, 3), .description1 = sBerryDescriptionPart1_Spelon, .description2 = sBerryDescriptionPart2_Spelon, .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), @@ -800,8 +807,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_SOFT, .color = BERRY_COLOR_PURPLE, .size = 244, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 15, 15, 15), + .minYield = YIELD_RATE(1, 3, 3, 3), .description1 = sBerryDescriptionPart1_Pamtre, .description2 = sBerryDescriptionPart2_Pamtre, .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), @@ -820,8 +827,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_PINK, .size = 250, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 15, 15, 15), + .minYield = YIELD_RATE(1, 2, 3, 3), .description1 = sBerryDescriptionPart1_Watmel, .description2 = sBerryDescriptionPart2_Watmel, .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), @@ -840,8 +847,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_GREEN, .size = 280, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 15, 15, 15), + .minYield = YIELD_RATE(1, 3, 3, 3), .description1 = sBerryDescriptionPart1_Durin, .description2 = sBerryDescriptionPart2_Durin, .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), @@ -860,8 +867,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_SOFT, .color = BERRY_COLOR_PURPLE, .size = 300, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 15, 15, 15), + .minYield = YIELD_RATE(1, 2, 3, 3), .description1 = sBerryDescriptionPart1_Belue, .description2 = sBerryDescriptionPart2_Belue, .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), @@ -880,8 +887,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_SOFT, .color = BERRY_COLOR_YELLOW, .size = 34, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Chilan, .description2 = sBerryDescriptionPart2_Chilan, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -900,8 +907,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SUPER_HARD, .color = BERRY_COLOR_RED, .size = 90, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Occa, .description2 = sBerryDescriptionPart2_Occa, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -920,8 +927,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_BLUE, .size = 33, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Passho, .description2 = sBerryDescriptionPart2_Passho, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -940,8 +947,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_SOFT, .color = BERRY_COLOR_YELLOW, .size = 250, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Wacan, .description2 = sBerryDescriptionPart2_Wacan, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -960,8 +967,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_GREEN, .size = 156, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Rindo, .description2 = sBerryDescriptionPart2_Rindo, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -980,8 +987,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_HARD, .color = BERRY_COLOR_BLUE, .size = 135, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Yache, .description2 = sBerryDescriptionPart2_Yache, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1000,8 +1007,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_RED, .size = 77, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Chople, .description2 = sBerryDescriptionPart2_Chople, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1020,8 +1027,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_GREEN, .size = 90, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Kebia, .description2 = sBerryDescriptionPart2_Kebia, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1040,8 +1047,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_YELLOW, .size = 42, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Shuca, .description2 = sBerryDescriptionPart2_Shuca, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1060,8 +1067,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_HARD, .color = BERRY_COLOR_BLUE, .size = 278, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Coba, .description2 = sBerryDescriptionPart2_Coba, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1080,8 +1087,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_PURPLE, .size = 252, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Payapa, .description2 = sBerryDescriptionPart2_Payapa, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1100,8 +1107,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_SOFT, .color = BERRY_COLOR_GREEN, .size = 42, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Tanga, .description2 = sBerryDescriptionPart2_Tanga, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1120,8 +1127,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_SOFT, .color = BERRY_COLOR_YELLOW, .size = 28, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Charti, .description2 = sBerryDescriptionPart2_Charti, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1140,8 +1147,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_PURPLE, .size = 144, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Kasib, .description2 = sBerryDescriptionPart2_Kasib, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1160,8 +1167,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_RED, .size = 23, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Haban, .description2 = sBerryDescriptionPart2_Haban, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1180,8 +1187,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SUPER_HARD, .color = BERRY_COLOR_PURPLE, .size = 39, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Colbur, .description2 = sBerryDescriptionPart2_Colbur, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1200,8 +1207,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SUPER_HARD, .color = BERRY_COLOR_GREEN, .size = 265, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Babiri, .description2 = sBerryDescriptionPart2_Babiri, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1220,8 +1227,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_PINK, .size = 35, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(5, 5, 20, 10), + .minYield = YIELD_RATE(2, 1, 3, 2), .description1 = sBerryDescriptionPart1_Roseli, .description2 = sBerryDescriptionPart2_Roseli, .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), @@ -1240,8 +1247,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_HARD, .color = BERRY_COLOR_RED, .size = 111, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), .description1 = sBerryDescriptionPart1_Liechi, .description2 = sBerryDescriptionPart2_Liechi, .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), @@ -1260,8 +1267,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_HARD, .color = BERRY_COLOR_PURPLE, .size = 33, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), .description1 = sBerryDescriptionPart1_Ganlon, .description2 = sBerryDescriptionPart2_Ganlon, .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), @@ -1280,8 +1287,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_HARD, .color = BERRY_COLOR_GREEN, .size = 95, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), .description1 = sBerryDescriptionPart1_Salac, .description2 = sBerryDescriptionPart2_Salac, .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), @@ -1300,8 +1307,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_HARD, .color = BERRY_COLOR_PINK, .size = 237, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), .description1 = sBerryDescriptionPart1_Petaya, .description2 = sBerryDescriptionPart2_Petaya, .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), @@ -1320,8 +1327,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_BLUE, .size = 75, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), .description1 = sBerryDescriptionPart1_Apicot, .description2 = sBerryDescriptionPart2_Apicot, .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), @@ -1340,8 +1347,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_RED, .size = 97, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 5, 5, 7), + .minYield = YIELD_RATE(1, 1, 1, 1), .description1 = sBerryDescriptionPart1_Lansat, .description2 = sBerryDescriptionPart2_Lansat, .growthDuration = GROWTH_DURATION(96, 96, 144, 120, 48, 72), @@ -1360,8 +1367,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SUPER_HARD, .color = BERRY_COLOR_GREEN, .size = 153, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 5, 5, 7), + .minYield = YIELD_RATE(1, 1, 1, 1), .description1 = sBerryDescriptionPart1_Starf, .description2 = sBerryDescriptionPart2_Starf, .growthDuration = GROWTH_DURATION(96, 96, 144, 120, 48, 72), @@ -1380,8 +1387,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_HARD, .color = BERRY_COLOR_PURPLE, .size = 155, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(2, 5, 5, 13), + .minYield = YIELD_RATE(1, 1, 1, 1), .description1 = sBerryDescriptionPart1_Enigma, .description2 = sBerryDescriptionPart2_Enigma, .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), @@ -1400,8 +1407,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_GREEN, .size = 41, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(2, 5, 5, 13), + .minYield = YIELD_RATE(1, 1, 1, 1), .description1 = sBerryDescriptionPart1_Micle, .description2 = sBerryDescriptionPart2_Micle, .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), @@ -1420,8 +1427,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SUPER_HARD, .color = BERRY_COLOR_RED, .size = 267, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(2, 5, 5, 13), + .minYield = YIELD_RATE(1, 1, 1, 1), .description1 = sBerryDescriptionPart1_Custap, .description2 = sBerryDescriptionPart2_Custap, .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), @@ -1440,8 +1447,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_SOFT, .color = BERRY_COLOR_YELLOW, .size = 33, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(2, 5, 5, 13), + .minYield = YIELD_RATE(1, 1, 1, 1), .description1 = sBerryDescriptionPart1_Jaboca, .description2 = sBerryDescriptionPart2_Jaboca, .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), @@ -1460,8 +1467,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_VERY_SOFT, .color = BERRY_COLOR_BLUE, .size = 52, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(2, 5, 5, 13), + .minYield = YIELD_RATE(1, 1, 1, 1), .description1 = sBerryDescriptionPart1_Rowap, .description2 = sBerryDescriptionPart2_Rowap, .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), @@ -1480,8 +1487,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_UNKNOWN, .color = BERRY_COLOR_YELLOW, .size = 0, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), .description1 = sBerryDescriptionPart1_Kee, .description2 = sBerryDescriptionPart2_Kee, .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), @@ -1500,8 +1507,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_UNKNOWN, .color = BERRY_COLOR_BLUE, .size = 0, - .maxYield = 5, - .minYield = 2, + .maxYield = YIELD_RATE(2, 5, 10, 13), + .minYield = YIELD_RATE(1, 1, 1, 2), .description1 = sBerryDescriptionPart1_Maranga, .description2 = sBerryDescriptionPart2_Maranga, .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), @@ -1520,8 +1527,8 @@ const struct Berry gBerries[] = .firmness = BERRY_FIRMNESS_UNKNOWN, .color = BERRY_COLOR_PURPLE, .size = 0, - .maxYield = 2, - .minYield = 1, + .maxYield = YIELD_RATE(2, 5, 5, 13), + .minYield = YIELD_RATE(1, 1, 1, 1), .description1 = sBerryDescriptionPart1_Enigma, .description2 = sBerryDescriptionPart2_Enigma, .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), From 2b711870008ef02e0e3992c184b013b6bb95063c Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 7 Dec 2023 23:50:08 +0100 Subject: [PATCH 20/33] Add caretaking bonuses to berry data --- include/global.berry.h | 18 +++- src/berry.c | 228 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 240 insertions(+), 6 deletions(-) diff --git a/include/global.berry.h b/include/global.berry.h index 1fb98e56b2..18b48d191b 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -4,14 +4,21 @@ #define BERRY_NAME_LENGTH 6 #define BERRY_ITEM_EFFECT_COUNT 18 +// water up to 15 (4 bits) +// weeds up to 7 * 0.5 (3 bits), 0 => 0.1 +// pests up to 7 * 0.5 (3 bits), 0 => 0.2 + struct Berry { const u8 name[BERRY_NAME_LENGTH + 1]; u8 firmness:4; u8 color:4; - u16 size; + u16 size:10; + u16 weedsBonus:3; + u16 pestsBonus:3; u8 maxYield; - u8 minYield; + u8 minYield:4; + u8 waterBonus:4; const u8 *description1; const u8 *description2; u8 growthDuration; @@ -31,9 +38,12 @@ struct Berry2 u8 name[BERRY_NAME_LENGTH + 1]; u8 firmness:4; u8 color:4; - u16 size; + u16 size:10; + u16 weedsBonus:3; + u16 pestsBonus:3; u8 maxYield; - u8 minYield; + u8 minYield:4; + u8 waterBonus:4; u8 *description1; u8 *description2; u8 growthDuration; diff --git a/src/berry.c b/src/berry.c index 4e65e5be5b..6a95d1d6a2 100644 --- a/src/berry.c +++ b/src/berry.c @@ -23,7 +23,10 @@ static u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water); static u8 CalcBerryYield(struct BerryTree *tree); static u8 GetBerryCountByBerryTreeId(u8 id); static u16 GetStageDurationByBerryType(u8); -static u16 GetDrainRateByBerryType(u8); +static u8 GetDrainRateByBerryType(u8); +static u8 GetWaterBonusByBerryType(u8); +static u8 GetWeedingBonusByBerryType(u8); +static u8 GetPestsBonusByBerryType(u8); static void SetTreeMutations(u8 id, u8 berry); static u8 GetTreeMutationValue(u8 id); static u16 GetBerryPestSpecies(u8 berryId); @@ -199,6 +202,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 25, .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_CHESTO_BERRY - FIRST_BERRY_INDEX] = @@ -219,6 +225,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 25, .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_PECHA_BERRY - FIRST_BERRY_INDEX] = @@ -239,6 +248,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 25, .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 4, + .pestsBonus = 6, }, [ITEM_RAWST_BERRY - FIRST_BERRY_INDEX] = @@ -259,6 +271,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 25, .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_ASPEAR_BERRY - FIRST_BERRY_INDEX] = @@ -279,6 +294,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 25, .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_LEPPA_BERRY - FIRST_BERRY_INDEX] = @@ -299,6 +317,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 20, .drainRate = 15, + .waterBonus = 15, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_ORAN_BERRY - FIRST_BERRY_INDEX] = @@ -319,6 +340,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 20, .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 4, + .pestsBonus = 6, }, [ITEM_PERSIM_BERRY - FIRST_BERRY_INDEX] = @@ -339,6 +363,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 20, .drainRate = 15, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_LUM_BERRY - FIRST_BERRY_INDEX] = @@ -359,6 +386,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 20, .drainRate = 8, + .waterBonus = 12, + .weedsBonus = 1, + .pestsBonus = 6, }, [ITEM_SITRUS_BERRY - FIRST_BERRY_INDEX] = @@ -379,6 +409,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 20, .drainRate = 7, + .waterBonus = 12, + .weedsBonus = 1, + .pestsBonus = 6, }, [ITEM_FIGY_BERRY - FIRST_BERRY_INDEX] = @@ -399,6 +432,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 25, .drainRate = 10, + .waterBonus = 15, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_WIKI_BERRY - FIRST_BERRY_INDEX] = @@ -419,6 +455,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 25, .drainRate = 10, + .waterBonus = 15, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_MAGO_BERRY - FIRST_BERRY_INDEX] = @@ -439,6 +478,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 25, .drainRate = 10, + .waterBonus = 15, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_AGUAV_BERRY - FIRST_BERRY_INDEX] = @@ -459,6 +501,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 25, .drainRate = 10, + .waterBonus = 15, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_IAPAPA_BERRY - FIRST_BERRY_INDEX] = @@ -479,6 +524,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 25, .drainRate = 10, + .waterBonus = 15, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_RAZZ_BERRY - FIRST_BERRY_INDEX] = @@ -499,6 +547,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 20, .drainRate = 35, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_BLUK_BERRY - FIRST_BERRY_INDEX] = @@ -519,6 +570,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 20, .drainRate = 35, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_NANAB_BERRY - FIRST_BERRY_INDEX] = @@ -539,6 +593,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 20, .drainRate = 35, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_WEPEAR_BERRY - FIRST_BERRY_INDEX] = @@ -559,6 +616,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 20, .drainRate = 35, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_PINAP_BERRY - FIRST_BERRY_INDEX] = @@ -579,6 +639,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 20, .drainRate = 35, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_POMEG_BERRY - FIRST_BERRY_INDEX] = @@ -599,6 +662,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 20, .drainRate = 8, + .waterBonus = 5, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_KELPSY_BERRY - FIRST_BERRY_INDEX] = @@ -619,6 +685,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 20, .drainRate = 8, + .waterBonus = 5, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_QUALOT_BERRY - FIRST_BERRY_INDEX] = @@ -639,6 +708,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 20, .drainRate = 8, + .waterBonus = 5, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_HONDEW_BERRY - FIRST_BERRY_INDEX] = @@ -659,6 +731,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 20, .drainRate = 8, + .waterBonus = 5, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_GREPA_BERRY - FIRST_BERRY_INDEX] = @@ -679,6 +754,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 20, .drainRate = 8, + .waterBonus = 5, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_TAMATO_BERRY - FIRST_BERRY_INDEX] = @@ -699,6 +777,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 30, .drainRate = 8, + .waterBonus = 5, + .weedsBonus = 3, + .pestsBonus = 6, }, [ITEM_CORNN_BERRY - FIRST_BERRY_INDEX] = @@ -719,6 +800,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 30, .drainRate = 10, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_MAGOST_BERRY - FIRST_BERRY_INDEX] = @@ -739,6 +823,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 30, .drainRate = 10, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_RABUTA_BERRY - FIRST_BERRY_INDEX] = @@ -759,6 +846,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 30, .drainRate = 10, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_NOMEL_BERRY - FIRST_BERRY_INDEX] = @@ -779,6 +869,9 @@ const struct Berry gBerries[] = .sour = 20, .smoothness = 30, .drainRate = 10, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_SPELON_BERRY - FIRST_BERRY_INDEX] = @@ -799,6 +892,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 70, .drainRate = 8, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_PAMTRE_BERRY - FIRST_BERRY_INDEX] = @@ -819,6 +915,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 70, .drainRate = 8, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_WATMEL_BERRY - FIRST_BERRY_INDEX] = @@ -839,6 +938,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 70, .drainRate = 8, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_DURIN_BERRY - FIRST_BERRY_INDEX] = @@ -859,6 +961,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 70, .drainRate = 8, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_BELUE_BERRY - FIRST_BERRY_INDEX] = @@ -879,6 +984,9 @@ const struct Berry gBerries[] = .sour = 40, .smoothness = 70, .drainRate = 8, + .waterBonus = 10, + .weedsBonus = 2, + .pestsBonus = 6, }, [ITEM_CHILAN_BERRY - FIRST_BERRY_INDEX] = @@ -899,6 +1007,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 35, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_OCCA_BERRY - FIRST_BERRY_INDEX] = @@ -919,6 +1030,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 30, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_PASSHO_BERRY - FIRST_BERRY_INDEX] = @@ -939,6 +1053,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 30, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_WACAN_BERRY - FIRST_BERRY_INDEX] = @@ -959,6 +1076,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 30, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_RINDO_BERRY - FIRST_BERRY_INDEX] = @@ -979,6 +1099,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 30, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_YACHE_BERRY - FIRST_BERRY_INDEX] = @@ -999,6 +1122,9 @@ const struct Berry gBerries[] = .sour = 15, .smoothness = 30, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_CHOPLE_BERRY - FIRST_BERRY_INDEX] = @@ -1019,6 +1145,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 30, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_KEBIA_BERRY - FIRST_BERRY_INDEX] = @@ -1039,6 +1168,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 30, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_SHUCA_BERRY - FIRST_BERRY_INDEX] = @@ -1059,6 +1191,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 30, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_COBA_BERRY - FIRST_BERRY_INDEX] = @@ -1079,6 +1214,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 30, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_PAYAPA_BERRY - FIRST_BERRY_INDEX] = @@ -1099,6 +1237,9 @@ const struct Berry gBerries[] = .sour = 15, .smoothness = 30, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_TANGA_BERRY - FIRST_BERRY_INDEX] = @@ -1119,6 +1260,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 35, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_CHARTI_BERRY - FIRST_BERRY_INDEX] = @@ -1139,6 +1283,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 35, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_KASIB_BERRY - FIRST_BERRY_INDEX] = @@ -1159,6 +1306,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 35, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_HABAN_BERRY - FIRST_BERRY_INDEX] = @@ -1179,6 +1329,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 35, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_COLBUR_BERRY - FIRST_BERRY_INDEX] = @@ -1199,6 +1352,9 @@ const struct Berry gBerries[] = .sour = 20, .smoothness = 35, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_BABIRI_BERRY - FIRST_BERRY_INDEX] = @@ -1219,6 +1375,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 35, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_ROSELI_BERRY - FIRST_BERRY_INDEX] = @@ -1239,6 +1398,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 35, .drainRate = 6, + .waterBonus = 10, + .weedsBonus = 1, + .pestsBonus = 4, }, [ITEM_LIECHI_BERRY - FIRST_BERRY_INDEX] = @@ -1259,6 +1421,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 80, .drainRate = 4, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_GANLON_BERRY - FIRST_BERRY_INDEX] = @@ -1279,6 +1444,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 80, .drainRate = 4, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_SALAC_BERRY - FIRST_BERRY_INDEX] = @@ -1299,6 +1467,9 @@ const struct Berry gBerries[] = .sour = 40, .smoothness = 80, .drainRate = 4, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_PETAYA_BERRY - FIRST_BERRY_INDEX] = @@ -1319,6 +1490,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 80, .drainRate = 4, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = @@ -1339,6 +1513,9 @@ const struct Berry gBerries[] = .sour = 40, .smoothness = 80, .drainRate = 4, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = @@ -1359,6 +1536,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 30, .drainRate = 4, + .waterBonus = 1, + .weedsBonus = 0, + .pestsBonus = 1, }, [ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = @@ -1379,6 +1559,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 30, .drainRate = 4, + .waterBonus = 1, + .weedsBonus = 0, + .pestsBonus = 1, }, [ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = @@ -1399,6 +1582,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 60, .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 0, }, [ITEM_MICLE_BERRY - FIRST_BERRY_INDEX] = @@ -1419,6 +1605,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 60, .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 0, }, [ITEM_CUSTAP_BERRY - FIRST_BERRY_INDEX] = @@ -1439,6 +1628,9 @@ const struct Berry gBerries[] = .sour = 0, .smoothness = 60, .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 0, }, [ITEM_JABOCA_BERRY - FIRST_BERRY_INDEX] = @@ -1459,6 +1651,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 60, .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 0, }, [ITEM_ROWAP_BERRY - FIRST_BERRY_INDEX] = @@ -1479,6 +1674,9 @@ const struct Berry gBerries[] = .sour = 40, .smoothness = 60, .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 0, }, [ITEM_KEE_BERRY - FIRST_BERRY_INDEX] = @@ -1499,6 +1697,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 60, .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_MARANGA_BERRY - FIRST_BERRY_INDEX] = @@ -1519,6 +1720,9 @@ const struct Berry gBerries[] = .sour = 10, .smoothness = 60, .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 2, }, [ITEM_ENIGMA_BERRY_E_READER - FIRST_BERRY_INDEX] = @@ -1539,6 +1743,9 @@ const struct Berry gBerries[] = .sour = 40, .smoothness = 40, .drainRate = 7, + .waterBonus = 2, + .weedsBonus = 0, + .pestsBonus = 0, }, }; @@ -1978,11 +2185,28 @@ static u16 GetStageDurationByBerryType(u8 berry) return GetBerryInfo(berry)->growthDuration * 60 / (OW_BERRY_SIX_STAGES ? 6 : 4); } -static u16 GetDrainRateByBerryType(u8 berry) +static u8 GetDrainRateByBerryType(u8 berry) { return GetBerryInfo(berry)->drainRate; } +static u8 GetWaterBonusByBerryType(u8 berry) +{ + return GetBerryInfo(berry)->waterBonus; +} + +static u8 GetWeedingBonusByBerryType(u8 berry) +{ + u8 bonus = GetBerryInfo(berry)->weedsBonus; + return (bonus == 0) ? 1 : bonus * 5; +} + +static u8 GetPestsBonusByBerryType(u8 berry) +{ + u8 bonus = GetBerryInfo(berry)->pestsBonus; + return (bonus == 0) ? 2 : bonus * 5; +} + void ObjectEventInteractionGetBerryTreeData(void) { u8 id; From 061e56a5648c0eaf9f52ca8df5bcdc4f1b2b63a7 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Fri, 8 Dec 2023 00:22:12 +0100 Subject: [PATCH 21/33] Make weeds and pests affect yield --- include/config/overworld.h | 18 +++++++-------- include/global.berry.h | 2 +- src/berry.c | 46 ++++++++++++++++++++++++++++++++------ 3 files changed, 49 insertions(+), 17 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index dc4c600e21..8e8a0a27a8 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -17,16 +17,16 @@ #define GEN_6_XY GEN_6 #define GEN_6_ORAS (GEN_6 + 0.5) -#define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them. -#define OW_BERRY_MULCH_USAGE FALSE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. Note that moisture effects only work with OW_BERRY_MOISTURE enabled! -#define OW_BERRY_WEEDS FALSE // If enabled, weeds may grow on Berry plants that the player needs to take care of. -#define OW_BERRY_PESTS FALSE // If enabled, pests may approach Berry plants that the player needs to take care of. -#define OW_BERRY_MOISTURE FALSE // If enabled, Berry watering is not a matter of watering it once per stage, but rather of keeping the soil moist. -#define OW_BERRY_VARIABLE_DRAIN_RATE FALSE // If moisture is enabled, this setting uses the Gen4 drain rates for different berries. -#define OW_BERRY_SIX_STAGES FALSE // In XY, Berries go through six stages instead of four. This toggle does not affect the time it takes for a tree to be ready for harvest. Without OW_BERRY_MOISTURE, the two extra stages count as BERRY_STAGE_TALLER for watering purposes. +#define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them. +#define OW_BERRY_MOISTURE FALSE // If enabled, Berry watering is not a matter of watering it once per stage, but rather of keeping the soil moist. +#define OW_BERRY_VARIABLE_DRAIN_RATE FALSE // If moisture is enabled, this setting uses the Gen4 drain rates for different berries. +#define OW_BERRY_MULCH_USAGE FALSE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. Note that moisture effects only work with OW_BERRY_MOISTURE enabled! +#define OW_BERRY_WEEDS FALSE // If enabled, weeds may grow on Berry plants that the player needs to take care of. Without OW_BERRY_MOISTURE, weeding bonuses are rounded down. +#define OW_BERRY_PESTS FALSE // If enabled, pests may approach Berry plants that the player needs to take care of. Without OW_BERRY_MOISTURE, pest bonuses are rounded down. +#define OW_BERRY_SIX_STAGES FALSE // In XY, Berries go through six stages instead of four. This toggle does not affect the time it takes for a tree to be ready for harvest. Without OW_BERRY_MOISTURE, the two extra stages count as BERRY_STAGE_TALLER for watering purposes. -#define OW_BERRY_GROWTH_RATE GEN_3 // Presets for how long each Berry plant takes to grow. -#define OW_BERRY_YIELD_RATE GEN_3 // Presets for how many Berries each plant can yield. +#define OW_BERRY_GROWTH_RATE GEN_3 // Presets for how long each Berry plant takes to grow. +#define OW_BERRY_YIELD_RATE GEN_3 // Presets for how many Berries each plant can yield. // Out-of-battle Ability effects #define OW_SYNCHRONIZE_NATURE GEN_LATEST // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same Nature, as opposed to 50% previously. Stationary Pokémon are excluded in Gen3. In Gen6, all No Eggs Discovered gift Pokémon will have the same Nature, while in Gen7 all gift Pokémon will, regardless of Egg Group - In Gen 8, no gift Pokémon are affected. In Gen9, this ability has no out-of-battle effect. diff --git a/include/global.berry.h b/include/global.berry.h index 18b48d191b..f5967d4839 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -86,7 +86,7 @@ struct BerryTree u8 pests:1; u8 mutationB:2; u8 regrowthCount:4; - u8 watered:4; // Used to keep track of yield lost to drought in case of Gen4 watering + u8 watered:4; // Used to keep track of bonuses in case of gradient watering u16 moistureLevel:7; u16 moistureClock:7; u16 padding:2; diff --git a/src/berry.c b/src/berry.c index 6a95d1d6a2..3d709fc88f 100644 --- a/src/berry.c +++ b/src/berry.c @@ -32,6 +32,7 @@ static u8 GetTreeMutationValue(u8 id); static u16 GetBerryPestSpecies(u8 berryId); static void TryForWeeds(struct BerryTree *tree); static void TryForPests(struct BerryTree *tree); +static void AddTreeBonus(struct BerryTree *tree, u8 bonus); //.rodata static const u8 sBerryDescriptionPart1_Cheri[] = _("Blooms with delicate pretty flowers."); @@ -1919,7 +1920,7 @@ bool32 BerryTreeGrow(struct BerryTree *tree) case BERRY_STAGE_NO_BERRY: return FALSE; case BERRY_STAGE_FLOWERING: - tree->berryYield = tree->berryYield + CalcBerryYield(tree); + tree->berryYield = CalcBerryYield(tree); case BERRY_STAGE_PLANTED: case BERRY_STAGE_SPROUTED: case BERRY_STAGE_TRUNK: @@ -2042,7 +2043,7 @@ void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 allowGrowth) tree->moistureLevel = 100; if (stage == BERRY_STAGE_BERRIES) { - tree->berryYield = tree->berryYield + CalcBerryYield(tree); + tree->berryYield = CalcBerryYield(tree); tree->minutesUntilNextStage *= ((tree->mulch == ITEM_TO_MULCH(ITEM_STABLE_MULCH)) ? 6 : 4); } @@ -2166,11 +2167,15 @@ static u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water) static u8 CalcBerryYield(struct BerryTree *tree) { const struct Berry *berry = GetBerryInfo(tree->berry); - u8 min = berry->minYield; + u8 min = berry->minYield + tree->berryYield; u8 max = berry->maxYield; - u8 result = CalcBerryYieldInternal(max, min, BerryTreeGetNumStagesWatered(tree)); + u8 result; if (OW_BERRY_MULCH_USAGE && (tree->mulch == ITEM_TO_MULCH(ITEM_RICH_MULCH) || tree->mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH))) - result += 2; + min += 2; + if (min >= max) + result = max; + else + result = CalcBerryYieldInternal(max, min, BerryTreeGetNumStagesWatered(tree)); return result; } @@ -2306,12 +2311,16 @@ void ObjectEventInteractionRemoveBerryTree(void) void ObjectEventInteractionPullBerryWeed(void) { - gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].weeds = FALSE; + struct BerryTree *tree = GetBerryTreeInfo(GetObjectEventBerryTreeId(gSelectedObjectEvent)); + tree->weeds = FALSE; + AddTreeBonus(tree, GetWeedingBonusByBerryType(tree->berry)); } void ObjectEventInteractionClearBerryPests(void) { - gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].pests = FALSE; + struct BerryTree *tree = GetBerryTreeInfo(GetObjectEventBerryTreeId(gSelectedObjectEvent)); + tree->pests = FALSE; + AddTreeBonus(tree, GetPestsBonusByBerryType(tree->berry)); } bool8 PlayerHasBerries(void) @@ -2549,3 +2558,26 @@ static void TryForPests(struct BerryTree *tree) if (Random() % 100 < BERRY_PESTS_CHANCE && tree->stage > BERRY_STAGE_PLANTED) tree->pests = TRUE; } + +static void AddTreeBonus(struct BerryTree *tree, u8 bonus) +{ + if (OW_BERRY_MOISTURE) // use watered field to save track of intermediate bonuses + { + tree->watered += bonus; + while (tree->watered > 10) + { + tree->watered -= 10; + bonus = tree->berryYield + 1; + if (bonus > GetBerryInfo(tree->berry)->maxYield) + bonus = GetBerryInfo(tree->berry)->maxYield; + tree->berryYield = bonus; + } + } + else + { + bonus = tree->berryYield + bonus / 10; + if (bonus > GetBerryInfo(tree->berry)->maxYield) + bonus = GetBerryInfo(tree->berry)->maxYield; + tree->berryYield = bonus; + } +} From 6173f9b81d43f7339f26655155ccb37822ca9f26 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Fri, 8 Dec 2023 01:01:01 +0100 Subject: [PATCH 22/33] Add soil moisturing config --- include/config/overworld.h | 3 ++- src/berry.c | 37 +++++++++++++++++++++++++++---------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index 8e8a0a27a8..8df6a4646a 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -19,7 +19,8 @@ #define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them. #define OW_BERRY_MOISTURE FALSE // If enabled, Berry watering is not a matter of watering it once per stage, but rather of keeping the soil moist. -#define OW_BERRY_VARIABLE_DRAIN_RATE FALSE // If moisture is enabled, this setting uses the Gen4 drain rates for different berries. +#define OW_BERRY_ALWAYS_WATERABLE FALSE // If OW_BERRY_MOISTURE is enabled, this setting allows the player to continuously water soil; dry soil will cause a decrease in Berry Yield (like Gen4). When off, soil can only be watered when dry and watering increases yield (like Gen6). +#define OW_BERRY_VARIABLE_DRAIN_RATE FALSE // If OW_BERRY_MOISTURE is enabled, this setting uses the Gen4 drain rates for different berries. #define OW_BERRY_MULCH_USAGE FALSE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. Note that moisture effects only work with OW_BERRY_MOISTURE enabled! #define OW_BERRY_WEEDS FALSE // If enabled, weeds may grow on Berry plants that the player needs to take care of. Without OW_BERRY_MOISTURE, weeding bonuses are rounded down. #define OW_BERRY_PESTS FALSE // If enabled, pests may approach Berry plants that the player needs to take care of. Without OW_BERRY_MOISTURE, pest bonuses are rounded down. diff --git a/src/berry.c b/src/berry.c index 3d709fc88f..68c32db822 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1858,10 +1858,17 @@ struct BerryTree *GetBerryTreeInfo(u8 id) bool32 ObjectEventInteractionWaterBerryTree(void) { struct BerryTree *tree = GetBerryTreeInfo(GetObjectEventBerryTreeId(gSelectedObjectEvent)); -#if OW_BERRY_MOISTURE == TRUE - tree->moistureLevel = 100; - return TRUE; -#else + + if (OW_BERRY_MOISTURE) + { + tree->moistureLevel = 100; + if (OW_BERRY_ALWAYS_WATERABLE) + { + return TRUE; + } + AddTreeBonus(tree, GetWaterBonusByBerryType(tree->berry)); + } + switch (tree->stage) { case BERRY_STAGE_PLANTED: @@ -1882,7 +1889,6 @@ bool32 ObjectEventInteractionWaterBerryTree(void) return FALSE; } return TRUE; -#endif } bool8 IsPlayerFacingEmptyBerryTreePatch(void) @@ -1983,7 +1989,7 @@ void BerryTreeTimeUpdate(s32 minutes) time -= 1; if (tree->moistureClock % 60 == 0) { - if (OW_BERRY_MOISTURE == TRUE) + if (OW_BERRY_MOISTURE) { drainVal = OW_BERRY_VARIABLE_DRAIN_RATE ? GetDrainRateByBerryType(tree->berry) : 4; if (OW_BERRY_MULCH_USAGE) @@ -1995,12 +2001,19 @@ void BerryTreeTimeUpdate(s32 minutes) if (tree->mulch == ITEM_TO_MULCH(ITEM_BOOST_MULCH) || tree->mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH)) drainVal = 25; } - if (tree->moistureLevel == 0 || (!OW_BERRY_VARIABLE_DRAIN_RATE && tree->moistureLevel == 4)) // Without variable drain rate (and without mulches), this needs to trigger after 24 hours, hence the extra check - tree->watered++; + if (OW_BERRY_ALWAYS_WATERABLE && tree->moistureLevel == 0) + { + if (tree->berryYield > GetBerryInfo(tree->berry)->minYield + GetBerryInfo(tree->berry)->maxYield / 5) + tree->berryYield -= GetBerryInfo(tree->berry)->maxYield / 5; + else + tree->berryYield = GetBerryInfo(tree->berry)->minYield; + } else if (tree->moistureLevel <= drainVal) tree->moistureLevel = 0; else tree->moistureLevel -= drainVal; + if (!OW_BERRY_VARIABLE_DRAIN_RATE && tree->moistureLevel <= 4) // Without variable drain rate (and without mulches), this needs to trigger after 24 hours, hence the extra check + tree->moistureLevel = 0; } if (tree->moistureClock == 120) { @@ -2041,6 +2054,8 @@ void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 allowGrowth) tree->minutesUntilNextStage = GetMulchAffectedGrowthRate(GetStageDurationByBerryType(berry), tree->mulch, stage); tree->stage = stage; tree->moistureLevel = 100; + if (OW_BERRY_ALWAYS_WATERABLE) + tree->berryYield = GetBerryInfo(berry)->maxYield; if (stage == BERRY_STAGE_BERRIES) { tree->berryYield = CalcBerryYield(tree); @@ -2147,7 +2162,7 @@ static u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water) u32 rand; u32 extraYield; - if (water == 0) + if (water == 0 || OW_BERRY_MOISTURE) return min; else { @@ -2167,11 +2182,13 @@ static u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water) static u8 CalcBerryYield(struct BerryTree *tree) { const struct Berry *berry = GetBerryInfo(tree->berry); - u8 min = berry->minYield + tree->berryYield; + u8 min = tree->berryYield; u8 max = berry->maxYield; u8 result; if (OW_BERRY_MULCH_USAGE && (tree->mulch == ITEM_TO_MULCH(ITEM_RICH_MULCH) || tree->mulch == ITEM_TO_MULCH(ITEM_AMAZE_MULCH))) min += 2; + if (!(OW_BERRY_MOISTURE && OW_BERRY_ALWAYS_WATERABLE)) + min += berry->minYield; if (min >= max) result = max; else From 1e0b895ecba86d43a4cd71d9fa1540d07256cb45 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Fri, 8 Dec 2023 01:05:54 +0100 Subject: [PATCH 23/33] Add missing check to prevents water grinding --- data/scripts/berry_tree.inc | 2 ++ data/specials.inc | 1 + src/berry.c | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index 10376d4c58..99768d5457 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -216,6 +216,8 @@ BerryTree_EventScript_WantToWater:: .endif checkitem ITEM_WAILMER_PAIL goto_if_eq VAR_RESULT, FALSE, BerryTree_EventScript_DontWater + specialvar VAR_RESULT, CanWaterBerryPlot + goto_if_eq VAR_RESULT, FALSE, BerryTree_EventScript_DontWater special ObjectEventInteractionGetBerryName msgbox BerryTree_Text_WantToWater, MSGBOX_YESNO goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_WaterBerry diff --git a/data/specials.inc b/data/specials.inc index 717970767c..d5e659e1f9 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -549,3 +549,4 @@ gSpecials:: def_special ObjectEventInteractionClearBerryPests def_special ObjectEventInteractionBerryHasWeed def_special ObjectEventInteractionBerryHasPests + def_special CanWaterBerryPlot diff --git a/src/berry.c b/src/berry.c index 68c32db822..ac8dab7e16 100644 --- a/src/berry.c +++ b/src/berry.c @@ -2229,6 +2229,13 @@ static u8 GetPestsBonusByBerryType(u8 berry) return (bonus == 0) ? 2 : bonus * 5; } +bool8 CanWaterBerryPlot(void) +{ + if (!OW_BERRY_MOISTURE || OW_BERRY_ALWAYS_WATERABLE) + return TRUE; + return (gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].moistureLevel == 0); +} + void ObjectEventInteractionGetBerryTreeData(void) { u8 id; From ffb16c0dd5f198a1c50db35bce4493f1a002e1d1 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Fri, 8 Dec 2023 12:03:16 +0100 Subject: [PATCH 24/33] ORAS drain rate --- include/config/overworld.h | 4 ++-- src/berry.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index 8df6a4646a..238e254c68 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -15,12 +15,11 @@ // Berry settings // These generational defines only make a distinction for Berries! #define GEN_6_XY GEN_6 -#define GEN_6_ORAS (GEN_6 + 0.5) +#define GEN_6_ORAS GEN_LATEST + 1 #define OW_BERRY_MUTATIONS FALSE // If enabled, Berry plants can mutate based on berries planted next to them. #define OW_BERRY_MOISTURE FALSE // If enabled, Berry watering is not a matter of watering it once per stage, but rather of keeping the soil moist. #define OW_BERRY_ALWAYS_WATERABLE FALSE // If OW_BERRY_MOISTURE is enabled, this setting allows the player to continuously water soil; dry soil will cause a decrease in Berry Yield (like Gen4). When off, soil can only be watered when dry and watering increases yield (like Gen6). -#define OW_BERRY_VARIABLE_DRAIN_RATE FALSE // If OW_BERRY_MOISTURE is enabled, this setting uses the Gen4 drain rates for different berries. #define OW_BERRY_MULCH_USAGE FALSE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. Note that moisture effects only work with OW_BERRY_MOISTURE enabled! #define OW_BERRY_WEEDS FALSE // If enabled, weeds may grow on Berry plants that the player needs to take care of. Without OW_BERRY_MOISTURE, weeding bonuses are rounded down. #define OW_BERRY_PESTS FALSE // If enabled, pests may approach Berry plants that the player needs to take care of. Without OW_BERRY_MOISTURE, pest bonuses are rounded down. @@ -28,6 +27,7 @@ #define OW_BERRY_GROWTH_RATE GEN_3 // Presets for how long each Berry plant takes to grow. #define OW_BERRY_YIELD_RATE GEN_3 // Presets for how many Berries each plant can yield. +#define OW_BERRY_DRAIN_RATE GEN_6_ORAS // If OW_BERRY_MOISTURE is enabled, this setting changes how fast the soil dries out. GEN_4 uses a Berry-dependent drain rate, GEN_6_XY dries out in 24 hours (4 hours with the relevant Mulch) and GEN_6_ORAS dries out in 4 hours. Other values are illegal. // Out-of-battle Ability effects #define OW_SYNCHRONIZE_NATURE GEN_LATEST // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same Nature, as opposed to 50% previously. Stationary Pokémon are excluded in Gen3. In Gen6, all No Eggs Discovered gift Pokémon will have the same Nature, while in Gen7 all gift Pokémon will, regardless of Egg Group - In Gen 8, no gift Pokémon are affected. In Gen9, this ability has no out-of-battle effect. diff --git a/src/berry.c b/src/berry.c index ac8dab7e16..bd4daaeb54 100644 --- a/src/berry.c +++ b/src/berry.c @@ -170,16 +170,21 @@ static const u8 sBerryDescriptionPart2_Kee[] = _("first, then extremely bitter." static const u8 sBerryDescriptionPart1_Maranga[] = _("Its outside is very bitter, but its"); static const u8 sBerryDescriptionPart2_Maranga[] = _("inside tastes like a sweet drink."); -#if OW_BERRY_GROWTH_RATE < GEN_3 || OW_BERRY_GROWTH_RATE > GEN_7 +// Check include/config/overworld.h configs and throw an error if illegal +#if OW_BERRY_GROWTH_RATE < GEN_3 || (OW_BERRY_GROWTH_RATE > GEN_7 && OW_BERRY_GROWTH_RATE != GEN_6_ORAS) #error "OW_BERRY_GROWTH_RATE must be between GEN_3 and GEN_7!" #endif -#if OW_BERRY_YIELD_RATE < GEN_3 || OW_BERRY_YIELD_RATE > GEN_6 +#if OW_BERRY_YIELD_RATE < GEN_3 || (OW_BERRY_YIELD_RATE > GEN_6 && OW_BERRY_GROWTH_RATE != GEN_6_ORAS) #error "OW_BERRY_YIELD_RATE must be between GEN_3 and GEN_6!" #elif OW_BERRY_YIELD_RATE == GEN_5 #error "OW_BERRY_YIELD_RATE can not be GEN_5!" #endif +#if OW_BERRY_MOISTURE && OW_BERRY_DRAIN_RATE != GEN_4 && OW_BERRY_DRAIN_RATE != GEN_6_XY && OW_BERRY_DRAIN_RATE != GEN_6_ORAS +#error "OW_BERRY_DRAIN_RATE must be GEN_5, GEN_6_XY or GEN_6_ORAS!" +#endif + #define GROWTH_DURATION(g3, g4, g5, xy, oras, g7) OW_BERRY_GROWTH_RATE == GEN_3 ? g3 : OW_BERRY_GROWTH_RATE == GEN_4 ? g4 : OW_BERRY_GROWTH_RATE == GEN_5 ? g5 : OW_BERRY_GROWTH_RATE == GEN_6_XY ? xy : OW_BERRY_GROWTH_RATE == GEN_6_ORAS ? oras : g7 #define YIELD_RATE(g3, g4, xy, oras) GROWTH_DURATION(g3, g4, 0, xy, oras, 0) @@ -1991,7 +1996,7 @@ void BerryTreeTimeUpdate(s32 minutes) { if (OW_BERRY_MOISTURE) { - drainVal = OW_BERRY_VARIABLE_DRAIN_RATE ? GetDrainRateByBerryType(tree->berry) : 4; + drainVal = (OW_BERRY_DRAIN_RATE == GEN_4) ? GetDrainRateByBerryType(tree->berry) : (OW_BERRY_DRAIN_RATE == GEN_6_XY) ? 4 : 25; if (OW_BERRY_MULCH_USAGE) { if (tree->mulch == ITEM_TO_MULCH(ITEM_GROWTH_MULCH)) @@ -2012,7 +2017,7 @@ void BerryTreeTimeUpdate(s32 minutes) tree->moistureLevel = 0; else tree->moistureLevel -= drainVal; - if (!OW_BERRY_VARIABLE_DRAIN_RATE && tree->moistureLevel <= 4) // Without variable drain rate (and without mulches), this needs to trigger after 24 hours, hence the extra check + if (OW_BERRY_DRAIN_RATE == GEN_6_XY && tree->moistureLevel <= 4) // Without variable drain rate (and without mulches), this needs to trigger after 24 hours, hence the extra check tree->moistureLevel = 0; } if (tree->moistureClock == 120) From 662939d5f9d09bd50ba6d7b4a9b9fa145141b4c6 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sat, 23 Dec 2023 00:41:47 +0100 Subject: [PATCH 25/33] Add family defines --- src/berry.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/berry.c b/src/berry.c index bd4daaeb54..f1f567e180 100644 --- a/src/berry.c +++ b/src/berry.c @@ -2543,22 +2543,22 @@ static u16 GetBerryPestSpecies(u8 berryId) switch(berry->color) { case BERRY_COLOR_RED: - return SPECIES_LEDYBA; + return P_FAMILY_LEDYBA ? SPECIES_LEDYBA : SPECIES_NONE; break; case BERRY_COLOR_BLUE: - return SPECIES_VOLBEAT; + return P_FAMILY_VOLBEAT_ILLUMISE ? SPECIES_VOLBEAT : SPECIES_NONE; break; case BERRY_COLOR_PURPLE: - return SPECIES_ILLUMISE; + return P_FAMILY_VOLBEAT_ILLUMISE ? SPECIES_ILLUMISE : SPECIES_NONE; break; case BERRY_COLOR_GREEN: - return SPECIES_BURMY_PLANT_CLOAK; + return P_FAMILY_BURMY ? SPECIES_BURMY_PLANT_CLOAK : SPECIES_NONE; break; case BERRY_COLOR_YELLOW: - return SPECIES_COMBEE; + return P_FAMILY_COMBEE ? SPECIES_COMBEE : SPECIES_NONE; break; case BERRY_COLOR_PINK: - return SPECIES_SPEWPA; + return P_FAMILY_SCATTERBUG ? SPECIES_SPEWPA : SPECIES_NONE; break; } #endif From 9be8fed52c5cc4ee67f439c30937e11a8c06ca70 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sun, 24 Dec 2023 22:59:43 +0100 Subject: [PATCH 26/33] Fix string with duplicate berry berry --- data/scripts/berry_tree.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index 99768d5457..4f4f723f1c 100644 --- a/data/scripts/berry_tree.inc +++ b/data/scripts/berry_tree.inc @@ -266,7 +266,7 @@ BerryTree_Text_PlantedOneBerry: BerryTree_Text_BerryGrowthStage1: .if OW_BERRY_SIX_STAGES == TRUE - .string "This is where you planted the\n{STR_VAR_1} BERRY!$" + .string "This is where you planted the\n{STR_VAR_1}!$" .else .string "One {STR_VAR_1} was planted here.$" .endif From c115649349f9b8447e492a4beb46a15c20ae216a Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sun, 24 Dec 2023 23:08:15 +0100 Subject: [PATCH 27/33] Fix 6 stage Berry trees not growing properly --- include/config/overworld.h | 2 +- src/berry.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index 238e254c68..41ea797546 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -23,7 +23,7 @@ #define OW_BERRY_MULCH_USAGE FALSE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. Note that moisture effects only work with OW_BERRY_MOISTURE enabled! #define OW_BERRY_WEEDS FALSE // If enabled, weeds may grow on Berry plants that the player needs to take care of. Without OW_BERRY_MOISTURE, weeding bonuses are rounded down. #define OW_BERRY_PESTS FALSE // If enabled, pests may approach Berry plants that the player needs to take care of. Without OW_BERRY_MOISTURE, pest bonuses are rounded down. -#define OW_BERRY_SIX_STAGES FALSE // In XY, Berries go through six stages instead of four. This toggle does not affect the time it takes for a tree to be ready for harvest. Without OW_BERRY_MOISTURE, the two extra stages count as BERRY_STAGE_TALLER for watering purposes. +#define OW_BERRY_SIX_STAGES TRUE // In XY, Berries go through six stages instead of four. This toggle does not affect the time it takes for a tree to be ready for harvest. Without OW_BERRY_MOISTURE, the two extra stages count as BERRY_STAGE_TALLER for watering purposes. #define OW_BERRY_GROWTH_RATE GEN_3 // Presets for how long each Berry plant takes to grow. #define OW_BERRY_YIELD_RATE GEN_3 // Presets for how many Berries each plant can yield. diff --git a/src/berry.c b/src/berry.c index f1f567e180..60776af2c6 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1935,7 +1935,6 @@ bool32 BerryTreeGrow(struct BerryTree *tree) case BERRY_STAGE_PLANTED: case BERRY_STAGE_SPROUTED: case BERRY_STAGE_TRUNK: - case BERRY_STAGE_BUDDING: tree->stage++; break; case BERRY_STAGE_TALLER: @@ -1944,6 +1943,10 @@ bool32 BerryTreeGrow(struct BerryTree *tree) else tree->stage++; break; + case BERRY_STAGE_BUDDING: + tree->berryYield = CalcBerryYield(tree); + tree->stage = BERRY_STAGE_BERRIES; + break; case BERRY_STAGE_BERRIES: tree->watered = 0; tree->berryYield = 0; From c2a5b71d46aa53f619ddbcf84a5acc68682d9519 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sun, 24 Dec 2023 23:17:05 +0100 Subject: [PATCH 28/33] Fix six stage berry graphical issues --- src/data/object_events/berry_tree_graphics_tables.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/object_events/berry_tree_graphics_tables.h b/src/data/object_events/berry_tree_graphics_tables.h index 2969b6a78e..63559a326c 100755 --- a/src/data/object_events/berry_tree_graphics_tables.h +++ b/src/data/object_events/berry_tree_graphics_tables.h @@ -628,9 +628,9 @@ const struct SpriteFrameImage sPicTable_RowapBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Rowap[] = {3, 4, 5, 5, 5}; -const u8 gDeadBerryTreeObjectEventGraphicsIdTable[] = {OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES}; +const u8 gDeadBerryTreeObjectEventGraphicsIdTable[] = {OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES}; -const u8 gBerryTreeObjectEventGraphicsIdTable[] = {OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES}; +const u8 gBerryTreeObjectEventGraphicsIdTable[] = {OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES}; const struct SpriteFrameImage *const gBerryTreePicTablePointers[] = { [ITEM_CHERI_BERRY - FIRST_BERRY_INDEX] = sPicTable_CheriBerryTree, From 52eeca6e4e5c1c590efb051e427ae0d730754ce8 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 4 Jan 2024 16:02:21 +0000 Subject: [PATCH 29/33] Replace berry descriptions with compound strings --- src/berry.c | 408 ++++++++++++++++++---------------------------------- 1 file changed, 136 insertions(+), 272 deletions(-) diff --git a/src/berry.c b/src/berry.c index 60776af2c6..88c4a16fe3 100644 --- a/src/berry.c +++ b/src/berry.c @@ -34,142 +34,6 @@ static void TryForWeeds(struct BerryTree *tree); static void TryForPests(struct BerryTree *tree); static void AddTreeBonus(struct BerryTree *tree, u8 bonus); -//.rodata -static const u8 sBerryDescriptionPart1_Cheri[] = _("Blooms with delicate pretty flowers."); -static const u8 sBerryDescriptionPart2_Cheri[] = _("The bright red Berry is very spicy."); -static const u8 sBerryDescriptionPart1_Chesto[] = _("The Berry's thick skin and fruit are"); -static const u8 sBerryDescriptionPart2_Chesto[] = _("very tough. It is dry-tasting all over."); -static const u8 sBerryDescriptionPart1_Pecha[] = _("Very sweet and delicious."); -static const u8 sBerryDescriptionPart2_Pecha[] = _("Also very tender - handle with care."); -static const u8 sBerryDescriptionPart1_Rawst[] = _("If the leaves grow long and curly,"); -static const u8 sBerryDescriptionPart2_Rawst[] = _("the Berry seems to grow very bitter."); -static const u8 sBerryDescriptionPart1_Aspear[] = _("The hard Berry is dense with a rich"); -static const u8 sBerryDescriptionPart2_Aspear[] = _("juice. It is quite sour."); -static const u8 sBerryDescriptionPart1_Leppa[] = _("Grows slower than Cheri and others."); -static const u8 sBerryDescriptionPart2_Leppa[] = _("The smaller the Berry, the tastier."); -static const u8 sBerryDescriptionPart1_Oran[] = _("A peculiar Berry with a mix of flavors."); -static const u8 sBerryDescriptionPart2_Oran[] = _("Berries grow in half a day."); -static const u8 sBerryDescriptionPart1_Persim[] = _("Loves sunlight. The Berry's color"); -static const u8 sBerryDescriptionPart2_Persim[] = _("grows vivid when exposed to the sun."); -static const u8 sBerryDescriptionPart1_Lum[] = _("Slow to grow. If raised with loving"); -static const u8 sBerryDescriptionPart2_Lum[] = _("care, it may grow two Berries."); -static const u8 sBerryDescriptionPart1_Sitrus[] = _("Closely related to Oran. The large"); -static const u8 sBerryDescriptionPart2_Sitrus[] = _("Berry has a well-rounded flavor."); -static const u8 sBerryDescriptionPart1_Figy[] = _("The Berry, which looks chewed up,"); -static const u8 sBerryDescriptionPart2_Figy[] = _("brims with spicy substances."); -static const u8 sBerryDescriptionPart1_Wiki[] = _("The Berry is said to have grown lumpy"); -static const u8 sBerryDescriptionPart2_Wiki[] = _("to help Pokémon grip it."); -static const u8 sBerryDescriptionPart1_Mago[] = _("The Berry turns curvy as it grows."); -static const u8 sBerryDescriptionPart2_Mago[] = _("The curvier, the sweeter and tastier."); -static const u8 sBerryDescriptionPart1_Aguav[] = _("The flower is dainty. It is rare in its"); -static const u8 sBerryDescriptionPart2_Aguav[] = _("ability to grow without light."); -static const u8 sBerryDescriptionPart1_Iapapa[] = _("The Berry is very big and sour."); -static const u8 sBerryDescriptionPart2_Iapapa[] = _("It takes at least a day to grow."); -static const u8 sBerryDescriptionPart1_Razz[] = _("The red Berry tastes slightly spicy."); -static const u8 sBerryDescriptionPart2_Razz[] = _("It grows quickly in just four hours."); -static const u8 sBerryDescriptionPart1_Bluk[] = _("The Berry is blue on the outside, but"); -static const u8 sBerryDescriptionPart2_Bluk[] = _("it blackens the mouth when eaten."); -static const u8 sBerryDescriptionPart1_Nanab[] = _("This Berry was the seventh"); -static const u8 sBerryDescriptionPart2_Nanab[] = _("discovered in the world. It is sweet."); -static const u8 sBerryDescriptionPart1_Wepear[] = _("The flower is small and white. It has a"); -static const u8 sBerryDescriptionPart2_Wepear[] = _("delicate balance of bitter and sour."); -static const u8 sBerryDescriptionPart1_Pinap[] = _("Weak against wind and cold."); -static const u8 sBerryDescriptionPart2_Pinap[] = _("The fruit is spicy and the skin, sour."); -static const u8 sBerryDescriptionPart1_Pomeg[] = _("However much it is watered,"); -static const u8 sBerryDescriptionPart2_Pomeg[] = _("it only grows up to six Berries."); -static const u8 sBerryDescriptionPart1_Kelpsy[] = _("A rare variety shaped like a root."); -static const u8 sBerryDescriptionPart2_Kelpsy[] = _("Grows a very large flower."); -static const u8 sBerryDescriptionPart1_Qualot[] = _("Loves water. Grows strong even in"); -static const u8 sBerryDescriptionPart2_Qualot[] = _("locations with constant rainfall."); -static const u8 sBerryDescriptionPart1_Hondew[] = _("A Berry that is very valuable and"); -static const u8 sBerryDescriptionPart2_Hondew[] = _("rarely seen. It is very delicious."); -static const u8 sBerryDescriptionPart1_Grepa[] = _("Despite its tenderness and round"); -static const u8 sBerryDescriptionPart2_Grepa[] = _("shape, the Berry is unimaginably sour."); -static const u8 sBerryDescriptionPart1_Tamato[] = _("The Berry is lip-bendingly spicy."); -static const u8 sBerryDescriptionPart2_Tamato[] = _("It takes time to grow."); -static const u8 sBerryDescriptionPart1_Cornn[] = _("A Berry from an ancient era. May not"); -static const u8 sBerryDescriptionPart2_Cornn[] = _("grow unless planted in quantity."); -static const u8 sBerryDescriptionPart1_Magost[] = _("A Berry that is widely said to have"); -static const u8 sBerryDescriptionPart2_Magost[] = _("a finely balanced flavor."); -static const u8 sBerryDescriptionPart1_Rabuta[] = _("A rare variety that is overgrown with"); -static const u8 sBerryDescriptionPart2_Rabuta[] = _("hair. It is quite bitter."); -static const u8 sBerryDescriptionPart1_Nomel[] = _("Quite sour. Just one bite makes it"); -static const u8 sBerryDescriptionPart2_Nomel[] = _("impossible to taste for three days."); -static const u8 sBerryDescriptionPart1_Spelon[] = _("The vividly red Berry is very spicy."); -static const u8 sBerryDescriptionPart2_Spelon[] = _("Its warts secrete a spicy substance."); -static const u8 sBerryDescriptionPart1_Pamtre[] = _("Drifts on the sea from somewhere."); -static const u8 sBerryDescriptionPart2_Pamtre[] = _("It is thought to grow elsewhere."); -static const u8 sBerryDescriptionPart1_Watmel[] = _("A huge Berry, with some over 20"); -static const u8 sBerryDescriptionPart2_Watmel[] = _("inches discovered. Exceedingly sweet."); -static const u8 sBerryDescriptionPart1_Durin[] = _("Bitter to even look at. It is so"); -static const u8 sBerryDescriptionPart2_Durin[] = _("bitter, no one has ever eaten it as is."); -static const u8 sBerryDescriptionPart1_Belue[] = _("It is glossy and looks delicious, but"); -static const u8 sBerryDescriptionPart2_Belue[] = _("it is awfully sour. Takes time to grow."); -static const u8 sBerryDescriptionPart1_Chilan[] = _("It can be made into a whistle that"); -static const u8 sBerryDescriptionPart2_Chilan[] = _("produces an indescribable sound."); -static const u8 sBerryDescriptionPart1_Occa[] = _("Said to grow in the tropics once,"); -static const u8 sBerryDescriptionPart2_Occa[] = _("it boasts an intensely hot spiciness."); -static const u8 sBerryDescriptionPart1_Passho[] = _("Its flesh is dotted with many tiny"); -static const u8 sBerryDescriptionPart2_Passho[] = _("bubbles that keep it afloat in water."); -static const u8 sBerryDescriptionPart1_Wacan[] = _("Energy drawn from lightning strikes"); -static const u8 sBerryDescriptionPart2_Wacan[] = _("makes this Berry grow big and rich."); -static const u8 sBerryDescriptionPart1_Rindo[] = _("This berry has a vegetable-like flavor,"); -static const u8 sBerryDescriptionPart2_Rindo[] = _("but is rich in health-promoting fiber."); -static const u8 sBerryDescriptionPart1_Yache[] = _("This Berry has a refreshing dry and"); -static const u8 sBerryDescriptionPart2_Yache[] = _("sour flavor. Tastes better chilled."); -static const u8 sBerryDescriptionPart1_Chople[] = _("Contains a substance that generates"); -static const u8 sBerryDescriptionPart2_Chople[] = _("heat. Can even fire up a chilly heart."); -static const u8 sBerryDescriptionPart1_Kebia[] = _("Brilliant green on the outside, inside"); -static const u8 sBerryDescriptionPart2_Kebia[] = _("it is packed with black-colored flesh."); -static const u8 sBerryDescriptionPart1_Shuca[] = _("The sweet pulp has just the hint of a"); -static const u8 sBerryDescriptionPart2_Shuca[] = _("a hard-edged and fragrant bite to it."); -static const u8 sBerryDescriptionPart1_Coba[] = _("This Berry is said to be a cross of"); -static const u8 sBerryDescriptionPart2_Coba[] = _("two Berries blown in from far away."); -static const u8 sBerryDescriptionPart1_Payapa[] = _("Said to sense human emotions, it swells"); -static const u8 sBerryDescriptionPart2_Payapa[] = _("roundly when a person approaches."); -static const u8 sBerryDescriptionPart1_Tanga[] = _("It grows a flower at the tip that lures"); -static const u8 sBerryDescriptionPart2_Tanga[] = _("Bug Pokémon with its stringy petals."); -static const u8 sBerryDescriptionPart1_Charti[] = _("Often used for pickles because of its"); -static const u8 sBerryDescriptionPart2_Charti[] = _("dry flavor. Sometimes eaten raw."); -static const u8 sBerryDescriptionPart1_Kasib[] = _("Old superstitions say it has an odd"); -static const u8 sBerryDescriptionPart2_Kasib[] = _("power. A popular good-luck charm."); -static const u8 sBerryDescriptionPart1_Haban[] = _("Less bitter if enough of this Berry"); -static const u8 sBerryDescriptionPart2_Haban[] = _("is boiled down. Makes a good jam."); -static const u8 sBerryDescriptionPart1_Colbur[] = _("Tiny hooks on the surface latch onto"); -static const u8 sBerryDescriptionPart2_Colbur[] = _("Pokémon to reach far-off places."); -static const u8 sBerryDescriptionPart1_Babiri[] = _("Very tough with a strong flavor. It"); -static const u8 sBerryDescriptionPart2_Babiri[] = _("was used to make medicine in the past."); -static const u8 sBerryDescriptionPart1_Roseli[] = _("In nature, they grow in wide rings"); -static const u8 sBerryDescriptionPart2_Roseli[] = _("for reasons that are still unknown."); -static const u8 sBerryDescriptionPart1_Liechi[] = _("A mysterious Berry. It is rumored to"); -static const u8 sBerryDescriptionPart2_Liechi[] = _("contain the power of the sea."); -static const u8 sBerryDescriptionPart1_Ganlon[] = _("A mysterious Berry. It is rumored to"); -static const u8 sBerryDescriptionPart2_Ganlon[] = _("contain the power of the land."); -static const u8 sBerryDescriptionPart1_Salac[] = _("A mysterious Berry. It is rumored to"); -static const u8 sBerryDescriptionPart2_Salac[] = _("contain the power of the sky."); -static const u8 sBerryDescriptionPart1_Petaya[] = _("A mysterious Berry. It is rumored to"); -static const u8 sBerryDescriptionPart2_Petaya[] = _("contain the power of all living things."); -static const u8 sBerryDescriptionPart1_Apicot[] = _("A very mystifying Berry. No telling"); -static const u8 sBerryDescriptionPart2_Apicot[] = _("what may happen or how it can be used."); -static const u8 sBerryDescriptionPart1_Lansat[] = _("Said to be a legendary Berry."); -static const u8 sBerryDescriptionPart2_Lansat[] = _("Holding it supposedly brings joy."); -static const u8 sBerryDescriptionPart1_Starf[] = _("So strong, it was abandoned at the"); -static const u8 sBerryDescriptionPart2_Starf[] = _("world's edge. Considered a mirage."); -static const u8 sBerryDescriptionPart1_Enigma[] = _("A completely enigmatic Berry."); -static const u8 sBerryDescriptionPart2_Enigma[] = _("Appears to have the power of stars."); -static const u8 sBerryDescriptionPart1_Micle[] = _("It makes other food eaten at the"); -static const u8 sBerryDescriptionPart2_Micle[] = _("same time taste sweet."); -static const u8 sBerryDescriptionPart1_Custap[] = _("The flesh underneath the Custap"); -static const u8 sBerryDescriptionPart2_Custap[] = _("Berry's skin is sweet and creamy soft."); -static const u8 sBerryDescriptionPart1_Jaboca[] = _("The drupelets that make up this berry"); -static const u8 sBerryDescriptionPart2_Jaboca[] = _("pop rythmically if handled roughly."); -static const u8 sBerryDescriptionPart1_Rowap[] = _("People once worked top-shaped pieces"); -static const u8 sBerryDescriptionPart2_Rowap[] = _("of this berry free to use as toys."); -static const u8 sBerryDescriptionPart1_Kee[] = _("A berry that is incredibly spicy at"); -static const u8 sBerryDescriptionPart2_Kee[] = _("first, then extremely bitter."); -static const u8 sBerryDescriptionPart1_Maranga[] = _("Its outside is very bitter, but its"); -static const u8 sBerryDescriptionPart2_Maranga[] = _("inside tastes like a sweet drink."); - // Check include/config/overworld.h configs and throw an error if illegal #if OW_BERRY_GROWTH_RATE < GEN_3 || (OW_BERRY_GROWTH_RATE > GEN_7 && OW_BERRY_GROWTH_RATE != GEN_6_ORAS) #error "OW_BERRY_GROWTH_RATE must be between GEN_3 and GEN_7!" @@ -198,8 +62,8 @@ const struct Berry gBerries[] = .size = 20, .maxYield = YIELD_RATE(3, 5, 15, 20), .minYield = YIELD_RATE(2, 2, 4, 4), - .description1 = sBerryDescriptionPart1_Cheri, - .description2 = sBerryDescriptionPart2_Cheri, + .description1 = COMPOUND_STRING("Blooms with delicate pretty flowers."), + .description2 = COMPOUND_STRING("The bright red Berry is very spicy."), .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 10, .dry = 0, @@ -221,8 +85,8 @@ const struct Berry gBerries[] = .size = 80, .maxYield = YIELD_RATE(3, 5, 15, 20), .minYield = YIELD_RATE(2, 2, 4, 4), - .description1 = sBerryDescriptionPart1_Chesto, - .description2 = sBerryDescriptionPart2_Chesto, + .description1 = COMPOUND_STRING("The Berry's thick skin and fruit are"), + .description2 = COMPOUND_STRING("very tough. It is dry-tasting all over."), .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 0, .dry = 10, @@ -244,8 +108,8 @@ const struct Berry gBerries[] = .size = 40, .maxYield = YIELD_RATE(3, 5, 15, 20), .minYield = YIELD_RATE(2, 2, 4, 4), - .description1 = sBerryDescriptionPart1_Pecha, - .description2 = sBerryDescriptionPart2_Pecha, + .description1 = COMPOUND_STRING("Very sweet and delicious."), + .description2 = COMPOUND_STRING("Also very tender - handle with care."), .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 0, .dry = 0, @@ -267,8 +131,8 @@ const struct Berry gBerries[] = .size = 32, .maxYield = YIELD_RATE(3, 5, 15, 20), .minYield = YIELD_RATE(2, 2, 4, 4), - .description1 = sBerryDescriptionPart1_Rawst, - .description2 = sBerryDescriptionPart2_Rawst, + .description1 = COMPOUND_STRING("If the leaves grow long and curly,"), + .description2 = COMPOUND_STRING("the Berry seems to grow very bitter."), .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 0, .dry = 0, @@ -290,8 +154,8 @@ const struct Berry gBerries[] = .size = 50, .maxYield = YIELD_RATE(3, 5, 15, 20), .minYield = YIELD_RATE(2, 2, 4, 4), - .description1 = sBerryDescriptionPart1_Aspear, - .description2 = sBerryDescriptionPart2_Aspear, + .description1 = COMPOUND_STRING("The hard Berry is dense with a rich"), + .description2 = COMPOUND_STRING("juice. It is quite sour."), .growthDuration = GROWTH_DURATION(12, 12, 18, 24, 16, 24), .spicy = 0, .dry = 0, @@ -313,8 +177,8 @@ const struct Berry gBerries[] = .size = 28, .maxYield = YIELD_RATE(3, 5, 15, 22), .minYield = YIELD_RATE(2, 2, 2, 2), - .description1 = sBerryDescriptionPart1_Leppa, - .description2 = sBerryDescriptionPart2_Leppa, + .description1 = COMPOUND_STRING("Grows slower than Cheri and others."), + .description2 = COMPOUND_STRING("The smaller the Berry, the tastier."), .growthDuration = GROWTH_DURATION(16, 16, 24, 24, 16, 24), .spicy = 10, .dry = 0, @@ -336,8 +200,8 @@ const struct Berry gBerries[] = .size = 35, .maxYield = YIELD_RATE(3, 5, 15, 20), .minYield = YIELD_RATE(2, 2, 4, 4), - .description1 = sBerryDescriptionPart1_Oran, - .description2 = sBerryDescriptionPart2_Oran, + .description1 = COMPOUND_STRING("A peculiar Berry with a mix of flavors."), + .description2 = COMPOUND_STRING("Berries grow in half a day."), .growthDuration = GROWTH_DURATION(12, 16, 24, 24, 16, 24), .spicy = 10, .dry = 10, @@ -359,8 +223,8 @@ const struct Berry gBerries[] = .size = 47, .maxYield = YIELD_RATE(3, 5, 15, 20), .minYield = YIELD_RATE(2, 2, 4, 4), - .description1 = sBerryDescriptionPart1_Persim, - .description2 = sBerryDescriptionPart2_Persim, + .description1 = COMPOUND_STRING("Loves sunlight. The Berry's color"), + .description2 = COMPOUND_STRING("grows vivid when exposed to the sun."), .growthDuration = GROWTH_DURATION(12, 16, 24, 24, 16, 24), .spicy = 10, .dry = 10, @@ -382,8 +246,8 @@ const struct Berry gBerries[] = .size = 34, .maxYield = YIELD_RATE(2, 5, 20, 18), .minYield = YIELD_RATE(1, 2, 3, 2), - .description1 = sBerryDescriptionPart1_Lum, - .description2 = sBerryDescriptionPart2_Lum, + .description1 = COMPOUND_STRING("Slow to grow. If raised with loving"), + .description2 = COMPOUND_STRING("care, it may grow two Berries."), .growthDuration = GROWTH_DURATION(48, 48, 72, 48, 32, 48), .spicy = 10, .dry = 10, @@ -405,8 +269,8 @@ const struct Berry gBerries[] = .size = 95, .maxYield = YIELD_RATE(3, 5, 20, 27), .minYield = YIELD_RATE(2, 2, 3, 3), - .description1 = sBerryDescriptionPart1_Sitrus, - .description2 = sBerryDescriptionPart2_Sitrus, + .description1 = COMPOUND_STRING("Closely related to Oran. The large"), + .description2 = COMPOUND_STRING("Berry has a well-rounded flavor."), .growthDuration = GROWTH_DURATION(24, 32, 48, 48, 32, 48), .spicy = 10, .dry = 10, @@ -428,8 +292,8 @@ const struct Berry gBerries[] = .size = 100, .maxYield = YIELD_RATE(3, 5, 15, 15), .minYield = YIELD_RATE(2, 1, 3, 3), - .description1 = sBerryDescriptionPart1_Figy, - .description2 = sBerryDescriptionPart2_Figy, + .description1 = COMPOUND_STRING("The Berry, which looks chewed up,"), + .description2 = COMPOUND_STRING("brims with spicy substances."), .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 10, .dry = 0, @@ -451,8 +315,8 @@ const struct Berry gBerries[] = .size = 115, .maxYield = YIELD_RATE(3, 5, 15, 15), .minYield = YIELD_RATE(2, 1, 3, 3), - .description1 = sBerryDescriptionPart1_Wiki, - .description2 = sBerryDescriptionPart2_Wiki, + .description1 = COMPOUND_STRING("The Berry is said to have grown lumpy"), + .description2 = COMPOUND_STRING("to help Pokémon grip it."), .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 0, .dry = 10, @@ -474,8 +338,8 @@ const struct Berry gBerries[] = .size = 126, .maxYield = YIELD_RATE(3, 5, 15, 15), .minYield = YIELD_RATE(2, 1, 3, 3), - .description1 = sBerryDescriptionPart1_Mago, - .description2 = sBerryDescriptionPart2_Mago, + .description1 = COMPOUND_STRING("The Berry turns curvy as it grows."), + .description2 = COMPOUND_STRING("The curvier, the sweeter and tastier."), .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 0, .dry = 0, @@ -497,8 +361,8 @@ const struct Berry gBerries[] = .size = 64, .maxYield = YIELD_RATE(3, 5, 15, 15), .minYield = YIELD_RATE(2, 1, 3, 3), - .description1 = sBerryDescriptionPart1_Aguav, - .description2 = sBerryDescriptionPart2_Aguav, + .description1 = COMPOUND_STRING("The flower is dainty. It is rare in its"), + .description2 = COMPOUND_STRING("ability to grow without light."), .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 0, .dry = 0, @@ -520,8 +384,8 @@ const struct Berry gBerries[] = .size = 223, .maxYield = YIELD_RATE(3, 5, 15, 15), .minYield = YIELD_RATE(2, 1, 3, 3), - .description1 = sBerryDescriptionPart1_Iapapa, - .description2 = sBerryDescriptionPart2_Iapapa, + .description1 = COMPOUND_STRING("The Berry is very big and sour."), + .description2 = COMPOUND_STRING("It takes at least a day to grow."), .growthDuration = GROWTH_DURATION(24, 20, 30, 24, 16, 24), .spicy = 0, .dry = 0, @@ -543,8 +407,8 @@ const struct Berry gBerries[] = .size = 120, .maxYield = YIELD_RATE(6, 10, 15, 20), .minYield = YIELD_RATE(3, 2, 3, 4), - .description1 = sBerryDescriptionPart1_Razz, - .description2 = sBerryDescriptionPart2_Razz, + .description1 = COMPOUND_STRING("The red Berry tastes slightly spicy."), + .description2 = COMPOUND_STRING("It grows quickly in just four hours."), .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 10, .dry = 10, @@ -566,8 +430,8 @@ const struct Berry gBerries[] = .size = 108, .maxYield = YIELD_RATE(6, 10, 15, 20), .minYield = YIELD_RATE(3, 2, 3, 4), - .description1 = sBerryDescriptionPart1_Bluk, - .description2 = sBerryDescriptionPart2_Bluk, + .description1 = COMPOUND_STRING("The Berry is blue on the outside, but"), + .description2 = COMPOUND_STRING("it blackens the mouth when eaten."), .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 0, .dry = 10, @@ -589,8 +453,8 @@ const struct Berry gBerries[] = .size = 77, .maxYield = YIELD_RATE(6, 10, 15, 20), .minYield = YIELD_RATE(3, 2, 3, 4), - .description1 = sBerryDescriptionPart1_Nanab, - .description2 = sBerryDescriptionPart2_Nanab, + .description1 = COMPOUND_STRING("This Berry was the seventh"), + .description2 = COMPOUND_STRING("discovered in the world. It is sweet."), .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 0, .dry = 0, @@ -612,8 +476,8 @@ const struct Berry gBerries[] = .size = 74, .maxYield = YIELD_RATE(6, 10, 15, 20), .minYield = YIELD_RATE(3, 2, 3, 4), - .description1 = sBerryDescriptionPart1_Wepear, - .description2 = sBerryDescriptionPart2_Wepear, + .description1 = COMPOUND_STRING("The flower is small and white. It has a"), + .description2 = COMPOUND_STRING("delicate balance of bitter and sour."), .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 0, .dry = 0, @@ -635,8 +499,8 @@ const struct Berry gBerries[] = .size = 80, .maxYield = YIELD_RATE(6, 10, 15, 20), .minYield = YIELD_RATE(3, 2, 3, 4), - .description1 = sBerryDescriptionPart1_Pinap, - .description2 = sBerryDescriptionPart2_Pinap, + .description1 = COMPOUND_STRING("Weak against wind and cold."), + .description2 = COMPOUND_STRING("The fruit is spicy and the skin, sour."), .growthDuration = GROWTH_DURATION(4, 8, 12, 24, 16, 24), .spicy = 10, .dry = 0, @@ -658,8 +522,8 @@ const struct Berry gBerries[] = .size = 135, .maxYield = YIELD_RATE(6, 5, 20, 26), .minYield = YIELD_RATE(2, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Pomeg, - .description2 = sBerryDescriptionPart2_Pomeg, + .description1 = COMPOUND_STRING("However much it is watered,"), + .description2 = COMPOUND_STRING("it only grows up to six Berries."), .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 10, .dry = 0, @@ -681,8 +545,8 @@ const struct Berry gBerries[] = .size = 150, .maxYield = YIELD_RATE(6, 5, 20, 26), .minYield = YIELD_RATE(2, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Kelpsy, - .description2 = sBerryDescriptionPart2_Kelpsy, + .description1 = COMPOUND_STRING("A rare variety shaped like a root."), + .description2 = COMPOUND_STRING("Grows a very large flower."), .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 0, .dry = 10, @@ -704,8 +568,8 @@ const struct Berry gBerries[] = .size = 110, .maxYield = YIELD_RATE(6, 5, 20, 26), .minYield = YIELD_RATE(2, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Qualot, - .description2 = sBerryDescriptionPart2_Qualot, + .description1 = COMPOUND_STRING("Loves water. Grows strong even in"), + .description2 = COMPOUND_STRING("locations with constant rainfall."), .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 10, .dry = 0, @@ -727,8 +591,8 @@ const struct Berry gBerries[] = .size = 162, .maxYield = YIELD_RATE(6, 5, 20, 26), .minYield = YIELD_RATE(2, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Hondew, - .description2 = sBerryDescriptionPart2_Hondew, + .description1 = COMPOUND_STRING("A Berry that is very valuable and"), + .description2 = COMPOUND_STRING("rarely seen. It is very delicious."), .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 10, .dry = 10, @@ -750,8 +614,8 @@ const struct Berry gBerries[] = .size = 149, .maxYield = YIELD_RATE(6, 5, 20, 26), .minYield = YIELD_RATE(2, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Grepa, - .description2 = sBerryDescriptionPart2_Grepa, + .description1 = COMPOUND_STRING("Despite its tenderness and round"), + .description2 = COMPOUND_STRING("shape, the Berry is unimaginably sour."), .growthDuration = GROWTH_DURATION(12, 32, 48, 48, 32, 48), .spicy = 0, .dry = 10, @@ -773,8 +637,8 @@ const struct Berry gBerries[] = .size = 200, .maxYield = YIELD_RATE(4, 5, 20, 26), .minYield = YIELD_RATE(2, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Tamato, - .description2 = sBerryDescriptionPart2_Tamato, + .description1 = COMPOUND_STRING("The Berry is lip-bendingly spicy."), + .description2 = COMPOUND_STRING("It takes time to grow."), .growthDuration = GROWTH_DURATION(24, 32, 48, 48, 32, 48), .spicy = 20, .dry = 10, @@ -796,8 +660,8 @@ const struct Berry gBerries[] = .size = 75, .maxYield = YIELD_RATE(4, 10, 15, 15), .minYield = YIELD_RATE(2, 2, 3, 3), - .description1 = sBerryDescriptionPart1_Cornn, - .description2 = sBerryDescriptionPart2_Cornn, + .description1 = COMPOUND_STRING("A Berry from an ancient era. May not"), + .description2 = COMPOUND_STRING("grow unless planted in quantity."), .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), .spicy = 0, .dry = 20, @@ -819,8 +683,8 @@ const struct Berry gBerries[] = .size = 140, .maxYield = YIELD_RATE(4, 10, 15, 15), .minYield = YIELD_RATE(2, 2, 3, 3), - .description1 = sBerryDescriptionPart1_Magost, - .description2 = sBerryDescriptionPart2_Magost, + .description1 = COMPOUND_STRING("A Berry that is widely said to have"), + .description2 = COMPOUND_STRING("a finely balanced flavor."), .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), .spicy = 0, .dry = 0, @@ -842,8 +706,8 @@ const struct Berry gBerries[] = .size = 226, .maxYield = YIELD_RATE(4, 10, 15, 15), .minYield = YIELD_RATE(2, 2, 3, 3), - .description1 = sBerryDescriptionPart1_Rabuta, - .description2 = sBerryDescriptionPart2_Rabuta, + .description1 = COMPOUND_STRING("A rare variety that is overgrown with"), + .description2 = COMPOUND_STRING("hair. It is quite bitter."), .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), .spicy = 0, .dry = 0, @@ -865,8 +729,8 @@ const struct Berry gBerries[] = .size = 285, .maxYield = YIELD_RATE(4, 10, 15, 15), .minYield = YIELD_RATE(2, 2, 3, 3), - .description1 = sBerryDescriptionPart1_Nomel, - .description2 = sBerryDescriptionPart2_Nomel, + .description1 = COMPOUND_STRING("Quite sour. Just one bite makes it"), + .description2 = COMPOUND_STRING("impossible to taste for three days."), .growthDuration = GROWTH_DURATION(24, 24, 36, 24, 16, 24), .spicy = 10, .dry = 0, @@ -888,8 +752,8 @@ const struct Berry gBerries[] = .size = 133, .maxYield = YIELD_RATE(2, 15, 15, 15), .minYield = YIELD_RATE(1, 2, 3, 3), - .description1 = sBerryDescriptionPart1_Spelon, - .description2 = sBerryDescriptionPart2_Spelon, + .description1 = COMPOUND_STRING("The vividly red Berry is very spicy."), + .description2 = COMPOUND_STRING("Its warts secrete a spicy substance."), .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 40, .dry = 10, @@ -911,8 +775,8 @@ const struct Berry gBerries[] = .size = 244, .maxYield = YIELD_RATE(2, 15, 15, 15), .minYield = YIELD_RATE(1, 3, 3, 3), - .description1 = sBerryDescriptionPart1_Pamtre, - .description2 = sBerryDescriptionPart2_Pamtre, + .description1 = COMPOUND_STRING("Drifts on the sea from somewhere."), + .description2 = COMPOUND_STRING("It is thought to grow elsewhere."), .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 0, .dry = 40, @@ -934,8 +798,8 @@ const struct Berry gBerries[] = .size = 250, .maxYield = YIELD_RATE(2, 15, 15, 15), .minYield = YIELD_RATE(1, 2, 3, 3), - .description1 = sBerryDescriptionPart1_Watmel, - .description2 = sBerryDescriptionPart2_Watmel, + .description1 = COMPOUND_STRING("A huge Berry, with some over 20"), + .description2 = COMPOUND_STRING("inches discovered. Exceedingly sweet."), .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 0, .dry = 0, @@ -957,8 +821,8 @@ const struct Berry gBerries[] = .size = 280, .maxYield = YIELD_RATE(2, 15, 15, 15), .minYield = YIELD_RATE(1, 3, 3, 3), - .description1 = sBerryDescriptionPart1_Durin, - .description2 = sBerryDescriptionPart2_Durin, + .description1 = COMPOUND_STRING("Bitter to even look at. It is so"), + .description2 = COMPOUND_STRING("bitter, no one has ever eaten it as is."), .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 0, .dry = 0, @@ -980,8 +844,8 @@ const struct Berry gBerries[] = .size = 300, .maxYield = YIELD_RATE(2, 15, 15, 15), .minYield = YIELD_RATE(1, 2, 3, 3), - .description1 = sBerryDescriptionPart1_Belue, - .description2 = sBerryDescriptionPart2_Belue, + .description1 = COMPOUND_STRING("It is glossy and looks delicious, but"), + .description2 = COMPOUND_STRING("it is awfully sour. Takes time to grow."), .growthDuration = GROWTH_DURATION(72, 60, 90, 24, 16, 24), .spicy = 10, .dry = 0, @@ -1003,8 +867,8 @@ const struct Berry gBerries[] = .size = 34, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Chilan, - .description2 = sBerryDescriptionPart2_Chilan, + .description1 = COMPOUND_STRING("It can be made into a whistle that"), + .description2 = COMPOUND_STRING("produces an indescribable sound."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 25, @@ -1026,8 +890,8 @@ const struct Berry gBerries[] = .size = 90, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Occa, - .description2 = sBerryDescriptionPart2_Occa, + .description1 = COMPOUND_STRING("Said to grow in the tropics once,"), + .description2 = COMPOUND_STRING("it boasts an intensely hot spiciness."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 15, .dry = 0, @@ -1049,8 +913,8 @@ const struct Berry gBerries[] = .size = 33, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Passho, - .description2 = sBerryDescriptionPart2_Passho, + .description1 = COMPOUND_STRING("Its flesh is dotted with many tiny"), + .description2 = COMPOUND_STRING("bubbles that keep it afloat in water."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 15, @@ -1072,8 +936,8 @@ const struct Berry gBerries[] = .size = 250, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Wacan, - .description2 = sBerryDescriptionPart2_Wacan, + .description1 = COMPOUND_STRING("Energy drawn from lightning strikes"), + .description2 = COMPOUND_STRING("makes this Berry grow big and rich."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, @@ -1095,8 +959,8 @@ const struct Berry gBerries[] = .size = 156, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Rindo, - .description2 = sBerryDescriptionPart2_Rindo, + .description1 = COMPOUND_STRING("This berry has a vegetable-like flavor,"), + .description2 = COMPOUND_STRING("but is rich in health-promoting fiber."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 10, .dry = 0, @@ -1118,8 +982,8 @@ const struct Berry gBerries[] = .size = 135, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Yache, - .description2 = sBerryDescriptionPart2_Yache, + .description1 = COMPOUND_STRING("This Berry has a refreshing dry and"), + .description2 = COMPOUND_STRING("sour flavor. Tastes better chilled."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 10, @@ -1141,8 +1005,8 @@ const struct Berry gBerries[] = .size = 77, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Chople, - .description2 = sBerryDescriptionPart2_Chople, + .description1 = COMPOUND_STRING("Contains a substance that generates"), + .description2 = COMPOUND_STRING("heat. Can even fire up a chilly heart."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 15, .dry = 0, @@ -1164,8 +1028,8 @@ const struct Berry gBerries[] = .size = 90, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Kebia, - .description2 = sBerryDescriptionPart2_Kebia, + .description1 = COMPOUND_STRING("Brilliant green on the outside, inside"), + .description2 = COMPOUND_STRING("it is packed with black-colored flesh."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 15, @@ -1187,8 +1051,8 @@ const struct Berry gBerries[] = .size = 42, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Shuca, - .description2 = sBerryDescriptionPart2_Shuca, + .description1 = COMPOUND_STRING("The sweet pulp has just the hint of a"), + .description2 = COMPOUND_STRING("a hard-edged and fragrant bite to it."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 10, .dry = 0, @@ -1210,8 +1074,8 @@ const struct Berry gBerries[] = .size = 278, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Coba, - .description2 = sBerryDescriptionPart2_Coba, + .description1 = COMPOUND_STRING("This Berry is said to be a cross of"), + .description2 = COMPOUND_STRING("two Berries blown in from far away."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 10, @@ -1233,8 +1097,8 @@ const struct Berry gBerries[] = .size = 252, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Payapa, - .description2 = sBerryDescriptionPart2_Payapa, + .description1 = COMPOUND_STRING("Said to sense human emotions, it swells"), + .description2 = COMPOUND_STRING("roundly when a person approaches."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, @@ -1256,8 +1120,8 @@ const struct Berry gBerries[] = .size = 42, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Tanga, - .description2 = sBerryDescriptionPart2_Tanga, + .description1 = COMPOUND_STRING("It grows a flower at the tip that lures"), + .description2 = COMPOUND_STRING("Bug Pokémon with its stringy petals."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 20, .dry = 0, @@ -1279,8 +1143,8 @@ const struct Berry gBerries[] = .size = 28, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Charti, - .description2 = sBerryDescriptionPart2_Charti, + .description1 = COMPOUND_STRING("Often used for pickles because of its"), + .description2 = COMPOUND_STRING("dry flavor. Sometimes eaten raw."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 10, .dry = 20, @@ -1302,8 +1166,8 @@ const struct Berry gBerries[] = .size = 144, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Kasib, - .description2 = sBerryDescriptionPart2_Kasib, + .description1 = COMPOUND_STRING("Old superstitions say it has an odd"), + .description2 = COMPOUND_STRING("power. A popular good-luck charm."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 10, @@ -1325,8 +1189,8 @@ const struct Berry gBerries[] = .size = 23, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Haban, - .description2 = sBerryDescriptionPart2_Haban, + .description1 = COMPOUND_STRING("Less bitter if enough of this Berry"), + .description2 = COMPOUND_STRING("is boiled down. Makes a good jam."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, @@ -1348,8 +1212,8 @@ const struct Berry gBerries[] = .size = 39, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Colbur, - .description2 = sBerryDescriptionPart2_Colbur, + .description1 = COMPOUND_STRING("Tiny hooks on the surface latch onto"), + .description2 = COMPOUND_STRING("Pokémon to reach far-off places."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, @@ -1371,8 +1235,8 @@ const struct Berry gBerries[] = .size = 265, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Babiri, - .description2 = sBerryDescriptionPart2_Babiri, + .description1 = COMPOUND_STRING("Very tough with a strong flavor. It"), + .description2 = COMPOUND_STRING("was used to make medicine in the past."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 25, .dry = 10, @@ -1394,8 +1258,8 @@ const struct Berry gBerries[] = .size = 35, .maxYield = YIELD_RATE(5, 5, 20, 10), .minYield = YIELD_RATE(2, 1, 3, 2), - .description1 = sBerryDescriptionPart1_Roseli, - .description2 = sBerryDescriptionPart2_Roseli, + .description1 = COMPOUND_STRING("In nature, they grow in wide rings"), + .description2 = COMPOUND_STRING("for reasons that are still unknown."), .growthDuration = GROWTH_DURATION(84, 72, 108, 48, 32, 48), .spicy = 0, .dry = 0, @@ -1417,8 +1281,8 @@ const struct Berry gBerries[] = .size = 111, .maxYield = YIELD_RATE(2, 5, 10, 13), .minYield = YIELD_RATE(1, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Liechi, - .description2 = sBerryDescriptionPart2_Liechi, + .description1 = COMPOUND_STRING("A mysterious Berry. It is rumored to"), + .description2 = COMPOUND_STRING("contain the power of the sea."), .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 40, .dry = 0, @@ -1440,8 +1304,8 @@ const struct Berry gBerries[] = .size = 33, .maxYield = YIELD_RATE(2, 5, 10, 13), .minYield = YIELD_RATE(1, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Ganlon, - .description2 = sBerryDescriptionPart2_Ganlon, + .description1 = COMPOUND_STRING("A mysterious Berry. It is rumored to"), + .description2 = COMPOUND_STRING("contain the power of the land."), .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 0, .dry = 40, @@ -1463,8 +1327,8 @@ const struct Berry gBerries[] = .size = 95, .maxYield = YIELD_RATE(2, 5, 10, 13), .minYield = YIELD_RATE(1, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Salac, - .description2 = sBerryDescriptionPart2_Salac, + .description1 = COMPOUND_STRING("A mysterious Berry. It is rumored to"), + .description2 = COMPOUND_STRING("contain the power of the sky."), .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 0, .dry = 0, @@ -1486,8 +1350,8 @@ const struct Berry gBerries[] = .size = 237, .maxYield = YIELD_RATE(2, 5, 10, 13), .minYield = YIELD_RATE(1, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Petaya, - .description2 = sBerryDescriptionPart2_Petaya, + .description1 = COMPOUND_STRING("A mysterious Berry. It is rumored to"), + .description2 = COMPOUND_STRING("contain the power of all living things."), .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 40, .dry = 0, @@ -1509,8 +1373,8 @@ const struct Berry gBerries[] = .size = 75, .maxYield = YIELD_RATE(2, 5, 10, 13), .minYield = YIELD_RATE(1, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Apicot, - .description2 = sBerryDescriptionPart2_Apicot, + .description1 = COMPOUND_STRING("A very mystifying Berry. No telling"), + .description2 = COMPOUND_STRING("what may happen or how it can be used."), .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 0, .dry = 40, @@ -1532,8 +1396,8 @@ const struct Berry gBerries[] = .size = 97, .maxYield = YIELD_RATE(2, 5, 5, 7), .minYield = YIELD_RATE(1, 1, 1, 1), - .description1 = sBerryDescriptionPart1_Lansat, - .description2 = sBerryDescriptionPart2_Lansat, + .description1 = COMPOUND_STRING("Said to be a legendary Berry."), + .description2 = COMPOUND_STRING("Holding it supposedly brings joy."), .growthDuration = GROWTH_DURATION(96, 96, 144, 120, 48, 72), .spicy = 10, .dry = 10, @@ -1555,8 +1419,8 @@ const struct Berry gBerries[] = .size = 153, .maxYield = YIELD_RATE(2, 5, 5, 7), .minYield = YIELD_RATE(1, 1, 1, 1), - .description1 = sBerryDescriptionPart1_Starf, - .description2 = sBerryDescriptionPart2_Starf, + .description1 = COMPOUND_STRING("So strong, it was abandoned at the"), + .description2 = COMPOUND_STRING("world's edge. Considered a mirage."), .growthDuration = GROWTH_DURATION(96, 96, 144, 120, 48, 72), .spicy = 10, .dry = 10, @@ -1578,8 +1442,8 @@ const struct Berry gBerries[] = .size = 155, .maxYield = YIELD_RATE(2, 5, 5, 13), .minYield = YIELD_RATE(1, 1, 1, 1), - .description1 = sBerryDescriptionPart1_Enigma, - .description2 = sBerryDescriptionPart2_Enigma, + .description1 = COMPOUND_STRING("A completely enigmatic Berry."), + .description2 = COMPOUND_STRING("Appears to have the power of stars."), .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 40, .dry = 10, @@ -1601,8 +1465,8 @@ const struct Berry gBerries[] = .size = 41, .maxYield = YIELD_RATE(2, 5, 5, 13), .minYield = YIELD_RATE(1, 1, 1, 1), - .description1 = sBerryDescriptionPart1_Micle, - .description2 = sBerryDescriptionPart2_Micle, + .description1 = COMPOUND_STRING("It makes other food eaten at the"), + .description2 = COMPOUND_STRING("same time taste sweet."), .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 0, .dry = 40, @@ -1624,8 +1488,8 @@ const struct Berry gBerries[] = .size = 267, .maxYield = YIELD_RATE(2, 5, 5, 13), .minYield = YIELD_RATE(1, 1, 1, 1), - .description1 = sBerryDescriptionPart1_Custap, - .description2 = sBerryDescriptionPart2_Custap, + .description1 = COMPOUND_STRING("The flesh underneath the Custap"), + .description2 = COMPOUND_STRING("Berry's skin is sweet and creamy soft."), .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 0, .dry = 0, @@ -1647,8 +1511,8 @@ const struct Berry gBerries[] = .size = 33, .maxYield = YIELD_RATE(2, 5, 5, 13), .minYield = YIELD_RATE(1, 1, 1, 1), - .description1 = sBerryDescriptionPart1_Jaboca, - .description2 = sBerryDescriptionPart2_Jaboca, + .description1 = COMPOUND_STRING("The drupelets that make up this berry"), + .description2 = COMPOUND_STRING("pop rythmically if handled roughly."), .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 0, .dry = 0, @@ -1670,8 +1534,8 @@ const struct Berry gBerries[] = .size = 52, .maxYield = YIELD_RATE(2, 5, 5, 13), .minYield = YIELD_RATE(1, 1, 1, 1), - .description1 = sBerryDescriptionPart1_Rowap, - .description2 = sBerryDescriptionPart2_Rowap, + .description1 = COMPOUND_STRING("People once worked top-shaped pieces"), + .description2 = COMPOUND_STRING("of this berry free to use as toys."), .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 10, .dry = 0, @@ -1693,8 +1557,8 @@ const struct Berry gBerries[] = .size = 0, .maxYield = YIELD_RATE(2, 5, 10, 13), .minYield = YIELD_RATE(1, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Kee, - .description2 = sBerryDescriptionPart2_Kee, + .description1 = COMPOUND_STRING("A berry that is incredibly spicy at"), + .description2 = COMPOUND_STRING("first, then extremely bitter."), .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 30, .dry = 30, @@ -1716,8 +1580,8 @@ const struct Berry gBerries[] = .size = 0, .maxYield = YIELD_RATE(2, 5, 10, 13), .minYield = YIELD_RATE(1, 1, 1, 2), - .description1 = sBerryDescriptionPart1_Maranga, - .description2 = sBerryDescriptionPart2_Maranga, + .description1 = COMPOUND_STRING("Its outside is very bitter, but its"), + .description2 = COMPOUND_STRING("inside tastes like a sweet drink."), .growthDuration = GROWTH_DURATION(96, 96, 144, 96, 48, 72), .spicy = 10, .dry = 10, @@ -1739,8 +1603,8 @@ const struct Berry gBerries[] = .size = 0, .maxYield = YIELD_RATE(2, 5, 5, 13), .minYield = YIELD_RATE(1, 1, 1, 1), - .description1 = sBerryDescriptionPart1_Enigma, - .description2 = sBerryDescriptionPart2_Enigma, + .description1 = COMPOUND_STRING("A completely enigmatic Berry."), + .description2 = COMPOUND_STRING("Appears to have the power of stars."), .growthDuration = GROWTH_DURATION(96, 96, 144, 72, 48, 72), .spicy = 40, .dry = 40, From b56a9e62860a7c5eba7c6580cbf2f0b8d1b75665 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 4 Jan 2024 16:04:00 +0000 Subject: [PATCH 30/33] Remove unused function --- include/berry.h | 1 - src/berry.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/include/berry.h b/include/berry.h index 13cf77d4dd..ba1bbb1d12 100644 --- a/include/berry.h +++ b/include/berry.h @@ -1,7 +1,6 @@ #ifndef GUARD_BERRY_H #define GUARD_BERRY_H -void ClearEnigmaBerries(void); void SetEnigmaBerry(u8 *src); bool32 IsEnigmaBerryValid(void); const struct Berry *GetBerryInfo(u8 berry); diff --git a/src/berry.c b/src/berry.c index 88c4a16fe3..a73c9ddf12 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1667,12 +1667,6 @@ const struct BerryCrushBerryData gBerryCrush_BerryData[] = { const struct BerryTree gBlankBerryTree = {}; -// unused -void ClearEnigmaBerries(void) -{ - CpuFill16(0, &gSaveBlock1Ptr->enigmaBerry, sizeof(gSaveBlock1Ptr->enigmaBerry)); -} - void SetEnigmaBerry(u8 *src) { u32 i; From b948accc804168391cd4c964950d2bc53de5d63b Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 4 Jan 2024 16:07:12 +0000 Subject: [PATCH 31/33] Remove redundant table --- include/event_object_movement.h | 1 - .../berry_tree_graphics_tables.h | 70 ------------------- src/event_object_movement.c | 2 +- 3 files changed, 1 insertion(+), 72 deletions(-) diff --git a/include/event_object_movement.h b/include/event_object_movement.h index b48522ebc8..276c4340de 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -94,7 +94,6 @@ extern const struct OamData gObjectEventBaseOam_32x32; extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[]; extern const u8 gReflectionEffectPaletteMap[]; -extern const u8 *const gBerryTreeObjectEventGraphicsIdTablePointers[]; extern const struct SpriteFrameImage *const gBerryTreePicTablePointers[]; extern const u8 *const gBerryTreePaletteSlotTablePointers[]; diff --git a/src/data/object_events/berry_tree_graphics_tables.h b/src/data/object_events/berry_tree_graphics_tables.h index 63559a326c..585c2ddb16 100755 --- a/src/data/object_events/berry_tree_graphics_tables.h +++ b/src/data/object_events/berry_tree_graphics_tables.h @@ -774,73 +774,3 @@ const u8 *const gBerryTreePaletteSlotTablePointers[] = { [ITEM_ENIGMA_BERRY_E_READER - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Durin, }; -const u8 *const gBerryTreeObjectEventGraphicsIdTablePointers[] = { - [ITEM_CHERI_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_CHESTO_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PECHA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_RAWST_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_ASPEAR_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_LEPPA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_ORAN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PERSIM_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_LUM_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_SITRUS_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_FIGY_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_WIKI_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_MAGO_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_AGUAV_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_IAPAPA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_RAZZ_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_BLUK_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_NANAB_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_WEPEAR_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PINAP_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_POMEG_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_KELPSY_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_QUALOT_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_HONDEW_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_GREPA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_TAMATO_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_CORNN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_MAGOST_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_RABUTA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_NOMEL_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_SPELON_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PAMTRE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_WATMEL_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_DURIN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_BELUE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_CHILAN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_OCCA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PASSHO_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_WACAN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_RINDO_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_YACHE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_CHOPLE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_KEBIA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_SHUCA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_COBA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PAYAPA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_TANGA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_CHARTI_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_KASIB_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_HABAN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_COLBUR_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_BABIRI_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_ROSELI_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_LIECHI_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_GANLON_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_SALAC_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_PETAYA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_MICLE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_CUSTAP_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_JABOCA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_ROWAP_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_KEE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_MARANGA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, - [ITEM_ENIGMA_BERRY_E_READER - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, -}; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 6cd6955031..fc14b5127a 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1888,7 +1888,7 @@ static void SetBerryTreeGraphics(struct ObjectEvent *objectEvent, struct Sprite if (berryId > ITEM_TO_BERRY(LAST_BERRY_INDEX)) berryId = 0; - ObjectEventSetGraphicsId(objectEvent, gBerryTreeObjectEventGraphicsIdTablePointers[berryId][berryStage]); + ObjectEventSetGraphicsId(objectEvent, gBerryTreeObjectEventGraphicsIdTable[berryStage]); sprite->images = gBerryTreePicTablePointers[berryId]; sprite->oam.paletteNum = gBerryTreePaletteSlotTablePointers[berryId][berryStage]; StartSpriteAnim(sprite, berryStage); From 1ee568ac6b44098fd1713635bff1f195190753bc Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 4 Jan 2024 16:12:39 +0000 Subject: [PATCH 32/33] Remove leftover code for myself --- include/global.berry.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/global.berry.h b/include/global.berry.h index f5967d4839..a8a76c089e 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -4,10 +4,6 @@ #define BERRY_NAME_LENGTH 6 #define BERRY_ITEM_EFFECT_COUNT 18 -// water up to 15 (4 bits) -// weeds up to 7 * 0.5 (3 bits), 0 => 0.1 -// pests up to 7 * 0.5 (3 bits), 0 => 0.2 - struct Berry { const u8 name[BERRY_NAME_LENGTH + 1]; From 7b0904c580d1bb9f8e9c4bc212c6fb6176ca36a5 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Fri, 5 Jan 2024 11:32:59 +0100 Subject: [PATCH 33/33] Fix extended berry stage palettes --- include/config/overworld.h | 2 +- .../berry_tree_graphics_tables.h | 90 +++++++++---------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index 1399d87648..c19ceeac7b 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -24,7 +24,7 @@ #define OW_BERRY_MULCH_USAGE FALSE // If enabled, Mulch can be used on soil to fertilize it. Otherwise, it is considered unusable. Note that moisture effects only work with OW_BERRY_MOISTURE enabled! #define OW_BERRY_WEEDS FALSE // If enabled, weeds may grow on Berry plants that the player needs to take care of. Without OW_BERRY_MOISTURE, weeding bonuses are rounded down. #define OW_BERRY_PESTS FALSE // If enabled, pests may approach Berry plants that the player needs to take care of. Without OW_BERRY_MOISTURE, pest bonuses are rounded down. -#define OW_BERRY_SIX_STAGES TRUE // In XY, Berries go through six stages instead of four. This toggle does not affect the time it takes for a tree to be ready for harvest. Without OW_BERRY_MOISTURE, the two extra stages count as BERRY_STAGE_TALLER for watering purposes. +#define OW_BERRY_SIX_STAGES FALSE // In XY, Berries go through six stages instead of four. This toggle does not affect the time it takes for a tree to be ready for harvest. Without OW_BERRY_MOISTURE, the two extra stages count as BERRY_STAGE_TALLER for watering purposes. #define OW_BERRY_GROWTH_RATE GEN_3 // Presets for how long each Berry plant takes to grow. #define OW_BERRY_YIELD_RATE GEN_3 // Presets for how many Berries each plant can yield. diff --git a/src/data/object_events/berry_tree_graphics_tables.h b/src/data/object_events/berry_tree_graphics_tables.h index 585c2ddb16..d2127199fd 100755 --- a/src/data/object_events/berry_tree_graphics_tables.h +++ b/src/data/object_events/berry_tree_graphics_tables.h @@ -10,7 +10,7 @@ static const struct SpriteFrameImage sPicTable_CheriBerryTree[] = { overworld_frame(gObjectEventPic_CheriBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Cheri[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Cheri[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_ChestoBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -24,7 +24,7 @@ static const struct SpriteFrameImage sPicTable_ChestoBerryTree[] = { overworld_frame(gObjectEventPic_ChestoBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Chesto[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Chesto[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_PechaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -38,7 +38,7 @@ static const struct SpriteFrameImage sPicTable_PechaBerryTree[] = { overworld_frame(gObjectEventPic_PechaBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Pecha[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Pecha[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_RawstBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -52,7 +52,7 @@ static const struct SpriteFrameImage sPicTable_RawstBerryTree[] = { overworld_frame(gObjectEventPic_RawstBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Rawst[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Rawst[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_AspearBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -66,7 +66,7 @@ static const struct SpriteFrameImage sPicTable_AspearBerryTree[] = { overworld_frame(gObjectEventPic_AspearBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Aspear[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Aspear[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_LeppaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -80,7 +80,7 @@ static const struct SpriteFrameImage sPicTable_LeppaBerryTree[] = { overworld_frame(gObjectEventPic_LeppaBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Leppa[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Leppa[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_OranBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -94,7 +94,7 @@ static const struct SpriteFrameImage sPicTable_OranBerryTree[] = { overworld_frame(gObjectEventPic_OranBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Oran[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Oran[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_PersimBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -108,7 +108,7 @@ static const struct SpriteFrameImage sPicTable_PersimBerryTree[] = { overworld_frame(gObjectEventPic_PersimBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Persim[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Persim[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_LumBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -122,7 +122,7 @@ static const struct SpriteFrameImage sPicTable_LumBerryTree[] = { overworld_frame(gObjectEventPic_LumBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Lum[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Lum[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_SitrusBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -136,7 +136,7 @@ static const struct SpriteFrameImage sPicTable_SitrusBerryTree[] = { overworld_frame(gObjectEventPic_SitrusBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Sitrus[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Sitrus[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_FigyBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -150,7 +150,7 @@ static const struct SpriteFrameImage sPicTable_FigyBerryTree[] = { overworld_frame(gObjectEventPic_FigyBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Figy[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Figy[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_WikiBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -164,7 +164,7 @@ static const struct SpriteFrameImage sPicTable_WikiBerryTree[] = { overworld_frame(gObjectEventPic_WikiBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Wiki[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Wiki[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_MagoBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -178,7 +178,7 @@ static const struct SpriteFrameImage sPicTable_MagoBerryTree[] = { overworld_frame(gObjectEventPic_MagoBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Mago[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Mago[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_AguavBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -192,7 +192,7 @@ static const struct SpriteFrameImage sPicTable_AguavBerryTree[] = { overworld_frame(gObjectEventPic_AguavBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Aguav[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Aguav[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_IapapaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -206,7 +206,7 @@ static const struct SpriteFrameImage sPicTable_IapapaBerryTree[] = { overworld_frame(gObjectEventPic_IapapaBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Iapapa[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Iapapa[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_RazzBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -220,7 +220,7 @@ static const struct SpriteFrameImage sPicTable_RazzBerryTree[] = { overworld_frame(gObjectEventPic_RazzBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Razz[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Razz[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_WepearBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -234,7 +234,7 @@ static const struct SpriteFrameImage sPicTable_WepearBerryTree[] = { overworld_frame(gObjectEventPic_WepearBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Wepear[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Wepear[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_PomegBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -248,7 +248,7 @@ static const struct SpriteFrameImage sPicTable_PomegBerryTree[] = { overworld_frame(gObjectEventPic_PomegBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Pomeg[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Pomeg[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_KelpsyBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -262,7 +262,7 @@ static const struct SpriteFrameImage sPicTable_KelpsyBerryTree[] = { overworld_frame(gObjectEventPic_KelpsyBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Kelpsy[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Kelpsy[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_HondewBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -276,7 +276,7 @@ static const struct SpriteFrameImage sPicTable_HondewBerryTree[] = { overworld_frame(gObjectEventPic_HondewBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Hondew[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Hondew[] = {3, 4, 5, 5, 5, 5, 5}; static const struct SpriteFrameImage sPicTable_GrepaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -290,7 +290,7 @@ static const struct SpriteFrameImage sPicTable_GrepaBerryTree[] = { overworld_frame(gObjectEventPic_GrepaBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Grepa[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Grepa[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_TamatoBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -304,7 +304,7 @@ static const struct SpriteFrameImage sPicTable_TamatoBerryTree[] = { overworld_frame(gObjectEventPic_TamatoBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Tamato[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Tamato[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_CornnBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -318,7 +318,7 @@ static const struct SpriteFrameImage sPicTable_CornnBerryTree[] = { overworld_frame(gObjectEventPic_CornnBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Cornn[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Cornn[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_RabutaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -332,7 +332,7 @@ static const struct SpriteFrameImage sPicTable_RabutaBerryTree[] = { overworld_frame(gObjectEventPic_RabutaBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Rabuta[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Rabuta[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_NomelBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -346,7 +346,7 @@ static const struct SpriteFrameImage sPicTable_NomelBerryTree[] = { overworld_frame(gObjectEventPic_NomelBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Nomel[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Nomel[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_SpelonBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -360,7 +360,7 @@ static const struct SpriteFrameImage sPicTable_SpelonBerryTree[] = { overworld_frame(gObjectEventPic_SpelonBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Spelon[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Spelon[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_PamtreBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -374,7 +374,7 @@ static const struct SpriteFrameImage sPicTable_PamtreBerryTree[] = { overworld_frame(gObjectEventPic_PamtreBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Pamtre[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Pamtre[] = {3, 4, 2, 2, 2, 2, 2}; static const struct SpriteFrameImage sPicTable_DurinBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -388,7 +388,7 @@ static const struct SpriteFrameImage sPicTable_DurinBerryTree[] = { overworld_frame(gObjectEventPic_DurinBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Durin[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Durin[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_OccaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -402,7 +402,7 @@ static const struct SpriteFrameImage sPicTable_OccaBerryTree[] = { overworld_frame(gObjectEventPic_OccaBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Occa[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Occa[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_YacheBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -416,7 +416,7 @@ static const struct SpriteFrameImage sPicTable_YacheBerryTree[] = { overworld_frame(gObjectEventPic_YacheBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Yache[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Yache[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_ChopleBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -430,7 +430,7 @@ static const struct SpriteFrameImage sPicTable_ChopleBerryTree[] = { overworld_frame(gObjectEventPic_ChopleBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Chople[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Chople[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_KebiaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -444,7 +444,7 @@ static const struct SpriteFrameImage sPicTable_KebiaBerryTree[] = { overworld_frame(gObjectEventPic_KebiaBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Kebia[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Kebia[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_ShucaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -458,7 +458,7 @@ static const struct SpriteFrameImage sPicTable_ShucaBerryTree[] = { overworld_frame(gObjectEventPic_ShucaBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Shuca[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Shuca[] = {3, 4, 5, 5, 5, 5, 5}; static const struct SpriteFrameImage sPicTable_PayapaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -472,7 +472,7 @@ static const struct SpriteFrameImage sPicTable_PayapaBerryTree[] = { overworld_frame(gObjectEventPic_PayapaBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Payapa[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Payapa[] = {3, 4, 5, 5, 5, 5, 5}; static const struct SpriteFrameImage sPicTable_TangaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -486,7 +486,7 @@ static const struct SpriteFrameImage sPicTable_TangaBerryTree[] = { overworld_frame(gObjectEventPic_TangaBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Tanga[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Tanga[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_KasibBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -500,7 +500,7 @@ static const struct SpriteFrameImage sPicTable_KasibBerryTree[] = { overworld_frame(gObjectEventPic_KasibBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Kasib[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Kasib[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_HabanBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -514,7 +514,7 @@ static const struct SpriteFrameImage sPicTable_HabanBerryTree[] = { overworld_frame(gObjectEventPic_HabanBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Haban[] = {3, 4, 3, 3, 3}; +const u8 gBerryTreePaletteSlotTable_Haban[] = {3, 4, 3, 3, 3, 3, 3}; static const struct SpriteFrameImage sPicTable_ColburBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -528,7 +528,7 @@ static const struct SpriteFrameImage sPicTable_ColburBerryTree[] = { overworld_frame(gObjectEventPic_ColburBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Colbur[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Colbur[] = {3, 4, 5, 5, 5, 5, 5}; static const struct SpriteFrameImage sPicTable_RoseliBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -542,7 +542,7 @@ static const struct SpriteFrameImage sPicTable_RoseliBerryTree[] = { overworld_frame(gObjectEventPic_RoseliBerryTree, 2, 4, 5) }; -const u8 gBerryTreePaletteSlotTable_Roseli[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Roseli[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_LiechiBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -556,7 +556,7 @@ static const struct SpriteFrameImage sPicTable_LiechiBerryTree[] = { overworld_frame(gObjectEventPic_LiechiBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Liechi[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Liechi[] = {3, 4, 4, 4, 4, 4, 4}; static const struct SpriteFrameImage sPicTable_LansatBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -570,7 +570,7 @@ static const struct SpriteFrameImage sPicTable_LansatBerryTree[] = { overworld_frame(gObjectEventPic_LansatBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Lansat[] = {3, 4, 2, 2, 2}; +const u8 gBerryTreePaletteSlotTable_Lansat[] = {3, 4, 2, 2, 2, 2, 2}; const struct SpriteFrameImage sPicTable_MicleBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -584,7 +584,7 @@ const struct SpriteFrameImage sPicTable_MicleBerryTree[] = { overworld_frame(gObjectEventPic_MicleBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Micle[] = {3, 4, 4, 4, 4}; +const u8 gBerryTreePaletteSlotTable_Micle[] = {3, 4, 4, 4, 4, 4, 4}; const struct SpriteFrameImage sPicTable_CustapBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -598,7 +598,7 @@ const struct SpriteFrameImage sPicTable_CustapBerryTree[] = { overworld_frame(gObjectEventPic_CustapBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Custap[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Custap[] = {3, 4, 5, 5, 5, 5, 5}; const struct SpriteFrameImage sPicTable_JabocaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -612,7 +612,7 @@ const struct SpriteFrameImage sPicTable_JabocaBerryTree[] = { overworld_frame(gObjectEventPic_JabocaBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Jaboca[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Jaboca[] = {3, 4, 5, 5, 5, 5, 5}; const struct SpriteFrameImage sPicTable_RowapBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), @@ -626,7 +626,7 @@ const struct SpriteFrameImage sPicTable_RowapBerryTree[] = { overworld_frame(gObjectEventPic_RowapBerryTree, 2, 4, 5), }; -const u8 gBerryTreePaletteSlotTable_Rowap[] = {3, 4, 5, 5, 5}; +const u8 gBerryTreePaletteSlotTable_Rowap[] = {3, 4, 5, 5, 5, 5, 5}; const u8 gDeadBerryTreeObjectEventGraphicsIdTable[] = {OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES};