mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-16 02:24:11 +01:00
Merge pull request #14120 from duncathan/listmos
[READY] Listmos & "Datum Gases"
This commit is contained in:
@@ -163,9 +163,12 @@
|
||||
T.air_update_turf()
|
||||
for(var/obj/effect/hotspot/H in T)
|
||||
qdel(H)
|
||||
if(G.toxins)
|
||||
G.nitrogen += (G.toxins)
|
||||
G.toxins = 0
|
||||
var/list/G_gases = G.gases
|
||||
if(G_gases["plasma"])
|
||||
G.assert_gas("n2")
|
||||
G_gases["n2"][MOLES] += (G_gases["plasma"][MOLES])
|
||||
G_gases["plasma"][MOLES] = 0
|
||||
G.garbage_collect()
|
||||
for(var/obj/machinery/atmospherics/components/unary/U in T)
|
||||
if(!isnull(U.welded) && !U.welded) //must be an unwelded vent pump or vent scrubber.
|
||||
U.welded = 1
|
||||
|
||||
@@ -414,6 +414,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
dat += "Unable to obtain a reading.<br>"
|
||||
else
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
var/list/env_gases = environment.gases
|
||||
|
||||
var/pressure = environment.return_pressure()
|
||||
var/total_moles = environment.total_moles()
|
||||
@@ -421,17 +422,11 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
dat += "Air Pressure: [round(pressure,0.1)] kPa<br>"
|
||||
|
||||
if (total_moles)
|
||||
var/o2_level = environment.oxygen/total_moles
|
||||
var/n2_level = environment.nitrogen/total_moles
|
||||
var/co2_level = environment.carbon_dioxide/total_moles
|
||||
var/plasma_level = environment.toxins/total_moles
|
||||
var/unknown_level = 1-(o2_level+n2_level+co2_level+plasma_level)
|
||||
dat += "Nitrogen: [round(n2_level*100)]%<br>"
|
||||
dat += "Oxygen: [round(o2_level*100)]%<br>"
|
||||
dat += "Carbon Dioxide: [round(co2_level*100)]%<br>"
|
||||
dat += "Plasma: [round(plasma_level*100)]%<br>"
|
||||
if(unknown_level > 0.01)
|
||||
dat += "OTHER: [round(unknown_level)]%<br>"
|
||||
for(var/id in env_gases)
|
||||
var/gas_level = env_gases[id][MOLES]/total_moles
|
||||
if(id in hardcoded_gases || gas_level > 0.01)
|
||||
dat += "[env_gases[id][GAS_NAME]]: [round(gas_level*100)]%<br>"
|
||||
|
||||
dat += "Temperature: [round(environment.temperature-T0C)]°C<br>"
|
||||
dat += "<br>"
|
||||
|
||||
|
||||
@@ -271,12 +271,15 @@ MASS SPECTROMETER
|
||||
else
|
||||
user << "<span class='alert'>Pressure: [round(pressure,0.1)] kPa</span>"
|
||||
if(total_moles)
|
||||
var/o2_concentration = environment.oxygen/total_moles
|
||||
var/n2_concentration = environment.nitrogen/total_moles
|
||||
var/co2_concentration = environment.carbon_dioxide/total_moles
|
||||
var/plasma_concentration = environment.toxins/total_moles
|
||||
var/list/env_gases = environment.gases
|
||||
|
||||
environment.assert_gases(arglist(hardcoded_gases))
|
||||
var/o2_concentration = env_gases["o2"][MOLES]/total_moles
|
||||
var/n2_concentration = env_gases["n2"][MOLES]/total_moles
|
||||
var/co2_concentration = env_gases["co2"][MOLES]/total_moles
|
||||
var/plasma_concentration = env_gases["plasma"][MOLES]/total_moles
|
||||
environment.garbage_collect()
|
||||
|
||||
var/unknown_concentration = 1-(o2_concentration+n2_concentration+co2_concentration+plasma_concentration)
|
||||
if(abs(n2_concentration - N2STANDARD) < 20)
|
||||
user << "<span class='info'>Nitrogen: [round(n2_concentration*100)] %</span>"
|
||||
else
|
||||
@@ -295,9 +298,11 @@ MASS SPECTROMETER
|
||||
if(plasma_concentration > 0.01)
|
||||
user << "<span class='info'>Plasma: [round(plasma_concentration*100)] %</span>"
|
||||
|
||||
if(unknown_concentration > 0.01)
|
||||
user << "<span class='alert'>Unknown: [round(unknown_concentration*100)] %</span>"
|
||||
|
||||
for(var/id in env_gases)
|
||||
if(id in hardcoded_gases)
|
||||
continue
|
||||
var/gas_concentration = env_gases[id][MOLES]/total_moles
|
||||
user << "<span class='alert'>[env_gases[id][GAS_NAME]]: [round(gas_concentration*100)] %</span>"
|
||||
user << "<span class='info'>Temperature: [round(environment.temperature-T0C)] °C</span>"
|
||||
|
||||
|
||||
|
||||
@@ -239,8 +239,9 @@
|
||||
|
||||
/obj/effect/chrono_field/return_air() //we always have nominal air and temperature
|
||||
var/datum/gas_mixture/GM = new
|
||||
GM.oxygen = MOLES_O2STANDARD
|
||||
GM.nitrogen = MOLES_N2STANDARD
|
||||
GM.assert_gases("o2","n2")
|
||||
GM.gases["o2"][MOLES] = MOLES_O2STANDARD
|
||||
GM.gases["n2"][MOLES] = MOLES_N2STANDARD
|
||||
GM.temperature = T20C
|
||||
return GM
|
||||
|
||||
|
||||
@@ -198,7 +198,8 @@
|
||||
//TODO: DEFERRED Consider checking to make sure tank pressure is high enough before doing this...
|
||||
//Transfer 5% of current tank air contents to turf
|
||||
var/datum/gas_mixture/air_transfer = ptank.air_contents.remove_ratio(release_amount)
|
||||
air_transfer.toxins = air_transfer.toxins * 5
|
||||
if(air_transfer.gases["plasma"])
|
||||
air_transfer.gases["plasma"][MOLES] *= 5
|
||||
target.assume_air(air_transfer)
|
||||
//Burn it based on transfered gas
|
||||
target.hotspot_expose((ptank.air_contents.temperature*2) + 380,500)
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
var/datum/gas_mixture/G = src.air_contents.remove(num)
|
||||
|
||||
var/allgases = G.carbon_dioxide + G.nitrogen + G.oxygen + G.toxins //fuck trace gases -Pete
|
||||
var/allgases = G.total_moles()
|
||||
if(allgases >= 0.005)
|
||||
return 1
|
||||
|
||||
@@ -73,7 +73,8 @@
|
||||
|
||||
/obj/item/weapon/tank/jetpack/void/New()
|
||||
..()
|
||||
air_contents.oxygen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.assert_gas("o2")
|
||||
air_contents.gases["o2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
|
||||
|
||||
/obj/item/weapon/tank/jetpack/oxygen
|
||||
@@ -84,7 +85,8 @@
|
||||
|
||||
/obj/item/weapon/tank/jetpack/oxygen/New()
|
||||
..()
|
||||
air_contents.oxygen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.assert_gas("o2")
|
||||
air_contents.gases["o2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
|
||||
/obj/item/weapon/tank/jetpack/oxygen/harness
|
||||
name = "jet harness (oxygen)"
|
||||
@@ -114,7 +116,8 @@
|
||||
..()
|
||||
ion_trail = new /datum/effect_system/trail_follow/ion()
|
||||
ion_trail.set_up(src)
|
||||
air_contents.carbon_dioxide = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.assert_gas("co2")
|
||||
air_contents.gases["co2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
|
||||
|
||||
/obj/item/weapon/tank/jetpack/suit
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
|
||||
/obj/item/weapon/tank/internals/oxygen/New()
|
||||
..()
|
||||
src.air_contents.oxygen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.assert_gas("o2")
|
||||
air_contents.gases["o2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
|
||||
@@ -45,13 +46,9 @@
|
||||
|
||||
/obj/item/weapon/tank/internals/anesthetic/New()
|
||||
..()
|
||||
|
||||
src.air_contents.oxygen = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
|
||||
var/datum/gas/sleeping_agent/trace_gas = new()
|
||||
trace_gas.moles = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
|
||||
src.air_contents.trace_gases += trace_gas
|
||||
air_contents.assert_gases("o2", "n2o")
|
||||
air_contents.gases["o2"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
air_contents.gases["n2o"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
return
|
||||
|
||||
/*
|
||||
@@ -66,9 +63,9 @@
|
||||
|
||||
/obj/item/weapon/tank/internals/air/New()
|
||||
..()
|
||||
|
||||
src.air_contents.oxygen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
src.air_contents.nitrogen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
air_contents.assert_gases("o2","n2")
|
||||
air_contents.gases["o2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
air_contents.gases["n2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
return
|
||||
|
||||
|
||||
@@ -86,8 +83,8 @@
|
||||
|
||||
/obj/item/weapon/tank/internals/plasma/New()
|
||||
..()
|
||||
|
||||
src.air_contents.toxins = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.assert_gas("plasma")
|
||||
air_contents.gases["plasma"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
/obj/item/weapon/tank/internals/plasma/attackby(obj/item/weapon/W, mob/user, params)
|
||||
@@ -105,7 +102,8 @@
|
||||
|
||||
/obj/item/weapon/tank/internals/plasma/full/New()
|
||||
..()
|
||||
src.air_contents.toxins = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.assert_gas("plasma")
|
||||
air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
|
||||
@@ -120,14 +118,14 @@
|
||||
|
||||
/obj/item/weapon/tank/internals/plasmaman/New()
|
||||
..()
|
||||
|
||||
src.air_contents.toxins = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.assert_gas("plasma")
|
||||
air_contents.gases["plasma"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
/obj/item/weapon/tank/internals/plasmaman/full/New()
|
||||
..()
|
||||
|
||||
src.air_contents.toxins = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.assert_gas("plasma")
|
||||
air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
|
||||
@@ -139,8 +137,8 @@
|
||||
|
||||
/obj/item/weapon/tank/internals/plasmaman/belt/full/New()
|
||||
..()
|
||||
|
||||
src.air_contents.toxins = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.assert_gas("plasma")
|
||||
air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
|
||||
@@ -162,7 +160,8 @@
|
||||
|
||||
/obj/item/weapon/tank/internals/emergency_oxygen/New()
|
||||
..()
|
||||
src.air_contents.oxygen = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.assert_gas("o2")
|
||||
air_contents.gases["o2"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
/obj/item/weapon/tank/internals/emergency_oxygen/engi
|
||||
|
||||
@@ -64,15 +64,14 @@
|
||||
|
||||
/obj/structure/closet/crate/freezer/return_air()
|
||||
var/datum/gas_mixture/gas = (..())
|
||||
if(!gas) return null
|
||||
if(!gas)
|
||||
return null
|
||||
|
||||
var/datum/gas_mixture/newgas = new/datum/gas_mixture()
|
||||
newgas.oxygen = gas.oxygen
|
||||
newgas.carbon_dioxide = gas.carbon_dioxide
|
||||
newgas.nitrogen = gas.nitrogen
|
||||
newgas.toxins = gas.toxins
|
||||
newgas.volume = gas.volume
|
||||
newgas.temperature = gas.temperature
|
||||
if(newgas.temperature <= target_temp) return
|
||||
newgas.copy_from(gas)
|
||||
|
||||
if(newgas.temperature <= target_temp)
|
||||
return
|
||||
|
||||
if((newgas.temperature - cooling_power) > target_temp)
|
||||
newgas.temperature -= cooling_power
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
/obj/structure/transit_tube_pod/New(loc)
|
||||
..(loc)
|
||||
|
||||
air_contents.oxygen = MOLES_O2STANDARD * 2
|
||||
air_contents.nitrogen = MOLES_N2STANDARD
|
||||
air_contents.assert_gases("o2", "n2")
|
||||
air_contents.gases["o2"][MOLES] = MOLES_O2STANDARD * 2
|
||||
air_contents.gases["n2"][MOLES] = MOLES_N2STANDARD
|
||||
air_contents.temperature = T20C
|
||||
|
||||
// Give auto tubes time to align before trying to start moving
|
||||
@@ -124,11 +125,7 @@
|
||||
// datum, there might be problems if I don't...
|
||||
/obj/structure/transit_tube_pod/return_air()
|
||||
var/datum/gas_mixture/GM = new()
|
||||
GM.oxygen = air_contents.oxygen
|
||||
GM.carbon_dioxide = air_contents.carbon_dioxide
|
||||
GM.nitrogen = air_contents.nitrogen
|
||||
GM.toxins = air_contents.toxins
|
||||
GM.temperature = air_contents.temperature
|
||||
GM.copy_from(air_contents)
|
||||
return GM
|
||||
|
||||
// For now, copying what I found in an unused FEA file (and almost identical in a
|
||||
|
||||
Reference in New Issue
Block a user