diff --git a/code/__DEFINES/sound.dm b/code/__DEFINES/sound.dm index 44b65e6cbfb..baf67f3fda6 100644 --- a/code/__DEFINES/sound.dm +++ b/code/__DEFINES/sound.dm @@ -8,13 +8,14 @@ #define CHANNEL_AMBIENCE 1018 #define CHANNEL_ENGINE 1017 // Engine ambient sounds #define CHANNEL_FIREALARM 1016 //fire alarm alarms +#define CHANNEL_ASH_STORM 1015 #define USER_VOLUME(M, C) M?.client?.prefs.get_channel_volume(C) //THIS SHOULD ALWAYS BE THE LOWEST ONE! //KEEP IT UPDATED -#define CHANNEL_HIGHEST_AVAILABLE 1015 +#define CHANNEL_HIGHEST_AVAILABLE 1014 #define MAX_INSTRUMENT_CHANNELS (128 * 6) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index e3c6b2bb1da..98fdfb0a479 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -2028,6 +2028,8 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) return "Engine Ambience" if(CHANNEL_FIREALARM) return "Fire Alarms" + if(CHANNEL_ASH_STORM) + return "Ash Storms" /proc/slot_bitfield_to_slot(input_slot_flags) // Kill off this garbage ASAP; slot flags and clothing flags should be IDENTICAL. GOSH DARN IT. Doesn't work with ears or pockets, either. switch(input_slot_flags) diff --git a/code/datums/looping_sounds/looping_sound.dm b/code/datums/looping_sounds/looping_sound.dm index a73f43d48e6..f2e178830c9 100644 --- a/code/datums/looping_sounds/looping_sound.dm +++ b/code/datums/looping_sounds/looping_sound.dm @@ -33,6 +33,8 @@ var/falloff_distance /// Channel of the audio, random otherwise var/channel + /// If this sound is based off of an area + var/area_sound = FALSE /datum/looping_sound/New(list/_output_atoms = list(), start_immediately = FALSE, _direct = FALSE) if(!mid_sounds) @@ -78,6 +80,12 @@ /datum/looping_sound/proc/play(soundfile) var/list/atoms_cache = output_atoms var/sound/S = sound(soundfile) + if(area_sound) + for(var/area/sound_outputs in atoms_cache) + for(var/mob/listener in mobs_in_area(sound_outputs, TRUE)) + S.volume = volume * (USER_VOLUME(listener, channel)) + SEND_SOUND(listener, S) + return if(direct) S.channel = channel || SSsounds.random_available_channel() for(var/atom/thing in atoms_cache) diff --git a/code/datums/looping_sounds/weather_sounds.dm b/code/datums/looping_sounds/weather_sounds.dm index d355bc59c14..ccd7fa1a5ad 100644 --- a/code/datums/looping_sounds/weather_sounds.dm +++ b/code/datums/looping_sounds/weather_sounds.dm @@ -9,6 +9,8 @@ start_length = 130 end_sound = 'sound/weather/ashstorm/outside/active_end.ogg' volume = 80 + area_sound = TRUE + channel = CHANNEL_ASH_STORM /datum/looping_sound/active_inside_ashstorm mid_sounds = list( @@ -21,6 +23,8 @@ start_length = 130 end_sound = 'sound/weather/ashstorm/inside/active_end.ogg' volume = 60 + area_sound = TRUE + channel = CHANNEL_ASH_STORM /datum/looping_sound/weak_outside_ashstorm mid_sounds = list( @@ -33,6 +37,8 @@ start_length = 130 end_sound = 'sound/weather/ashstorm/outside/weak_end.ogg' volume = 50 + area_sound = TRUE + channel = CHANNEL_ASH_STORM /datum/looping_sound/weak_inside_ashstorm mid_sounds = list( @@ -45,3 +51,5 @@ start_length = 130 end_sound = 'sound/weather/ashstorm/inside/weak_end.ogg' volume = 30 + area_sound = TRUE + channel = CHANNEL_ASH_STORM diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index b709d2d489a..c72572653ca 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -87,6 +87,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts "1018" = 100, // CHANNEL_AMBIENCE "1017" = 100, // CHANNEL_ENGINE "1016" = 100, // CHANNEL_FIREALARM + "1015" = 100, // CHANNEL_ASH_STORM ) /// The volume mixer save timer handle. Used to debounce the DB call to save, to avoid spamming. var/volume_mixer_saving = null