diff --git a/code/_helpers/turfs.dm b/code/_helpers/turfs.dm index 75cb9df3b04..e59bf929996 100644 --- a/code/_helpers/turfs.dm +++ b/code/_helpers/turfs.dm @@ -72,3 +72,10 @@ /proc/is_station_turf(var/turf/T) return T && isStationLevel(T.z) + +/proc/is_below_sound_pressure(var/turf/T) + var/datum/gas_mixture/environment = T ? T.return_air() : null + var/pressure = environment ? environment.return_pressure() : 0 + if(pressure < SOUND_MINIMUM_PRESSURE) + return TRUE + return FALSE diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 383d738770d..dceea32adad 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -118,6 +118,7 @@ var/warning_low_pressure = WARNING_LOW_PRESSURE // Low pressure warning. var/hazard_low_pressure = HAZARD_LOW_PRESSURE // Dangerously low pressure. var/light_dam // If set, mob will be damaged in light over this value and heal in light below its negative. + var/breathing_sound = 'sound/voice/monkey.ogg' // If set, this mob will have a breathing sound. var/body_temperature = 310.15 // Non-IS_SYNTHETIC species will try to stabilize at this temperature. // (also affects temperature processing) diff --git a/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm b/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm index eca063adfce..26f5febd520 100644 --- a/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm +++ b/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm @@ -41,6 +41,7 @@ breath_vol_mul = 1/6 // 0.5 liters * breath_vol_mul = breath volume breath_eff_mul = 6 // 1/6 * breath_eff_mul = fraction of gas consumed poison_type = "nitrogen" //a species that breathes plasma shouldn't be poisoned by it. + breathing_sound = null //They don't work that way I guess? I'm a coder not a purple man. mob_size = 13 //their half an inch thick exoskeleton and impressive height, plus all of their mechanical organs. natural_climbing = TRUE climb_coeff = 0.75 diff --git a/code/modules/organs/internal/lungs.dm b/code/modules/organs/internal/lungs.dm index ecc7f77646d..e3e5032c533 100644 --- a/code/modules/organs/internal/lungs.dm +++ b/code/modules/organs/internal/lungs.dm @@ -249,6 +249,13 @@ else last_successful_breath = world.time owner.oxygen_alert = 0 + if(!BP_IS_ROBOTIC(src) && species.breathing_sound && is_below_sound_pressure(get_turf(owner))) + if(breathing || owner.shock_stage >= 10) + sound_to(owner, sound(species.breathing_sound,0,0,0,5)) + breathing = 0 + else + breathing = 1 + return failed_breath /obj/item/organ/internal/lungs/proc/handle_temperature_effects(datum/gas_mixture/breath) diff --git a/sound/voice/monkey.ogg b/sound/voice/monkey.ogg new file mode 100644 index 00000000000..e11cbee8d62 Binary files /dev/null and b/sound/voice/monkey.ogg differ