Putnam
2021-06-08 09:54:28 -07:00
parent 842fdcaeba
commit 86177c51c4
54 changed files with 520 additions and 500 deletions
+44 -44
View File
@@ -143,12 +143,12 @@
var/gas_breathed = 0
//Partial pressures in our breath
var/O2_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/oxygen))+(8*breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/pluoxium)))
var/N2_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/nitrogen))
var/Toxins_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/plasma))
var/CO2_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/carbon_dioxide))
var/CH4_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/methane))
var/CH3Br_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/methyl_bromide))
var/O2_pp = breath.get_breath_partial_pressure(breath.get_moles(GAS_O2))+(8*breath.get_breath_partial_pressure(breath.get_moles(GAS_PLUOXIUM)))
var/N2_pp = breath.get_breath_partial_pressure(breath.get_moles(GAS_N2))
var/Toxins_pp = breath.get_breath_partial_pressure(breath.get_moles(GAS_PLASMA))
var/CO2_pp = breath.get_breath_partial_pressure(breath.get_moles(GAS_CO2))
var/CH4_pp = breath.get_breath_partial_pressure(breath.get_moles(GAS_METHANE))
var/CH3Br_pp = breath.get_breath_partial_pressure(breath.get_moles(GAS_METHYL_BROMIDE))
//-- OXY --//
@@ -156,7 +156,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.get_moles(/datum/gas/oxygen)/safe_oxygen_max) * 10
var/ratio = (breath.get_moles(GAS_O2)/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)
@@ -179,18 +179,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.get_moles(/datum/gas/oxygen))
gas_breathed = handle_too_little_breath(H, O2_pp, safe_oxygen_min, breath.get_moles(GAS_O2))
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(-breathModifier) //More damaged lungs = slower oxy rate up to a factor of half
gas_breathed = breath.get_moles(/datum/gas/oxygen)
gas_breathed = breath.get_moles(GAS_O2)
H.clear_alert("not_enough_oxy")
//Exhale
breath.adjust_moles(/datum/gas/oxygen, -gas_breathed)
breath.adjust_moles(/datum/gas/carbon_dioxide, gas_breathed)
breath.adjust_moles(GAS_O2, -gas_breathed)
breath.adjust_moles(GAS_CO2, gas_breathed)
gas_breathed = 0
//-- Nitrogen --//
@@ -198,7 +198,7 @@
//Too much nitrogen!
if(safe_nitro_max)
if(N2_pp > safe_nitro_max)
var/ratio = (breath.get_moles(/datum/gas/nitrogen)/safe_nitro_max) * 10
var/ratio = (breath.get_moles(GAS_N2)/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
@@ -208,18 +208,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.get_moles(/datum/gas/nitrogen))
gas_breathed = handle_too_little_breath(H, N2_pp, safe_nitro_min, breath.get_moles(GAS_N2))
H.throw_alert("nitro", /obj/screen/alert/not_enough_nitro)
else
H.failed_last_breath = FALSE
if(H.health >= H.crit_threshold)
H.adjustOxyLoss(-breathModifier)
gas_breathed = breath.get_moles(/datum/gas/nitrogen)
gas_breathed = breath.get_moles(GAS_N2)
H.clear_alert("nitro")
//Exhale
breath.adjust_moles(/datum/gas/nitrogen, -gas_breathed)
breath.adjust_moles(/datum/gas/carbon_dioxide, gas_breathed)
breath.adjust_moles(GAS_N2, -gas_breathed)
breath.adjust_moles(GAS_CO2, gas_breathed)
gas_breathed = 0
//-- CO2 --//
@@ -245,18 +245,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.get_moles(/datum/gas/carbon_dioxide))
gas_breathed = handle_too_little_breath(H, CO2_pp, safe_co2_min, breath.get_moles(GAS_CO2))
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(-breathModifier)
gas_breathed = breath.get_moles(/datum/gas/carbon_dioxide)
gas_breathed = breath.get_moles(GAS_CO2)
H.clear_alert("not_enough_co2")
//Exhale
breath.adjust_moles(/datum/gas/carbon_dioxide, -gas_breathed)
breath.adjust_moles(/datum/gas/oxygen, gas_breathed)
breath.adjust_moles(GAS_CO2, -gas_breathed)
breath.adjust_moles(GAS_O2, gas_breathed)
gas_breathed = 0
@@ -265,7 +265,7 @@
//Too much toxins!
if(safe_toxins_max)
if(Toxins_pp > safe_toxins_max)
var/ratio = (breath.get_moles(/datum/gas/plasma)/safe_toxins_max) * 10
var/ratio = (breath.get_moles(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
@@ -275,18 +275,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.get_moles(/datum/gas/plasma))
gas_breathed = handle_too_little_breath(H, Toxins_pp, safe_toxins_min, breath.get_moles(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(-breathModifier)
gas_breathed = breath.get_moles(/datum/gas/plasma)
gas_breathed = breath.get_moles(GAS_PLASMA)
H.clear_alert("not_enough_tox")
//Exhale
breath.adjust_moles(/datum/gas/plasma, -gas_breathed)
breath.adjust_moles(/datum/gas/carbon_dioxide, gas_breathed)
breath.adjust_moles(GAS_PLASMA, -gas_breathed)
breath.adjust_moles(GAS_CO2, gas_breathed)
gas_breathed = 0
//-- METHANE --//
@@ -294,7 +294,7 @@
//Too much methane!
if(safe_methane_max)
if(CH4_pp > safe_methane_max) //Same effect as excess nitrogen, generally nontoxic
var/ratio = (breath.get_moles(/datum/gas/methane)/safe_methane_max) * 10
var/ratio = (breath.get_moles(GAS_METHANE)/safe_methane_max) * 10
H.apply_damage_type(clamp(ratio, methane_breath_dam_min, methane_breath_dam_max), methane_damage_type)
H.throw_alert("too_much_ch4", /obj/screen/alert/too_much_ch4)
H.losebreath += 2
@@ -303,18 +303,18 @@
//Too little methane!
if(safe_methane_min)
if(CH4_pp < safe_methane_min)
gas_breathed = handle_too_little_breath(H, CH4_pp, safe_methane_min, breath.get_moles(/datum/gas/methane))
gas_breathed = handle_too_little_breath(H, CH4_pp, safe_methane_min, breath.get_moles(GAS_METHANE))
H.throw_alert("not_enough_ch4", /obj/screen/alert/not_enough_ch4)
else
H.failed_last_breath = FALSE
if(H.health >= H.crit_threshold)
H.adjustOxyLoss(-breathModifier)
gas_breathed = breath.get_moles(/datum/gas/methane)
gas_breathed = breath.get_moles(GAS_METHANE)
H.clear_alert("not_enough_ch4")
//Exhale
breath.adjust_moles(/datum/gas/methane, -gas_breathed)
breath.adjust_moles(/datum/gas/methyl_bromide, gas_breathed)
breath.adjust_moles(GAS_METHANE, -gas_breathed)
breath.adjust_moles(GAS_METHYL_BROMIDE, gas_breathed)
gas_breathed = 0
//-- CH3BR --//
@@ -333,13 +333,13 @@
//Too little methyl bromide!
if(safe_ch3br_min)
if(CH3Br_pp < safe_ch3br_min)
gas_breathed = handle_too_little_breath(H, CH3Br_pp, safe_ch3br_min, breath.get_moles(/datum/gas/methyl_bromide))
gas_breathed = handle_too_little_breath(H, CH3Br_pp, safe_ch3br_min, breath.get_moles(GAS_METHYL_BROMIDE))
H.throw_alert("not_enough_ch3br", /obj/screen/alert/not_enough_ch3br)
else
H.failed_last_breath = FALSE
if(H.health >= H.crit_threshold)
H.adjustOxyLoss(-breathModifier)
gas_breathed = breath.get_moles(/datum/gas/methyl_bromide)
gas_breathed = breath.get_moles(GAS_METHYL_BROMIDE)
H.clear_alert("not_enough_ch3br")
//-- TRACES --//
@@ -348,7 +348,7 @@
// N2O
var/SA_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/nitrous_oxide))
var/SA_pp = breath.get_breath_partial_pressure(breath.get_moles(GAS_NITROUS))
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
@@ -362,7 +362,7 @@
// BZ
var/bz_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/bz))
var/bz_pp = breath.get_breath_partial_pressure(breath.get_moles(GAS_BZ))
if(bz_pp > BZ_trip_balls_min)
H.hallucination += 10
H.reagents.add_reagent(/datum/reagent/bz_metabolites,5)
@@ -375,14 +375,14 @@
// Tritium
var/trit_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/tritium))
var/trit_pp = breath.get_breath_partial_pressure(breath.get_moles(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.get_moles(/datum/gas/nitryl))
var/nitryl_pp = breath.get_breath_partial_pressure(breath.get_moles(GAS_NITRYL))
if (prob(nitryl_pp))
to_chat(H, "<span class='alert'>Your mouth feels like it's burning!</span>")
if (nitryl_pp >40)
@@ -393,22 +393,22 @@
H.silent = max(H.silent, 3)
else
H.adjustFireLoss(nitryl_pp/4)
gas_breathed = breath.get_moles(/datum/gas/nitryl)
gas_breathed = breath.get_moles(GAS_NITRYL)
if (gas_breathed > gas_stimulation_min)
H.reagents.add_reagent(/datum/reagent/nitryl,1)
breath.adjust_moles(/datum/gas/nitryl, -gas_breathed)
breath.adjust_moles(GAS_NITRYL, -gas_breathed)
// Stimulum
gas_breathed = breath.get_moles(/datum/gas/stimulum)
gas_breathed = breath.get_moles(GAS_STIMULUM)
if (gas_breathed > gas_stimulation_min)
var/existing = H.reagents.get_reagent_amount(/datum/reagent/stimulum)
H.reagents.add_reagent(/datum/reagent/stimulum, max(0, 5 - existing))
breath.adjust_moles(/datum/gas/stimulum, -gas_breathed)
breath.adjust_moles(GAS_STIMULUM, -gas_breathed)
// Miasma
if (breath.get_moles(/datum/gas/miasma))
var/miasma_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/miasma))
if (breath.get_moles(GAS_MIASMA))
var/miasma_pp = breath.get_breath_partial_pressure(breath.get_moles(GAS_MIASMA))
if(miasma_pp > MINIMUM_MOLES_DELTA_TO_MOVE)
//Miasma sickness
@@ -448,7 +448,7 @@
// Then again, this is a purely hypothetical scenario and hardly reachable
owner.adjust_disgust(0.1 * miasma_pp)
breath.adjust_moles(/datum/gas/miasma, -gas_breathed)
breath.adjust_moles(GAS_MIASMA, -gas_breathed)
// Clear out moods when no miasma at all
else
@@ -624,7 +624,7 @@
/obj/item/organ/lungs/slime/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H)
. = ..()
if (breath)
var/plasma_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/plasma))
var/plasma_pp = breath.get_breath_partial_pressure(breath.get_moles(GAS_PLASMA))
owner.blood_volume += (0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you.
/obj/item/organ/lungs/yamerol