mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Fire alarm sounds (#17992)
* STOP DROP AND ROLL BABY! * bruh * roasty toasty * Choose Your Voluuume!!!! * :U 👌 🆘 * SteelSlayer Suggestion Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#define CHANNEL_BUZZ 1019
|
||||
#define CHANNEL_AMBIENCE 1018
|
||||
#define CHANNEL_ENGINE 1017 // Engine ambient sounds
|
||||
#define CHANNEL_FIREALARM 1016 //fire alarm alarms
|
||||
|
||||
#define USER_VOLUME(M, C) M?.client?.prefs.get_channel_volume(C)
|
||||
|
||||
|
||||
@@ -2011,6 +2011,8 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
|
||||
return "Ambience"
|
||||
if(CHANNEL_ENGINE)
|
||||
return "Engine Ambience"
|
||||
if(CHANNEL_FIREALARM)
|
||||
return "Fire Alarms"
|
||||
|
||||
/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)
|
||||
|
||||
@@ -58,9 +58,11 @@
|
||||
muted = FALSE
|
||||
on_start()
|
||||
|
||||
/datum/looping_sound/proc/stop(atom/remove_thing)
|
||||
/datum/looping_sound/proc/stop(atom/remove_thing, do_not_mute)
|
||||
if(remove_thing)
|
||||
output_atoms -= remove_thing
|
||||
if(do_not_mute)
|
||||
return
|
||||
if(muted)
|
||||
return
|
||||
muted = TRUE
|
||||
|
||||
@@ -17,3 +17,19 @@
|
||||
falloff_distance = 5
|
||||
vary = TRUE
|
||||
channel = CHANNEL_ENGINE
|
||||
|
||||
GLOBAL_DATUM_INIT(firealarm_soundloop, /datum/looping_sound/firealarm, new(list(), FALSE))
|
||||
|
||||
/datum/looping_sound/firealarm
|
||||
mid_sounds = 'sound/machines/fire_alarm.ogg'
|
||||
mid_length = 20
|
||||
volume = 80
|
||||
extra_range = 15
|
||||
falloff_exponent = 5
|
||||
channel = CHANNEL_FIREALARM
|
||||
|
||||
/datum/looping_sound/firealarm/sound_loop(looped)
|
||||
. = ..()
|
||||
if(!length(output_atoms))
|
||||
stop()
|
||||
|
||||
|
||||
@@ -264,6 +264,7 @@
|
||||
for(var/item in firealarms)
|
||||
var/obj/machinery/firealarm/F = item
|
||||
F.update_icon()
|
||||
GLOB.firealarm_soundloop.start(F)
|
||||
|
||||
for(var/thing in cameras)
|
||||
var/obj/machinery/camera/C = locateUID(thing)
|
||||
@@ -289,6 +290,7 @@
|
||||
for(var/item in firealarms)
|
||||
var/obj/machinery/firealarm/F = item
|
||||
F.update_icon()
|
||||
GLOB.firealarm_soundloop.stop(F, TRUE)
|
||||
|
||||
for(var/thing in cameras)
|
||||
var/obj/machinery/camera/C = locateUID(thing)
|
||||
|
||||
@@ -53,7 +53,6 @@ FIRE ALARM
|
||||
if(wiresexposed)
|
||||
icon_state = "firealarm_b[buildstage]"
|
||||
return
|
||||
|
||||
if(stat & BROKEN)
|
||||
icon_state = "firealarm_broken"
|
||||
else if(stat & NOPOWER)
|
||||
@@ -281,6 +280,7 @@ FIRE ALARM
|
||||
name = "fire alarm"
|
||||
|
||||
/obj/machinery/firealarm/Destroy()
|
||||
LAZYREMOVE(GLOB.firealarm_soundloop.output_atoms, src)
|
||||
LAZYREMOVE(myArea.firealarms, src)
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
"1019" = 100, // CHANNEL_BUZZ
|
||||
"1018" = 100, // CHANNEL_AMBIENCE
|
||||
"1017" = 100, // CHANNEL_ENGINE
|
||||
"1016" = 100, // CHANNEL_FIREALARM
|
||||
)
|
||||
/// The volume mixer save timer handle. Used to debounce the DB call to save, to avoid spamming.
|
||||
var/volume_mixer_saving = null
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user