[MIRROR] Fixes some bugs pertaining to breath code (#10044)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-02-01 13:21:07 -07:00
committed by GitHub
parent c6fee332f2
commit d26da7447b
2 changed files with 9 additions and 7 deletions

View File

@@ -150,6 +150,11 @@ Your emergency supply kit should have an air tank and gas mask in it!" // C
name = "Choking (No Sleeping Gas)"
desc = "You're not getting enough sleeping gas. Find some good air before you pass out!"
icon_state = "not_enough_tox"
/obj/screen/alert/not_enough_atmos
name = "Choking (No Breath)"
desc = "The atmosphere around you lacks any form of breathable air! Find some good air before you pass out!"
icon_state = "not_enough_oxy"
//End gas alerts

View File

@@ -592,10 +592,10 @@
if(!L.is_bruised() && prob(8))
rupture_lung()
throw_alert("pressure", /obj/screen/alert/lowpressure)
throw_alert("oxy", /obj/screen/alert/not_enough_atmos)
return 0
else
clear_alert("pressure")
clear_alert("oxy")
var/safe_pressure_min = species.minimum_breath_pressure // Minimum safe partial pressure of breathable gas in kPa
@@ -609,11 +609,6 @@
safe_pressure_min *= 1.5
else if(L.is_bruised())
safe_pressure_min *= 1.25
else if(breath)
if(breath.total_moles < BREATH_MOLES / 10 || breath.total_moles > BREATH_MOLES * 5)
if(is_below_sound_pressure(get_turf(src))) //No more popped lungs from choking/drowning
if (prob(8))
rupture_lung()
var/safe_exhaled_max = 10
var/safe_toxins_max = 0.2
@@ -661,6 +656,8 @@
if(inhale_pp < safe_pressure_min)
if(prob(20))
spawn(0) emote("gasp")
if(is_below_sound_pressure(get_turf(src)) && prob(8)) //No more popped lungs from choking/drowning
rupture_lung()
var/ratio = inhale_pp/safe_pressure_min
// Don't fuck them up too fast (space only does HUMAN_MAX_OXYLOSS after all!)