Fixes plant analyzer not showing information about gasses consumed or released

Fixes hydroponics trays not showing sensor information when empty
This commit is contained in:
Ithalan
2016-02-13 22:05:18 +01:00
parent 8ccfcc87ca
commit 9db3c3e268
2 changed files with 42 additions and 32 deletions
+21 -21
View File
@@ -567,11 +567,10 @@
..()
if(!seed)
if(seed)
usr << "<span class='notice'>[seed.display_name] are growing here.</span>"
else
usr << "[src] is empty."
return
usr << "<span class='notice'>[seed.display_name] are growing here.</span>"
if(!Adjacent(usr))
return
@@ -579,29 +578,30 @@
usr << "Water: [round(waterlevel,0.1)]/100"
usr << "Nutrient: [round(nutrilevel,0.1)]/10"
if(weedlevel >= 5)
usr << "\The [src] is <span class='danger'>infested with weeds</span>!"
if(pestlevel >= 5)
usr << "\The [src] is <span class='danger'>infested with tiny worms</span>!"
if(dead)
usr << "<span class='danger'>The plant is dead.</span>"
else if(health <= (seed.get_trait(TRAIT_ENDURANCE)/ 2))
usr << "The plant looks <span class='danger'>unhealthy</span>."
if(seed)
if(weedlevel >= 5)
usr << "\The [src] is <span class='danger'>infested with weeds</span>!"
if(pestlevel >= 5)
usr << "\The [src] is <span class='danger'>infested with tiny worms</span>!"
if(dead)
usr << "<span class='danger'>The plant is dead.</span>"
else if(health <= (seed.get_trait(TRAIT_ENDURANCE)/ 2))
usr << "The plant looks <span class='danger'>unhealthy</span>."
if(mechanical)
var/turf/T = loc
var/datum/gas_mixture/environment
if(closed_system && (connected_port || holding))
var/environment_type
if(closed_system && (connected_port || holding) && air_contents)
environment = air_contents
if(!environment)
environment_type = "connected"
else
if(istype(T))
environment = T.return_air()
if(!environment) //We're in a crate or nullspace, bail out.
return
if(!environment) //We're in a crate or nullspace, bail out.
return
environment_type = "surrounding"
var/light_string
if(closed_system && mechanical)
@@ -615,7 +615,7 @@
light_available = 5
light_string = "a light level of [light_available] lumens"
usr << "The tray's sensor suite is reporting [light_string] and a temperature of [environment.temperature]K."
usr << "The tray's sensor suite is reporting [light_string] and a temperature of [environment.temperature]K at [environment.return_pressure()] kPa in the [environment_type] environment"
/obj/machinery/portable_atmospherics/hydroponics/verb/close_lid_verb()
set name = "Toggle Tray Lid"
@@ -623,7 +623,7 @@
set src in view(1)
if(usr.incapacitated())
return
if(ishuman(usr) || istype(usr, /mob/living/silicon/robot))
close_lid(usr)
return
+21 -11
View File
@@ -96,7 +96,7 @@
dat += "<br>This sample contains: "
for(var/datum/reagent/R in grown_reagents.reagent_list)
dat += "<br>- [R.id], [grown_reagents.get_reagent_amount(R.id)] unit(s)"
dat += "<br>- [R.name], [grown_reagents.get_reagent_amount(R.id)] unit(s)"
dat += "<h2>Other Data</h2>"
@@ -175,8 +175,12 @@
if(grown_seed.get_trait(TRAIT_PARASITE))
dat += "<br>It is capable of parisitizing and gaining sustenance from tray weeds."
/*
There's currently no code that actually changes the temperature of the local environment, so let's not show it until there is.
if(grown_seed.get_trait(TRAIT_ALTER_TEMP))
dat += "<br>It will periodically alter the local temperature by [grown_seed.get_trait(TRAIT_ALTER_TEMP)] degrees Kelvin."
*/
if(grown_seed.get_trait(TRAIT_BIOLUM))
dat += "<br>It is [grown_seed.get_trait(TRAIT_BIOLUM_COLOUR) ? "<font color='[grown_seed.get_trait(TRAIT_BIOLUM_COLOUR)]'>bio-luminescent</font>" : "bio-luminescent"]."
@@ -197,18 +201,24 @@
if(grown_seed.get_trait(TRAIT_TELEPORTING))
dat += "<br>The fruit is temporal/spatially unstable."
if(grown_seed.get_trait(TRAIT_EXUDE_GASSES))
dat += "<br>It will release gas into the environment."
if(grown_seed.get_trait(TRAIT_CONSUME_GASSES))
dat += "<br>It will remove gas from the environment."
if(grown_seed.exude_gasses && grown_seed.exude_gasses.len)
for(var/gas in grown_seed.exude_gasses)
var/amount = ""
if (grown_seed.exude_gasses[gas] > 7)
amount = "large amounts of "
else if (grown_seed.exude_gasses[gas] < 5)
amount = "small amounts of "
dat += "<br>It will release [amount][gas_data.name[gas]] into the environment."
if(grown_seed.get_trait(TRAIT_EXUDE_GASSES))
dat += "<br>It will release gas into the environment."
if(grown_seed.get_trait(TRAIT_CONSUME_GASSES))
dat += "<br>It will remove gas from the environment."
if(grown_seed.consume_gasses && grown_seed.consume_gasses.len)
for(var/gas in grown_seed.consume_gasses)
var/amount = ""
if (grown_seed.consume_gasses[gas] > 7)
amount = "large amounts of "
else if (grown_seed.consume_gasses[gas] < 5)
amount = "small amounts of "
dat += "<br>It will consume [amount][gas_data.name[gas]] from the environment."
if(dat)
last_data = dat