Refactor Lung Handling
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
diff a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm (rejected hunks)
|
||||
@@ -36,6 +36,8 @@
|
||||
adjustCloneLoss(damage * hit_percent)
|
||||
if(STAMINA)
|
||||
adjustStaminaLoss(damage * hit_percent)
|
||||
+ if(BRAIN)
|
||||
+ adjustBrainLoss(damage * hit_percent)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -103,11 +103,13 @@
|
||||
var/datum/species/S = dna.species
|
||||
|
||||
if(S.breathid == "o2")
|
||||
throw_alert("oxy", /obj/screen/alert/oxy)
|
||||
throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
else if(S.breathid == "tox")
|
||||
throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox)
|
||||
else if(S.breathid == "co2")
|
||||
throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2)
|
||||
else if(S.breathid == "n2")
|
||||
throw_alert("not_enough_nitro", /obj/screen/alert/not_enough_nitro)
|
||||
|
||||
return 0
|
||||
else
|
||||
|
||||
@@ -1502,6 +1502,8 @@
|
||||
H.adjustCloneLoss(damage * hit_percent)
|
||||
if(STAMINA)
|
||||
H.adjustStaminaLoss(damage * hit_percent)
|
||||
if(BRAIN)
|
||||
H.adjustBrainLoss(damage * hit_percent)
|
||||
return 1
|
||||
|
||||
/datum/species/proc/on_hit(obj/item/projectile/P, mob/living/carbon/human/H)
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
return
|
||||
adjustOxyLoss(1)
|
||||
failed_last_breath = 1
|
||||
throw_alert("oxy", /obj/screen/alert/oxy)
|
||||
throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
return 0
|
||||
|
||||
var/safe_oxy_min = 16
|
||||
@@ -144,14 +144,14 @@
|
||||
else
|
||||
adjustOxyLoss(3)
|
||||
failed_last_breath = 1
|
||||
throw_alert("oxy", /obj/screen/alert/oxy)
|
||||
throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
|
||||
else //Enough oxygen
|
||||
failed_last_breath = 0
|
||||
if(oxyloss)
|
||||
adjustOxyLoss(-5)
|
||||
oxygen_used = breath_gases["o2"][MOLES]
|
||||
clear_alert("oxy")
|
||||
clear_alert("not_enough_oxy")
|
||||
|
||||
breath_gases["o2"][MOLES] -= oxygen_used
|
||||
breath_gases["co2"][MOLES] += oxygen_used
|
||||
@@ -174,11 +174,10 @@
|
||||
//TOXINS/PLASMA
|
||||
if(Toxins_partialpressure > safe_tox_max)
|
||||
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)
|
||||
adjustToxLoss(Clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
|
||||
throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
|
||||
else
|
||||
clear_alert("tox_in_air")
|
||||
clear_alert("too_much_tox")
|
||||
|
||||
//NITROUS OXIDE
|
||||
if(breath_gases["n2o"])
|
||||
|
||||
Reference in New Issue
Block a user