Skip to content

Commit 0bb653b

Browse files
committed
visible_stages
1 parent bda87f8 commit 0bb653b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

code/modules/hydroponics/hydro_tray.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
var/harvest = 0 // Is it ready to harvest?
3232
var/age = 0 // Current plant age
3333
var/sampled = 0 // Have we taken a sample?
34+
var/growth_level = 0
3435

3536
// Harvest/mutation mods.
3637
var/list/mutation_levels = list() // Increases as mutagenic compounds are added, determines potency of resulting mutation when it's called.
@@ -136,6 +137,7 @@
136137
seed = null
137138
dead = 0
138139
age = 0
140+
growth_level = 0
139141
sampled = 0
140142
harvest = 0
141143
improper_light = 0

code/modules/hydroponics/hydro_tray_process.dm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
else
5959
if(prob(80))
6060
age += 1 * HYDRO_SPEED_MULTIPLIER
61-
update_icon_after_process = 1
61+
update_icon_after_process = 1
6262

6363
//Highly mutable plants have a chance of mutating every tick.
6464
if(seed.immutable == -1)
@@ -210,7 +210,12 @@
210210
plant_appearance = "harvest"
211211
else if(age < seed.maturation)
212212
var/t_growthstate = clamp(1+round((age * seed.growth_stages) / seed.maturation),1,seed.growth_stages)
213-
plant_appearance = "stage-[t_growthstate]"
213+
if (t_growthstate > growth_level)
214+
//this should give us a chance to witness stages we wouldn't otherwise see due to the plant's maturation var being inferior or equal to its growth_stages var.
215+
growth_level++
216+
if (t_growthstate > growth_level+1)
217+
growth_level++
218+
plant_appearance = "stage-[growth_level]"
214219
lastproduce = age
215220
else
216221
plant_appearance = "stage-[seed.growth_stages]"

0 commit comments

Comments
 (0)