mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] Methane Atmogas (#11574)
Co-authored-by: Will <7099514+Willburd@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e441a92a07
commit
9a5ca42e91
@@ -1,37 +1,5 @@
|
||||
/obj/item/communicator/proc/analyze_air()
|
||||
var/list/results = list()
|
||||
var/turf/T = get_turf(src.loc)
|
||||
if(!isnull(T))
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
var/pressure = environment.return_pressure()
|
||||
var/total_moles = environment.total_moles
|
||||
if (total_moles)
|
||||
var/o2_level = environment.gas[GAS_O2]/total_moles
|
||||
var/n2_level = environment.gas[GAS_N2]/total_moles
|
||||
var/co2_level = environment.gas[GAS_CO2]/total_moles
|
||||
var/phoron_level = environment.gas[GAS_PHORON]/total_moles
|
||||
var/unknown_level = 1-(o2_level+n2_level+co2_level+phoron_level)
|
||||
|
||||
// Label is what the entry is describing
|
||||
// Type identifies which unit or other special characters to use
|
||||
// Val is the information reported
|
||||
// Bad_high/_low are the values outside of which the entry reports as dangerous
|
||||
// Poor_high/_low are the values outside of which the entry reports as unideal
|
||||
// Values were extracted from the template itself
|
||||
results = list(
|
||||
list("entry" = "Pressure", "units" = "kPa", "val" = "[round(pressure,0.1)]", "bad_high" = 120, "poor_high" = 110, "poor_low" = 95, "bad_low" = 80),
|
||||
list("entry" = "Temperature", "units" = "\u00B0" + "C", "val" = "[round(environment.temperature-T0C,0.1)]", "bad_high" = 35, "poor_high" = 25, "poor_low" = 15, "bad_low" = 5),
|
||||
list("entry" = "Oxygen", "units" = "kPa", "val" = "[round(o2_level*100,0.1)]", "bad_high" = 140, "poor_high" = 135, "poor_low" = 19, "bad_low" = 17),
|
||||
list("entry" = "Nitrogen", "units" = "kPa", "val" = "[round(n2_level*100,0.1)]", "bad_high" = 105, "poor_high" = 85, "poor_low" = 50, "bad_low" = 40),
|
||||
list("entry" = "Carbon Dioxide", "units" = "kPa", "val" = "[round(co2_level*100,0.1)]", "bad_high" = 10, "poor_high" = 5, "poor_low" = 0, "bad_low" = 0),
|
||||
list("entry" = "Phoron", "units" = "kPa", "val" = "[round(phoron_level*100,0.01)]", "bad_high" = 0.5, "poor_high" = 0, "poor_low" = 0, "bad_low" = 0),
|
||||
list("entry" = "Other", "units" = "kPa", "val" = "[round(unknown_level, 0.01)]", "bad_high" = 1, "poor_high" = 0.5, "poor_low" = 0, "bad_low" = 0)
|
||||
)
|
||||
|
||||
if(isnull(results))
|
||||
results = list(list("entry" = "pressure", "units" = "kPa", "val" = "0", "bad_high" = 120, "poor_high" = 110, "poor_low" = 95, "bad_low" = 80))
|
||||
return results
|
||||
|
||||
return get_gas_mixture_default_scan_data(get_turf(src.loc))
|
||||
|
||||
// Proc - compile_news()
|
||||
// Parameters - none
|
||||
|
||||
@@ -265,3 +265,49 @@
|
||||
/obj/item/tank/stasis/nitro_cryo/Initialize(mapload)
|
||||
. = ..()
|
||||
src.air_contents.adjust_gas_temp(GAS_N2, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*TN60C), TN60C)
|
||||
|
||||
/*
|
||||
* Methane
|
||||
*/
|
||||
/obj/item/tank/methane
|
||||
name = "methane tank"
|
||||
desc = "A tank of methane."
|
||||
icon_state = "methane"
|
||||
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
||||
|
||||
/obj/item/tank/methane/Initialize(mapload)
|
||||
. = ..()
|
||||
src.air_contents.adjust_gas(GAS_CH4, (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
|
||||
/obj/item/tank/methane/examine(mob/user)
|
||||
. = ..()
|
||||
if(loc == user && (air_contents.gas[GAS_CH4] < 10))
|
||||
. += span_danger("The meter on \the [src] indicates you are almost out of methane!")
|
||||
//playsound(user, 'sound/effects/alert.ogg', 50, 1)
|
||||
|
||||
/*
|
||||
* Emergency CO2
|
||||
*/
|
||||
/obj/item/tank/emergency/carbon_dioxide
|
||||
name = "emergency carbon dioxide tank"
|
||||
desc = "An emergency air tank hastily painted yellow."
|
||||
icon_state = "emergency_tst"
|
||||
gauge_icon = "indicator_emergency"
|
||||
|
||||
/obj/item/tank/emergency/carbon_dioxide/Initialize(mapload)
|
||||
. = ..()
|
||||
src.air_contents.adjust_gas(GAS_CO2, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
|
||||
/*
|
||||
* Emergency Methane
|
||||
*/
|
||||
/obj/item/tank/emergency/methane
|
||||
name = "emergency methane tank"
|
||||
desc = "An emergency air tank hastily painted green."
|
||||
icon_state = "emergency_methane"
|
||||
gauge_icon = "indicator_emergency"
|
||||
gauge_cap = 3
|
||||
|
||||
/obj/item/tank/emergency/methane/Initialize(mapload)
|
||||
. = ..()
|
||||
src.air_contents.adjust_gas(GAS_CH4, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
|
||||
@@ -1040,6 +1040,12 @@
|
||||
desc = "WARNING! O2 flow tube. Ensure the flow is disengaged before working."
|
||||
icon_state = "atmos_o2"
|
||||
|
||||
/obj/structure/sign/atmos_ch4
|
||||
icon = 'icons/obj/decals.dmi'
|
||||
name = "CH4 warning sign"
|
||||
desc = "WARNING! CH4 flow tube. Ensure the flow is disengaged before working."
|
||||
icon_state = "atmos_ch4"
|
||||
|
||||
/obj/structure/sign/atmos_air
|
||||
icon = 'icons/obj/decals.dmi'
|
||||
name = "Air warning sign"
|
||||
|
||||
Reference in New Issue
Block a user