mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 03:55:11 +01:00
Merge pull request #14120 from duncathan/listmos
[READY] Listmos & "Datum Gases"
This commit is contained in:
@@ -194,12 +194,12 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/env = T.return_air()
|
||||
var/list/env_gases = env.gases
|
||||
|
||||
var/t = ""
|
||||
t+= "Nitrogen : [env.nitrogen]\n"
|
||||
t+= "Oxygen : [env.oxygen]\n"
|
||||
t+= "Plasma : [env.toxins]\n"
|
||||
t+= "CO2: [env.carbon_dioxide]\n"
|
||||
for(var/id in env_gases)
|
||||
if(id in hardcoded_gases || env_gases[id][MOLES])
|
||||
t+= "[env_gases[id][GAS_NAME]] : [env_gases[id][MOLES]]\n"
|
||||
|
||||
usr << t
|
||||
feedback_add_details("admin_verb","ASL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -638,7 +638,8 @@ var/global/list/g_fancy_list_of_types = null
|
||||
if(Rad.anchored)
|
||||
if(!Rad.P)
|
||||
var/obj/item/weapon/tank/internals/plasma/Plasma = new/obj/item/weapon/tank/internals/plasma(Rad)
|
||||
Plasma.air_contents.toxins = 70
|
||||
Plasma.air_contents.assert_gas("plasma")
|
||||
Plasma.air_contents.gases["plasma"][MOLES] = 70
|
||||
Rad.drainratio = 0
|
||||
Rad.P = Plasma
|
||||
Plasma.loc = Rad
|
||||
|
||||
@@ -6,15 +6,17 @@
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/GM = target.return_air()
|
||||
var/list/GM_gases
|
||||
var/burning = 0
|
||||
if(istype(target, /turf/simulated))
|
||||
var/turf/simulated/T = target
|
||||
if(T.active_hotspot)
|
||||
burning = 1
|
||||
|
||||
usr << "<span class='adminnotice'>@[target.x],[target.y]: O:[GM.oxygen] T:[GM.toxins] N:[GM.nitrogen] C:[GM.carbon_dioxide] w [GM.temperature] Kelvin, [GM.return_pressure()] kPa [(burning)?("\red BURNING"):(null)]</span>"
|
||||
for(var/datum/gas/trace_gas in GM.trace_gases)
|
||||
usr << "[trace_gas.type]: [trace_gas.moles]"
|
||||
usr << "<span class='adminnotice'>@[target.x],[target.y]: [GM.temperature] Kelvin, [GM.return_pressure()] kPa [(burning)?("\red BURNING"):(null)]</span>"
|
||||
for(var/id in GM_gases)
|
||||
if(id in hardcoded_gases || GM_gases[id][MOLES])
|
||||
usr << "[GM_gases[id][GAS_NAME]]: [GM_gases[id][MOLES]]"
|
||||
feedback_add_details("admin_verb","DAST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/fix_next_move()
|
||||
|
||||
@@ -108,7 +108,10 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/tank/proc/ignite() //This happens when a bomb is told to explode
|
||||
var/fuel_moles = air_contents.toxins + air_contents.oxygen/6
|
||||
air_contents.assert_gases("plasma", "o2")
|
||||
var/fuel_moles = air_contents.gases["plasma"][MOLES] + air_contents.gases["o2"][MOLES]/6
|
||||
air_contents.garbage_collect()
|
||||
|
||||
var/strength = 1
|
||||
|
||||
var/turf/ground_zero = get_turf(loc)
|
||||
|
||||
@@ -228,7 +228,10 @@
|
||||
var/turf/simulated/floor/T = holder.loc
|
||||
if(istype(T))
|
||||
var/datum/gas_mixture/GM = T.air
|
||||
GM.oxygen = max(0, GM.oxygen - severity * holder.energy)
|
||||
if(!GM.gases["o2"])
|
||||
return
|
||||
GM.gases["o2"][MOLES] -= severity * holder.energy
|
||||
GM.garbage_collect()
|
||||
|
||||
/datum/spacevine_mutation/nitro_eater
|
||||
name = "nitrogen consuming"
|
||||
@@ -240,7 +243,10 @@
|
||||
var/turf/simulated/floor/T = holder.loc
|
||||
if(istype(T))
|
||||
var/datum/gas_mixture/GM = T.air
|
||||
GM.nitrogen = max(0, GM.nitrogen - severity * holder.energy)
|
||||
if(!GM.gases["n2"])
|
||||
return
|
||||
GM.gases["n2"][MOLES] -= severity * holder.energy
|
||||
GM.garbage_collect()
|
||||
|
||||
/datum/spacevine_mutation/carbondioxide_eater
|
||||
name = "CO2 consuming"
|
||||
@@ -252,7 +258,10 @@
|
||||
var/turf/simulated/floor/T = holder.loc
|
||||
if(istype(T))
|
||||
var/datum/gas_mixture/GM = T.air
|
||||
GM.carbon_dioxide = max(0, GM.carbon_dioxide - severity * holder.energy)
|
||||
if(!GM.gases["co2"])
|
||||
return
|
||||
GM.gases["co2"][MOLES] -= severity * holder.energy
|
||||
GM.garbage_collect()
|
||||
|
||||
/datum/spacevine_mutation/plasma_eater
|
||||
name = "toxins consuming"
|
||||
@@ -264,7 +273,10 @@
|
||||
var/turf/simulated/floor/T = holder.loc
|
||||
if(istype(T))
|
||||
var/datum/gas_mixture/GM = T.air
|
||||
GM.toxins = max(0, GM.toxins - severity * holder.energy)
|
||||
if(!GM.gases["plasma"])
|
||||
return
|
||||
GM.gases["plasma"][MOLES] -= severity * holder.energy
|
||||
GM.garbage_collect()
|
||||
|
||||
/datum/spacevine_mutation/thorns
|
||||
name = "thorny"
|
||||
|
||||
@@ -258,11 +258,7 @@
|
||||
A.nitrogen = 82
|
||||
A.carbon_dioxide = 0
|
||||
A.toxins = 0
|
||||
A.air.oxygen = 21
|
||||
A.air.carbon_dioxide = 0
|
||||
A.air.nitrogen = 82
|
||||
A.air.toxins = 0
|
||||
A.air.temperature = 293.15
|
||||
A.air.copy_from_turf(A)
|
||||
SSair.add_to_active(A)
|
||||
A.overlays.Cut()
|
||||
var/area/Z = get_area(A)
|
||||
|
||||
@@ -9,22 +9,27 @@
|
||||
|
||||
var/toxins_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
var/list/breath_gases = breath.gases
|
||||
|
||||
breath.assert_gases("plasma", "o2")
|
||||
|
||||
//Partial pressure of the toxins in our breath
|
||||
var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure
|
||||
var/Toxins_pp = (breath_gases["plasma"][MOLES]/breath.total_moles())*breath_pressure
|
||||
|
||||
if(Toxins_pp) // Detect toxins in air
|
||||
adjustPlasma(breath.toxins*250)
|
||||
adjustPlasma(breath_gases["plasma"][MOLES]*250)
|
||||
throw_alert("alien_tox", /obj/screen/alert/alien_tox)
|
||||
|
||||
toxins_used = breath.toxins
|
||||
toxins_used = breath_gases["plasma"][MOLES]
|
||||
|
||||
else
|
||||
clear_alert("alien_tox")
|
||||
|
||||
//Breathe in toxins and out oxygen
|
||||
breath.toxins -= toxins_used
|
||||
breath.oxygen += toxins_used
|
||||
breath_gases["plasma"][MOLES] -= toxins_used
|
||||
breath_gases["o2"][MOLES] += toxins_used
|
||||
|
||||
breath.garbage_collect()
|
||||
|
||||
//BREATH TEMPERATURE
|
||||
handle_breath_temperature(breath)
|
||||
|
||||
@@ -1168,10 +1168,14 @@
|
||||
|
||||
var/gas_breathed = 0
|
||||
|
||||
var/list/breath_gases = breath.gases
|
||||
|
||||
breath.assert_gases("o2", "plasma", "co2", "n2o")
|
||||
|
||||
//Partial pressures in our breath
|
||||
var/O2_pp = breath.get_breath_partial_pressure(breath.oxygen)
|
||||
var/Toxins_pp = breath.get_breath_partial_pressure(breath.toxins)
|
||||
var/CO2_pp = breath.get_breath_partial_pressure(breath.carbon_dioxide)
|
||||
var/O2_pp = breath.get_breath_partial_pressure(breath_gases["o2"][MOLES])
|
||||
var/Toxins_pp = breath.get_breath_partial_pressure(breath_gases["plasma"][MOLES])
|
||||
var/CO2_pp = breath.get_breath_partial_pressure(breath_gases["co2"][MOLES])
|
||||
|
||||
|
||||
//-- OXY --//
|
||||
@@ -1179,7 +1183,7 @@
|
||||
//Too much oxygen! //Yes, some species may not like it.
|
||||
if(safe_oxygen_max)
|
||||
if(O2_pp > safe_oxygen_max && !(NOBREATH in specflags))
|
||||
var/ratio = (breath.oxygen/safe_oxygen_max) * 10
|
||||
var/ratio = (breath_gases["o2"][MOLES]/safe_oxygen_max) * 10
|
||||
H.adjustOxyLoss(Clamp(ratio,oxy_breath_dam_min,oxy_breath_dam_max))
|
||||
H.throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy)
|
||||
else
|
||||
@@ -1188,17 +1192,17 @@
|
||||
//Too little oxygen!
|
||||
if(safe_oxygen_min)
|
||||
if(O2_pp < safe_oxygen_min)
|
||||
gas_breathed = handle_too_little_breath(H,O2_pp,safe_oxygen_min,breath.oxygen)
|
||||
gas_breathed = handle_too_little_breath(H,O2_pp,safe_oxygen_min,breath_gases["o2"][MOLES])
|
||||
H.throw_alert("oxy", /obj/screen/alert/oxy)
|
||||
else
|
||||
H.failed_last_breath = 0
|
||||
H.adjustOxyLoss(-5)
|
||||
gas_breathed = breath.oxygen/6
|
||||
gas_breathed = breath_gases["o2"][MOLES]/6
|
||||
H.clear_alert("oxy")
|
||||
|
||||
//Exhale
|
||||
breath.oxygen -= gas_breathed
|
||||
breath.carbon_dioxide += gas_breathed
|
||||
breath_gases["o2"][MOLES] -= gas_breathed
|
||||
breath_gases["co2"][MOLES] += gas_breathed
|
||||
gas_breathed = 0
|
||||
|
||||
|
||||
@@ -1225,17 +1229,17 @@
|
||||
//Too little CO2!
|
||||
if(safe_co2_min)
|
||||
if(CO2_pp < safe_co2_min)
|
||||
gas_breathed = handle_too_little_breath(H,CO2_pp, safe_co2_min,breath.carbon_dioxide)
|
||||
gas_breathed = handle_too_little_breath(H,CO2_pp, safe_co2_min,breath_gases["co2"][MOLES])
|
||||
H.throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2)
|
||||
else
|
||||
H.failed_last_breath = 0
|
||||
H.adjustOxyLoss(-5)
|
||||
gas_breathed = breath.carbon_dioxide/6
|
||||
gas_breathed = breath_gases["co2"][MOLES]/6
|
||||
H.clear_alert("not_enough_co2")
|
||||
|
||||
//Exhale
|
||||
breath.carbon_dioxide -= gas_breathed
|
||||
breath.oxygen += gas_breathed
|
||||
breath_gases["co2"][MOLES] -= gas_breathed
|
||||
breath_gases["o2"][MOLES] += gas_breathed
|
||||
gas_breathed = 0
|
||||
|
||||
|
||||
@@ -1244,7 +1248,7 @@
|
||||
//Too much toxins!
|
||||
if(safe_toxins_max)
|
||||
if(Toxins_pp > safe_toxins_max && !(NOBREATH in specflags))
|
||||
var/ratio = (breath.toxins/safe_toxins_max) * 10
|
||||
var/ratio = (breath_gases["plasma"][MOLES]/safe_toxins_max) * 10
|
||||
if(H.reagents)
|
||||
H.reagents.add_reagent("plasma", Clamp(ratio, tox_breath_dam_min, tox_breath_dam_max))
|
||||
H.throw_alert("tox_in_air", /obj/screen/alert/tox_in_air)
|
||||
@@ -1255,34 +1259,33 @@
|
||||
//Too little toxins!
|
||||
if(safe_toxins_min)
|
||||
if(Toxins_pp < safe_toxins_min && !(NOBREATH in specflags))
|
||||
gas_breathed = handle_too_little_breath(H,Toxins_pp, safe_toxins_min, breath.toxins)
|
||||
gas_breathed = handle_too_little_breath(H,Toxins_pp, safe_toxins_min, breath_gases["plasma"][MOLES])
|
||||
H.throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox)
|
||||
else
|
||||
H.failed_last_breath = 0
|
||||
H.adjustOxyLoss(-5)
|
||||
gas_breathed = breath.toxins/6
|
||||
gas_breathed = breath_gases["plasma"][MOLES]/6
|
||||
H.clear_alert("not_enough_tox")
|
||||
|
||||
//Exhale
|
||||
breath.toxins -= gas_breathed
|
||||
breath.carbon_dioxide += gas_breathed
|
||||
breath_gases["plasma"][MOLES] -= gas_breathed
|
||||
breath_gases["co2"][MOLES] += gas_breathed
|
||||
gas_breathed = 0
|
||||
|
||||
|
||||
//-- TRACES --//
|
||||
|
||||
if(breath.trace_gases.len && !(NOBREATH in specflags)) // If there's some other shit in the air lets deal with it here.
|
||||
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
|
||||
var/SA_pp = breath.get_breath_partial_pressure(SA.moles)
|
||||
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
|
||||
H.Paralyse(3) // 3 gives them one second to wake up and run away a bit!
|
||||
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
|
||||
H.sleeping = max(H.sleeping+2, 10)
|
||||
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
if(prob(20))
|
||||
H.emote(pick("giggle", "laugh"))
|
||||
|
||||
handle_breath_temperature(breath, H)
|
||||
if(breath && !(NOBREATH in specflags)) // If there's some other shit in the air lets deal with it here.
|
||||
var/SA_pp = breath.get_breath_partial_pressure(breath_gases["n2o"][MOLES])
|
||||
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
|
||||
H.Paralyse(3) // 3 gives them one second to wake up and run away a bit!
|
||||
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
|
||||
H.sleeping = max(H.sleeping+2, 10)
|
||||
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
if(prob(20))
|
||||
H.emote(pick("giggle", "laugh"))
|
||||
handle_breath_temperature(breath, H)
|
||||
breath.garbage_collect()
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -510,7 +510,7 @@ var/global/image/plasmaman_on_fire = image("icon"='icons/mob/OnFire.dmi', "icon_
|
||||
if(environment)
|
||||
var/total_moles = environment.total_moles()
|
||||
if(total_moles)
|
||||
if((environment.oxygen /total_moles) >= 0.01)
|
||||
if(environment.gases["o2"] && (environment.gases["o2"][MOLES] /total_moles) >= 0.01)
|
||||
H.adjust_fire_stacks(0.5)
|
||||
if(!H.on_fire && H.fire_stacks > 0)
|
||||
H.visible_message("<span class='danger'>[H]'s body reacts with the atmosphere and bursts into flames!</span>","<span class='userdanger'>Your body reacts with the atmosphere and bursts into flame!</span>")
|
||||
|
||||
@@ -105,9 +105,12 @@
|
||||
var/oxygen_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
|
||||
var/O2_partialpressure = (breath.oxygen/breath.total_moles())*breath_pressure
|
||||
var/Toxins_partialpressure = (breath.toxins/breath.total_moles())*breath_pressure
|
||||
var/CO2_partialpressure = (breath.carbon_dioxide/breath.total_moles())*breath_pressure
|
||||
var/list/breath_gases = breath.gases
|
||||
breath.assert_gases("o2","plasma","co2","n2o")
|
||||
|
||||
var/O2_partialpressure = (breath_gases["o2"][MOLES]/breath.total_moles())*breath_pressure
|
||||
var/Toxins_partialpressure = (breath_gases["plasma"][MOLES]/breath.total_moles())*breath_pressure
|
||||
var/CO2_partialpressure = (breath_gases["co2"][MOLES]/breath.total_moles())*breath_pressure
|
||||
|
||||
|
||||
//OXYGEN
|
||||
@@ -118,7 +121,7 @@
|
||||
var/ratio = safe_oxy_min/O2_partialpressure
|
||||
adjustOxyLoss(min(5*ratio, 3))
|
||||
failed_last_breath = 1
|
||||
oxygen_used = breath.oxygen*ratio/6
|
||||
oxygen_used = breath_gases["o2"][MOLES]*ratio/6
|
||||
else
|
||||
adjustOxyLoss(3)
|
||||
failed_last_breath = 1
|
||||
@@ -127,11 +130,11 @@
|
||||
else //Enough oxygen
|
||||
failed_last_breath = 0
|
||||
adjustOxyLoss(-5)
|
||||
oxygen_used = breath.oxygen/6
|
||||
oxygen_used = breath_gases["o2"][MOLES]/6
|
||||
clear_alert("oxy")
|
||||
|
||||
breath.oxygen -= oxygen_used
|
||||
breath.carbon_dioxide += oxygen_used
|
||||
breath_gases["o2"][MOLES] -= oxygen_used
|
||||
breath_gases["co2"][MOLES] += oxygen_used
|
||||
|
||||
//CARBON DIOXIDE
|
||||
if(CO2_partialpressure > safe_co2_max)
|
||||
@@ -150,24 +153,24 @@
|
||||
|
||||
//TOXINS/PLASMA
|
||||
if(Toxins_partialpressure > safe_tox_max)
|
||||
var/ratio = (breath.toxins/safe_tox_max) * 10
|
||||
var/ratio = (breath_gases["plasma"][MOLES]/safe_tox_max) * 10
|
||||
if(reagents)
|
||||
reagents.add_reagent("plasma", Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE))
|
||||
throw_alert("tox_in_air", /obj/screen/alert/tox_in_air)
|
||||
else
|
||||
clear_alert("tox_in_air")
|
||||
|
||||
//TRACE GASES
|
||||
if(breath.trace_gases.len)
|
||||
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
|
||||
var/SA_partialpressure = (SA.moles/breath.total_moles())*breath_pressure
|
||||
if(SA_partialpressure > SA_para_min)
|
||||
Paralyse(3)
|
||||
if(SA_partialpressure > SA_sleep_min)
|
||||
sleeping = max(sleeping+2, 10)
|
||||
else if(SA_partialpressure > 0.01)
|
||||
if(prob(20))
|
||||
emote(pick("giggle","laugh"))
|
||||
//NITROUS OXIDE
|
||||
if(breath_gases["n2o"])
|
||||
var/SA_partialpressure = (breath_gases["n2o"][MOLES]/breath.total_moles())*breath_pressure
|
||||
if(SA_partialpressure > SA_para_min)
|
||||
Paralyse(3)
|
||||
if(SA_partialpressure > SA_sleep_min)
|
||||
sleeping = max(sleeping+2, 10)
|
||||
else if(SA_partialpressure > 0.01)
|
||||
if(prob(20))
|
||||
emote(pick("giggle","laugh"))
|
||||
breath.garbage_collect()
|
||||
|
||||
//BREATH TEMPERATURE
|
||||
handle_breath_temperature(breath)
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
ExtinguishMob()
|
||||
return
|
||||
var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
|
||||
if(G.oxygen < 1)
|
||||
if(!G.gases["o2"] || G.gases["o2"][MOLES] < 1)
|
||||
ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire
|
||||
return
|
||||
var/turf/location = get_turf(src)
|
||||
|
||||
@@ -526,6 +526,7 @@
|
||||
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()
|
||||
@@ -533,17 +534,10 @@
|
||||
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 += "<a href='byond://?src=\ref[src];software=atmosensor;sub=0'>Refresh Reading</a> <br>"
|
||||
dat += "<br>"
|
||||
|
||||
@@ -388,7 +388,15 @@
|
||||
if(src.beacon) //Check that the beacon still exists and is in a safe place. No instant kills.
|
||||
if(beacon.air)
|
||||
var/datum/gas_mixture/Z = beacon.air
|
||||
if(Z.oxygen >= 16 && !Z.toxins && Z.carbon_dioxide < 10 && !Z.trace_gases.len)
|
||||
var/list/Z_gases = Z.gases
|
||||
var/trace_gases = FALSE
|
||||
|
||||
for(var/id in Z_gases)
|
||||
if(id in hardcoded_gases)
|
||||
continue
|
||||
trace_gases = TRUE
|
||||
break
|
||||
if((Z_gases["o2"] && Z_gases["o2"][MOLES] >= 16) && !Z_gases["plasma"] && (!Z_gases["co2"] || Z_gases["co2"][MOLES] < 10) && !trace_gases)
|
||||
if((Z.temperature > 270) && (Z.temperature < 360))
|
||||
var/pressure = Z.return_pressure()
|
||||
if((pressure > 20) && (pressure < 550))
|
||||
|
||||
@@ -41,12 +41,12 @@
|
||||
..()
|
||||
if(istype(src.loc, /turf/simulated))
|
||||
var/turf/simulated/T = src.loc
|
||||
if(T.air)
|
||||
var/co2 = T.air.carbon_dioxide
|
||||
if(T.air && T.air.gases["co2"])
|
||||
var/co2 = T.air.gases["co2"][MOLES]
|
||||
if(co2 > 0)
|
||||
if(prob(25))
|
||||
var/amt = min(co2, 9)
|
||||
T.air.carbon_dioxide -= amt
|
||||
T.air.gases["co2"][MOLES] -= amt
|
||||
T.atmos_spawn_air(SPAWN_OXYGEN, amt)
|
||||
|
||||
/mob/living/simple_animal/hostile/tree/AttackingTarget()
|
||||
|
||||
@@ -196,10 +196,15 @@
|
||||
if(istype(T,/turf/simulated))
|
||||
var/turf/simulated/ST = T
|
||||
if(ST.air)
|
||||
var/tox = ST.air.toxins
|
||||
var/oxy = ST.air.oxygen
|
||||
var/n2 = ST.air.nitrogen
|
||||
var/co2 = ST.air.carbon_dioxide
|
||||
var/ST_gases = ST.air.gases
|
||||
ST.air.assert_gases(arglist(hardcoded_gases))
|
||||
|
||||
var/tox = ST_gases["plasma"][MOLES]
|
||||
var/oxy = ST_gases["o2"][MOLES]
|
||||
var/n2 = ST_gases["n2"][MOLES]
|
||||
var/co2 = ST_gases["co2"][MOLES]
|
||||
|
||||
ST.air.garbage_collect()
|
||||
|
||||
if(atmos_requirements["min_oxy"] && oxy < atmos_requirements["min_oxy"])
|
||||
atmos_suitable = 0
|
||||
|
||||
@@ -33,14 +33,12 @@ var/next_mob_id = 0
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
var/t = "<span class='notice'>Coordinates: [x],[y] \n</span>"
|
||||
t+= "<span class='danger'>Temperature: [environment.temperature] \n</span>"
|
||||
t+= "<span class='notice'>Nitrogen: [environment.nitrogen] \n</span>"
|
||||
t+= "<span class='notice'>Oxygen: [environment.oxygen] \n</span>"
|
||||
t+= "<span class='notice'>Plasma : [environment.toxins] \n</span>"
|
||||
t+= "<span class='notice'>Carbon Dioxide: [environment.carbon_dioxide] \n</span>"
|
||||
for(var/datum/gas/trace_gas in environment.trace_gases)
|
||||
t+= "<span class='notice'>[trace_gas.type]: [trace_gas.moles] \n</span>"
|
||||
var/t = "<span class='notice'>Coordinates: [x],[y] \n</span>"
|
||||
t += "<span class='danger'>Temperature: [environment.temperature] \n</span>"
|
||||
for(var/id in environment.gases)
|
||||
var/gas = environment.gases[id]
|
||||
if(gas[MOLES])
|
||||
t+="<span class='notice'>[gas[GAS_NAME]]: [gas[MOLES]] \n</span>"
|
||||
|
||||
usr << t
|
||||
|
||||
@@ -967,4 +965,4 @@ var/next_mob_id = 0
|
||||
for(var/F in faction)
|
||||
if(F in target.faction)
|
||||
return 1
|
||||
return 0
|
||||
return 0
|
||||
|
||||
@@ -26,12 +26,12 @@ var/global/list/rad_collectors = list()
|
||||
|
||||
/obj/machinery/power/rad_collector/process()
|
||||
if(P)
|
||||
if(P.air_contents.toxins <= 0)
|
||||
if(!P.air_contents.gases["plasma"])
|
||||
investigate_log("<font color='red'>out of fuel</font>.","singulo")
|
||||
P.air_contents.toxins = 0
|
||||
eject()
|
||||
else
|
||||
P.air_contents.toxins -= 0.001*drainratio
|
||||
P.air_contents.gases["plasma"][MOLES] -= 0.001*drainratio
|
||||
P.air_contents.garbage_collect()
|
||||
return
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ var/global/list/rad_collectors = list()
|
||||
toggle_power()
|
||||
user.visible_message("[user.name] turns the [src.name] [active? "on":"off"].", \
|
||||
"<span class='notice'>You turn the [src.name] [active? "on":"off"].</span>")
|
||||
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [P?"Fuel: [round(P.air_contents.toxins/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
|
||||
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [P?"Fuel: [round(P.air_contents.gases["plasma"][MOLES]/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
|
||||
return
|
||||
else
|
||||
user << "<span class='warning'>The controls are locked!</span>"
|
||||
@@ -129,8 +129,8 @@ var/global/list/rad_collectors = list()
|
||||
|
||||
/obj/machinery/power/rad_collector/proc/receive_pulse(pulse_strength)
|
||||
if(P && active)
|
||||
var/power_produced = 0
|
||||
power_produced = P.air_contents.toxins*pulse_strength*20
|
||||
var/power_produced = P.air_contents.gases["plasma"] ? P.air_contents.gases["plasma"][MOLES] : 0
|
||||
power_produced *= pulse_strength*20
|
||||
add_avail(power_produced)
|
||||
last_power = power_produced
|
||||
return
|
||||
|
||||
@@ -138,7 +138,13 @@
|
||||
damage = max( damage + ( (removed.temperature - 800) / 150 ) , 0 )
|
||||
//Ok, 100% oxygen atmosphere = best reaction
|
||||
//Maxes out at 100% oxygen pressure
|
||||
oxygen = max(min((removed.oxygen - (removed.nitrogen * NITROGEN_RETARDATION_FACTOR)) / MOLES_CELLSTANDARD, 1), 0)
|
||||
var/removed_nitrogen = 0
|
||||
if(removed.gases["n2"])
|
||||
removed_nitrogen = (removed.gases["n2"][MOLES] * NITROGEN_RETARDATION_FACTOR)
|
||||
|
||||
removed.assert_gases("o2", "plasma")
|
||||
|
||||
oxygen = max(min((removed.gases["o2"][MOLES] - removed_nitrogen) / MOLES_CELLSTANDARD, 1), 0)
|
||||
|
||||
var/temp_factor = 50
|
||||
|
||||
@@ -169,9 +175,9 @@
|
||||
removed.temperature = max(0, min(removed.temperature, 2500))
|
||||
|
||||
//Calculate how much gas to release
|
||||
removed.toxins += max(device_energy / PLASMA_RELEASE_MODIFIER, 0)
|
||||
removed.gases["plasma"][MOLES] += max(device_energy / PLASMA_RELEASE_MODIFIER, 0)
|
||||
|
||||
removed.oxygen += max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0)
|
||||
removed.gases["o2"][MOLES] += max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0)
|
||||
|
||||
env.merge(removed)
|
||||
|
||||
|
||||
@@ -14,11 +14,7 @@
|
||||
SSair.remove_from_active(T)
|
||||
for(var/turf/simulated/T in map)
|
||||
if(T.air)
|
||||
T.air.oxygen = T.oxygen
|
||||
T.air.nitrogen = T.nitrogen
|
||||
T.air.carbon_dioxide = T.carbon_dioxide
|
||||
T.air.toxins = T.toxins
|
||||
T.air.temperature = T.temperature
|
||||
T.air.copy_from_turf(T)
|
||||
SSair.add_to_active(T)
|
||||
|
||||
//Only places atoms/turfs on area borders
|
||||
|
||||
Reference in New Issue
Block a user