mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 08:29:57 +01:00
Adds sensitive hearing (#12151)
This commit is contained in:
@@ -150,16 +150,37 @@ var/datum/controller/subsystem/explosives/SSexplosives
|
||||
continue
|
||||
|
||||
var/dist = get_dist(M_turf, epicenter)
|
||||
var/explosion_dir = get_dir(M_turf, epicenter)
|
||||
if (reception == 2 && (M.ear_deaf <= 0 || !M.ear_deaf))//Dont play sounds to deaf people
|
||||
var/explosion_dir = angle2text(Get_Angle(M_turf, epicenter))
|
||||
if (reception == 2 && (M.ear_deaf <= 0 || !M.ear_deaf)) //Dont play sounds to deaf people
|
||||
|
||||
// Anyone with sensitive hearing gets a bonus to hearing explosions
|
||||
var/extendeddist = closedist
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/hearing_sensitivity = H.get_hearing_sensitivity()
|
||||
if (hearing_sensitivity)
|
||||
if(H.is_listening())
|
||||
if (hearing_sensitivity == HEARING_VERY_SENSITIVE)
|
||||
extendeddist *= 2
|
||||
else
|
||||
extendeddist = round(closedist *= 1.5, 1)
|
||||
else
|
||||
if (hearing_sensitivity == HEARING_VERY_SENSITIVE)
|
||||
extendeddist *= 1.5
|
||||
else
|
||||
extendeddist = round(closedist *= 1.2, 1)
|
||||
|
||||
// If inside the blast radius + world.view - 2
|
||||
if(dist <= closedist)
|
||||
to_chat(M, FONT_LARGE(SPAN_WARNING("You hear the sound of a nearby explosion coming from \the [dir2text(explosion_dir)].")))
|
||||
if (dist <= closedist)
|
||||
to_chat(M, FONT_LARGE(SPAN_WARNING("You hear the sound of a nearby explosion coming from \the [explosion_dir].")))
|
||||
M.playsound_simple(epicenter, get_sfx(/decl/sound_category/explosion_sound), min(100, volume), use_random_freq = TRUE, falloff = 5)
|
||||
else if (dist > closedist && dist <= extendeddist) // People with sensitive hearing get a better idea of how far it is
|
||||
to_chat(M, FONT_LARGE(SPAN_WARNING("You hear the sound of a semi-close explosion coming from \the [explosion_dir].")))
|
||||
M.playsound_simple(epicenter, get_sfx(/decl/sound_category/explosion_sound), min(100, volume), use_random_freq = TRUE, falloff = 5)
|
||||
else //You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
|
||||
volume = M.playsound_simple(epicenter, 'sound/effects/explosionfar.ogg', volume, use_random_freq = TRUE, falloff = 1000, use_pressure = TRUE)
|
||||
if(volume)
|
||||
to_chat(M, FONT_LARGE(SPAN_NOTICE("You hear the sound of a distant explosion coming from \the [dir2text(explosion_dir)].")))
|
||||
to_chat(M, FONT_LARGE(SPAN_NOTICE("You hear the sound of a distant explosion coming from \the [explosion_dir].")))
|
||||
|
||||
//Deaf people will feel vibrations though
|
||||
if (volume > 0)//Only shake camera if someone was close enough to hear it
|
||||
|
||||
Reference in New Issue
Block a user