From fbbbf46c717ec92e296ab1e19cb1a18115443a70 Mon Sep 17 00:00:00 2001 From: Niezann Date: Fri, 6 Sep 2024 13:17:44 -0700 Subject: [PATCH 1/2] xenobotany requirement traits stop water / nutriment depletion. --- code/modules/hydroponics/trays/tray_process.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/modules/hydroponics/trays/tray_process.dm b/code/modules/hydroponics/trays/tray_process.dm index 180617133d51..974db5daff14 100644 --- a/code/modules/hydroponics/trays/tray_process.dm +++ b/code/modules/hydroponics/trays/tray_process.dm @@ -53,18 +53,18 @@ mutate((rand(100) < 15) ? 2 : 1) mutation_level = 0 - // Maintain tray nutrient and water levels. - if(seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) > 0 && nutrilevel > 0 && prob(25)) + // Maintain tray nutrient and water levels, only if they don't have nutrient/water requirements. + if(seed.get_trait(TRAIT_REQUIRES_NUTRIENT) && seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) > 0 && nutrilevel > 0 && prob(25)) nutrilevel -= max(0,seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) * HYDRO_SPEED_MULTIPLIER) - if(seed.get_trait(TRAIT_WATER_CONSUMPTION) > 0 && waterlevel > 0 && prob(25)) + if(seed.get_trait(TRAIT_REQUIRES_WATER) && seed.get_trait(TRAIT_WATER_CONSUMPTION) > 0 && waterlevel > 0 && prob(25)) waterlevel -= max(0,seed.get_trait(TRAIT_WATER_CONSUMPTION) * HYDRO_SPEED_MULTIPLIER) // Make sure the plant is not starving or thirsty. Adequate // water and nutrients will cause a plant to become healthier. var/healthmod = rand(1,3) * HYDRO_SPEED_MULTIPLIER - if(seed.get_trait(TRAIT_REQUIRES_NUTRIENTS) && prob(35)) + if(prob(35)) health += (nutrilevel < 2 ? -healthmod : healthmod) - if(seed.get_trait(TRAIT_REQUIRES_WATER) && prob(35)) + if(prob(35)) health += (waterlevel < 10 ? -healthmod : healthmod) // Check that pressure, heat and light are all within bounds. From 4279a4355c9a0a22fd707671555105479d94be9b Mon Sep 17 00:00:00 2001 From: Niezann Date: Fri, 6 Sep 2024 13:37:01 -0700 Subject: [PATCH 2/2] Update tray_process.dm --- code/modules/hydroponics/trays/tray_process.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/hydroponics/trays/tray_process.dm b/code/modules/hydroponics/trays/tray_process.dm index 974db5daff14..d827b63ca343 100644 --- a/code/modules/hydroponics/trays/tray_process.dm +++ b/code/modules/hydroponics/trays/tray_process.dm @@ -54,7 +54,7 @@ mutation_level = 0 // Maintain tray nutrient and water levels, only if they don't have nutrient/water requirements. - if(seed.get_trait(TRAIT_REQUIRES_NUTRIENT) && seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) > 0 && nutrilevel > 0 && prob(25)) + if(seed.get_trait(TRAIT_REQUIRES_NUTRIENTS) && seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) > 0 && nutrilevel > 0 && prob(25)) nutrilevel -= max(0,seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) * HYDRO_SPEED_MULTIPLIER) if(seed.get_trait(TRAIT_REQUIRES_WATER) && seed.get_trait(TRAIT_WATER_CONSUMPTION) > 0 && waterlevel > 0 && prob(25)) waterlevel -= max(0,seed.get_trait(TRAIT_WATER_CONSUMPTION) * HYDRO_SPEED_MULTIPLIER)