From b74024f6c1dd5fec5de16bc08a1c20c142e76cca Mon Sep 17 00:00:00 2001 From: AlbertNanotracen Date: Tue, 5 Mar 2024 20:38:05 -0400 Subject: [PATCH] Self sustaining plants grow without nutrients --- code/modules/hydroponics/hydroponics.dm | 11 ++++++----- monkestation/code/modules/hydroponics/seeds.dm | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 5e5211d00245..75f1523fdcae 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -249,11 +249,13 @@ myseed.forceMove(src) update_appearance() - if((world.time > (lastcycle + cycledelay) && waterlevel > 10 && reagents.total_volume > 2 && pestlevel < 10 && weedlevel < 10) || bio_boosted) + if((world.time > (lastcycle + cycledelay) && waterlevel > 10 && (reagents.total_volume > 2 || self_sustaining) && pestlevel < 10 && weedlevel < 10) || bio_boosted) lastcycle = world.time if(myseed && plant_status != HYDROTRAY_PLANT_DEAD) // Advance age - age++ + var/growth_mult = (1.01 ** -myseed.maturation) + if(!(age > max(myseed.maturation, myseed.production)/* Fuck Corpse Flowers */ && (growth >= myseed.harvest_age * growth_mult) && self_sustaining)) + age++ needs_update = TRUE growth += 3 @@ -270,9 +272,9 @@ apply_chemicals(lastuser?.resolve()) // Nutrients deplete slowly if(bio_boosted) - adjust_plant_nutriments((reagents.total_volume * ((nutriment_drain_precent * 0.2) * 0.01))) + adjust_plant_nutriments(max(reagents.total_volume * ((nutriment_drain_precent * 0.2) * 0.01), 0.05)) else - adjust_plant_nutriments((reagents.total_volume * (nutriment_drain_precent * 0.01))) + adjust_plant_nutriments(max(reagents.total_volume * (nutriment_drain_precent * 0.01), 0.05)) /** * Photosynthesis @@ -367,7 +369,6 @@ if(age > (myseed.lifespan - repeated_harvest)) adjust_plant_health(-rand(1,5) / rating) - var/growth_mult = (1.01 ** -myseed.maturation) // Harvest code if(growth >= myseed.harvest_age * growth_mult) //if(myseed.harvest_age < age * max(myseed.production * 0.044, 0.5) && (myseed.harvest_age) < (age - lastproduce) * max(myseed.production * 0.044, 0.5) && (!harvest && !dead)) diff --git a/monkestation/code/modules/hydroponics/seeds.dm b/monkestation/code/modules/hydroponics/seeds.dm index bc1de174a79f..b271390e939c 100644 --- a/monkestation/code/modules/hydroponics/seeds.dm +++ b/monkestation/code/modules/hydroponics/seeds.dm @@ -76,6 +76,9 @@ for(var/g in genes) var/datum/plant_gene/G = g S.genes += G.Copy() + + for(var/datum/plant_gene/trait/traits in S.genes) + traits.on_new_seed(S) // Copy all the stats S.set_lifespan(lifespan) S.set_endurance(endurance)