Buffs atmospheric analyzers to show mole count, volume and higher degrees of precision (#37631)

add: Analyzers can now scan all kinds of atmospheric machinery - unary, binary, ternary, quaternary, you name it. This means stuff like gas pumps, gas mixers, vents and so forth can be analyzed.

tweak: Analyzers now show temperature in kelvin as well as celsius.

tweak: Analyzers now show total mole count, volume, and mole count of all gases.

tweak: Analyzers show everything at slightly higher degrees of precision.


More accurate and advanced analyzers have been something that I think atmos and toxins mains have been wanting for a while now (including myself). It's always a pain to have to manually add 273.15 to every celsius temperature, or have to use outside tools or VV (which isnt usable in actual games) to calculate mole count for a gas mixture. Not to mention, the ability to analyze things like volume pumps and gas filters makes it easier to manage larger atmos setups. This is just a QoL change for people in any of those jobs. In fact, most players probably don't even know what the fuck is a mole is so adding mole readout to analyzers is a good way to get people to understand atmospherics better.
This commit is contained in:
cyclowns
2018-05-22 22:11:23 -05:00
committed by letterjay
parent 292c5dfa96
commit f37865ee6c
18 changed files with 102 additions and 94 deletions
-22
View File
@@ -882,28 +882,6 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list(
/proc/format_text(text)
return replacetext(replacetext(text,"\proper ",""),"\improper ","")
/obj/proc/atmosanalyzer_scan(datum/gas_mixture/air_contents, mob/user, obj/target = src)
var/obj/icon = target
user.visible_message("[user] has used the analyzer on [icon2html(icon, viewers(src))] [target].", "<span class='notice'>You use the analyzer on [icon2html(icon, user)] [target].</span>")
var/pressure = air_contents.return_pressure()
var/total_moles = air_contents.total_moles()
to_chat(user, "<span class='notice'>Results of analysis of [icon2html(icon, user)] [target].</span>")
if(total_moles>0)
to_chat(user, "<span class='notice'>Pressure: [round(pressure,0.1)] kPa</span>")
var/list/cached_gases = air_contents.gases
for(var/id in cached_gases)
var/gas_concentration = cached_gases[id][MOLES]/total_moles
if((id in GLOB.hardcoded_gases) || gas_concentration > 0.001) //ensures the four primary gases are always shown.
to_chat(user, "<span class='notice'>[cached_gases[id][GAS_META][META_GAS_NAME]]: [round(gas_concentration*100, 0.01)] %</span>")
to_chat(user, "<span class='notice'>Temperature: [round(air_contents.temperature-T0C)] &deg;C</span>")
else
to_chat(user, "<span class='notice'>[target] is empty!</span>")
return
/proc/check_target_facings(mob/living/initator, mob/living/target)
/*This can be used to add additional effects on interactions between mobs depending on how the mobs are facing each other, such as adding a crit damage to blows to the back of a guy's head.
Given how click code currently works (Nov '13), the initiating mob will be facing the target mob most of the time