fuck atmos - attempts to optimize atmos by removing GAS_META from the gas mixture meta list and removing the usage of gas archive
This commit is contained in:
@@ -87,10 +87,10 @@
|
||||
breath.assert_gases(/datum/gas/oxygen, /datum/gas/plasma, /datum/gas/carbon_dioxide, /datum/gas/nitrous_oxide, /datum/gas/bz, /datum/gas/nitrogen, /datum/gas/tritium, /datum/gas/nitryl, /datum/gas/pluoxium, /datum/gas/stimulum)
|
||||
|
||||
//Partial pressures in our breath
|
||||
var/O2_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/oxygen][MOLES])+(8*breath.get_breath_partial_pressure(breath_gases[/datum/gas/pluoxium][MOLES]))
|
||||
var/N2_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/nitrogen][MOLES])
|
||||
var/Toxins_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/plasma][MOLES])
|
||||
var/CO2_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/carbon_dioxide][MOLES])
|
||||
var/O2_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/oxygen])+(8*breath.get_breath_partial_pressure(breath_gases[/datum/gas/pluoxium]))
|
||||
var/N2_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/nitrogen])
|
||||
var/Toxins_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/plasma])
|
||||
var/CO2_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/carbon_dioxide])
|
||||
|
||||
|
||||
//-- OXY --//
|
||||
@@ -98,7 +98,7 @@
|
||||
//Too much oxygen! //Yes, some species may not like it.
|
||||
if(safe_oxygen_max)
|
||||
if((O2_pp > safe_oxygen_max) && safe_oxygen_max == 0) //I guess plasma men technically need to have a check.
|
||||
var/ratio = (breath_gases[/datum/gas/oxygen][MOLES]/safe_oxygen_max) * 10
|
||||
var/ratio = (breath_gases[/datum/gas/oxygen]/safe_oxygen_max) * 10
|
||||
H.apply_damage_type(CLAMP(ratio, oxy_breath_dam_min, oxy_breath_dam_max), oxy_damage_type)
|
||||
H.throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy)
|
||||
|
||||
@@ -121,18 +121,18 @@
|
||||
//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_gases[/datum/gas/oxygen][MOLES])
|
||||
gas_breathed = handle_too_little_breath(H, O2_pp, safe_oxygen_min, breath_gases[/datum/gas/oxygen])
|
||||
H.throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
else
|
||||
H.failed_last_breath = FALSE
|
||||
if(H.health >= H.crit_threshold)
|
||||
H.adjustOxyLoss(-5)
|
||||
gas_breathed = breath_gases[/datum/gas/oxygen][MOLES]
|
||||
gas_breathed = breath_gases[/datum/gas/oxygen]
|
||||
H.clear_alert("not_enough_oxy")
|
||||
|
||||
//Exhale
|
||||
breath_gases[/datum/gas/oxygen][MOLES] -= gas_breathed
|
||||
breath_gases[/datum/gas/carbon_dioxide][MOLES] += gas_breathed
|
||||
breath_gases[/datum/gas/oxygen] -= gas_breathed
|
||||
breath_gases[/datum/gas/carbon_dioxide] += gas_breathed
|
||||
gas_breathed = 0
|
||||
|
||||
//-- Nitrogen --//
|
||||
@@ -140,7 +140,7 @@
|
||||
//Too much nitrogen!
|
||||
if(safe_nitro_max)
|
||||
if(N2_pp > safe_nitro_max)
|
||||
var/ratio = (breath_gases[/datum/gas/nitrogen][MOLES]/safe_nitro_max) * 10
|
||||
var/ratio = (breath_gases[/datum/gas/nitrogen]/safe_nitro_max) * 10
|
||||
H.apply_damage_type(CLAMP(ratio, nitro_breath_dam_min, nitro_breath_dam_max), nitro_damage_type)
|
||||
H.throw_alert("too_much_nitro", /obj/screen/alert/too_much_nitro)
|
||||
H.losebreath += 2
|
||||
@@ -150,18 +150,18 @@
|
||||
//Too little nitrogen!
|
||||
if(safe_nitro_min)
|
||||
if(N2_pp < safe_nitro_min)
|
||||
gas_breathed = handle_too_little_breath(H, N2_pp, safe_nitro_min, breath_gases[/datum/gas/nitrogen][MOLES])
|
||||
gas_breathed = handle_too_little_breath(H, N2_pp, safe_nitro_min, breath_gases[/datum/gas/nitrogen])
|
||||
H.throw_alert("nitro", /obj/screen/alert/not_enough_nitro)
|
||||
else
|
||||
H.failed_last_breath = FALSE
|
||||
if(H.health >= H.crit_threshold)
|
||||
H.adjustOxyLoss(-5)
|
||||
gas_breathed = breath_gases[/datum/gas/nitrogen][MOLES]
|
||||
gas_breathed = breath_gases[/datum/gas/nitrogen]
|
||||
H.clear_alert("nitro")
|
||||
|
||||
//Exhale
|
||||
breath_gases[/datum/gas/nitrogen][MOLES] -= gas_breathed
|
||||
breath_gases[/datum/gas/carbon_dioxide][MOLES] += gas_breathed
|
||||
breath_gases[/datum/gas/nitrogen] -= gas_breathed
|
||||
breath_gases[/datum/gas/carbon_dioxide] += gas_breathed
|
||||
gas_breathed = 0
|
||||
|
||||
//-- CO2 --//
|
||||
@@ -187,18 +187,18 @@
|
||||
//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_gases[/datum/gas/carbon_dioxide][MOLES])
|
||||
gas_breathed = handle_too_little_breath(H, CO2_pp, safe_co2_min, breath_gases[/datum/gas/carbon_dioxide])
|
||||
H.throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2)
|
||||
else
|
||||
H.failed_last_breath = FALSE
|
||||
if(H.health >= H.crit_threshold)
|
||||
H.adjustOxyLoss(-5)
|
||||
gas_breathed = breath_gases[/datum/gas/carbon_dioxide][MOLES]
|
||||
gas_breathed = breath_gases[/datum/gas/carbon_dioxide]
|
||||
H.clear_alert("not_enough_co2")
|
||||
|
||||
//Exhale
|
||||
breath_gases[/datum/gas/carbon_dioxide][MOLES] -= gas_breathed
|
||||
breath_gases[/datum/gas/oxygen][MOLES] += gas_breathed
|
||||
breath_gases[/datum/gas/carbon_dioxide] -= gas_breathed
|
||||
breath_gases[/datum/gas/oxygen] += gas_breathed
|
||||
gas_breathed = 0
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
//Too much toxins!
|
||||
if(safe_toxins_max)
|
||||
if(Toxins_pp > safe_toxins_max)
|
||||
var/ratio = (breath_gases[/datum/gas/plasma][MOLES]/safe_toxins_max) * 10
|
||||
var/ratio = (breath_gases[/datum/gas/plasma]/safe_toxins_max) * 10
|
||||
H.apply_damage_type(CLAMP(ratio, tox_breath_dam_min, tox_breath_dam_max), tox_damage_type)
|
||||
H.throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
|
||||
else
|
||||
@@ -217,18 +217,18 @@
|
||||
//Too little toxins!
|
||||
if(safe_toxins_min)
|
||||
if(Toxins_pp < safe_toxins_min)
|
||||
gas_breathed = handle_too_little_breath(H, Toxins_pp, safe_toxins_min, breath_gases[/datum/gas/plasma][MOLES])
|
||||
gas_breathed = handle_too_little_breath(H, Toxins_pp, safe_toxins_min, breath_gases[/datum/gas/plasma])
|
||||
H.throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox)
|
||||
else
|
||||
H.failed_last_breath = FALSE
|
||||
if(H.health >= H.crit_threshold)
|
||||
H.adjustOxyLoss(-5)
|
||||
gas_breathed = breath_gases[/datum/gas/plasma][MOLES]
|
||||
gas_breathed = breath_gases[/datum/gas/plasma]
|
||||
H.clear_alert("not_enough_tox")
|
||||
|
||||
//Exhale
|
||||
breath_gases[/datum/gas/plasma][MOLES] -= gas_breathed
|
||||
breath_gases[/datum/gas/carbon_dioxide][MOLES] += gas_breathed
|
||||
breath_gases[/datum/gas/plasma] -= gas_breathed
|
||||
breath_gases[/datum/gas/carbon_dioxide] += gas_breathed
|
||||
gas_breathed = 0
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
|
||||
// N2O
|
||||
|
||||
var/SA_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/nitrous_oxide][MOLES])
|
||||
var/SA_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/nitrous_oxide])
|
||||
if(SA_pp > SA_para_min) // Enough to make us stunned for a bit
|
||||
H.Unconscious(60) // 60 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
|
||||
@@ -249,7 +249,7 @@
|
||||
|
||||
// BZ
|
||||
|
||||
var/bz_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/bz][MOLES])
|
||||
var/bz_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/bz])
|
||||
if(bz_pp > BZ_trip_balls_min)
|
||||
H.hallucination += 10
|
||||
H.reagents.add_reagent("bz_metabolites",5)
|
||||
@@ -262,14 +262,14 @@
|
||||
|
||||
|
||||
// Tritium
|
||||
var/trit_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/tritium][MOLES])
|
||||
var/trit_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/tritium])
|
||||
if (trit_pp > 50)
|
||||
H.radiation += trit_pp/2 //If you're breathing in half an atmosphere of radioactive gas, you fucked up.
|
||||
else
|
||||
H.radiation += trit_pp/10
|
||||
|
||||
// Nitryl
|
||||
var/nitryl_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/nitryl][MOLES])
|
||||
var/nitryl_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/nitryl])
|
||||
if (prob(nitryl_pp))
|
||||
to_chat(H, "<span class='alert'>Your mouth feels like it's burning!</span>")
|
||||
if (nitryl_pp >40)
|
||||
@@ -280,22 +280,22 @@
|
||||
H.silent = max(H.silent, 3)
|
||||
else
|
||||
H.adjustFireLoss(nitryl_pp/4)
|
||||
gas_breathed = breath_gases[/datum/gas/nitryl][MOLES]
|
||||
gas_breathed = breath_gases[/datum/gas/nitryl]
|
||||
if (gas_breathed > gas_stimulation_min)
|
||||
H.reagents.add_reagent("no2",1)
|
||||
|
||||
breath_gases[/datum/gas/nitryl][MOLES]-=gas_breathed
|
||||
breath_gases[/datum/gas/nitryl]-=gas_breathed
|
||||
|
||||
// Stimulum
|
||||
gas_breathed = breath_gases[/datum/gas/stimulum][MOLES]
|
||||
gas_breathed = breath_gases[/datum/gas/stimulum]
|
||||
if (gas_breathed > gas_stimulation_min)
|
||||
var/existing = H.reagents.get_reagent_amount("stimulum")
|
||||
H.reagents.add_reagent("stimulum",max(0, 1 - existing))
|
||||
breath_gases[/datum/gas/stimulum][MOLES]-=gas_breathed
|
||||
breath_gases[/datum/gas/stimulum]-=gas_breathed
|
||||
|
||||
// Miasma
|
||||
if (breath_gases[/datum/gas/miasma])
|
||||
var/miasma_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/miasma][MOLES])
|
||||
var/miasma_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/miasma])
|
||||
|
||||
//Miasma sickness
|
||||
if(prob(0.5 * miasma_pp))
|
||||
@@ -334,7 +334,7 @@
|
||||
// Then again, this is a purely hypothetical scenario and hardly reachable
|
||||
owner.adjust_disgust(0.1 * miasma_pp)
|
||||
|
||||
breath_gases[/datum/gas/miasma][MOLES]-=gas_breathed
|
||||
breath_gases[/datum/gas/miasma]-=gas_breathed
|
||||
|
||||
// Clear out moods when no miasma at all
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user