mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 16:38:22 +01:00
Looping sounds, competently. (#14709)
This commit is contained in:
@@ -19,13 +19,18 @@
|
||||
var/list/atom/output_atoms
|
||||
var/mid_sounds
|
||||
var/mid_length
|
||||
var/start_volume
|
||||
var/start_sound
|
||||
var/start_length
|
||||
var/end_volume
|
||||
var/end_sound
|
||||
var/chance
|
||||
var/volume = 100
|
||||
var/vary = FALSE
|
||||
var/max_loops
|
||||
var/direct
|
||||
var/extra_range
|
||||
var/falloff
|
||||
|
||||
var/timerid
|
||||
|
||||
@@ -70,7 +75,7 @@
|
||||
if(!timerid)
|
||||
timerid = addtimer(CALLBACK(src, .proc/sound_loop, world.time), mid_length, TIMER_STOPPABLE | TIMER_LOOP)
|
||||
|
||||
/datum/looping_sound/proc/play(soundfile)
|
||||
/datum/looping_sound/proc/play(soundfile, volume_override)
|
||||
var/list/atoms_cache = output_atoms
|
||||
var/sound/S = sound(soundfile)
|
||||
// if(direct)
|
||||
@@ -81,7 +86,7 @@
|
||||
// if(direct)
|
||||
// SEND_SOUND(thing, S)
|
||||
// else
|
||||
playsound(thing, S, volume)
|
||||
playsound(thing, S, volume_override || volume, vary, extra_range, falloff, required_preferences = ASFX_AMBIENCE) // you can turn it off, i guess.
|
||||
|
||||
/datum/looping_sound/proc/get_sound(starttime, _mid_sounds)
|
||||
. = _mid_sounds || mid_sounds
|
||||
@@ -91,10 +96,10 @@
|
||||
/datum/looping_sound/proc/on_start()
|
||||
var/start_wait = 0
|
||||
if(start_sound)
|
||||
play(start_sound)
|
||||
play(start_sound, start_volume)
|
||||
start_wait = start_length
|
||||
addtimer(CALLBACK(src, .proc/sound_loop), start_wait)
|
||||
|
||||
/datum/looping_sound/proc/on_stop()
|
||||
if(end_sound)
|
||||
play(end_sound)
|
||||
play(end_sound, end_volume)
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
/datum/looping_sound/showering
|
||||
start_sound = 'sound/machines/shower/shower_start.ogg'
|
||||
start_length = 2
|
||||
mid_sounds = list('sound/machines/shower/shower_mid1.ogg'=1,'sound/machines/shower/shower_mid2.ogg'=1,'sound/machines/shower/shower_mid3.ogg'=1)
|
||||
mid_sounds = list('sound/machines/shower/shower_mid1.ogg' = 1,'sound/machines/shower/shower_mid2.ogg' = 1,'sound/machines/shower/shower_mid3.ogg' = 1)
|
||||
mid_length = 10
|
||||
end_sound = 'sound/machines/shower/shower_end.ogg'
|
||||
volume = 10
|
||||
volume = 20
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/supermatter
|
||||
mid_sounds = list('sound/machines/sm/supermatter1.ogg'=1,'sound/machines/sm/supermatter2.ogg'=1,'sound/machines/sm/supermatter3.ogg'=1)
|
||||
mid_length = 10
|
||||
volume = 0.5
|
||||
mid_sounds = list('sound/machines/sm/loops/calm.ogg' = 1)
|
||||
mid_length = 60
|
||||
volume = 40
|
||||
extra_range = 10
|
||||
falloff = 4
|
||||
vary = TRUE
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/generator
|
||||
start_sound = 'sound/machines/generator/generator_start.ogg'
|
||||
start_length = 4
|
||||
mid_sounds = list('sound/machines/generator/generator_mid1.ogg'=1, 'sound/machines/generator/generator_mid2.ogg'=1, 'sound/machines/generator/generator_mid3.ogg'=1)
|
||||
mid_sounds = list('sound/machines/generator/generator_mid1.ogg' = 1, 'sound/machines/generator/generator_mid2.ogg' = 1, 'sound/machines/generator/generator_mid3.ogg' = 1)
|
||||
mid_length = 4
|
||||
end_sound = 'sound/machines/generator/generator_end.ogg'
|
||||
volume = 20
|
||||
@@ -32,14 +35,84 @@
|
||||
mid_sounds = list('sound/machines/fryer/deep_fryer_1.ogg' = 1, 'sound/machines/fryer/deep_fryer_2.ogg' = 1)
|
||||
mid_length = 2
|
||||
end_sound = 'sound/machines/fryer/deep_fryer_emerge.ogg'
|
||||
volume = 2
|
||||
volume = 15
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/grill
|
||||
mid_sounds = list('sound/machines/grill/grillsizzle.ogg' = 1)
|
||||
mid_length = 18
|
||||
volume = 50
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/oven
|
||||
start_sound = 'sound/machines/oven/oven_loop_start.ogg' //my immersions
|
||||
start_length = 12
|
||||
mid_sounds = list('sound/machines/oven/oven_loop_mid.ogg' = 1)
|
||||
mid_length = 13
|
||||
end_sound = 'sound/machines/oven/oven_loop_end.ogg'
|
||||
volume = 100
|
||||
falloff = 4
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/microwave
|
||||
start_sound = 'sound/machines/microwave/microwave-start.ogg'
|
||||
start_length = 10
|
||||
mid_sounds = list('sound/machines/microwave/microwave-mid1.ogg'=10, 'sound/machines/microwave/microwave-mid2.ogg'=1)
|
||||
mid_sounds = list('sound/machines/microwave/microwave-mid1.ogg'= 1, 'sound/machines/microwave/microwave-mid2.ogg'= 1)
|
||||
mid_length = 10
|
||||
end_sound = 'sound/machines/microwave/microwave-end.ogg'
|
||||
volume = 30
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/server
|
||||
mid_sounds = list(
|
||||
'sound/machines/tcomms/tcomms_mid1.ogg' = 1,
|
||||
'sound/machines/tcomms/tcomms_mid2.ogg' = 1,
|
||||
'sound/machines/tcomms/tcomms_mid3.ogg' = 1,
|
||||
'sound/machines/tcomms/tcomms_mid4.ogg' = 1,
|
||||
'sound/machines/tcomms/tcomms_mid5.ogg' = 1,
|
||||
'sound/machines/tcomms/tcomms_mid6.ogg' = 1,
|
||||
'sound/machines/tcomms/tcomms_mid7.ogg' = 1
|
||||
)
|
||||
mid_length = 1.8 SECONDS
|
||||
extra_range = -4.5
|
||||
volume = 10
|
||||
|
||||
// mid_length = 1.8 SECONDS
|
||||
// extra_range = -11
|
||||
// falloff_distance = 1
|
||||
// falloff_exponent = 5 (falloff system from /tg/)(not smart enough to port it)
|
||||
// volume = 50
|
||||
// ignore_walls = FALSE
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/datum/looping_sound/computer
|
||||
start_sound = 'sound/machines/computer/computer_start.ogg'
|
||||
start_length = 7.2 SECONDS
|
||||
start_volume = 10
|
||||
mid_sounds = list('sound/machines/computer/computer_mid1.ogg' = 1, 'sound/machines/computer/computer_mid2.ogg' = 1)
|
||||
mid_length = 1.8 SECONDS
|
||||
end_sound = 'sound/machines/computer/computer_end.ogg'
|
||||
end_volume = 10
|
||||
volume = 3
|
||||
extra_range = -5.5
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/gravgen
|
||||
mid_sounds = list('sound/machines/gravgen/gravgen_mid1.ogg' = 1, 'sound/machines/gravgen/gravgen_mid2.ogg' = 1, 'sound/machines/gravgen/gravgen_mid3.ogg' = 1, 'sound/machines/gravgen/gravgen_mid4.ogg' = 1)
|
||||
mid_length = 1.8 SECONDS
|
||||
extra_range = 10
|
||||
volume = 70
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/looping_sound/firealarm
|
||||
mid_sounds = list('sound/machines/firealarm/FireAlarm1.ogg' = 1,'sound/machines/firealarm/FireAlarm2.ogg' = 1,'sound/machines/firealarm/FireAlarm3.ogg' = 1,'sound/machines/firealarm/FireAlarm4.ogg' = 1)
|
||||
mid_length = 2.4 SECONDS
|
||||
volume = 75
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user