mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-16 13:12:22 +00:00
Merge pull request #8429 from Rykka-Stormheart/shep-dev-breath-sounds
Breathing Sounds While in Space
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
var/can_defib = 1 //Horrible damage (like beheadings) will prevent defibbing organics.
|
var/can_defib = 1 //Horrible damage (like beheadings) will prevent defibbing organics.
|
||||||
var/active_regen = FALSE //Used for the regenerate proc in human_powers.dm
|
var/active_regen = FALSE //Used for the regenerate proc in human_powers.dm
|
||||||
var/active_regen_delay = 300
|
var/active_regen_delay = 300
|
||||||
|
var/last_breath_sound // Feels weird doing this, but allows us to store the value across proc calls per-mob.
|
||||||
|
|
||||||
/mob/living/carbon/human/Initialize(mapload, var/new_species = null)
|
/mob/living/carbon/human/Initialize(mapload, var/new_species = null)
|
||||||
if(!dna)
|
if(!dna)
|
||||||
|
|||||||
@@ -563,6 +563,16 @@
|
|||||||
else
|
else
|
||||||
failed_last_breath = 0
|
failed_last_breath = 0
|
||||||
adjustOxyLoss(-5)
|
adjustOxyLoss(-5)
|
||||||
|
|
||||||
|
if(!does_not_breathe && client) // If we breathe, and have an active client, check if we have synthetic lungs.
|
||||||
|
var/obj/item/organ/internal/lungs/L = internal_organs_by_name[O_LUNGS]
|
||||||
|
var/turf = get_turf(src)
|
||||||
|
var/mob/living/carbon/human/M = src
|
||||||
|
if(L.robotic < ORGAN_ROBOT && is_below_sound_pressure(turf) && M.internal) // Only non-synthetic lungs, please, and only play these while the pressure is below that which we can hear sounds normally AND we're on internals.
|
||||||
|
if(!failed_inhale && (world.time >= (last_breath_sound + 7 SECONDS))) // Were we able to inhale successfully? Play inhale.
|
||||||
|
var/exhale = failed_exhale // Pass through if we passed exhale or not
|
||||||
|
play_inhale(M, exhale)
|
||||||
|
last_breath_sound = world.time
|
||||||
|
|
||||||
|
|
||||||
// Hot air hurts :(
|
// Hot air hurts :(
|
||||||
@@ -629,6 +639,26 @@
|
|||||||
|
|
||||||
breath.update_values()
|
breath.update_values()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
/mob/living/carbon/human/proc/play_inhale(var/mob/living/M, var/exhale)
|
||||||
|
var/suit_inhale_sound
|
||||||
|
if(species.suit_inhale_sound)
|
||||||
|
suit_inhale_sound = species.suit_inhale_sound
|
||||||
|
else // Failsafe
|
||||||
|
suit_inhale_sound = 'sound/effects/mob_effects/suit_breathe_in.ogg'
|
||||||
|
|
||||||
|
playsound_local(get_turf(src), suit_inhale_sound, 100, pressure_affected = FALSE, volume_channel = VOLUME_CHANNEL_AMBIENCE)
|
||||||
|
if(!exhale) // Did we fail exhale? If no, play it after inhale finishes.
|
||||||
|
addtimer(CALLBACK(src, .proc/play_exhale, M), 5 SECONDS)
|
||||||
|
|
||||||
|
/mob/living/carbon/human/proc/play_exhale(var/mob/living/M)
|
||||||
|
var/suit_exhale_sound
|
||||||
|
if(species.suit_exhale_sound)
|
||||||
|
suit_exhale_sound = species.suit_exhale_sound
|
||||||
|
else // Failsafe
|
||||||
|
suit_exhale_sound = 'sound/effects/mob_effects/suit_breathe_out.ogg'
|
||||||
|
|
||||||
|
playsound_local(get_turf(src), suit_exhale_sound, 100, pressure_affected = FALSE, volume_channel = VOLUME_CHANNEL_AMBIENCE)
|
||||||
|
|
||||||
/mob/living/carbon/human/handle_environment(datum/gas_mixture/environment)
|
/mob/living/carbon/human/handle_environment(datum/gas_mixture/environment)
|
||||||
if(!environment)
|
if(!environment)
|
||||||
|
|||||||
@@ -129,6 +129,8 @@
|
|||||||
var/breath_type = "oxygen" // Non-oxygen gas breathed, if any.
|
var/breath_type = "oxygen" // Non-oxygen gas breathed, if any.
|
||||||
var/poison_type = "phoron" // Poisonous air.
|
var/poison_type = "phoron" // Poisonous air.
|
||||||
var/exhale_type = "carbon_dioxide" // Exhaled gas type.
|
var/exhale_type = "carbon_dioxide" // Exhaled gas type.
|
||||||
|
var/suit_inhale_sound = 'sound/effects/mob_effects/suit_breathe_in.ogg'
|
||||||
|
var/suit_exhale_sound = 'sound/effects/mob_effects/suit_breathe_out.ogg'
|
||||||
|
|
||||||
var/body_temperature = 310.15 // Species will try to stabilize at this temperature. (also affects temperature processing)
|
var/body_temperature = 310.15 // Species will try to stabilize at this temperature. (also affects temperature processing)
|
||||||
|
|
||||||
|
|||||||
BIN
sound/effects/mob_effects/suit_breathe_in.ogg
Normal file
BIN
sound/effects/mob_effects/suit_breathe_in.ogg
Normal file
Binary file not shown.
BIN
sound/effects/mob_effects/suit_breathe_out.ogg
Normal file
BIN
sound/effects/mob_effects/suit_breathe_out.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user