Cleans up old echo, tweaks new echo (#2076)

* aa

* Update jukeboxes.dm

* Update jukeboxes.dm

* Update jukeboxes.dm
This commit is contained in:
Azarak
2020-12-08 01:05:49 +00:00
committed by GitHub
parent 803442b928
commit 679fe3ce6c
2 changed files with 6 additions and 14 deletions
+5 -6
View File
@@ -106,8 +106,7 @@ distance_multiplier - Can be used to multiply the distance at which the sound is
*/
///mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff_exponent = SOUND_FALLOFF_EXPONENT, channel = 0, pressure_affected = TRUE, sound/S, max_distance, falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE, distance_multiplier = 1, use_reverb = TRUE) //ORIGINAL
/mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff_exponent = SOUND_FALLOFF_EXPONENT, channel = 0, pressure_affected = TRUE, sound/S, max_distance, falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE, distance_multiplier = 1,envwet = -10000, envdry = 0, use_reverb = TRUE) //SKYRAT EDIT CHANGE - SOUND ECHO
/mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff_exponent = SOUND_FALLOFF_EXPONENT, channel = 0, pressure_affected = TRUE, sound/S, max_distance, falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE, distance_multiplier = 1, use_reverb = TRUE)
if(!client || !can_hear())
return
@@ -150,8 +149,6 @@ distance_multiplier - Can be used to multiply the distance at which the sound is
else //space
pressure_factor = 0
S.echo = list(envdry, null, envwet, null, null, null, null, null, null, null, null, null, null, 1, 1, 1, null, null) //SKYRAT CHANGE ADDITION - SOUND ECHO
if(distance <= 1)
pressure_factor = max(pressure_factor, 0.15) //touching the source of the sound
@@ -179,8 +176,10 @@ distance_multiplier - Can be used to multiply the distance at which the sound is
S.environment = A.sound_environment
if(use_reverb && S.environment != SOUND_ENVIRONMENT_NONE) //We have reverb, reset our echo setting
S.echo[3] = 0 //Room setting, 0 means normal reverb
S.echo[4] = 0 //RoomHF setting, 0 means normal reverb.
//S.echo[3] = 0 //Room setting, 0 means normal reverb //ORIGINAL
//S.echo[4] = 0 //RoomHF setting, 0 means normal reverb. //ORIGINAL
S.echo[3] = -1000 //Room setting, 0 means normal reverb //SKYRAT EDIT CHANGE
S.echo[4] = -1000 //RoomHF setting, 0 means normal reverb. //SKYRAT EDIT CHANGE
SEND_SOUND(src, S)
@@ -96,9 +96,7 @@ SUBSYSTEM_DEF(jukeboxes)
stack_trace("Nonexistant or invalid object associated with jukebox.")
continue
var/sound/song_played = sound(juketrack.song_path)
var/area/currentarea = get_area(jukebox)
var/turf/currentturf = get_turf(jukebox)
var/list/hearerscache = hearers(7, jukebox)
song_played.falloff = jukeinfo[4]
@@ -109,16 +107,11 @@ SUBSYSTEM_DEF(jukeboxes)
M.stop_sound_channel(jukeinfo[2])
continue
var/inrange = FALSE
if(jukebox.z == M.z) //todo - expand this to work with mining planet z-levels when robust jukebox audio gets merged to master
song_played.status = SOUND_UPDATE
if(get_area(M) == currentarea)
inrange = TRUE
else if(M in hearerscache)
inrange = TRUE
else
song_played.status = SOUND_MUTE | SOUND_UPDATE //Setting volume = 0 doesn't let the sound properties update at all, which is lame.
M.playsound_local(currentturf, null, jukebox.volume, channel = jukeinfo[2], S = song_played, envwet = (inrange ? -250 : 0), envdry = (inrange ? 0 : -10000))
M.playsound_local(currentturf, null, jukebox.volume, channel = jukeinfo[2], S = song_played)
CHECK_TICK
return