diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index b401db24f9..59911fc30c 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -233,7 +233,7 @@ origin_turf.visible_message("The [thrown.name] splatters against [target]!") del(thrown) -/datum/seed/proc/handle_environment(var/turf/current_turf, var/datum/gas_mixture/environment, var/check_only) +/datum/seed/proc/handle_environment(var/turf/current_turf, var/datum/gas_mixture/environment, var/light_supplied, var/check_only) var/health_change = 0 // Handle gas consumption. @@ -261,17 +261,18 @@ // Handle gas production. if(exude_gasses && exude_gasses.len && !check_only) for(var/gas in exude_gasses) - environment.adjust_gas(gas, max(1,round((exude_gasses[gas]*get_trait(TRAIT_POTENCY))/exude_gasses.len))) + environment.adjust_gas(gas, max(1,round((exude_gasses[gas]*(get_trait(TRAIT_POTENCY)/5))/exude_gasses.len))) // Handle light requirements. - var/area/A = get_area(current_turf) - if(A) - var/light_available - if(A.lighting_use_dynamic) - light_available = max(0,min(10,current_turf.lighting_lumcount)-5) - else - light_available = 5 - if(abs(light_available - get_trait(TRAIT_IDEAL_LIGHT)) > get_trait(TRAIT_LIGHT_TOLERANCE)) + if(!light_supplied) + var/area/A = get_area(current_turf) + if(A) + if(A.lighting_use_dynamic) + light_supplied = max(0,min(10,current_turf.lighting_lumcount)-5) + else + light_supplied = 5 + if(light_supplied) + if(abs(light_supplied - get_trait(TRAIT_IDEAL_LIGHT)) > get_trait(TRAIT_LIGHT_TOLERANCE)) health_change += rand(1,3) * HYDRO_SPEED_MULTIPLIER return health_change diff --git a/code/modules/hydroponics/spreading/spreading_growth.dm b/code/modules/hydroponics/spreading/spreading_growth.dm index 63db3e6799..2b3c6b85cd 100644 --- a/code/modules/hydroponics/spreading/spreading_growth.dm +++ b/code/modules/hydroponics/spreading/spreading_growth.dm @@ -30,7 +30,7 @@ // Handle life. var/turf/simulated/T = get_turf(src) if(istype(T)) - health -= seed.handle_environment(T, T.return_air(),1) + health -= seed.handle_environment(T,T.return_air(),null,1) if(health < max_health) health += rand(3,5) refresh_icon() diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm index 85ff118868..968d707472 100644 --- a/code/modules/hydroponics/trays/tray.dm +++ b/code/modules/hydroponics/trays/tray.dm @@ -27,6 +27,7 @@ var/mutation_mod = 0 // Modifier to mutation chance var/toxins = 0 // Toxicity in the tray? var/mutation_level = 0 // When it hits 100, the plant mutates. + var/tray_light = 1 // Supplied lighting. // Mechanical concerns. var/health = 0 // Plant health. @@ -350,6 +351,14 @@ return /obj/machinery/portable_atmospherics/hydroponics/verb/set_light() + set name = "Set Light" + set category = "Object" + set src in view(1) + + var/new_light = input("Specify a light level.") as null|anything in list(0,1,2,3,4,5,6,7,8,9,10) + if(new_light) + tray_light = new_light + usr << "You set the tray to a light level of [tray_light] lumens." /obj/machinery/portable_atmospherics/hydroponics/proc/check_level_sanity() //Make sure various values are sane. diff --git a/code/modules/hydroponics/trays/tray_process.dm b/code/modules/hydroponics/trays/tray_process.dm index f1199c780d..280ce9e6d6 100644 --- a/code/modules/hydroponics/trays/tray_process.dm +++ b/code/modules/hydroponics/trays/tray_process.dm @@ -60,7 +60,6 @@ // Check that pressure, heat and light are all within bounds. // First, handle an open system or an unconnected closed system. - var/turf/T = loc var/datum/gas_mixture/environment // If we're closed, take from our internal sources. @@ -71,7 +70,10 @@ if(!environment) return // Seed datum handles gasses, light and pressure. - health -= seed.handle_environment(T,environment) + if(mechanical && closed_system) + health -= seed.handle_environment(T,environment,tray_light) + else + health -= seed.handle_environment(T,environment) // If we're attached to a pipenet, then we should let the pipenet know we might have modified some gasses if (closed_system && connected_port) diff --git a/code/modules/hydroponics/trays/tray_soil.dm b/code/modules/hydroponics/trays/tray_soil.dm index d3a82ba383..ff8e3e23df 100644 --- a/code/modules/hydroponics/trays/tray_soil.dm +++ b/code/modules/hydroponics/trays/tray_soil.dm @@ -4,6 +4,7 @@ density = 0 use_power = 0 mechanical = 0 + tray_light = 0 /obj/machinery/portable_atmospherics/hydroponics/soil/attackby(var/obj/item/O as obj, var/mob/user as mob) if(istype(O,/obj/item/weapon/tank)) @@ -15,6 +16,7 @@ ..() verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/close_lid_verb verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/remove_label + verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/set_light /obj/machinery/portable_atmospherics/hydroponics/soil/CanPass() return 1