From 9fa811dd7183fafbe89aa3b3f78c85ea7bfae2a1 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 7 Dec 2023 11:54:07 +0100 Subject: [PATCH] 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;