mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Plant Age, Weeds, and Pest Tweaks
Makes plants die when they get old again. - Plants begin dying once they age past 5 times their TRAIT_MATURATION value. - This means a plant with TRAIT_MATURATION 5 will begin dying when it reaches age 26 and higher - Plant death will occur over time as it loses health each process. - Can be slightly deferred with health restoring reagents, but is unavoidable in the long run. Weed growth in trays has been returned to pre-#980 chances. - Chance for weedLevel to increase is 6% if no seed planted, 3% otherwise - With #980, this was unintentionally dropped to 5% / 1% Pest growth in trays has received a buff - Now a 5% chance per process to increase pestLevel by 0.5 - Previously was 3% chance to increase by 0.1 - Pre-#980, this was a 3% chance to increase by 1.0
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
// Weeds like water and nutrients, there's a chance the weed population will increase.
|
||||
// Bonus chance if the tray is unoccupied.
|
||||
if(waterlevel > 10 && nutrilevel > 2 && prob(isnull(seed) ? 5 : 1))
|
||||
if(waterlevel > 10 && nutrilevel > 2 && prob(isnull(seed) ? 6 : 3))
|
||||
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// There's a chance for a weed explosion to happen if the weeds take over.
|
||||
@@ -110,6 +110,11 @@
|
||||
health -= HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// Handle life and death.
|
||||
// If the plant gets too old, begin killing it each cycle
|
||||
var/lifespan = 5 * seed.get_trait(TRAIT_MATURATION)
|
||||
if(age > lifespan)
|
||||
health -= rand(5,10) * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// When the plant dies, weeds thrive and pests die off.
|
||||
check_health()
|
||||
|
||||
@@ -120,8 +125,8 @@
|
||||
harvest = 1
|
||||
lastproduce = age
|
||||
|
||||
if(prob(3)) // On each tick, there's a chance the pest population will increase
|
||||
pestlevel += 0.1 * HYDRO_SPEED_MULTIPLIER
|
||||
if(prob(5)) // On each tick, there's a chance the pest population will increase
|
||||
pestlevel += 0.5 * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// Some seeds will self-harvest if you don't keep a lid on them.
|
||||
if(seed && seed.can_self_harvest && harvest && !closed_system && prob(5))
|
||||
|
||||
Reference in New Issue
Block a user