From 0d70d9951da2aeca123e1f0376ab48b914f0001b Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Mon, 4 Dec 2023 00:33:25 +0100 Subject: [PATCH] Put Mulch behind config --- data/scripts/berry_tree.inc | 47 +++++++++++++++++-------------- include/config/overworld.h | 1 + src/berry.c | 4 ++- src/data/items.h | 16 +++++------ src/data/text/item_descriptions.h | 5 ++++ 5 files changed, 43 insertions(+), 30 deletions(-) diff --git a/data/scripts/berry_tree.inc b/data/scripts/berry_tree.inc index ac68dc4b9688..bea246fde331 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,23 +58,24 @@ BerryTree_EventScript_WantToPlantMulch:: case 2, BerryTree_EventScript_CancelPlanting case MULTI_B_PRESSED, BerryTree_EventScript_CancelPlanting -BerryTree_EventScript_ChooseBerryToPlant:: +BerryTree_EventScript_ChooseMulchToUse:: fadescreen FADE_TO_BLACK closemessage - special Bag_ChooseBerry + special Bag_ChooseMulch waitstate goto_if_eq VAR_ITEM_ID, 0, BerryTree_EventScript_CancelPlanting removeitem VAR_ITEM_ID - call BerryTree_EventScript_PlantBerry + call BerryTree_EventScript_UseMulch +.endif -BerryTree_EventScript_ChooseMulchToUse:: +BerryTree_EventScript_ChooseBerryToPlant:: fadescreen FADE_TO_BLACK closemessage - special Bag_ChooseMulch + special Bag_ChooseBerry waitstate goto_if_eq VAR_ITEM_ID, 0, BerryTree_EventScript_CancelPlanting removeitem VAR_ITEM_ID - call BerryTree_EventScript_UseMulch + 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 fb24c680b0ed..b15e6c356000 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 0f2091c7754c..79109984b6fa 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 74c8ac014d75..f1cf2c95a502 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 422549a186ff..c129597f95a3 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"