mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Adds volume channel for engine ambience (SM, Tesla) (#15845)
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
var/falloff_exponent
|
||||
var/muted = TRUE
|
||||
var/falloff_distance
|
||||
/// Channel of the audio, random otherwise
|
||||
var/channel
|
||||
|
||||
/datum/looping_sound/New(list/_output_atoms = list(), start_immediately = FALSE, _direct = FALSE)
|
||||
if(!mid_sounds)
|
||||
@@ -75,14 +77,16 @@
|
||||
var/list/atoms_cache = output_atoms
|
||||
var/sound/S = sound(soundfile)
|
||||
if(direct)
|
||||
S.channel = SSsounds.random_available_channel()
|
||||
S.volume = volume
|
||||
S.channel = channel || SSsounds.random_available_channel()
|
||||
for(var/i in 1 to atoms_cache.len)
|
||||
var/atom/thing = atoms_cache[i]
|
||||
if(direct)
|
||||
if(ismob(thing))
|
||||
var/mob/M = thing
|
||||
S.volume = volume * (USER_VOLUME(M, channel) || 1)
|
||||
SEND_SOUND(thing, S)
|
||||
else
|
||||
playsound(thing, S, volume, vary, extra_range, falloff_exponent = falloff_exponent, falloff_distance = falloff_distance)
|
||||
playsound(thing, S, volume, vary, extra_range, falloff_exponent = falloff_exponent, falloff_distance = falloff_distance, channel = channel)
|
||||
|
||||
/datum/looping_sound/proc/get_sound(looped, _mid_sounds)
|
||||
if(!_mid_sounds)
|
||||
|
||||
@@ -16,3 +16,4 @@
|
||||
falloff_exponent = 10
|
||||
falloff_distance = 5
|
||||
vary = TRUE
|
||||
channel = CHANNEL_ENGINE
|
||||
|
||||
Reference in New Issue
Block a user