mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 14:07:51 +01:00
Limits hearing sounds in a vacuum
Conflicts: code/modules/mob/living/say.dm
This commit is contained in:
+15
-2
@@ -14,10 +14,23 @@
|
||||
var/mob/M = P
|
||||
if(!M || !M.client)
|
||||
continue
|
||||
if(get_dist(M, turf_source) <= (world.view + extrarange) * 3)
|
||||
|
||||
var/distance = get_dist(M, turf_source)
|
||||
if(distance <= (world.view + extrarange) * 3)
|
||||
var/turf/T = get_turf(M)
|
||||
|
||||
if(T && T.z == turf_source.z)
|
||||
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff)
|
||||
//check that the air can transmit sound
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
if (!environment || environment.return_pressure() < SOUND_MINIMUM_PRESSURE)
|
||||
if (distance > 1)
|
||||
continue
|
||||
|
||||
var/new_frequency = 32000 + (frequency - 32000)*0.75 //lower the frequency a bit. very rudimentary
|
||||
var/new_volume = vol*0.5 //muffle the sound, like we're hearing through contact
|
||||
M.playsound_local(turf_source, soundin, new_volume, vary, new_frequency, falloff)
|
||||
else
|
||||
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff)
|
||||
|
||||
var/const/FALLOFF_SOUNDS = 2
|
||||
var/const/SURROUND_CAP = 255
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#define SAY_MINIMUM_PRESSURE 10
|
||||
var/list/department_radio_keys = list(
|
||||
":r" = "right ear", "#r" = "right ear", ".r" = "right ear", "!r" = "fake right ear",
|
||||
":l" = "left ear", "#l" = "left ear", ".l" = "left ear", "!l" = "fake left ear",
|
||||
@@ -329,7 +328,7 @@ var/list/department_radio_keys = list(
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
if(environment)
|
||||
var/pressure = environment.return_pressure()
|
||||
if (pressure < SAY_MINIMUM_PRESSURE) //in space no one can hear you scream
|
||||
if(pressure < SOUND_MINIMUM_PRESSURE)
|
||||
italics = 1
|
||||
message_range = 1
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#define HUMAN_NEEDED_OXYGEN MOLES_CELLSTANDARD*BREATH_PERCENTAGE*0.16
|
||||
//Amount of air needed before pass out/suffocation commences
|
||||
|
||||
#define SOUND_MINIMUM_PRESSURE 10
|
||||
|
||||
// Pressure limits.
|
||||
#define HAZARD_HIGH_PRESSURE 550 //This determins at what pressure the ultra-high pressure red icon is displayed. (This one is set as a constant)
|
||||
#define WARNING_HIGH_PRESSURE 325 //This determins when the orange pressure icon is displayed (it is 0.7 * HAZARD_HIGH_PRESSURE)
|
||||
|
||||
Reference in New Issue
Block a user