Exoplanet Random Plants (#17967)

* icons

* and now, we suffer

* i keep screaming but god wont answer

* adapt seed

* Update code/modules/hydroponics/trays/tray_update_icons.dm

Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>

* Update code/modules/hydroponics/trays/tray_update_icons.dm

Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>

* Update code/modules/hydroponics/trays/tray_update_icons.dm

Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>

* Update code/modules/hydroponics/trays/tray_update_icons.dm

Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>

* addresses requested changes

---------

Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>
This commit is contained in:
RustingWithYou
2023-12-19 11:45:10 +00:00
committed by GitHub
co-authored by Matt Atlas
parent 9a0d640f3f
commit 6f9140382f
26 changed files with 242 additions and 66 deletions
+12 -27
View File
@@ -43,7 +43,7 @@
opacity = 0
density = 0
icon = 'icons/obj/hydroponics_growing.dmi'
icon_state = "bush4-1"
icon_state = ""
layer = 3
movable_flags = MOVABLE_FLAG_PROXMOVE
pass_flags = PASSTABLE
@@ -100,18 +100,10 @@
name = seed.display_name
max_health = round(seed.get_trait(TRAIT_ENDURANCE)/2)
if(seed.get_trait(TRAIT_SPREAD)==2)
if(seed.get_trait(TRAIT_SPREAD)==GROWTH_VINES)
max_growth = VINE_GROWTH_STAGES
growth_threshold = max_health/VINE_GROWTH_STAGES
icon = 'icons/obj/hydroponics_vines.dmi'
growth_type = 2 // Vines by default.
if(seed.get_trait(TRAIT_CARNIVOROUS) == 2)
growth_type = 1 // WOOOORMS.
else if(!(seed.seed_noun in list(SEED_NOUN_SEEDS,SEED_NOUN_PITS)))
if(seed.seed_noun == SEED_NOUN_NODES)
growth_type = 3 // Biomass
else
growth_type = 4 // Mold
growth_type = seed.get_growth_type()
else
max_growth = seed.growth_stages
growth_threshold = max_health/seed.growth_stages
@@ -123,7 +115,7 @@
mature_time = world.time + seed.get_trait(TRAIT_MATURATION) + 15 //prevent vines from maturing until at least a few seconds after they've been created.
spread_chance = seed.get_trait(TRAIT_POTENCY)
spread_distance = ((growth_type > 0) ? round(spread_chance * 0.6) : round(spread_chance * 0.3))
spread_distance = (growth_type ? round(spread_chance * 0.6) : round(spread_chance * 0.3))
update_icon()
addtimer(CALLBACK(src, PROC_REF(post_initialize)), 1)
@@ -140,7 +132,7 @@
/obj/effect/plant/update_icon()
//TODO: should really be caching this.
refresh_icon()
if(growth_type == 0 && !floor)
if(!growth_type && !floor)
src.transform = null
var/matrix/M = matrix()
// should make the plant flush against the wall it's meant to be growing from.
@@ -172,6 +164,7 @@
last_biolum = null
/obj/effect/plant/proc/refresh_icon()
overlays.Cut()
var/growth = 0
if(growth_threshold)
growth = min(max_growth,round(health/growth_threshold))
@@ -181,25 +174,17 @@
max_growth--
if(at_fringe >= (spread_distance-2))
max_growth--
max_growth = max(1,max_growth)
if(growth_type > 0)
switch(growth_type)
if(1)
icon_state = "worms"
if(2)
icon_state = "vines-[growth]"
if(3)
icon_state = "mass-[growth]"
if(4)
icon_state = "mold-[growth]"
else
icon_state = "[seed.get_trait(TRAIT_PLANT_ICON)]-[growth]"
if(growth>2 && growth == max_growth)
layer = (seed && seed.force_layer) ? seed.force_layer : 5
opacity = 1
if(growth_type in list(GROWTH_VINES,GROWTH_BIOMASS))
opacity = 1
if(islist(seed.chems) && !isnull(seed.chems[/singleton/reagent/woodpulp]))
opacity = 1
density = 1
if(seed.get_trait(TRAIT_LARGE))
density = 1
opacity = 1
else
layer = (seed && seed.force_layer) ? seed.force_layer : 5
density = 0