diff --git a/aurorastation.dme b/aurorastation.dme
index 78c1443c5e6..6d383028689 100644
--- a/aurorastation.dme
+++ b/aurorastation.dme
@@ -113,6 +113,7 @@
#include "code\__DEFINES\singletons.dm"
#include "code\__DEFINES\smart_token_bucket.dm"
#include "code\__DEFINES\solar.dm"
+#include "code\__DEFINES\sound.dm"
#include "code\__DEFINES\space_sectors.dm"
#include "code\__DEFINES\spatial_gridmap.dm"
#include "code\__DEFINES\species.dm"
@@ -334,6 +335,8 @@
#include "code\controllers\subsystems\responseteam.dm"
#include "code\controllers\subsystems\runechat.dm"
#include "code\controllers\subsystems\skybox.dm"
+#include "code\controllers\subsystems\sound_loops.dm"
+#include "code\controllers\subsystems\sounds.dm"
#include "code\controllers\subsystems\spatial_gridmap.dm"
#include "code\controllers\subsystems\statistics.dm"
#include "code\controllers\subsystems\statpanel.dm"
diff --git a/code/__DEFINES/atmos.dm b/code/__DEFINES/atmos.dm
index 869918d6cca..6cc3f6b3561 100644
--- a/code/__DEFINES/atmos.dm
+++ b/code/__DEFINES/atmos.dm
@@ -21,8 +21,6 @@
#define HUMAN_NEEDED_OXYGEN (MOLES_CELLSTANDARD * BREATH_PERCENTAGE * 0.16)
#define HUMAN_HEAT_CAPACITY 280000 //J/K For 80kg person
-#define SOUND_MINIMUM_PRESSURE 10
-
#define PRESSURE_DAMAGE_COEFFICIENT 4 // The amount of pressure damage someone takes is equal to (pressure / HAZARD_HIGH_PRESSURE)*PRESSURE_DAMAGE_COEFFICIENT, with the maximum of MAX_PRESSURE_DAMAGE.
#define MAX_HIGH_PRESSURE_DAMAGE 4
#define LOW_PRESSURE_DAMAGE 0.6 // The amount of damage someone takes when in a low pressure area. (The pressure threshold is so low that it doesn't make sense to do any calculations, so it just applies this flat value).
diff --git a/code/__DEFINES/sound.dm b/code/__DEFINES/sound.dm
new file mode 100644
index 00000000000..a45ae4aacb2
--- /dev/null
+++ b/code/__DEFINES/sound.dm
@@ -0,0 +1,86 @@
+//max channel is 1024. Only go lower from here, because byond tends to pick the first available channel to play sounds on
+#define CHANNEL_LOBBYMUSIC 1024
+#define CHANNEL_ADMIN 1023
+#define CHANNEL_VOX 1022
+#define CHANNEL_JUKEBOX 1021
+#define CHANNEL_HEARTBEAT 1020 //sound channel for heartbeats
+#define CHANNEL_BOSS_MUSIC 1019
+#define CHANNEL_AMBIENCE 1018
+#define CHANNEL_BUZZ 1017
+#define CHANNEL_TRAITOR 1016
+#define CHANNEL_CHARGED_SPELL 1015
+#define CHANNEL_ELEVATOR 1014
+
+///Default range of a sound.
+#define SOUND_RANGE 17
+#define MEDIUM_RANGE_SOUND_EXTRARANGE -5
+///default extra range for sounds considered to be quieter
+#define SHORT_RANGE_SOUND_EXTRARANGE -9
+///The range deducted from sound range for things that are considered silent / sneaky
+#define SILENCED_SOUND_EXTRARANGE -11
+///Percentage of sound's range where no falloff is applied
+#define SOUND_DEFAULT_FALLOFF_DISTANCE 1 //For a normal sound this would be 1 tile of no falloff
+///The default exponent of sound falloff
+#define SOUND_FALLOFF_EXPONENT 6
+
+//THIS SHOULD ALWAYS BE THE LOWEST ONE!
+//KEEP IT UPDATED
+
+#define CHANNEL_HIGHEST_AVAILABLE 1015
+
+#define MAX_INSTRUMENT_CHANNELS (128 * 6)
+
+#define SOUND_MINIMUM_PRESSURE 10
+
+#define INTERACTION_SOUND_RANGE_MODIFIER -3
+#define EQUIP_SOUND_VOLUME 30
+#define PICKUP_SOUND_VOLUME 15
+#define DROP_SOUND_VOLUME 20
+#define YEET_SOUND_VOLUME 90
+#define BLOCK_SOUND_VOLUME 70
+
+
+//default byond sound environments
+#define SOUND_ENVIRONMENT_NONE -1
+#define SOUND_ENVIRONMENT_GENERIC 0
+#define SOUND_ENVIRONMENT_PADDED_CELL 1
+#define SOUND_ENVIRONMENT_ROOM 2
+#define SOUND_ENVIRONMENT_BATHROOM 3
+#define SOUND_ENVIRONMENT_LIVINGROOM 4
+#define SOUND_ENVIRONMENT_STONEROOM 5
+#define SOUND_ENVIRONMENT_AUDITORIUM 6
+#define SOUND_ENVIRONMENT_CONCERT_HALL 7
+#define SOUND_ENVIRONMENT_CAVE 8
+#define SOUND_ENVIRONMENT_ARENA 9
+#define SOUND_ENVIRONMENT_HANGAR 10
+#define SOUND_ENVIRONMENT_CARPETED_HALLWAY 11
+#define SOUND_ENVIRONMENT_HALLWAY 12
+#define SOUND_ENVIRONMENT_STONE_CORRIDOR 13
+#define SOUND_ENVIRONMENT_ALLEY 14
+#define SOUND_ENVIRONMENT_FOREST 15
+#define SOUND_ENVIRONMENT_CITY 16
+#define SOUND_ENVIRONMENT_MOUNTAINS 17
+#define SOUND_ENVIRONMENT_QUARRY 18
+#define SOUND_ENVIRONMENT_PLAIN 19
+#define SOUND_ENVIRONMENT_PARKING_LOT 20
+#define SOUND_ENVIRONMENT_SEWER_PIPE 21
+#define SOUND_ENVIRONMENT_UNDERWATER 22
+#define SOUND_ENVIRONMENT_DRUGGED 23
+#define SOUND_ENVIRONMENT_DIZZY 24
+#define SOUND_ENVIRONMENT_PSYCHOTIC 25
+//If we ever make custom ones add them here
+#define SOUND_ENVIROMENT_PHASED list(1.8, 0.5, -1000, -4000, 0, 5, 0.1, 1, -15500, 0.007, 2000, 0.05, 0.25, 1, 1.18, 0.348, -5, 2000, 250, 0, 3, 100, 63)
+
+//"sound areas": easy way of keeping different types of areas consistent.
+#define SOUND_AREA_STANDARD_STATION SOUND_ENVIRONMENT_PARKING_LOT
+#define SOUND_AREA_LARGE_ENCLOSED SOUND_ENVIRONMENT_QUARRY
+#define SOUND_AREA_SMALL_ENCLOSED SOUND_ENVIRONMENT_BATHROOM
+#define SOUND_AREA_TUNNEL_ENCLOSED SOUND_ENVIRONMENT_STONEROOM
+#define SOUND_AREA_LARGE_SOFTFLOOR SOUND_ENVIRONMENT_CARPETED_HALLWAY
+#define SOUND_AREA_MEDIUM_SOFTFLOOR SOUND_ENVIRONMENT_LIVINGROOM
+#define SOUND_AREA_SMALL_SOFTFLOOR SOUND_ENVIRONMENT_ROOM
+#define SOUND_AREA_ASTEROID SOUND_ENVIRONMENT_CAVE
+#define SOUND_AREA_SPACE SOUND_ENVIRONMENT_UNDERWATER
+#define SOUND_AREA_LAVALAND SOUND_ENVIRONMENT_MOUNTAINS
+#define SOUND_AREA_ICEMOON SOUND_ENVIRONMENT_CAVE
+#define SOUND_AREA_WOODFLOOR SOUND_ENVIRONMENT_CITY
diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm
index 3c8eb2ac3cb..8fe6a8fcbdf 100644
--- a/code/__DEFINES/subsystems.dm
+++ b/code/__DEFINES/subsystems.dm
@@ -214,6 +214,7 @@
#define INIT_ORDER_PERSISTENT_CONFIGURATION 101 //Aurora snowflake conflg handling
#define INIT_ORDER_PROFILER 101
#define INIT_ORDER_GARBAGE 99
+#define INIT_ORDER_SOUNDS 83
#define INIT_ORDER_DISCORD 78
#define INIT_ORDER_JOBS 65 // Must init before atoms, to set up properly the dynamic job lists.
#define INIT_ORDER_TICKER 55
@@ -259,6 +260,7 @@
#define FIRE_PRIORITY_CHAT 400
#define FIRE_PRIORITY_RUNECHAT 410
#define FIRE_PRIORITY_TIMER 700
+#define FIRE_PRIORITY_SOUND_LOOPS 800
/**
Create a new timer and add it to the queue.
diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm
index a1190a2527e..ee86cd76675 100644
--- a/code/__HELPERS/files.dm
+++ b/code/__HELPERS/files.dm
@@ -89,3 +89,33 @@
fcopy(file, filename)
. = md5filepath(filename)
fdel(filename)
+
+/**
+ * Takes a directory and returns every file within every sub directory.
+ * If extensions_filter is provided then only files that end in that extension are given back.
+ * If extensions_filter is a list, any file that matches at least one entry is given back.
+ */
+/proc/pathwalk(path, extensions_filter)
+ var/list/jobs = list(path)
+ var/list/filenames = list()
+
+ while(jobs.len)
+ var/current_dir = pop(jobs)
+ var/list/new_filenames = flist(current_dir)
+ for(var/new_filename in new_filenames)
+ // if filename ends in / it is a directory, append to currdir
+ if(findtext(new_filename, "/", -1))
+ jobs += "[current_dir][new_filename]"
+ continue
+ // filename extension filtering
+ if(extensions_filter)
+ if(islist(extensions_filter))
+ for(var/allowed_extension in extensions_filter)
+ if(endswith(new_filename, allowed_extension))
+ filenames += "[current_dir][new_filename]"
+ break
+ else if(endswith(new_filename, extensions_filter))
+ filenames += "[current_dir][new_filename]"
+ else
+ filenames += "[current_dir][new_filename]"
+ return filenames
diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm
index 88af9bd5bb4..7a400e884f6 100644
--- a/code/__HELPERS/text.dm
+++ b/code/__HELPERS/text.dm
@@ -871,3 +871,8 @@
return copytext(html_encode(user_input), 1, max_length)
else
return trim(html_encode(user_input), max_length)
+
+/// Returns TRUE if the input_text ends with the ending
+/proc/endswith(input_text, ending)
+ var/input_length = LAZYLEN(ending)
+ return !!findtext(input_text, ending, -input_length)
diff --git a/code/controllers/subsystems/explosives.dm b/code/controllers/subsystems/explosives.dm
index 48c5a000a37..f44d7754181 100644
--- a/code/controllers/subsystems/explosives.dm
+++ b/code/controllers/subsystems/explosives.dm
@@ -160,12 +160,12 @@ SUBSYSTEM_DEF(explosives)
// If inside the blast radius + world.view - 2
if (dist <= closedist)
to_chat(M, FONT_LARGE(SPAN_WARNING("You hear the sound of a nearby explosion coming from \the [explosion_dir].")))
- M.playsound_simple(epicenter, get_sfx(/singleton/sound_category/explosion_sound), min(100, volume), use_random_freq = TRUE, falloff = 5)
+ M.playsound_local(epicenter, get_sfx(/singleton/sound_category/explosion_sound), min(100, volume), vary = TRUE, falloff_distance = 5)
else if (dist > closedist && dist <= extendeddist) // People with sensitive hearing get a better idea of how far it is
to_chat(M, FONT_LARGE(SPAN_WARNING("You hear the sound of a semi-close explosion coming from \the [explosion_dir].")))
- M.playsound_simple(epicenter, get_sfx(/singleton/sound_category/explosion_sound), min(100, volume), use_random_freq = TRUE, falloff = 5)
+ M.playsound_local(epicenter, get_sfx(/singleton/sound_category/explosion_sound), min(100, volume), vary = TRUE, falloff_distance = 5)
else //You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
- volume = M.playsound_simple(epicenter, 'sound/effects/explosionfar.ogg', volume, use_random_freq = TRUE, falloff = 1000, use_pressure = TRUE)
+ volume = M.playsound_local(epicenter, 'sound/effects/explosionfar.ogg', volume, vary = TRUE, falloff_distance = 1000, pressure_affected = TRUE)
if(volume)
to_chat(M, FONT_LARGE(SPAN_NOTICE("You hear the sound of a distant explosion coming from \the [explosion_dir].")))
@@ -357,10 +357,10 @@ SUBSYSTEM_DEF(explosives)
var/dist = get_dist(M, epicenter) || 1
if ((reception & EXPLFX_SOUND) && !isdeaf(M))
if (dist <= close_dist)
- M.playsound_simple(epicenter, explosion_sound, min(100, volume), use_random_freq = TRUE, falloff = 5)
+ M.playsound_local(epicenter, explosion_sound, min(100, volume), vary = TRUE, falloff_distance = 5)
//You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else
- volume = M.playsound_simple(epicenter, 'sound/effects/explosionfar.ogg', volume, use_random_freq = TRUE, falloff = 1000, use_pressure = FALSE)
+ volume = M.playsound_local(epicenter, 'sound/effects/explosionfar.ogg', volume, vary = TRUE, falloff_distance = 1000, pressure_affected = FALSE)
if ((reception & EXPLFX_SHAKE) && volume > 0)
shake_camera(M, min(30, max(2,(power*2) / dist)), min(3.5, ((power/3) / dist)),0.05)
diff --git a/code/controllers/subsystems/sound_loops.dm b/code/controllers/subsystems/sound_loops.dm
new file mode 100644
index 00000000000..46b916603f9
--- /dev/null
+++ b/code/controllers/subsystems/sound_loops.dm
@@ -0,0 +1,3 @@
+TIMER_SUBSYSTEM_DEF(sound_loops)
+ name = "Sound Loops"
+ priority = FIRE_PRIORITY_SOUND_LOOPS
diff --git a/code/controllers/subsystems/sounds.dm b/code/controllers/subsystems/sounds.dm
new file mode 100644
index 00000000000..2bc253c5af7
--- /dev/null
+++ b/code/controllers/subsystems/sounds.dm
@@ -0,0 +1,159 @@
+#define DATUMLESS "NO_DATUM"
+
+SUBSYSTEM_DEF(sounds)
+ name = "Sounds"
+ flags = SS_NO_FIRE
+ init_order = INIT_ORDER_SOUNDS
+ var/static/using_channels_max = CHANNEL_HIGHEST_AVAILABLE //BYOND max channels
+ /// Amount of channels to reserve for random usage rather than reservations being allowed to reserve all channels. Also a nice safeguard for when someone screws up.
+ var/static/random_channels_min = 50
+
+ // Hey uh these two needs to be initialized fast because the whole "things get deleted before init" thing.
+ /// Assoc list, `"[channel]" =` either the datum using it or TRUE for an unsafe-reserved (datumless reservation) channel
+ var/list/using_channels
+ /// Assoc list datum = list(channel1, channel2, ...) for what channels something reserved.
+ var/list/using_channels_by_datum
+ // Special datastructure for fast channel management
+ /// List of all channels as numbers
+ var/list/channel_list
+ /// Associative list of all reserved channels associated to their position. `"[channel_number]" =` index as number
+ var/list/reserved_channels
+ /// lower iteration position - Incremented and looped to get "random" sound channels for normal sounds. The channel at this index is returned when asking for a random channel.
+ var/channel_random_low
+ /// higher reserve position - decremented and incremented to reserve sound channels, anything above this is reserved. The channel at this index is the highest unreserved channel.
+ var/channel_reserve_high
+
+ /// All valid sound files in the sound directory
+ var/list/all_sounds
+
+/datum/controller/subsystem/sounds/Initialize()
+ setup_available_channels()
+ find_all_available_sounds()
+ return SS_INIT_SUCCESS
+
+/datum/controller/subsystem/sounds/proc/setup_available_channels()
+ channel_list = list()
+ reserved_channels = list()
+ using_channels = list()
+ using_channels_by_datum = list()
+ for(var/i in 1 to using_channels_max)
+ channel_list += i
+ channel_random_low = 1
+ channel_reserve_high = length(channel_list)
+
+/datum/controller/subsystem/sounds/proc/find_all_available_sounds()
+ all_sounds = list()
+ // Put more common extensions first to speed this up a bit
+ var/static/list/valid_file_extensions = list(
+ ".ogg",
+ ".wav",
+ ".mid",
+ ".midi",
+ ".mod",
+ ".it",
+ ".s3m",
+ ".xm",
+ ".oxm",
+ ".raw",
+ ".wma",
+ ".aiff",
+ )
+
+ all_sounds = pathwalk("sound/", valid_file_extensions)
+
+/// Removes a channel from using list.
+/datum/controller/subsystem/sounds/proc/free_sound_channel(channel)
+ var/text_channel = num2text(channel)
+ var/using = using_channels[text_channel]
+ using_channels -= text_channel
+ if(using != TRUE) // datum channel
+ using_channels_by_datum[using] -= channel
+ if(!length(using_channels_by_datum[using]))
+ using_channels_by_datum -= using
+ free_channel(channel)
+
+/// Frees all the channels a datum is using.
+/datum/controller/subsystem/sounds/proc/free_datum_channels(datum/D)
+ var/list/L = using_channels_by_datum[D]
+ if(!L)
+ return
+ for(var/channel in L)
+ using_channels -= num2text(channel)
+ free_channel(channel)
+ using_channels_by_datum -= D
+
+/// Frees all datumless channels
+/datum/controller/subsystem/sounds/proc/free_datumless_channels()
+ free_datum_channels(DATUMLESS)
+
+/// NO AUTOMATIC CLEANUP - If you use this, you better manually free it later! Returns an integer for channel.
+/datum/controller/subsystem/sounds/proc/reserve_sound_channel_datumless()
+ . = reserve_channel()
+ if(!.) //oh no..
+ return FALSE
+ var/text_channel = num2text(.)
+ using_channels[text_channel] = DATUMLESS
+ LAZYINITLIST(using_channels_by_datum[DATUMLESS])
+ using_channels_by_datum[DATUMLESS] += .
+
+/// Reserves a channel for a datum. Automatic cleanup only when the datum is deleted. Returns an integer for channel.
+/datum/controller/subsystem/sounds/proc/reserve_sound_channel(datum/D)
+ if(!D) //i don't like typechecks but someone will fuck it up
+ CRASH("Attempted to reserve sound channel without datum using the managed proc.")
+ .= reserve_channel()
+ if(!.)
+ CRASH("No more sound channels can be reserved")
+ var/text_channel = num2text(.)
+ using_channels[text_channel] = D
+ LAZYINITLIST(using_channels_by_datum[D])
+ using_channels_by_datum[D] += .
+
+/**
+ * Reserves a channel and updates the datastructure. Private proc.
+ */
+/datum/controller/subsystem/sounds/proc/reserve_channel()
+ PRIVATE_PROC(TRUE)
+ if(channel_reserve_high <= random_channels_min) // out of channels
+ return
+ var/channel = channel_list[channel_reserve_high]
+ reserved_channels[num2text(channel)] = channel_reserve_high--
+ return channel
+
+/**
+ * Frees a channel and updates the datastructure. Private proc.
+ */
+/datum/controller/subsystem/sounds/proc/free_channel(number)
+ PRIVATE_PROC(TRUE)
+ var/text_channel = num2text(number)
+ var/index = reserved_channels[text_channel]
+ if(!index)
+ CRASH("Attempted to (internally) free a channel that wasn't reserved.")
+ reserved_channels -= text_channel
+ // push reserve index up, which makes it now on a channel that is reserved
+ channel_reserve_high++
+ // swap the reserved channel wtih the unreserved channel so the reserve index is now on an unoccupied channel and the freed channel is next to be used.
+ channel_list.Swap(channel_reserve_high, index)
+ // now, an existing reserved channel will likely (exception: unreserving last reserved channel) be at index
+ // get it, and update position.
+ var/text_reserved = num2text(channel_list[index])
+ if(!reserved_channels[text_reserved]) //if it isn't already reserved make sure we don't accidently mistakenly put it on reserved list!
+ return
+ reserved_channels[text_reserved] = index
+
+/// Random available channel, returns text.
+/datum/controller/subsystem/sounds/proc/random_available_channel_text()
+ if(channel_random_low > channel_reserve_high)
+ channel_random_low = 1
+ . = "[channel_list[channel_random_low++]]"
+
+/// Random available channel, returns number
+/datum/controller/subsystem/sounds/proc/random_available_channel()
+ if(channel_random_low > channel_reserve_high)
+ channel_random_low = 1
+ . = channel_list[channel_random_low++]
+
+/// How many channels we have left.
+/datum/controller/subsystem/sounds/proc/available_channels_left()
+ return length(channel_list) - random_channels_min
+
+#undef DATUMLESS
diff --git a/code/datums/looping_sounds/_looping_sound.dm b/code/datums/looping_sounds/_looping_sound.dm
index cb10aa17f30..54185efdb8d 100644
--- a/code/datums/looping_sounds/_looping_sound.dm
+++ b/code/datums/looping_sounds/_looping_sound.dm
@@ -1,136 +1,249 @@
-/*
- output_atoms (list of atoms) The destination(s) for the sounds
-
- mid_sounds (list or soundfile) Since this can be either a list or a single soundfile you can have random sounds. May contain further lists but must contain a soundfile at the end.
- mid_length (num) The length to wait between playing mid_sounds
-
- start_sound (soundfile) Played before starting the mid_sounds loop
- start_length (num) How long to wait before starting the main loop after playing start_sound
-
- end_sound (soundfile) The sound played after the main loop has concluded
-
- chance (num) Chance per loop to play a mid_sound
- volume (num) Sound output volume
- max_loops (num) The max amount of loops to run for.
- direct (bool) If true plays directly to provided atoms instead of from them
-*/
-
+/**
+ * A datum for sounds that need to loop, with a high amount of configurability.
+ */
/datum/looping_sound
-
- ///A `/list` of `/atom`, destinations for the sound
- var/list/atom/output_atoms = list()
-
- /**
- * A list with soundfiles, or a soundfile, to play for the intermediate steps
- *
- * Must contain at least one sound
- */
+ /// (list or soundfile) Since this can be either a list or a single soundfile you can have random sounds. May contain further lists but must contain a soundfile at the end.
var/mid_sounds
-
- ///The length to wait between playing mid_sounds
+ /// The length of time to wait between playing mid_sounds.
var/mid_length
-
- ///Volume for the start sound
+ /// Amount of time to add/take away from the mid length, randomly
+ var/mid_length_vary = 0
+ /// If we should always play each sound once per loop of all sounds. Weights here only really effect order, and could be disgarded
+ var/each_once = FALSE
+ /// Whether if the sounds should be played in order or not. Defaults to FALSE.
+ var/in_order = FALSE
+ /// Override for volume of start sound.
var/start_volume
-
- ///A soundfile, played before starting the mid_sounds loop
+ /// (soundfile) Played before starting the mid_sounds loop.
var/start_sound
-
- ///How long to wait before starting the main loop after playing start_sound
+ /// How long to wait before starting the main loop after playing start_sound.
var/start_length
-
- ///Volume for the end sound
+ /// Override for volume of end sound.
var/end_volume
-
- ///A soundfile, the sound played after the main loop has concluded
+ /// (soundfile) The sound played after the main loop has concluded.
var/end_sound
-
- ///Chance per loop to play a mid_sound
+ /// Chance per loop to play a mid_sound.
var/chance
-
- ///Sound output volume
+ /// Sound output volume.
var/volume = 100
-
- ///Whether or not the sounds will vary in pitch when played
+ /// Whether or not the sounds will vary in pitch when played.
var/vary = FALSE
-
- ///The max amount of loops to run for
+ /// The max amount of loops to run for.
var/max_loops
+ /// The extra range of the sound in tiles, defaults to 0.
+ var/extra_range = 0
+ /// How much the sound will be affected by falloff per tile.
+ var/falloff_exponent
+ /// The falloff distance of the sound,
+ var/falloff_distance
+ /// Are the sounds affected by pressure? Defaults to TRUE.
+ var/pressure_affected = TRUE
+ /// Are the sounds subject to reverb? Defaults to TRUE.
+ var/use_reverb = TRUE
+ /// Are we ignoring walls? Defaults to TRUE.
+ var/ignore_walls = TRUE
+
+ // State stuff
+ /// The source of the sound, or the recipient of the sound.
+ var/atom/parent
+ /// The ID of the timer that's used to loop the sounds.
+ var/timer_id
+ /// Has the looping started yet?
+ var/loop_started = FALSE
+ /// If we're using cut_mid, this is the list we cut from
+ var/list/cut_list
+ ///The index of the current song we're playing in the mid_sounds list, only used if in_order is used
+ ///This is immediately set to 1, so we start the index at 0
+ var/audio_index = 0
+
+ // Args
+ /// Do we skip the starting sounds?
+ var/skip_starting_sounds = FALSE
+ /// If true, plays directly to provided atoms instead of from them.
var/direct
+ /// Sound channel to play on, random if not provided
+ var/sound_channel
- ///The extra range of the sound in tiles, defaults to 0.
- var/extra_range
- var/falloff
-
- ///The ID of the timer that's used to loop the sounds.
- var/timerid
-
-/datum/looping_sound/New(list/_output_atoms=list(), start_immediately=FALSE, _direct=FALSE)
+/datum/looping_sound/New(_parent, start_immediately = FALSE, _direct = FALSE, _skip_starting_sounds = FALSE)
if(!mid_sounds)
- crash_with("A looping sound datum was created without sounds to play.")
+ WARNING("A looping sound datum was created without sounds to play.")
return
- output_atoms |= _output_atoms
+ set_parent(_parent)
direct = _direct
+ skip_starting_sounds = _skip_starting_sounds
if(start_immediately)
start()
/datum/looping_sound/Destroy()
- stop()
- output_atoms = null
+ stop(TRUE)
return ..()
-/datum/looping_sound/proc/start(atom/add_thing)
- if(add_thing)
- output_atoms |= add_thing
- if(timerid)
+/**
+ * The proc to actually kickstart the whole sound sequence. This is what you should call to start the `looping_sound`.
+ *
+ * Arguments:
+ * * on_behalf_of - The new object to set as a parent.
+ */
+/datum/looping_sound/proc/start(on_behalf_of)
+ if(on_behalf_of)
+ set_parent(on_behalf_of)
+ if(timer_id)
return
on_start()
-/datum/looping_sound/proc/stop(atom/remove_thing)
- if(remove_thing)
- output_atoms -= remove_thing
- if(!timerid)
+/**
+ * The proc to call to stop the sound loop.
+ *
+ * Arguments:
+ * * null_parent - Whether or not we should set the parent to null (useful when destroying the `looping_sound` itself). Defaults to FALSE.
+ */
+/datum/looping_sound/proc/stop(null_parent = FALSE)
+ stop_current()
+ if(null_parent)
+ set_parent(null)
+ if(!timer_id)
return
on_stop()
- deltimer(timerid)
- timerid = null
+ deltimer(timer_id, SSsound_loops)
+ timer_id = null
+ loop_started = FALSE
-/datum/looping_sound/proc/sound_loop(starttime)
- if(max_loops && (world.time >= starttime + mid_length * max_loops))
+/// The proc that handles starting the actual core sound loop.
+/datum/looping_sound/proc/start_sound_loop()
+ loop_started = TRUE
+ sound_loop()
+ timer_id = addtimer(CALLBACK(src, PROC_REF(sound_loop), world.time), mid_length, TIMER_CLIENT_TIME | TIMER_STOPPABLE | TIMER_LOOP | TIMER_DELETE_ME, SSsound_loops)
+
+/**
+ * A simple proc handling the looping of the sound itself.
+ *
+ * Arguments:
+ * * start_time - The time at which the `mid_sounds` started being played (so we know when to stop looping).
+ */
+/datum/looping_sound/proc/sound_loop(start_time)
+ if(max_loops && world.time >= start_time + mid_length * max_loops)
stop()
return
+ // If we have a timer, we're varying mid length, and this is happening while we're runnin mid_sounds
+ if(timer_id && mid_length_vary && start_time)
+ updatetimedelay(timer_id, mid_length + rand(-mid_length_vary, mid_length_vary), timer_subsystem = SSsound_loops)
if(!chance || prob(chance))
- play(get_sound(starttime))
- if(!timerid)
- timerid = addtimer(CALLBACK(src, PROC_REF(sound_loop), world.time), mid_length, TIMER_STOPPABLE | TIMER_LOOP)
+ play(get_sound())
+/**
+ * Applies a new mid length to the sound
+ */
+/datum/looping_sound/proc/set_mid_length(new_mid)
+ mid_length = new_mid
+ if(!timer_id)
+ return
+ updatetimedelay(timer_id, mid_length + rand(-mid_length_vary, mid_length_vary), timer_subsystem = SSsound_loops)
+
+/**
+ * The proc that handles actually playing the sound.
+ *
+ * Arguments:
+ * * soundfile - The soundfile we want to play.
+ * * volume_override - The volume we want to play the sound at, overriding the `volume` variable.
+ */
/datum/looping_sound/proc/play(soundfile, volume_override)
- var/list/atoms_cache = output_atoms
- var/sound/S = sound(soundfile)
-// if(direct)
- // S.channel = open_sound_channel() someone could probably make this work but you could probably just delete this with no reprecussions.
- // S.volume = volume
- for(var/i in 1 to atoms_cache.len)
- var/atom/thing = atoms_cache[i]
- // if(direct)
- // SEND_SOUND(thing, S)
- // else
- playsound(thing, S, volume_override || volume, vary, extra_range, falloff, required_preferences = ASFX_AMBIENCE) // you can turn it off, i guess.
+ var/sound/sound_to_play = sound(soundfile)
+ if(direct)
+ sound_to_play.channel = sound_channel || SSsounds.random_available_channel()
+ sound_to_play.volume = volume_override || volume //Use volume as fallback if theres no override
+ SEND_SOUND(parent, sound_to_play)
+ else
+ playsound(
+ parent,
+ sound_to_play,
+ volume,
+ vary,
+ extra_range,
+ falloff_exponent = falloff_exponent,
+ pressure_affected = pressure_affected,
+ ignore_walls = ignore_walls,
+ falloff_distance = falloff_distance,
+ use_reverb = use_reverb
+ )
-/datum/looping_sound/proc/get_sound(starttime, _mid_sounds)
- . = _mid_sounds || mid_sounds
+/// Returns the sound we should now be playing.
+/datum/looping_sound/proc/get_sound(_mid_sounds)
+ var/list/play_from = _mid_sounds || mid_sounds
+ if(!each_once)
+ . = play_from
+ while(!isfile(.) && !isnull(.))
+ . = pick_weight(.)
+ return .
+
+ if(in_order)
+ . = play_from
+ audio_index++
+ if(audio_index > length(play_from))
+ audio_index = 1
+ return .[audio_index]
+
+ if(!length(cut_list))
+ cut_list = shuffle(play_from.Copy())
+ var/list/tree = list()
+ . = cut_list
while(!isfile(.) && !isnull(.))
- . = pickweight(.)
+ // Tree is a list of lists containign files
+ // If an entry in the tree goes to 0 length, we cut it from the list
+ tree += list(.)
+ . = pick_weight(.)
+ if(!isfile(.))
+ return
+
+ // Remove the sound file
+ tree[length(tree)] -= .
+
+ // Walk the tree bottom up, remove any lists that are empty
+ // Don't do anything for the topmost list, cause we do not care
+ for(var/i in length(tree) to 2 step -1)
+ var/list/branch = tree[i]
+ if(length(branch))
+ break
+ tree[i - 1] -= list(branch) // Remove the empty list
+ return .
+
+
+
+/// A proc that's there to handle delaying the main sounds if there's a start_sound, and simply starting the sound loop in general.
/datum/looping_sound/proc/on_start()
var/start_wait = 0
- if(start_sound)
+ if(start_sound && !skip_starting_sounds)
play(start_sound, start_volume)
start_wait = start_length
- addtimer(CALLBACK(src, PROC_REF(sound_loop)), start_wait)
+ timer_id = addtimer(CALLBACK(src, PROC_REF(start_sound_loop)), start_wait, TIMER_CLIENT_TIME | TIMER_DELETE_ME | TIMER_STOPPABLE, SSsound_loops)
+/// Stops sound playing on current channel, if specified
+/datum/looping_sound/proc/stop_current()
+ if(!sound_channel || !ismob(parent))
+ return
+ var/mob/mob_parent = parent
+ mob_parent.stop_sound_channel(sound_channel)
+
+/// Simple proc that's executed when the looping sound is stopped, so that the `end_sound` can be played, if there's one.
/datum/looping_sound/proc/on_stop()
- if(end_sound)
+ if(end_sound && loop_started)
play(end_sound, end_volume)
+
+/// A simple proc to change who our parent is set to, also handling registering and unregistering the QDELETING signals on the parent.
+/datum/looping_sound/proc/set_parent(new_parent)
+ if(parent)
+ UnregisterSignal(parent, COMSIG_QDELETING)
+ parent = new_parent
+ if(parent)
+ RegisterSignal(parent, COMSIG_QDELETING, PROC_REF(handle_parent_del))
+
+/// A simple proc that lets us know whether the sounds are currently active or not.
+/datum/looping_sound/proc/is_active()
+ return !!timer_id
+
+/// A simple proc to handle the deletion of the parent, so that it does not force it to hard-delete.
+/datum/looping_sound/proc/handle_parent_del(datum/source)
+ SIGNAL_HANDLER
+ set_parent(null)
diff --git a/code/datums/looping_sounds/machinery_sounds.dm b/code/datums/looping_sounds/machinery_sounds.dm
index d105d7c949e..4a19183c0f7 100644
--- a/code/datums/looping_sounds/machinery_sounds.dm
+++ b/code/datums/looping_sounds/machinery_sounds.dm
@@ -5,6 +5,7 @@
mid_length = 10
end_sound = 'sound/machines/shower/shower_end.ogg'
volume = 20
+ extra_range = SHORT_RANGE_SOUND_EXTRARANGE
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -12,8 +13,8 @@
mid_sounds = list('sound/machines/sm/loops/calm.ogg' = 1)
mid_length = 60
volume = 40
- extra_range = 10
- falloff = 4
+ ignore_walls = FALSE
+ falloff_distance = 4
vary = TRUE
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -32,6 +33,7 @@
mid_sounds = list('sound/machines/grill/grillsizzle.ogg' = 1)
mid_length = 18
volume = 50
+ extra_range = SHORT_RANGE_SOUND_EXTRARANGE
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -42,7 +44,8 @@
mid_length = 13
end_sound = 'sound/machines/oven/oven_loop_end.ogg'
volume = 100
- falloff = 4
+ falloff_distance = 4
+ extra_range = SHORT_RANGE_SOUND_EXTRARANGE
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -53,6 +56,7 @@
mid_length = 10
end_sound = 'sound/machines/microwave/microwave-end.ogg'
volume = 30
+ extra_range = SHORT_RANGE_SOUND_EXTRARANGE
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -67,7 +71,8 @@
'sound/machines/tcomms/tcomms_mid7.ogg' = 1
)
mid_length = 1.8 SECONDS
- extra_range = -4.5
+ extra_range = SHORT_RANGE_SOUND_EXTRARANGE
+ ignore_walls = FALSE
volume = 10
// mid_length = 1.8 SECONDS
@@ -87,7 +92,8 @@
end_sound = 'sound/machines/computer/computer_end.ogg'
end_volume = 10
volume = 1
- extra_range = -5.5
+ extra_range = SILENCED_SOUND_EXTRARANGE
+ ignore_walls = FALSE
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -96,6 +102,7 @@
mid_length = 1.8 SECONDS
extra_range = 10
volume = 70
+ ignore_walls = FALSE
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -103,5 +110,6 @@
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
+ ignore_walls = FALSE
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/code/datums/sound_player.dm b/code/datums/sound_player.dm
index cb61ccee642..a90ab317cab 100644
--- a/code/datums/sound_player.dm
+++ b/code/datums/sound_player.dm
@@ -250,7 +250,7 @@ GLOBAL_DATUM_INIT(sound_player, /singleton/sound_player, new)
/datum/sound_token/proc/PrivGetEnvironment(listener)
var/area/A = get_area(listener)
- return A && PrivIsValidEnvironment(A.sound_env) ? A.sound_env : sound.environment
+ return A && PrivIsValidEnvironment(A.sound_environment) ? A.sound_environment : sound.environment
/datum/sound_token/proc/PrivIsValidEnvironment(environment)
if(islist(environment) && length(environment) != 23)
diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm
index 266e0fec09e..1fbd1fa7a55 100644
--- a/code/defines/obj/weapon.dm
+++ b/code/defines/obj/weapon.dm
@@ -509,7 +509,7 @@
/obj/item/neuralbroke/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.isscrewdriver())
new /obj/item/device/encryptionkey/hivenet(user.loc)
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You bypass the fried security chip and extract the encryption key.")
to_chat(user, "The fried neural socket crumbles away like dust.")
qdel(src)
diff --git a/code/game/antagonist/antagonist_create.dm b/code/game/antagonist/antagonist_create.dm
index cb251389932..f36472ed7cb 100644
--- a/code/game/antagonist/antagonist_create.dm
+++ b/code/game/antagonist/antagonist_create.dm
@@ -112,7 +112,7 @@
to_chat(player.current, "[welcome_text]")
if(antag_sound)
- player.current.playsound_simple(get_turf(src), sound(antag_sound), 50, FALSE)
+ player.current.playsound_local(get_turf(src), sound(antag_sound), 50, FALSE)
if((flags & ANTAG_HAS_NUKE) && !spawned_nuke)
create_nuke()
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index 56ee7def3b2..e921f5ccbb6 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -58,7 +58,9 @@ var/global/list/area_blurb_stated_to = list()
var/list/ambience = list()
var/list/forced_ambience = null
var/list/music = list()
- var/sound_env = STANDARD_STATION
+
+ ///Used to decide what kind of reverb the area makes sound have
+ var/sound_environment = SOUND_AREA_STANDARD_STATION
var/no_light_control = FALSE // If TRUE, lights in area cannot be toggled with light controller.
var/allow_nightmode = FALSE // If TRUE, lights in area will be darkened by the night mode controller.
@@ -330,7 +332,7 @@ var/list/mob/living/forced_ambiance_list = new
/area/proc/play_ambience(var/mob/living/L)
if((world.time >= L.client.ambience_last_played_time + 5 MINUTES) && prob(20))
var/picked_ambience = pick(ambience)
- L << sound(picked_ambience, volume = VOLUME_AMBIENCE, channel = 2)
+ L << sound(picked_ambience, volume = VOLUME_AMBIENCE, channel = CHANNEL_AMBIENCE)
L.client.ambience_last_played_time = world.time
// Stop Ambience
diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm
index 6df4447fce7..b84c56b2699 100644
--- a/code/game/gamemodes/meteor/meteors.dm
+++ b/code/game/gamemodes/meteor/meteors.dm
@@ -292,4 +292,4 @@
var/turf/mobloc = get_turf(M)
if(mobloc && mobloc.z == T.z)
if(!isdeaf(M))
- M.playsound_simple(T, 'sound/effects/meteorimpact.ogg', range, use_random_freq = TRUE, use_pressure = FALSE)
+ M.playsound_local(T, 'sound/effects/meteorimpact.ogg', range, vary = TRUE, pressure_affected = FALSE)
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 8111b3f4a83..dc9e344aeb2 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -998,7 +998,7 @@ pixel_x = 10;
else if(attacking_item.iswrench())
to_chat(user, "You remove the air alarm assembly from the wall!")
new /obj/item/frame/air_alarm(get_turf(user))
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(src.loc, 50)
qdel(src)
return TRUE
diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm
index d85988a8610..79e747b06c0 100644
--- a/code/game/machinery/atmoalter/portable_atmospherics.dm
+++ b/code/game/machinery/atmoalter/portable_atmospherics.dm
@@ -119,7 +119,7 @@
if(connected_port)
disconnect()
to_chat(user, "You disconnect \the [src] from the port.")
- playsound(get_turf(src), attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
update_icon()
SStgui.update_uis(src)
return TRUE
@@ -128,7 +128,7 @@
if(possible_port)
if(connect(possible_port))
to_chat(user, "You connect \the [src] to the port.")
- playsound(get_turf(src), attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
update_icon()
SStgui.update_uis(src)
return TRUE
diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm
index 8578ab15ea4..81ccc475268 100644
--- a/code/game/machinery/atmoalter/scrubber.dm
+++ b/code/game/machinery/atmoalter/scrubber.dm
@@ -221,7 +221,7 @@
return TRUE
anchored = !anchored
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
return TRUE
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index e1e10191f63..8ad1e00e43f 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -153,7 +153,7 @@
panel_open = !panel_open
user.visible_message("[user] screws the camera's panel [panel_open ? "open" : "closed"]!",
"You screw the camera's panel [panel_open ? "open" : "closed"].")
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
return TRUE
else if((attacking_item.iswirecutter() || attacking_item.ismultitool()) && panel_open)
diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm
index fca89dc82fe..69965fe2de6 100644
--- a/code/game/machinery/camera/camera_assembly.dm
+++ b/code/game/machinery/camera/camera_assembly.dm
@@ -30,7 +30,7 @@
if(0)
// State 0
if(attacking_item.iswrench() && isturf(src.loc))
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You wrench the assembly into place.")
anchored = 1
state = 1
@@ -48,7 +48,7 @@
return TRUE
else if(attacking_item.iswrench())
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You unattach the assembly from its place.")
anchored = 0
update_icon()
@@ -78,7 +78,7 @@
if(3)
// State 3
if(attacking_item.isscrewdriver())
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
var/input = sanitize( tgui_input_text(user, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: Station,Security,Secret",
"Set Network", (camera_network ? camera_network : NETWORK_STATION)) )
@@ -143,7 +143,7 @@
var/obj/U = locate(/obj) in upgrades
if(U)
to_chat(user, "You unattach an upgrade from the assembly.")
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
U.forceMove(get_turf(src))
upgrades -= U
return
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index 5af1301245b..4fa1d50fa18 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -60,7 +60,7 @@
anchored = !anchored
to_chat(user, "You [anchored ? "" : "un"]secure \the [src].")
- playsound(src, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(src, 50)
return TRUE
if(istype(attacking_item, /obj/item/cell))
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 9639b1d9cc6..695115bc932 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -248,7 +248,7 @@
connected = null
else
anchored = 1
- playsound(loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
if(anchored)
user.visible_message("[user] secures [src] to the floor.", "You secure [src] to the floor.")
else
diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm
index f1f4fd2af6f..2db45f8990a 100644
--- a/code/game/machinery/computer/ai_core.dm
+++ b/code/game/machinery/computer/ai_core.dm
@@ -48,13 +48,13 @@
user.drop_from_inventory(attacking_item,src)
return TRUE
if(attacking_item.isscrewdriver() && circuit)
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You screw the circuit board into place.")
state = 2
icon_state = "2"
return TRUE
if(attacking_item.iscrowbar() && circuit)
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You remove the circuit board.")
state = 1
icon_state = "0"
@@ -63,7 +63,7 @@
return TRUE
if(2)
if(attacking_item.isscrewdriver() && circuit)
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You unfasten the circuit board.")
state = 1
icon_state = "1"
@@ -152,7 +152,7 @@
return TRUE
if(attacking_item.iscrowbar() && brain)
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You remove the brain.")
brain.forceMove(loc)
brain = null
@@ -161,7 +161,7 @@
if(4)
if(attacking_item.iscrowbar())
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You remove the glass panel.")
state = 3
if (brain)
@@ -172,7 +172,7 @@
return TRUE
if(attacking_item.isscrewdriver())
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You connect the monitor.")
if(!brain)
var/open_for_latejoin = alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", "Yes", "Yes", "No") == "Yes"
diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm
index 1eb0fdfd885..596c986fd12 100644
--- a/code/game/machinery/computer/arcade.dm
+++ b/code/game/machinery/computer/arcade.dm
@@ -114,7 +114,7 @@
src.blocked = 1
var/attackamt = rand(2,6)
src.temp = "You attack for [attackamt] damage!"
- playsound(loc, 'sound/arcade/hit.ogg', 5, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/hit.ogg', 5, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
src.updateUsrDialog()
if(turtle > 0)
turtle--
@@ -128,7 +128,7 @@
var/pointamt = rand(1,3)
var/healamt = rand(6,8)
src.temp = "You use [pointamt] magic to heal for [healamt] damage!"
- playsound(loc, 'sound/arcade/heal.ogg', 2, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/heal.ogg', 2, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
src.updateUsrDialog()
turtle++
@@ -143,7 +143,7 @@
src.blocked = 1
var/chargeamt = rand(4,7)
src.temp = "You regain [chargeamt] points."
- playsound(loc, 'sound/arcade/mana.ogg', 1, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/mana.ogg', 1, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
src.player_mp += chargeamt
if(turtle > 0)
turtle--
@@ -178,7 +178,7 @@
if(!gameover)
src.gameover = 1
src.temp = "[src.enemy_name] has fallen! Rejoice!"
- playsound(loc, 'sound/arcade/win.ogg', 5, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/win.ogg', 5, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
if(emagged)
feedback_inc("arcade_win_emagged")
@@ -195,13 +195,13 @@
else if (emagged && (turtle >= 4))
var/boomamt = rand(5,10)
src.temp = "[src.enemy_name] throws a bomb, exploding you for [boomamt] damage!"
- playsound(loc, 'sound/arcade/boom.ogg', 5, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/boom.ogg', 5, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
src.player_hp -= boomamt
else if ((src.enemy_mp <= 5) && (prob(70)))
var/stealamt = rand(2,3)
src.temp = "[src.enemy_name] steals [stealamt] of your power!"
- playsound(loc, 'sound/arcade/steal.ogg', 5, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/steal.ogg', 5, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
src.player_mp -= stealamt
src.updateUsrDialog()
@@ -217,20 +217,20 @@
else if ((src.enemy_hp <= 10) && (src.enemy_mp > 4))
src.temp = "[src.enemy_name] heals for 4 health!"
- playsound(loc, 'sound/arcade/heal.ogg', 5, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/heal.ogg', 5, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
src.enemy_hp += 4
src.enemy_mp -= 4
else
var/attackamt = rand(3,6)
src.temp = "[src.enemy_name] attacks for [attackamt] damage!"
- playsound(loc, 'sound/arcade/hit.ogg', 5, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/hit.ogg', 5, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
src.player_hp -= attackamt
if ((src.player_mp <= 0) || (src.player_hp <= 0))
src.gameover = 1
src.temp = "You have been crushed! GAME OVER"
- playsound(loc, 'sound/arcade/lose.ogg', 5, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/lose.ogg', 5, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
if(emagged)
feedback_inc("arcade_loss_hp_emagged")
usr.gib()
diff --git a/code/game/machinery/computer/arcade_orion.dm b/code/game/machinery/computer/arcade_orion.dm
index 6acd6c3e4b3..2ead32c6f5a 100644
--- a/code/game/machinery/computer/arcade_orion.dm
+++ b/code/game/machinery/computer/arcade_orion.dm
@@ -100,7 +100,7 @@
if(ORION_VIEW_MAIN)
if(event == ORION_TRAIL_START) //new game? New game.
if(world.time >= cooldown)
- playsound(loc, 'sound/arcade/Ori_begin.ogg', 1, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/Ori_begin.ogg', 1, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
cooldown = world.time + 300
dat = "
Orion Trail[emagged ? ": Realism Edition" : ""]
Learn how our ancestors got to Orion, and have fun in the process!
Start New Game
"
@@ -113,7 +113,7 @@
event_actions = "Continue your journey
"
switch(event)
if(ORION_TRAIL_GAMEOVER)
- playsound(loc, 'sound/arcade/Ori_fail.ogg', 2, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/Ori_fail.ogg', 2, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
event_info = ""
event_actions = "Start New Game
"
if(ORION_TRAIL_SPACEPORT)
@@ -135,7 +135,7 @@
if(ORION_TRAIL_ILLNESS)
event_desc = "A disease has spread amoungst your crew!"
if(ORION_TRAIL_FLUX)
- playsound(loc, 'sound/arcade/explo.ogg', 3, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/explo.ogg', 3, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
event_desc = "You've entered a turbulent region. Slowing down would be better for your ship but would cost more fuel."
event_actions = "Continue as normal
"
event_actions += "Take it slow
"
@@ -146,14 +146,14 @@
if(supplies["3"] != 0)
event_actions += "Fix using a part.
"
if(ORION_TRAIL_COLLISION)
- playsound(loc, 'sound/arcade/explo.ogg', 3, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/explo.ogg', 3, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
event_info = ""
event_desc = "Something has hit your ship and breached the hull! You can choose to fix it with a part or risk something going awry."
event_actions = "Continue as normal
"
if(supplies["2"] != 0)
event_actions += "Fix using a part.
"
if(ORION_TRAIL_BREAKDOWN)
- playsound(loc, 'sound/arcade/explo.ogg', 3, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/explo.ogg', 3, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
event_info = ""
event_desc = "The ship's engines broke down! You can choose to fix it with a part or risk something going awry."
event_actions = "Continue as normal
"
@@ -259,26 +259,26 @@
if(href_list["buy"])
var/item = href_list["buy"]
- playsound(loc, 'sound/arcade/get_fuel.ogg', 10, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/get_fuel.ogg', 10, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
if(supply_cost["[item]"] <= supplies["6"])
supplies["[item]"] += (text2num(item) > 3 ? 10 : 1)
supplies["6"] -= supply_cost["[item]"]
if(href_list["sell"])
var/item = href_list["sell"]
- playsound(loc, 'sound/arcade/lose_fuel.ogg', 10, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/lose_fuel.ogg', 10, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
if(supplies["[item]"] >= (text2num(item) > 3 ? 10 : 1))
supplies["6"] += supply_cost["[item]"]
supplies["[item]"] -= (text2num(item) > 3 ? 10 : 1)
if(href_list["kill"])
var/item = text2num(href_list["kill"])
- playsound(loc, 'sound/arcade/kill_crew.ogg', 10, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/kill_crew.ogg', 10, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
remove_settler(item)
if(href_list["attack"])
supply_cost = list()
- playsound(loc, 'sound/arcade/raid.ogg', 10, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/raid.ogg', 10, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
if(prob(17*settlers.len))
event_desc = "An empty husk of a station now, all its resources stripped for use in your travels."
event_info = "You've successfully raided the spaceport!
"
@@ -482,7 +482,7 @@
/obj/machinery/computer/arcade/orion_trail/proc/win()
src.visible_message("\The [src] plays a triumpant tune, stating 'CONGRATULATIONS, YOU HAVE MADE IT TO ORION.'")
- playsound(loc, 'sound/arcade/Ori_win.ogg', 10, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/Ori_win.ogg', 10, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
if(emagged)
new /obj/item/orion_ship(src.loc)
message_admins("[key_name_admin(usr)] made it to Orion on an emagged machine and got an explosive toy ship.")
diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm
index b293cb75e2c..d1c8d637280 100644
--- a/code/game/machinery/computer/buildandrepair.dm
+++ b/code/game/machinery/computer/buildandrepair.dm
@@ -49,13 +49,13 @@
to_chat(user, "This frame does not accept circuit boards of this type!")
return TRUE
if(attacking_item.isscrewdriver() && circuit)
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You screw the circuit board into place and screw the drawer shut.")
src.state = 2
src.icon_state = "2"
return TRUE
if(attacking_item.iscrowbar() && circuit)
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You remove the circuit board.")
src.state = 1
src.icon_state = "0"
@@ -64,7 +64,7 @@
return TRUE
if(2)
if(attacking_item.isscrewdriver() && circuit)
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You unfasten the circuit board.")
src.state = 1
src.icon_state = "1"
@@ -107,14 +107,14 @@
return TRUE
if(4)
if(attacking_item.iscrowbar())
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You remove the glass keyboard.")
src.state = 3
src.icon_state = "3"
new /obj/item/stack/material/glass( src.loc, 2 )
return TRUE
if(attacking_item.isscrewdriver())
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You connect the glass keyboard.")
var/B = new src.circuit.build_path ( src.loc )
src.circuit.construct(B)
diff --git a/code/game/machinery/computer/slotmachine.dm b/code/game/machinery/computer/slotmachine.dm
index a40d2556c2b..4479e1c55c1 100644
--- a/code/game/machinery/computer/slotmachine.dm
+++ b/code/game/machinery/computer/slotmachine.dm
@@ -89,7 +89,7 @@
to_chat(user, SPAN_WARNING("[src] spits your coin back out!"))
else
to_chat(user, SPAN_NOTICE("You insert [C] into [src]'s slot!"))
- playsound(loc, 'sound/arcade/sloto_token.ogg', 10, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/sloto_token.ogg', 10, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
balance += get_value(C)
updateUsrDialog()
qdel(C)
@@ -100,7 +100,7 @@
if(paymode == CREDITCHIP)
var/obj/item/spacecash/H = attacking_item
to_chat(user, SPAN_NOTICE("You insert [H.worth] credits into [src]'s slot!"))
- playsound(loc, 'sound/arcade/sloto_token.ogg', 10, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/sloto_token.ogg', 10, 1, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
balance += H.worth
updateUsrDialog()
qdel(H)
@@ -200,7 +200,7 @@
if(user)
the_name = user.real_name
visible_message(SPAN_NOTICE("[user] pulls the lever and the slot machine starts spinning!"))
- playsound(loc, 'sound/arcade/sloto_lever.ogg', 10, 0, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
+ playsound(loc, 'sound/arcade/sloto_lever.ogg', 10, 0, extrarange = -3, falloff_distance = 10, required_asfx_toggles = ASFX_ARCADE)
flick("slots_pull", src)
else
the_name = "Exaybachay"
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index a1fa98108d5..525758f3870 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -90,7 +90,7 @@
return TRUE
else
if(attacking_item.iswrench())
- playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, SPAN_NOTICE("You dismantle the blueprint."))
new /obj/item/stack/material/steel(get_turf(src), 2)
qdel(src)
@@ -147,7 +147,7 @@
if(COMPONENT_STATE)
if(attacking_item.iscrowbar())
- playsound(get_turf(src), attacking_item.usesound, 50, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 50)
state = CIRCUITBOARD_STATE
circuit.forceMove(get_turf(src))
circuit = null
@@ -172,7 +172,7 @@
component_check = FALSE
break
if(component_check)
- playsound(get_turf(src), attacking_item.usesound, 50, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 50)
var/obj/machinery/new_machine = new circuit.build_path(loc, dir, FALSE)
if(istype(new_machine))
if(new_machine.component_parts)
@@ -246,7 +246,7 @@
/obj/machinery/constructable_frame/temp_deco/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.iswrench())
- playsound(get_turf(src), attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, SPAN_NOTICE("You dismantle \the [src]."))
new /obj/item/stack/material/steel(get_turf(src), 5)
qdel(src)
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index df45672aaa6..02cb65a9159 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -1116,18 +1116,18 @@ About the new airlock wires panel:
if(density && arePowerSystemsOn())
flick("denied", src)
if(secured_wires)
- playsound(src.loc, open_failure_access_denied, 50, 0)
+ playsound(src.loc, open_failure_access_denied, 50, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
update_icon(AIRLOCK_CLOSED)
if("emag")
set_airlock_overlays(AIRLOCK_EMAG, TRUE)
if(density && arePowerSystemsOn())
flick("denied", src)
- playsound(src.loc, open_failure_access_denied, 50, 0)
+ playsound(src.loc, open_failure_access_denied, 50, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
if ("braced")
set_airlock_overlays(AIRLOCK_DENY, TRUE)
if (arePowerSystemsOn())
flick("denied", src)
- playsound(src.loc, 'sound/machines/hydraulic_short.ogg', 50, 0)
+ playsound(src.loc, 'sound/machines/hydraulic_short.ogg', 50, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
else
update_icon()
@@ -1350,7 +1350,7 @@ About the new airlock wires panel:
if(H.getBrainLoss() >= 50)
if(prob(40) && src.density)
- playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
+ playsound(src.loc, 'sound/effects/bang.ogg', 25, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
if(!istype(H.head, /obj/item/clothing/head/helmet))
user.visible_message(SPAN_WARNING("[user] headbutts the airlock."))
var/obj/item/organ/external/affecting = H.get_organ(BP_HEAD)
@@ -1384,7 +1384,7 @@ About the new airlock wires panel:
if(H.default_attack?.attack_door && !(stat & (BROKEN|NOPOWER)))
user.visible_message(SPAN_DANGER("\The [user] forcefully strikes \the [src] with their [H.default_attack.attack_name]!"))
user.do_attack_animation(src, null)
- playsound(loc, hitsound, 60, 1)
+ playsound(loc, hitsound, 60, TRUE)
take_damage(H.default_attack.attack_door)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
return
@@ -1435,7 +1435,7 @@ About the new airlock wires panel:
return FALSE
if(bolt_cut_state == BOLTS_FINE)
to_chat(user, SPAN_WARNING("You smash the bolt cover open!"))
- playsound(src, 'sound/weapons/smash.ogg', 100, 1)
+ playsound(src, 'sound/weapons/smash.ogg', 100, TRUE, extrarange = MEDIUM_RANGE_SOUND_EXTRARANGE)
bolt_cut_state = BOLTS_EXPOSED
else if(bolt_cut_state != BOLTS_FINE)
cut_verb = "smashing"
@@ -1445,7 +1445,7 @@ About the new airlock wires panel:
else if(istype(tool, /obj/item/crowbar/robotic/jawsoflife))
if(bolt_cut_state == BOLTS_FINE)
to_chat(user, SPAN_WARNING("You force the bolt cover open!"))
- playsound(src, 'sound/weapons/smash.ogg', 100, 1)
+ playsound(src, 'sound/weapons/smash.ogg', 100, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
bolt_cut_state = BOLTS_EXPOSED
else if(bolt_cut_state != BOLTS_FINE)
cut_verb = "smashing"
@@ -1468,18 +1468,18 @@ About the new airlock wires panel:
if(do_after(user, cut_delay, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You're a quarter way through."))
- playsound(src, cut_sound, 100, 1)
+ playsound(src, cut_sound, 100, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
if(do_after(user, cut_delay, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You're halfway through."))
- playsound(src, cut_sound, 100, 1)
+ playsound(src, cut_sound, 100, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
if(do_after(user, cut_delay, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You're three quarters through."))
- playsound(src, cut_sound, 100, 1)
+ playsound(src, cut_sound, 100, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
if(do_after(user, cut_delay, src, DO_REPAIR_CONSTRUCT))
- playsound(src, cut_sound, 100, 1)
+ playsound(src, cut_sound, 100, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
if(initial_state != bolt_cut_state)
return
@@ -1668,13 +1668,13 @@ About the new airlock wires panel:
SPAN_NOTICE("You begin welding [src] [welded ? "open" : "shut"]."),
"You hear a welding torch on metal."
)
- playsound(src, 'sound/items/Welder.ogg', 50, 1)
+ playsound(src, 'sound/items/Welder.ogg', 50, TRUE, extrarange = SILENCED_SOUND_EXTRARANGE)
if(!WT.use_tool(src, user, 20, volume = 50, extra_checks = CALLBACK(src, PROC_REF(is_open), src.density)))
return TRUE
if(!WT.use(0,user))
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
return TRUE
- playsound(src, 'sound/items/welder_pry.ogg', 50, 1)
+ playsound(src, 'sound/items/welder_pry.ogg', 50, TRUE, extrarange = SILENCED_SOUND_EXTRARANGE)
welded = !welded
update_icon()
return TRUE
@@ -1850,9 +1850,9 @@ About the new airlock wires panel:
//if the door is unpowered then it doesn't make sense to hear the woosh of a pneumatic actuator
if(!forced && arePowerSystemsOn())
- playsound(src.loc, open_sound_powered, 50, FALSE)
+ playsound(src.loc, open_sound_powered, 50, FALSE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
else
- playsound(src.loc, open_sound_unpowered, 70, FALSE)
+ playsound(src.loc, open_sound_unpowered, 70, FALSE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
if(src.close_other != null && istype(src.close_other, /obj/machinery/door/airlock/) && !src.close_other.density)
src.close_other.close()
@@ -1956,7 +1956,7 @@ About the new airlock wires panel:
for(var/atom/movable/AM in turf)
if(AM.blocks_airlock())
if(world.time > next_beep_at)
- playsound(src.loc, close_failure_blocked, 30, 0, -3)
+ playsound(src.loc, close_failure_blocked, 30, FALSE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
next_beep_at = world.time + SecondsToTicks(20)
close_door_in(6)
return
@@ -1971,9 +1971,9 @@ About the new airlock wires panel:
take_damage(DOOR_CRUSH_DAMAGE)
use_power_oneoff(360) //360 W seems much more appropriate for an actuator moving an industrial door capable of crushing people
if(arePowerSystemsOn())
- playsound(src.loc, close_sound_powered, 100, 1)
+ playsound(src.loc, close_sound_powered, 100, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
else
- playsound(src.loc, close_sound_unpowered, 100, 1)
+ playsound(src.loc, close_sound_unpowered, 100, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
..()
@@ -1986,7 +1986,7 @@ About the new airlock wires panel:
if (operating && !forced) return 0
if (bolt_cut_state == BOLTS_CUT) return 0 //what bolts?
src.locked = TRUE
- playsound(src, bolts_dropping, 30, 0, -6)
+ playsound(src, bolts_dropping, 30, 0, extrarange = SILENCED_SOUND_EXTRARANGE)
update_icon()
return 1
@@ -1999,7 +1999,7 @@ About the new airlock wires panel:
if (!forced)
if(operating || !src.arePowerSystemsOn() || isWireCut(WIRE_BOLTS)) return
src.locked = FALSE
- playsound(src, bolts_rising, 30, 0, -6)
+ playsound(src, bolts_rising, 30, 0, extrarange = SILENCED_SOUND_EXTRARANGE)
update_icon()
return 1
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 480ab11bd67..71e4d3ef92c 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -68,7 +68,7 @@
take_damage(damage)
else
visible_message("\The [user] bonks \the [src] harmlessly.")
- playsound(src.loc, hitsound_light, 8, 1, -1)
+ playsound(src.loc, hitsound_light, 8, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
user.do_attack_animation(src)
/obj/machinery/door/Initialize()
@@ -107,7 +107,7 @@
if (!hatchstate)
hatchstate = 1
update_icon()
- playsound(src.loc, hatch_open_sound, 40, 1, -1)
+ playsound(src.loc, hatch_open_sound, 40, TRUE, extrarange = SILENCED_SOUND_EXTRARANGE)
close_hatch_in(29)
@@ -120,7 +120,7 @@
/obj/machinery/door/proc/close_hatch()
hatchstate = 0//hatch stays open for 3 seconds
update_icon()
- playsound(src.loc, hatch_close_sound, 30, 1, -1)
+ playsound(src.loc, hatch_close_sound, 30, TRUE, extrarange = SILENCED_SOUND_EXTRARANGE)
/obj/machinery/door/Destroy()
density = 0
@@ -271,7 +271,7 @@
var/volume = 100
if (tforce < 20)//No more stupidly loud banging sound from throwing a piece of paper at a door
volume *= (tforce / 20)
- playsound(src.loc, hitsound, volume, 1)
+ playsound(src.loc, hitsound, volume, TRUE)
take_damage(tforce)
return
@@ -351,7 +351,7 @@
if(repairing && attacking_item.iscrowbar())
to_chat(user, "You remove \the [repairing].")
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
repairing.forceMove(user.loc)
repairing = null
return TRUE
@@ -366,7 +366,7 @@
user.visible_message("\The [user] hits \the [src] with \the [W] with no visible effect.")
else
user.visible_message("\The [user] forcefully strikes \the [src] with \the [W]!")
- playsound(src.loc, hitsound, W.get_clamped_volume(), 1)
+ playsound(src.loc, hitsound, W.get_clamped_volume(), TRUE, extrarange = MEDIUM_RANGE_SOUND_EXTRARANGE)
take_damage(W.force)
return TRUE
@@ -489,7 +489,7 @@
if("deny")
if(density && !(stat & (NOPOWER|BROKEN)))
flick("door_deny", src)
- playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0)
+ playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, FALSE, extrarange = SILENCED_SOUND_EXTRARANGE)
return
/obj/machinery/door/proc/open(var/forced = 0)
diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm
index 871bfc3effa..0bab71e57b9 100644
--- a/code/game/machinery/doors/firedoor_assembly.dm
+++ b/code/game/machinery/doors/firedoor_assembly.dm
@@ -49,7 +49,7 @@
return TRUE
else if(attacking_item.iswrench())
anchored = !anchored
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
user.visible_message("[user] has [anchored ? "" : "un" ]secured \the [src]!",
"You have [anchored ? "" : "un" ]secured \the [src]!")
update_icon()
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index 4134922e181..474ea5fbc5f 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -112,7 +112,7 @@
return TRUE
else if(attacking_item.iscrowbar())
to_chat(user, "You pry out the circuit!")
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
spawn(20)
var/obj/item/firealarm_electronics/circuit = new /obj/item/firealarm_electronics()
circuit.forceMove(user.loc)
@@ -129,7 +129,7 @@
else if(attacking_item.iswrench())
to_chat(user, "You remove the fire alarm assembly from the wall!")
new /obj/item/frame/fire_alarm(get_turf(user))
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
qdel(src)
return TRUE
return TRUE
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index 3146e46dad6..3beb635eaad 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -185,7 +185,7 @@
var/obj/item/organ/internal/lungs/L = breather.internal_organs_by_name[BP_LUNGS]
if(!L)
src.visible_message(SPAN_NOTICE("\The [src] buzzes, automatically deactivating \the [tank]."))
- playsound(src, 'sound/machines/buzz-two.ogg', 50)
+ playsound(src, 'sound/machines/buzz-two.ogg', 50, extrarange = SILENCED_SOUND_EXTRARANGE)
tank_off()
return
var/safe_pressure_min = breather.species.breath_pressure + 5
@@ -194,23 +194,23 @@
if(!tank_active) // Activates and sets the kPa to a safe pressure. This keeps from it constantly resetting itself
tank.distribute_pressure = safe_pressure_min
src.visible_message(SPAN_NOTICE("\The [src] chimes and adjusts \the [tank]'s release pressure."))
- playsound(src, 'sound/machines/chime.ogg', 50)
+ playsound(src, 'sound/machines/chime.ogg', 50, extrarange = SILENCED_SOUND_EXTRARANGE)
tank_active = TRUE
if(L.checking_rupture == FALSE) // Safely retracts in case the lungs are about to rupture
src.visible_message(SPAN_WARNING("\The [src]'s flashes a warning light, automatically deactivating \the [tank] and retracting \the [breath_mask]."))
- playsound(src, 'sound/machines/twobeep.ogg', 50)
+ playsound(src, 'sound/machines/twobeep.ogg', 50, extrarange = SILENCED_SOUND_EXTRARANGE)
breath_mask_rip()
return
if(tank.air_contents.return_pressure() <= 10)
src.visible_message(SPAN_WARNING("\The [src] buzzes, automatically deactivating \the [tank] and retracting \the [breath_mask]."))
- playsound(src, 'sound/machines/buzz-two.ogg', 50)
+ playsound(src, 'sound/machines/buzz-two.ogg', 50, extrarange = SILENCED_SOUND_EXTRARANGE)
breath_mask_rip()
return
if(epp) // Emergency Positive Pressure system forces respiration
if(breather.losebreath > 0)
if(!epp_active)
src.visible_message(SPAN_WARNING("\The [src] flashes a blue light, activating it's Emergency Positive Pressure system!"))
- playsound(breather, 'sound/machines/windowdoor.ogg', 50)
+ playsound(breather, 'sound/machines/windowdoor.ogg', 50, extrarange = SILENCED_SOUND_EXTRARANGE)
epp_active = TRUE
update_icon()
tank.distribute_pressure = safe_pressure_min // Constantly adjusts the pressure to keep up with the damage
@@ -240,7 +240,7 @@
if(toggle_stop) // Automatically detaches if the blood volume is at 100%
if((beaker.reagents.has_reagent(/singleton/reagent/blood) || beaker.reagents.has_reagent(/singleton/reagent/saline)) && attached.get_blood_volume() >= 100)
visible_message("\The [src] flashes a warning light, disengaging from [attached]'s [vein.name] automatically!")
- playsound(src, 'sound/machines/buzz-two.ogg', 100)
+ playsound(src, 'sound/machines/buzz-two.ogg', 100, extrarange = SILENCED_SOUND_EXTRARANGE)
vein = null
attached = null
blood_message_sent = FALSE
@@ -253,17 +253,17 @@
if(world.time > last_full + 10 SECONDS)
last_full = world.time
visible_message("\The [src] pings.")
- playsound(src, 'sound/machines/ping.ogg', 100)
+ playsound(src, 'sound/machines/ping.ogg', 100, extrarange = SILENCED_SOUND_EXTRARANGE)
return
if(attached.get_blood_volume() < 90 && !blood_message_sent)
visible_message(SPAN_WARNING("\The [src] flashes a warning light!"))
- playsound(src, 'sound/machines/buzz-two.ogg', 100)
+ playsound(src, 'sound/machines/buzz-two.ogg', 100, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
blood_message_sent = TRUE
if(blood_message_sent)
if(world.time > last_warning + 5 SECONDS)
last_warning = world.time
visible_message(SPAN_WARNING("\The [src] flashes a warning light!"))
- playsound(src, 'sound/machines/buzz-two.ogg', 100)
+ playsound(src, 'sound/machines/buzz-two.ogg', 100, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
if(attached.take_blood(beaker, amount))
update_icon()
@@ -335,7 +335,7 @@
if(tank)
tank_on()
visible_message("[usr] secures the mask over \the [breather]'s face.")
- playsound(breather, 'sound/effects/buckle.ogg', 50)
+ playsound(breather, 'sound/effects/buckle.ogg', 50, extrarange = SILENCED_SOUND_EXTRARANGE)
breath_mask.forceMove(breather.loc)
breather.equip_to_slot(breath_mask, slot_wear_mask)
breather.update_inv_wear_mask()
@@ -448,7 +448,7 @@
user.visible_message(
SPAN_NOTICE("[user] [is_loose ? "tightens" : "loosens"] the nuts on [src]."),
SPAN_NOTICE("You [is_loose ? "tighten" : "loosen"] the nuts on [src], [is_loose ? "securing \the [tank]" : "allowing \the [tank] to be removed"]."))
- playsound(src.loc, 'sound/items/wrench.ogg', 50, 1)
+ playsound(src.loc, 'sound/items/wrench.ogg', 50, TRUE, extrarange = SILENCED_SOUND_EXTRARANGE)
is_loose = !is_loose
return TRUE
if(default_deconstruction_screwdriver(user, attacking_item))
@@ -503,7 +503,7 @@
cut_overlays()
visible_message(SPAN_WARNING("\The [src] falls over with a buzz, spilling out it's contents!"))
flick("iv_crash[is_loose ? "" : "_tank_[tank_type]"]", src)
- playsound(src, 'sound/effects/table_slam.ogg', 50)
+ playsound(src, 'sound/effects/table_slam.ogg', 50, extrarange = MEDIUM_RANGE_SOUND_EXTRARANGE)
spill()
tipped = TRUE
animate(src, time = 5, transform = transform.Turn(90), easing = BOUNCE_EASING)
@@ -575,7 +575,7 @@
update_icon()
/obj/machinery/iv_drip/proc/tank_on()
- playsound(src, 'sound/effects/internals.ogg', 100)
+ playsound(src, 'sound/effects/internals.ogg', 100, extrarange = SILENCED_SOUND_EXTRARANGE)
tank.forceMove(breather)
breather.internal = tank
if(breather.internals)
@@ -585,7 +585,7 @@
return
/obj/machinery/iv_drip/proc/tank_off()
- playsound(src, 'sound/effects/internals.ogg', 100)
+ playsound(src, 'sound/effects/internals.ogg', 100, extrarange = SILENCED_SOUND_EXTRARANGE)
tank.forceMove(src)
if(breather.internals)
breather.internals.icon_state = "internal0"
@@ -604,7 +604,7 @@
return
mode = !mode
usr.visible_message("[usr] toggles \the [src] to [mode ? "inject" : "take blood"].", SPAN_NOTICE("You set \the [src] to [mode ? "injecting" : "taking blood"]."))
- playsound(usr, 'sound/machines/buttonbeep.ogg', 50)
+ playsound(usr, 'sound/machines/buttonbeep.ogg', 50, extrarange = SILENCED_SOUND_EXTRARANGE)
update_icon()
/obj/machinery/iv_drip/verb/toggle_stop()
@@ -616,7 +616,7 @@
return
toggle_stop = !toggle_stop
usr.visible_message("[usr] toggles \the [src]'s automatic stop mode [toggle_stop ? "on" : "off"].", SPAN_NOTICE("You toggle \the [src]'s automatic stop mode [toggle_stop ? "on" : "off"]."))
- playsound(usr, 'sound/machines/click.ogg', 50)
+ playsound(usr, 'sound/machines/click.ogg', 50, extrarange = SILENCED_SOUND_EXTRARANGE)
/obj/machinery/iv_drip/verb/toggle_valve()
set category = "Object"
@@ -661,7 +661,7 @@
update_icon()
epp = !epp
usr.visible_message("[usr] toggles \the [src]'s Emergency Positive Pressure system [epp ? "on" : "off"].", SPAN_NOTICE("You toggle \the [src]'s Emergency Positive Pressure system [epp ? "on" : "off"]."))
- playsound(usr, 'sound/machines/click.ogg', 50)
+ playsound(usr, 'sound/machines/click.ogg', 50, extrarange = SILENCED_SOUND_EXTRARANGE)
/obj/machinery/iv_drip/verb/transfer_rate()
set category = "Object"
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index 050da06f2c6..e342f0def0f 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -170,7 +170,7 @@
StopPlaying()
user.visible_message("[user] has [anchored ? "un" : ""]secured \the [src].", "You [anchored ? "un" : ""]secure \the [src].")
anchored = !anchored
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
power_change()
update_icon()
return TRUE
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index ade9364b35b..d87704a3f20 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -393,7 +393,7 @@ Class Procs:
/obj/machinery/proc/default_deconstruction_screwdriver(var/mob/user, var/obj/item/S)
if(!istype(S) || !S.isscrewdriver())
return FALSE
- playsound(src.loc, S.usesound, 50, 1)
+ S.play_tool_sound(get_turf(src), 50)
panel_open = !panel_open
to_chat(user, "You [panel_open ? "open" : "close"] the maintenance hatch of [src].")
update_icon()
diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm
index 7c84574b574..08910ced2d8 100644
--- a/code/game/machinery/mass_driver.dm
+++ b/code/game/machinery/mass_driver.dm
@@ -58,13 +58,13 @@
if(attacking_item.iswrench())
if(!anchored)
- playsound(src.loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message("[user.name] secures [src] to the floor.", \
"You secure the external reinforcing bolts to the floor.", \
"You hear a ratchet")
src.anchored = 1
else
- playsound(src.loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message("[user.name] unsecures [src] from the floor.", \
"You unsecure the external reinforcing bolts from the floor.", \
"You hear a ratchet")
diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm
index 7af37bbd749..bdd1a38d49f 100644
--- a/code/game/machinery/nuclear_bomb.dm
+++ b/code/game/machinery/nuclear_bomb.dm
@@ -51,12 +51,12 @@ var/bomb_set
panel_open = 1
add_overlay("panel_open")
to_chat(user, "You unscrew the control panel of [src].")
- playsound(src, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(src, 50)
else
panel_open = 0
cut_overlay("panel_open")
to_chat(user, "You screw the control panel of [src] back on.")
- playsound(src, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(src, 50)
else
if (panel_open == 0)
to_chat(user, "\The [src] emits a buzzing noise, the panel staying locked in.")
@@ -64,7 +64,7 @@ var/bomb_set
panel_open = 0
cut_overlay("panel_open")
to_chat(user, "You screw the control panel of \the [src] back on.")
- playsound(src, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(src, 50)
flick("lock", src)
return TRUE
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index 192da1c6728..55e4ea5ba42 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -1506,7 +1506,7 @@
P.atmos_init()
P.build_network()
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
user.visible_message( \
"[user] fastens the [src].", \
"You have fastened the [src].", \
@@ -1534,7 +1534,7 @@
to_chat(user, "You need to fasten it to a pipe")
return 1
new/obj/machinery/meter( src.loc )
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You have fastened the meter to the pipe")
qdel(src)
return TRUE
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 075fb2cc38c..2cd4ae2f817 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -362,12 +362,12 @@
if(attacking_item.use_tool(src, user, 50, volume = 50))
//This code handles moving the turret around. After all, it's a portable turret!
if(!anchored)
- playsound(loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
anchored = 1
update_icon()
to_chat(user, "You secure the exterior bolts on the turret.")
else if(anchored)
- playsound(loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
anchored = 0
to_chat(user, "You unsecure the exterior bolts on the turret.")
update_icon()
@@ -841,7 +841,7 @@
switch(build_step)
if(0) //first step
if(attacking_item.iswrench() && !anchored)
- playsound(loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, "You secure the external bolts.")
anchored = 1
build_step = 1
@@ -849,7 +849,7 @@
return TRUE
else if(attacking_item.iscrowbar() && !anchored)
- playsound(loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, "You dismantle the turret construction.")
new /obj/item/stack/material/steel( loc, 5)
qdel(src)
@@ -867,7 +867,7 @@
return TRUE
else if(attacking_item.iswrench())
- playsound(loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, "You unfasten the external bolts.")
anchored = 0
build_step = 0
@@ -877,7 +877,7 @@
if(2)
if(attacking_item.iswrench())
- playsound(loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, "You bolt the metal armor into place.")
build_step = 3
icon_state = "turret_frame_3_[case_sprite_set]"
@@ -920,7 +920,7 @@
return TRUE
else if(attacking_item.iswrench())
- playsound(loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, "You remove the turret's metal armor bolts.")
build_step = 2
icon_state = "turret_frame_2_[case_sprite_set]"
@@ -940,7 +940,7 @@
if(5)
if(attacking_item.isscrewdriver())
- playsound(loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
build_step = 6
to_chat(user, "You close the access hatch.")
icon_state = "turret_frame_5a_[case_sprite_set]"
@@ -965,7 +965,7 @@
return TRUE
else if(attacking_item.isscrewdriver())
- playsound(loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
build_step = 5
to_chat(user, "You open the access hatch.")
cut_overlays()
@@ -1021,7 +1021,7 @@
return TRUE
else if(attacking_item.iscrowbar())
- playsound(loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, "You pry off the turret's exterior armor.")
new /obj/item/stack/material/steel(loc, 2)
build_step = 6
diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm
index f78c4831d89..babbf201556 100644
--- a/code/game/machinery/recharger.dm
+++ b/code/game/machinery/recharger.dm
@@ -55,7 +55,7 @@
return TRUE
anchored = !anchored
user.visible_message("[user] [anchored ? "attaches" : "detaches"] \the [src].", SPAN_NOTICE("You [anchored ? "attach" : "detach"] \the [src]."))
- playsound(loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
return TRUE
if (istype(attacking_item, /obj/item/gripper))//Code for allowing cyborgs to use rechargers
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 71542ac2a0c..33541365f92 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -469,7 +469,7 @@
return TRUE
if(attacking_item.isscrewdriver())
src.panelopen = !src.panelopen
- playsound(src.loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, text("You [] the unit's maintenance panel.",(src.panelopen ? "open up" : "close") ))
update_icon()
src.updateUsrDialog()
diff --git a/code/game/machinery/supplybeacon.dm b/code/game/machinery/supplybeacon.dm
index c34dadd9f74..8a542b1c0ac 100644
--- a/code/game/machinery/supplybeacon.dm
+++ b/code/game/machinery/supplybeacon.dm
@@ -51,7 +51,7 @@
return TRUE
anchored = !anchored
user.visible_message("\The [user] [anchored ? "secures" : "unsecures"] \the [src].")
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
return TRUE
return ..()
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index df7071bf35a..b7dd969749b 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -27,28 +27,28 @@
if(0)
if(attacking_item.isscrewdriver())
to_chat(user, SPAN_NOTICE("You unfasten the bolts."))
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
construct_op ++
. = TRUE
if(1)
if(attacking_item.isscrewdriver())
to_chat(user, SPAN_NOTICE("You fasten the bolts."))
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
construct_op --
. = TRUE
if(attacking_item.iswrench())
to_chat(user, SPAN_NOTICE("You dislodge the external plating."))
- playsound(src.loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
construct_op ++
. = TRUE
if(2)
if(attacking_item.iswrench())
to_chat(user, SPAN_NOTICE("You secure the external plating."))
- playsound(src.loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
construct_op --
. = TRUE
if(attacking_item.iswirecutter())
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You remove the cables."))
construct_op ++
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( user.loc )
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index efad76f1966..c65a9509ba4 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -314,7 +314,7 @@
if(!can_move)
return TRUE
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
user.visible_message("[user] begins [anchored? "un" : ""]securing \the [src] [anchored? "from" : "to"] the floor.", SPAN_NOTICE("You start [anchored? "un" : ""]securing \the [src] [anchored? "from" : "to"] the floor."))
if(attacking_item.use_tool(src, user, 20, volume = 50))
if(!src) return
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 7057d11db63..481dd78f62e 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -452,7 +452,7 @@
else
playsound(hit_atom, 'sound/weapons/throwtap.ogg', 1, volume, -1)
else
- playsound(src, drop_sound, THROW_SOUND_VOLUME)
+ playsound(src, drop_sound, YEET_SOUND_VOLUME)
return ..()
/**
@@ -535,9 +535,9 @@
playsound(src, pickup_sound, PICKUP_SOUND_VOLUME)
else if(slot_flags && slot)
if(equip_sound)
- playsound(src, equip_sound, EQUIP_SOUND_VOLUME)
+ playsound(src, equip_sound, EQUIP_SOUND_VOLUME, TRUE, ignore_walls = FALSE)
else
- playsound(src, drop_sound, DROP_SOUND_VOLUME)
+ playsound(src, drop_sound, DROP_SOUND_VOLUME, ignore_walls = FALSE)
if(item_action_slot_check(user, slot))
add_verb(user, verbs)
for(var/v in verbs)
@@ -1100,7 +1100,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
/obj/item/proc/tool_use_check(mob/living/user, amount)
return TRUE
-// Plays item's usesound, if any.
+/// Plays item's usesound, if any
/obj/item/proc/play_tool_sound(atom/target, volume=null) // null, so default value of this proc won't override default value of the playsound.
if(target && volume)
var/played_sound
@@ -1114,7 +1114,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
played_sound = pick(hitsound)
//playsound(target, played_sound, VOL_EFFECTS_MASTER, volume) implement sound channel system in future
- playsound(target, played_sound, volume, TRUE)
+ playsound(target, played_sound, volume, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
// Generic use proc. Depending on the item, it uses up fuel, charges, sheets, etc.
// Returns TRUE on success, FALSE on failure.
diff --git a/code/game/objects/items/devices/magnetic_lock.dm b/code/game/objects/items/devices/magnetic_lock.dm
index c856425a585..dbe35c94207 100644
--- a/code/game/objects/items/devices/magnetic_lock.dm
+++ b/code/game/objects/items/devices/magnetic_lock.dm
@@ -201,7 +201,7 @@
if (2)
if (attacking_item.isscrewdriver())
to_chat(user, SPAN_NOTICE("You unscrew and remove the wiring cover from \the [src]."))
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
setconstructionstate(3)
return TRUE
@@ -227,7 +227,7 @@
if (attacking_item.isscrewdriver())
to_chat(user, SPAN_NOTICE("You replace and screw tight the wiring cover from \the [src]."))
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
setconstructionstate(2)
return TRUE
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index f203c17aad8..6cf8d2ca6e9 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -94,7 +94,7 @@ BREATH ANALYZER
user.visible_message("[user] runs the scanner over the floor.", "You run the scanner over the floor.", "You hear metal repeatedly clunking against the floor.")
to_chat(user, "Scan results for the ERROR:")
if(sound_scan)
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25, extrarange = SILENCED_SOUND_EXTRARANGE)
return
if(!user.IsAdvancedToolUser())
@@ -106,7 +106,7 @@ BREATH ANALYZER
if(!istype(M, /mob/living/carbon/human))
to_chat(user, "This scanner is designed for humanoid patients only.")
if(sound_scan)
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25, extrarange = SILENCED_SOUND_EXTRARANGE)
return
var/mob/living/carbon/human/H = M
@@ -114,7 +114,7 @@ BREATH ANALYZER
if(H.isSynthetic() && !H.isFBP())
to_chat(user, "This scanner is designed for organic humanoid patients only.")
if(sound_scan)
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25, extrarange = SILENCED_SOUND_EXTRARANGE)
return
. = list()
@@ -146,18 +146,18 @@ BREATH ANALYZER
if(sound_scan)
switch(brain_result)
if(0)
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_dead.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_dead.ogg', 25, extrarange = SILENCED_SOUND_EXTRARANGE)
if(-1)
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25, extrarange = SILENCED_SOUND_EXTRARANGE)
else
if(brain_result <= 25)
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_critical.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_critical.ogg', 25, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
else if(brain_result <= 50)
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_danger.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_danger.ogg', 25, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
else if(brain_result <= 90)
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25, extrarange = SILENCED_SOUND_EXTRARANGE)
else
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_stable.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_stable.ogg', 25, extrarange = SILENCED_SOUND_EXTRARANGE)
// Pulse rate.
var/pulse_result = "normal"
@@ -635,19 +635,19 @@ BREATH ANALYZER
if(H.stat == DEAD || H.losebreath || !H.breathing)
to_chat(user,"Alert: No breathing detected.")
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_dead.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_dead.ogg', 25, extrarange = SILENCED_SOUND_EXTRARANGE)
return
switch(H.getOxyLoss())
if(0 to 25)
to_chat(user,"Subject oxygen levels nominal.")
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_stable.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_stable.ogg', 25, extrarange = SILENCED_SOUND_EXTRARANGE)
if(25 to 50)
to_chat(user,"Subject oxygen levels abnormal.")
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_danger.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_danger.ogg', 25, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
if(50 to INFINITY)
to_chat(user,"Severe oxygen deprivation detected.")
- playsound(user.loc, 'sound/items/healthscanner/healthscanner_critical.ogg', 25)
+ playsound(user.loc, 'sound/items/healthscanner/healthscanner_critical.ogg', 25, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
var/obj/item/organ/internal/L = H.internal_organs_by_name[BP_LUNGS]
if(istype(L))
diff --git a/code/game/objects/items/stacks/tiles/light.dm b/code/game/objects/items/stacks/tiles/light.dm
index 34df47a430b..2d9261d34ce 100644
--- a/code/game/objects/items/stacks/tiles/light.dm
+++ b/code/game/objects/items/stacks/tiles/light.dm
@@ -21,7 +21,7 @@
if(attacking_item.iscrowbar())
amount--
to_chat(user, "You pry off the steel sheet from the [name].")
- playsound(src.loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
new /obj/item/stack/material/glass/wired(user.loc)
new /obj/item/stack/material/steel(user.loc)
if(amount <= 0)
diff --git a/code/game/objects/items/weapons/landmines.dm b/code/game/objects/items/weapons/landmines.dm
index 9694241bc15..c9f844979c8 100644
--- a/code/game/objects/items/weapons/landmines.dm
+++ b/code/game/objects/items/weapons/landmines.dm
@@ -286,7 +286,7 @@
START_PROCESSING(SSfast_process, src)
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(tgui_alert), triggerer, "You feel your [pick("right", "left")] foot step down on a button with a click..., Uh..., Oh...", "Dread", list("Mom..."))
- playsound_allinrange(src, sound('sound/weapons/empty/empty6.ogg'))
+ playsound(src, sound('sound/weapons/empty/empty6.ogg'))
else
late_trigger(locate(engaged_by))
diff --git a/code/game/objects/items/weapons/thermal_drill.dm b/code/game/objects/items/weapons/thermal_drill.dm
index c958374fe0a..a65ccf9cfc4 100644
--- a/code/game/objects/items/weapons/thermal_drill.dm
+++ b/code/game/objects/items/weapons/thermal_drill.dm
@@ -10,7 +10,7 @@
/obj/item/thermal_drill/Initialize()
. = ..()
- soundloop = new(list(src), FALSE)
+ soundloop = new(src, FALSE)
/obj/item/thermal_drill/Destroy()
QDEL_NULL(soundloop)
diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm
index 2c16486ccea..8ef63771144 100644
--- a/code/game/objects/items/weapons/tools.dm
+++ b/code/game/objects/items/weapons/tools.dm
@@ -434,7 +434,7 @@
)
affecting.heal_damage(brute = 15, robo_repair = TRUE)
user.visible_message(SPAN_WARNING("\The [user] [pick(repair_messages)] on [target]'s [affecting.name] with \the [src]."))
- playsound(target, usesound, 15)
+ playsound(target, usesound, 15, extrarange = SILENCED_SOUND_EXTRARANGE)
repair_organ(user, target, affecting)
/obj/item/weldingtool/afterattack(obj/O, mob/user, proximity)
@@ -536,7 +536,7 @@
to_chat(M, "You switch the [src] on.")
else if(T)
T.visible_message("\The [src] turns on.")
- playsound(loc, 'sound/items/welder_activate.ogg', 50, 1)
+ playsound(loc, 'sound/items/welder_activate.ogg', 50, TRUE, extrarange = SILENCED_SOUND_EXTRARANGE)
force = 22
damtype = DAMAGE_BURN
w_class = ITEMSIZE_LARGE
@@ -555,7 +555,7 @@
to_chat(M, "You switch \the [src] off.")
else if(T)
T.visible_message("\The [src] turns off.")
- playsound(loc, 'sound/items/welder_deactivate.ogg', 50, 1)
+ playsound(loc, 'sound/items/welder_deactivate.ogg', 50, TRUE, extrarange = SILENCED_SOUND_EXTRARANGE)
force = 3
damtype = DAMAGE_BRUTE
w_class = initial(w_class)
@@ -826,7 +826,7 @@
current_tool = 1
var/tool = RADIAL_INPUT(user, tools)
if(tool)
- playsound(user, 'sound/items/penclick.ogg', 25)
+ playsound(user, 'sound/items/penclick.ogg', 25, extrarange = SILENCED_SOUND_EXTRARANGE)
current_tool = tool
switch(tool)
if("wrench")
@@ -958,7 +958,7 @@
lit = TRUE
if(user)
user.visible_message(SPAN_NOTICE("[user] ignites the steel wool with \the [L]."), SPAN_NOTICE("You ignite the steel wool with \the [L]"), SPAN_NOTICE("You hear a gentle flame crackling."))
- playsound(get_turf(src), 'sound/items/flare.ogg', 50)
+ playsound(get_turf(src), 'sound/items/flare.ogg', 50, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
desc += " Watch your hands!"
icon_state = "burning_wool"
set_light(2, 2, LIGHT_COLOR_LAVA)
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index 806f9269910..1961f1578ae 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -34,7 +34,9 @@
var/icon_species_in_hand = FALSE
var/equip_slot = 0
+ ///Played when the item is used, for example tools
var/usesound
+
var/toolspeed = 1
var/surgerysound
diff --git a/code/game/objects/structures/ECD.dm b/code/game/objects/structures/ECD.dm
index 34613d4396b..5c3318dd9da 100644
--- a/code/game/objects/structures/ECD.dm
+++ b/code/game/objects/structures/ECD.dm
@@ -30,14 +30,14 @@
switch(state)
if(ECD_LOOSE)
state = ECD_BOLTED
- playsound(get_turf(src), W.usesound, 75, TRUE)
+ W.play_tool_sound(get_turf(src), 75)
user.visible_message(SPAN_NOTICE("\The [user] secures \the [src] to the floor."), \
SPAN_NOTICE("You secure \the [src]'s external reinforcing bolts to the floor."), \
SPAN_WARNING("You hear a ratcheting noise."))
anchored = TRUE
if(ECD_BOLTED)
state = ECD_LOOSE
- playsound(get_turf(src), W.usesound, 75, TRUE)
+ W.play_tool_sound(get_turf(src), 75)
user.visible_message(SPAN_NOTICE("\The [user] unsecures \the [src]'s reinforcing bolts from the floor."), \
SPAN_NOTICE("You undo \the [src]'s external reinforcing bolts."), \
SPAN_WARNING("You hear a ratcheting noise."))
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index dc5e738fd55..892e70079e3 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -410,33 +410,33 @@
else if(attacking_item.isscrewdriver() && canbemoved)
if(screwed)
to_chat(user, SPAN_NOTICE("You start to unscrew \the [src] from the floor..."))
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
if (do_after(user, 10/attacking_item.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You unscrew the locker!"))
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
screwed = FALSE
else if(!screwed && wrenched)
to_chat(user, SPAN_NOTICE("You start to screw the \the [src] to the floor..."))
playsound(src, 'sound/items/Welder.ogg', 80, 1)
if (do_after(user, 15/attacking_item.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You screw \the [src]!"))
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
screwed = TRUE
else if(attacking_item.iswrench() && canbemoved)
if(wrenched && !screwed)
to_chat(user, SPAN_NOTICE("You start to unfasten the bolts holding \the [src] in place..."))
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
if (do_after(user, 15/attacking_item.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You unfasten \the [src]'s bolts!"))
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
wrenched = FALSE
anchored = FALSE
else if(!wrenched)
to_chat(user, SPAN_NOTICE("You start to fasten the bolts holding the locker in place..."))
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
if (do_after(user, 15/attacking_item.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You fasten the \the [src]'s bolts!"))
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
wrenched = TRUE
anchored = TRUE
else if(istype(attacking_item, /obj/item/device/hand_labeler))
diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm
index b4fb69e412e..56db9fa6d22 100644
--- a/code/game/objects/structures/curtains.dm
+++ b/code/game/objects/structures/curtains.dm
@@ -60,7 +60,7 @@
if(C != src && C.anchored) //Can't secure more than one curtain in a tile
to_chat(user, "There is already a curtain secured here!")
return
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
visible_message(SPAN_NOTICE("\The [src] has been [anchored ? "secured in place" : "unsecured"] by \the [user]."))
/obj/structure/curtain/proc/toggle()
diff --git a/code/game/objects/structures/full_window_frame.dm b/code/game/objects/structures/full_window_frame.dm
index 115ff4ab822..b7ba4014f72 100644
--- a/code/game/objects/structures/full_window_frame.dm
+++ b/code/game/objects/structures/full_window_frame.dm
@@ -97,7 +97,7 @@
return
if(WT.use(0, user))
to_chat(user, SPAN_NOTICE("You use \the [WT] to weld apart \the [src]."))
- playsound(src, WT.usesound, 50, 1)
+ WT.play_tool_sound(get_turf(src), 50)
new /obj/item/stack/material/steel(get_turf(src), 4)
qdel(src)
return
diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm
index 8ea8209328c..e330c032a80 100644
--- a/code/game/objects/structures/girders.dm
+++ b/code/game/objects/structures/girders.dm
@@ -149,7 +149,7 @@
to_chat(user, "You unsecured the support struts!")
state = 1
else if(anchored && !reinf_material)
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
reinforcing = !reinforcing
to_chat(user, "\The [src] can now be [reinforcing? "reinforced" : "constructed"]!")
return
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index c94fefcfd49..63dc3d86526 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -203,7 +203,11 @@
spill()
if(user)
- playsound(src.loc, I.usesound, 50, 1)
+
+ if(iswelder(I))
+ var/obj/item/welder = I
+ welder.play_tool_sound(get_turf(src), 50)
+
user.visible_message("[user] starts taking apart the [src]...", SPAN_NOTICE("You start disassembling the [src]..."))
if (!do_after(user, 30, do_flags = DO_DEFAULT & ~DO_USER_SAME_HAND))
return
diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm
index 4d437511769..3c5e8c19005 100644
--- a/code/game/objects/structures/railing.dm
+++ b/code/game/objects/structures/railing.dm
@@ -244,7 +244,7 @@
return
// Wrench Open
else
- playsound(get_turf(src), attacking_item.usesound, 50, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 50)
if(density)
user.visible_message(SPAN_NOTICE("\The [user] wrenches \the [src] open."), SPAN_NOTICE("You wrench \the [src] open."))
density = FALSE
@@ -260,7 +260,7 @@
if(health >= maxhealth)
to_chat(user, SPAN_WARNING("\The [src] does not need repairs."))
return
- playsound(get_turf(src), attacking_item.usesound, 50, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 50)
if(do_after(user, 20, src))
if(health >= maxhealth)
return
@@ -274,7 +274,7 @@
to_chat(user, SPAN_NOTICE("You need to wrench \the [src] from back into place first."))
return
user.visible_message(anchored ? "\The [user] begins unscrewing \the [src]." : "\The [user] begins fastening \the [src]." )
- playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 75)
if(do_after(user, 10, src) && density)
to_chat(user, (anchored ? "You have unfastened \the [src] from the floor." : "You have fastened \the [src] to the floor."))
anchored = !anchored
diff --git a/code/game/objects/structures/therapy.dm b/code/game/objects/structures/therapy.dm
index 28eba94e4ad..82976524ae4 100644
--- a/code/game/objects/structures/therapy.dm
+++ b/code/game/objects/structures/therapy.dm
@@ -181,7 +181,7 @@
/obj/structure/metronome/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.iswrench())
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
if(anchored)
to_chat(user, "You unanchor \the [src] and it destabilizes.")
STOP_PROCESSING(SSfast_process, src)
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 6c26df3365a..8da3441edd1 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -147,7 +147,7 @@
/obj/machinery/shower/Initialize()
. = ..()
create_reagents(2)
- soundloop = new(list(src), FALSE)
+ soundloop = new(src, FALSE)
/obj/machinery/shower/Destroy()
QDEL_NULL(soundloop)
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index 6dc475f21b8..d026b68ce67 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -265,24 +265,24 @@
if(reinf && state >= 1)
state = 3 - state
update_nearby_icons()
- playsound(loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, (state == 1 ? SPAN_NOTICE("You have unfastened the window from the frame.") : SPAN_NOTICE("You have fastened the window to the frame.")))
else if(reinf && state == 0)
anchored = !anchored
update_icon()
update_nearby_icons()
- playsound(loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, (anchored ? SPAN_NOTICE("You have fastened the frame to the floor.") : SPAN_NOTICE("You have unfastened the frame from the floor.")))
else if(!reinf)
anchored = !anchored
update_nearby_icons()
- playsound(loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, (anchored ? SPAN_NOTICE("You have fastened the window to the floor.") : SPAN_NOTICE("You have unfastened the window.")))
update_icon()
update_nearby_icons()
else if(attacking_item.iscrowbar() && reinf && state <= 1 && user.a_intent != I_HURT)
state = 1 - state
- playsound(loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
to_chat(user, (state ? SPAN_NOTICE("You have pried the window into the frame.") : SPAN_NOTICE("You have pried the window out of the frame.")))
else if(attacking_item.iswrench() && !anchored && (!state || !reinf) && user.a_intent != I_HURT)
if(!glasstype)
diff --git a/code/game/sound.dm b/code/game/sound.dm
index 3b57ce0f01b..4c9ae8291b9 100644
--- a/code/game/sound.dm
+++ b/code/game/sound.dm
@@ -1,248 +1,217 @@
-//Sound environment defines. Reverb preset for sounds played in an area, see sound datum reference for more.
-#define GENERIC 0
-#define PADDED_CELL 1
-#define ROOM 2
-#define BATHROOM 3
-#define LIVINGROOM 4
-#define STONEROOM 5
-#define AUDITORIUM 6
-#define CONCERT_HALL 7
-#define CAVE 8
-#define ARENA 9 // used for thunderdome and arena.
-#define HANGAR 10
-#define CARPETED_HALLWAY 11
-#define HALLWAY 12
-#define STONE_CORRIDOR 13
-#define ALLEY 14
-#define FOREST 15
-#define CITY 16
-#define MOUNTAINS 17
-#define QUARRY 18
-#define PLAIN 19
-#define PARKING_LOT 20
-#define SEWER_PIPE 21
-#define UNDERWATER 22
-#define DRUGGED 23
-#define DIZZY 24
+///Default override for echo
+/sound
+ echo = list(
+ 0, // Direct
+ 0, // DirectHF
+ -10000, // Room, -10000 means no low frequency sound reverb
+ -10000, // RoomHF, -10000 means no high frequency sound reverb
+ 0, // Obstruction
+ 0, // ObstructionLFRatio
+ 0, // Occlusion
+ 0.25, // OcclusionLFRatio
+ 1.5, // OcclusionRoomRatio
+ 1.0, // OcclusionDirectRatio
+ 0, // Exclusion
+ 1.0, // ExclusionLFRatio
+ 0, // OutsideVolumeHF
+ 0, // DopplerFactor
+ 0, // RolloffFactor
+ 0, // RoomRolloffFactor
+ 1.0, // AirAbsorptionFactor
+ 0, // Flags (1 = Auto Direct, 2 = Auto Room, 4 = Auto RoomHF)
+ )
+ environment = SOUND_ENVIRONMENT_NONE //Default to none so sounds without overrides dont get reverb
+/**
+ * playsound is a proc used to play a 3D sound in a specific range. This uses SOUND_RANGE + extra_range to determine that.
+ *
+ * * source - Origin of sound.
+ * * soundin - Either a file, or a string that can be used to get an SFX.
+ * * vol - The volume of the sound, excluding falloff and pressure affection.
+ * * vary - bool that determines if the sound changes pitch every time it plays.
+ * * extrarange - modifier for sound range. This gets added on top of SOUND_RANGE.
+ * * falloff_exponent - Rate of falloff for the audio. Higher means quicker drop to low volume. Should generally be over 1 to indicate a quick dive to 0 rather than a slow dive.
+ * * frequency - playback speed of audio.
+ * * channel - The channel the sound is played at.
+ * * pressure_affected - Whether or not difference in pressure affects the sound (E.g. if you can hear in space).
+ * * ignore_walls - Whether or not the sound can pass through walls.
+ * * falloff_distance - Distance at which falloff begins. Sound is at peak volume (in regards to falloff) aslong as it is in this range.
+ *
+ * Aurora snowflake parameters:
+ *
+ * * required_preferences - What preference is required to be on on the client, for the sound to play
+ * * required_asfx_toggles - What toggles are required to be on on the client, for the sound to play
+ */
+/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff_exponent = SOUND_FALLOFF_EXPONENT, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE, use_reverb = TRUE, required_preferences, required_asfx_toggles)
+ if(isarea(source))
+ CRASH("playsound(): source is an area")
-#define STANDARD_STATION STONEROOM // default
-#define LARGE_ENCLOSED HANGAR // used for hangars, chapel
-#define SMALL_ENCLOSED BATHROOM // used for bathrooms, mostly.
-#define TUNNEL_ENCLOSED CAVE // maint tunnels and crawlspaces
-#define LARGE_SOFTFLOOR CARPETED_HALLWAY // used for library and theater
-#define MEDIUM_SOFTFLOOR LIVINGROOM // used for larger offices, usually with wooden floors
-#define SMALL_SOFTFLOOR ROOM // used for offices, dormitories and other small miscallaneous rooms
-#define ASTEROID CAVE // well, the asteroid
-#define SPACE UNDERWATER // space
-#define PSYCHOTIC PARKING_LOT // not actually used in areas, used in drug hallucinations.
+ var/turf/turf_source = get_turf(source)
-#define EQUIP_SOUND_VOLUME 30
-#define PICKUP_SOUND_VOLUME 15
-#define DROP_SOUND_VOLUME 20
-#define THROW_SOUND_VOLUME 90
-
-/proc/playsound(atom/source, soundin, vol, vary, extrarange, falloff, is_global, usepressure = 1, environment = -1, required_preferences = 0, required_asfx_toggles = 0, frequency = 0)
- if (isarea(source))
- crash_with("[source] is an area and is trying to make the sound: [soundin]")
+ if (!turf_source || !soundin || !vol)
return
- var/sound/original_sound = playsound_get_sound(soundin, vol, falloff, frequency, environment)
+ //allocate a channel if necessary now so its the same for everyone
+ channel = channel || SSsounds.random_available_channel()
- if (!original_sound)
- crash_with("Could not construct original sound.")
+ var/sound/S = isdatum(soundin) ? soundin : sound(get_sfx(soundin))
+ var/maxdistance = SOUND_RANGE + extrarange
+ var/source_z = turf_source.z
+ var/list/listeners = list()
+
+ var/list/players_by_zlevel[world.maxz][1]
+ var/list/dead_players_by_zlevel[world.maxz][1]
+
+ for(var/mob/player as anything in GLOB.player_list)
+ if(required_preferences && (player.client.prefs.toggles & required_preferences) != required_preferences)
+ continue
+
+ if(required_asfx_toggles && (player.client.prefs.sfx_toggles & required_asfx_toggles) != required_asfx_toggles)
+ continue
+
+ if(player.z == source_z)
+ listeners += player
+
+ if(player.z)
+ players_by_zlevel[player.z] += player
+
+ if(istype(player, /mob/abstract/observer) && player.z)
+ dead_players_by_zlevel[player.z] += player
+
+ . = list()//output everything that successfully heard the sound
+
+ var/turf/above_turf = GetAbove(turf_source)
+ var/turf/below_turf = GetBelow(turf_source)
+
+ if(ignore_walls)
+
+ if(above_turf && istype(above_turf, /turf/simulated/open))
+ listeners += players_by_zlevel[above_turf.z]
+
+ if(below_turf && istype(turf_source, /turf/simulated/open))
+ listeners += players_by_zlevel[below_turf.z]
+
+ else //these sounds don't carry through walls
+ listeners = get_hearers_in_view(maxdistance, turf_source)
+
+ if(above_turf && istype(above_turf, /turf/simulated/open))
+ listeners += get_hearers_in_view(maxdistance, above_turf)
+
+ if(below_turf && istype(turf_source, /turf/simulated/open))
+ listeners += get_hearers_in_view(maxdistance, below_turf)
+
+ for(var/mob/listening_mob in listeners | dead_players_by_zlevel[source_z])//observers always hear through walls
+ if(get_dist(listening_mob, turf_source) <= maxdistance)
+ listening_mob.playsound_local(turf_source, soundin, vol, vary, frequency, falloff_exponent, channel, pressure_affected, S, maxdistance, falloff_distance, 1, use_reverb)
+ . += listening_mob
+
+/mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff_exponent = SOUND_FALLOFF_EXPONENT, channel = 0, pressure_affected = TRUE, sound/sound_to_use, max_distance, falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE, distance_multiplier = 1, use_reverb = TRUE)
+ if(!client || !can_hear())
return
- if (is_global)
- playsound_allinrange(source, original_sound,
- extra_range = extrarange,
- is_global = is_global,
- use_random_freq = !!vary,
- use_pressure = usepressure,
- modify_environment = (environment != 0),
- required_preferences = required_preferences,
- required_asfx_toggles = required_asfx_toggles
- )
- else
- playsound_lineofsight(source, original_sound,
- use_pressure = usepressure,
- use_random_freq = !!vary,
- modify_environment = (environment != 0),
- required_preferences = required_preferences,
- required_asfx_toggles = required_asfx_toggles
- )
+ if(!sound_to_use)
+ sound_to_use = sound(get_sfx(soundin))
-/proc/playsound_get_sound(soundin, volume, fall_off, frequency = 0, environment = -1)
- if(ispath(soundin))
- soundin = get_sfx(soundin)
+ sound_to_use.wait = 0 //No queue
+ sound_to_use.channel = channel || SSsounds.random_available_channel()
+ sound_to_use.volume = vol
- var/sound/S = sound(soundin)
+ if(vary)
+ if(frequency)
+ sound_to_use.frequency = frequency
+ else
+ sound_to_use.frequency = get_rand_frequency()
- S.wait = 0
- S.channel = 0
- S.frequency = frequency
- S.falloff = fall_off || FALLOFF_SOUNDS
- S.environment = environment
- S.volume = volume
+ if(isturf(turf_source))
+ var/turf/turf_loc = get_turf(src)
- return S
+ //sound volume falloff with distance
+ var/distance = get_dist(turf_loc, turf_source) * distance_multiplier
-/proc/copy_sound(sound/original)
- var/sound/S = sound(original.file, original.repeat, 0, 0, original.volume)
+ if(max_distance) //If theres no max_distance we're not a 3D sound, so no falloff.
+ sound_to_use.volume -= (max(distance - falloff_distance, 0) ** (1 / falloff_exponent)) / ((max(max_distance, distance) - falloff_distance) ** (1 / falloff_exponent)) * sound_to_use.volume
+ //https://www.desmos.com/calculator/sqdfl8ipgf
- S.wait = original.wait
- S.channel = original.channel
- S.frequency = original.frequency
- S.falloff = original.falloff
- S.environment = original.environment
+ if(pressure_affected)
+ //Atmosphere affects sound
+ var/pressure_factor = 1
+ var/datum/gas_mixture/hearer_env = turf_loc.return_air()
+ var/datum/gas_mixture/source_env = turf_source.return_air()
- return S
-
-/proc/playsound_allinrange(atom/source, sound/S, extra_range = 0, is_global = FALSE, use_random_freq = FALSE, use_pressure = TRUE, modify_environment = TRUE, required_preferences = 0, required_asfx_toggles = 0)
- var/turf/source_turf = get_turf(source)
-
- for (var/MM in GLOB.player_list)
- var/mob/M = MM
-
- if (!M?.client)
- continue
-
- var/dist = get_dist(M, source_turf)
-
- if (dist <= (world.view + extra_range) * 3)
- var/turf/T = get_turf(M)
-
- if (!T || T.z != source_turf.z)
- continue
- else if (!M.sound_can_play(required_preferences, required_asfx_toggles))
- continue
-
- M.playsound_to(source_turf, S, use_random_freq = use_random_freq, use_pressure = use_pressure, modify_environment = modify_environment)
-
-/proc/playsound_lineofsight(atom/source, sound/S, use_random_freq = FALSE, use_pressure = TRUE, modify_environment = TRUE, required_preferences = 0, required_asfx_toggles = 0)
- var/list/hearers = get_hearers_in_view(world.view, source)
- var/turf/source_turf = get_turf(source)
-
- for (var/mob/M in hearers)
- if (!M.sound_can_play(required_preferences, required_asfx_toggles))
- continue
-
- M.playsound_to(source_turf, S, use_random_freq = use_random_freq, use_pressure = use_pressure, modify_environment = modify_environment)
-
-/mob/proc/sound_can_play(required_preferences = 0, required_asfx_toggles = 0)
- if (!client)
- return FALSE
-
- if (required_preferences && (client.prefs.toggles & required_preferences) != required_preferences)
- return FALSE
-
- if (required_asfx_toggles && (client.prefs.sfx_toggles & required_asfx_toggles) != required_asfx_toggles)
- return FALSE
-
- return TRUE
-
-/mob/proc/playsound_get_environment(pressure_factor = 1.0)
- if (pressure_factor < 0.5)
- return SPACE
- else
- var/area/A = get_area(src)
- return A ? A.sound_env : STANDARD_STATION
-
-/mob/living/playsound_get_environment(pressure_factor = 1.0)
- if (hallucination)
- return PSYCHOTIC
- else if (druggy)
- return DRUGGED
- else if (drowsiness)
- return DIZZY
- else if (confused)
- return DIZZY
- else if (stat == UNCONSCIOUS)
- return UNDERWATER
- else
- return ..()
-
-/mob/living/carbon/human/playsound_get_environment(pressure_factor = 1.0)
- if(get_hearing_protection() >= EAR_PROTECTION_MAJOR)
- return PADDED_CELL
- return ..()
-
-/mob/proc/check_sound_equipment_volume()
- return 1
-
-/mob/living/carbon/human/check_sound_equipment_volume()
- return 1 - (get_hearing_protection() * 0.2)
-
-/mob/proc/playsound_to(turf/source_turf, sound/original_sound, use_random_freq, modify_environment = TRUE, use_pressure = TRUE, required_preferences = 0, required_asfx_toggles = 0)
- var/sound/S = copy_sound(original_sound)
-
- var/pressure_factor = 1.0
-
- if(!sound_can_play(required_preferences, required_asfx_toggles))
- return 0
-
- if (use_random_freq)
- S.frequency = get_rand_frequency()
-
- if (isturf(source_turf))
- var/turf/T = get_turf(src)
-
- var/distance = get_dist(T, source_turf)
-
- S.volume -= max(distance - world.view, 0) * 2
-
- if (use_pressure && istype(T))
- var/datum/gas_mixture/hearer_env = T.return_air()
- var/datum/gas_mixture/source_env = source_turf.return_air()
-
- if (hearer_env && source_env)
+ if(hearer_env && source_env)
var/pressure = min(hearer_env.return_pressure(), source_env.return_pressure())
-
- if (pressure < ONE_ATMOSPHERE)
+ if(pressure < ONE_ATMOSPHERE)
pressure_factor = max((pressure - SOUND_MINIMUM_PRESSURE)/(ONE_ATMOSPHERE - SOUND_MINIMUM_PRESSURE), 0)
- else //in space
+ else //space
pressure_factor = 0
- if (distance <= 1)
- pressure_factor = max(pressure_factor, 0.15) //hearing through contact
+ if(distance <= 1)
+ pressure_factor = max(pressure_factor, 0.15) //touching the source of the sound
- S.volume *= pressure_factor
+ sound_to_use.volume *= pressure_factor
+ //End Atmosphere affecting sound
- if (S.volume <= 0)
- return 0
+ if(sound_to_use.volume <= 0)
+ return //No sound
- S.x = source_turf.x - T.x // left/right
- S.z = source_turf.y - T.y // front/back
- S.y = (source_turf.z - T.z) * SOUND_Z_FACTOR // above/below-ish
+ var/dx = turf_source.x - turf_loc.x // Hearing from the right/left
+ sound_to_use.x = dx * distance_multiplier
+ var/dz = turf_source.y - turf_loc.y // Hearing from infront/behind
+ sound_to_use.z = dz * distance_multiplier
+ var/dy = (turf_source.z - turf_loc.z) * 5 * distance_multiplier // Hearing from above / below, multiplied by 5 because we assume height is further along coords.
+ sound_to_use.y = dy
- if (modify_environment)
- S.environment = playsound_get_environment(pressure_factor)
+ sound_to_use.falloff = max_distance || 1 //use max_distance, else just use 1 as we are a direct sound so falloff isnt relevant.
- S.volume *= check_sound_equipment_volume()
+ // Sounds can't have their own environment. A sound's environment will be:
+ // 1. the mob's
+ // 2. the area's (defaults to SOUND_ENVRIONMENT_NONE)
+ if(sound_environment_override != SOUND_ENVIRONMENT_NONE)
+ sound_to_use.environment = sound_environment_override
+ else
+ var/area/A = get_area(src)
+ sound_to_use.environment = A.sound_environment
- sound_to(src, S)
- return S.volume
+ if(use_reverb && sound_to_use.environment != SOUND_ENVIRONMENT_NONE) //We have reverb, reset our echo setting
+ sound_to_use.echo[3] = 0 //Room setting, 0 means normal reverb
+ sound_to_use.echo[4] = 0 //RoomHF setting, 0 means normal reverb.
-/mob/proc/playsound_simple(source, soundin, volume, use_random_freq = FALSE, frequency = 0, falloff = 0, use_pressure = TRUE, required_preferences = 0, required_asfx_toggles = 0)
- var/sound/S = playsound_get_sound(soundin, volume, falloff, frequency)
- return playsound_to(source ? get_turf(source) : null, S, use_random_freq, use_pressure = use_pressure, required_preferences = required_preferences, required_asfx_toggles = required_asfx_toggles)
+ SEND_SOUND(src, sound_to_use)
-/proc/playsound_in(atom/source, soundin, vol, vary, extrarange, falloff, is_global, usepressure = 1, environment = -1, required_preferences = 0, required_asfx_toggles = 0, frequency = 0, time)
- addtimer(CALLBACK(GLOBAL_PROC, /proc/playsound, source, soundin, vol, vary, extrarange, falloff, is_global, usepressure, environment, required_preferences, required_asfx_toggles, frequency), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME)
+/proc/sound_to_playing_players(soundin, volume = 100, vary = FALSE, frequency = 0, channel = 0, pressure_affected = FALSE, sound/S)
+ if(!S)
+ S = sound(get_sfx(soundin))
+ for(var/m in GLOB.player_list)
+ if(ismob(m) && !isnewplayer(m))
+ var/mob/M = m
+ M.playsound_local(M, null, volume, vary, frequency, null, channel, pressure_affected, S)
+
+/mob/proc/stop_sound_channel(chan)
+ SEND_SOUND(src, sound(null, repeat = 0, wait = 0, channel = chan))
+
+/mob/proc/set_sound_channel_volume(channel, volume)
+ var/sound/S = sound(null, FALSE, FALSE, channel, volume)
+ S.status = SOUND_UPDATE
+ SEND_SOUND(src, S)
+
+/client/proc/playtitlemusic(vol = 85)
+ set waitfor = FALSE
+ UNTIL(SSticker.login_music) //wait for SSticker init to set the login music
-/client/proc/playtitlemusic()
- if(!SSticker.login_music)
- return
if(prefs.toggles & SOUND_LOBBY)
- src << sound(SSticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS)
+ SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = vol, channel = CHANNEL_LOBBYMUSIC)) // MAD JAMS
/proc/get_rand_frequency()
return rand(32000, 55000) //Frequency stuff only works with 45kbps oggs.
-/proc/get_sfx(var/sound_category)
- var/singleton/sound_category/SC = GET_SINGLETON(sound_category)
+//Unlike TG, we use singletons here, so this is different, for now
+/proc/get_sfx(soundin)
+ if(isfile(soundin) || (istext(soundin) && !ispath(soundin)))
+ return soundin
+
+ var/singleton/sound_category/SC = GET_SINGLETON(soundin)
if(!istype(SC))
- CRASH("Non-decl path in get_sfx: [sound_category]")
+ CRASH("Non-decl path in get_sfx: [soundin]")
return SC.get_sound()
/singleton/sound_category
diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm
index f6ec7de8b28..5d2a4c0de61 100644
--- a/code/game/turfs/simulated/floor_attackby.dm
+++ b/code/game/turfs/simulated/floor_attackby.dm
@@ -23,17 +23,17 @@
return
to_chat(user, "You unscrew and remove the [flooring.descriptor].")
make_plating(1)
- playsound(src, attacking_item.usesound, 80, 1)
+ attacking_item.play_tool_sound(get_turf(src), 80)
return
else if(attacking_item.iswrench() && (flooring.flags & TURF_REMOVE_WRENCH))
to_chat(user, "You unwrench and remove the [flooring.descriptor].")
make_plating(1)
- playsound(src, attacking_item.usesound, 80, 1)
+ attacking_item.play_tool_sound(get_turf(src), 80)
return
else if(istype(attacking_item, /obj/item/shovel) && (flooring.flags & TURF_REMOVE_SHOVEL))
to_chat(user, "You shovel off the [flooring.descriptor].")
make_plating(1)
- playsound(src, attacking_item.usesound, 80, 1)
+ attacking_item.play_tool_sound(get_turf(src), 80)
return
else if(attacking_item.iswelder() && (flooring.flags & TURF_REMOVE_WELDER))
var/obj/item/weldingtool/WT = attacking_item
@@ -43,7 +43,7 @@
if(WT.use(0, user))
to_chat(user, SPAN_NOTICE("You use \the [WT] to remove \the [src]."))
make_plating(1)
- playsound(src, attacking_item.usesound, 80, 1)
+ attacking_item.play_tool_sound(get_turf(src), 80)
return
else if(attacking_item.iscoil())
to_chat(user, "You must remove the [flooring.descriptor] first.")
diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm
index b39e9622a92..66485f2b194 100644
--- a/code/game/turfs/simulated/wall_attacks.dm
+++ b/code/game/turfs/simulated/wall_attacks.dm
@@ -274,7 +274,7 @@
if(5)
if (attacking_item.isscrewdriver())
to_chat(user, SPAN_NOTICE("You begin removing the support lines."))
- playsound(src, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
if(!attacking_item.use_tool(src, user, 60, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 5)
return
construction_stage = 4
diff --git a/code/modules/atmospherics/components/binary_devices/circulator.dm b/code/modules/atmospherics/components/binary_devices/circulator.dm
index baf32ac7cb9..1df8be62c02 100644
--- a/code/modules/atmospherics/components/binary_devices/circulator.dm
+++ b/code/modules/atmospherics/components/binary_devices/circulator.dm
@@ -95,7 +95,7 @@
/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.iswrench())
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
"You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor.", \
diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm
index 23d9bdf7d1c..539439d61ae 100644
--- a/code/modules/client/preferences_toggles.dm
+++ b/code/modules/client/preferences_toggles.dm
@@ -83,7 +83,7 @@
else
to_chat(src, "You will no longer hear music in the game lobby.")
if(istype(mob, /mob/abstract/new_player))
- src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // stop the jamsz)
+ src << sound(null, repeat = 0, wait = 0, volume = 85, channel = CHANNEL_LOBBYMUSIC) // stop the jamsz)
feedback_add_details("admin_verb","TLobby") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/togglemidis()
diff --git a/code/modules/clothing/spacesuits/rig/rig_construction.dm b/code/modules/clothing/spacesuits/rig/rig_construction.dm
index b846062cd55..62bfb671b50 100644
--- a/code/modules/clothing/spacesuits/rig/rig_construction.dm
+++ b/code/modules/clothing/spacesuits/rig/rig_construction.dm
@@ -201,13 +201,13 @@
else
return 0
else if(I.iswrench())
- playsound(holder, I.usesound, 50, 1)
+ I.play_tool_sound(get_turf(src), 50)
else if(I.isscrewdriver())
- playsound(holder, I.usesound, 50, 1)
+ I.play_tool_sound(get_turf(src), 50)
else if(I.iswirecutter())
- playsound(holder, I.usesound, 50, 1)
+ I.play_tool_sound(get_turf(src), 50)
else if(I.iscoil())
var/obj/item/stack/cable_coil/C = used_atom
diff --git a/code/modules/cooking/machinery/cooking_machines/grill.dm b/code/modules/cooking/machinery/cooking_machines/grill.dm
index a2c000fdeaf..04944aac852 100644
--- a/code/modules/cooking/machinery/cooking_machines/grill.dm
+++ b/code/modules/cooking/machinery/cooking_machines/grill.dm
@@ -36,7 +36,7 @@
/obj/machinery/appliance/cooker/grill/Initialize()
. = ..()
- grill_loop = new(list(src), FALSE)
+ grill_loop = new(src, FALSE)
/obj/machinery/appliance/cooker/grill/Destroy()
QDEL_NULL(grill_loop)
diff --git a/code/modules/cooking/machinery/smartfridge.dm b/code/modules/cooking/machinery/smartfridge.dm
index 912fa89c4f9..85703c6a092 100644
--- a/code/modules/cooking/machinery/smartfridge.dm
+++ b/code/modules/cooking/machinery/smartfridge.dm
@@ -299,7 +299,7 @@
anchored = !anchored
user.visible_message("\The [user] [anchored ? "secures" : "unsecures"] the bolts holding \the [src] to the floor.",
"You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.")
- playsound(get_turf(src), attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
power_change()
return
diff --git a/code/modules/custom_ka/core.dm b/code/modules/custom_ka/core.dm
index aa0ec69f405..a9ea74e5020 100644
--- a/code/modules/custom_ka/core.dm
+++ b/code/modules/custom_ka/core.dm
@@ -410,7 +410,7 @@
return TRUE
else if(attacking_item.iswrench())
if(installed_upgrade_chip)
- playsound(src,attacking_item.usesound, 50, 0)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user,"You remove \the [installed_upgrade_chip].")
installed_upgrade_chip.forceMove(user.loc)
installed_upgrade_chip.update_icon()
@@ -418,7 +418,7 @@
update_stats()
update_icon()
else if(installed_barrel && can_disassemble_barrel)
- playsound(src,attacking_item.usesound, 50, 0)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user,"You remove \the [installed_barrel].")
installed_barrel.forceMove(user.loc)
installed_barrel.update_icon()
@@ -426,7 +426,7 @@
update_stats()
update_icon()
else if(installed_cell && can_disassemble_cell)
- playsound(src,attacking_item.usesound, 50, 0)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user,"You remove \the [installed_cell].")
installed_cell.forceMove(user.loc)
installed_cell.update_icon()
diff --git a/code/modules/ghostroles/spawner/antagonist/revenant.dm b/code/modules/ghostroles/spawner/antagonist/revenant.dm
index dd8a1530d36..68f5f06b0f7 100644
--- a/code/modules/ghostroles/spawner/antagonist/revenant.dm
+++ b/code/modules/ghostroles/spawner/antagonist/revenant.dm
@@ -54,7 +54,7 @@
var/mob/M = m
if(M.ear_deaf)
continue
- M.playsound_simple(get_turf(M), 'sound/ambience/tension/tension.ogg', 75, FALSE)
+ M.playsound_local(get_turf(M), 'sound/ambience/tension/tension.ogg', 75, FALSE)
to_chat(M, FONT_LARGE(SPAN_CULT("A faint hum coming from the station walls fills your ears...")))
has_fired = TRUE
diff --git a/code/modules/heavy_vehicle/components/frame.dm b/code/modules/heavy_vehicle/components/frame.dm
index ffd87063f59..d78bffffdee 100644
--- a/code/modules/heavy_vehicle/components/frame.dm
+++ b/code/modules/heavy_vehicle/components/frame.dm
@@ -210,7 +210,7 @@
return
visible_message("\The [user] [(is_wired == FRAME_WIRED_ADJUSTED) ? "snips some of" : "neatens"] the wiring in \the [src].")
- playsound(user.loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
is_wired = (is_wired == FRAME_WIRED_ADJUSTED) ? FRAME_WIRED : FRAME_WIRED_ADJUSTED
// Installing metal.
else if(istype(attacking_item, /obj/item/stack/material))
@@ -237,7 +237,7 @@
to_chat(user, SPAN_WARNING("\The [src]'s internal reinforcement has been welded in."))
return
visible_message("\The [user] [(is_reinforced == 2) ? "unsecures" : "secures"] the metal reinforcement in \the [src].")
- playsound(user.loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
is_reinforced = (is_reinforced == FRAME_REINFORCED_SECURE) ? FRAME_REINFORCED : FRAME_REINFORCED_SECURE
// Welding metal.
else if(attacking_item.iswelder())
@@ -254,7 +254,7 @@
if(WT.use(1, user))
visible_message("\The [user] [(is_reinforced == 3) ? "unwelds the reinforcement from" : "welds the reinforcement into"] \the [src].")
is_reinforced = (is_reinforced == FRAME_REINFORCED_WELDED) ? FRAME_REINFORCED_SECURE : FRAME_REINFORCED_WELDED
- playsound(user.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
else
to_chat(user, SPAN_WARNING("Not enough fuel!"))
return
diff --git a/code/modules/heavy_vehicle/equipment/utility.dm b/code/modules/heavy_vehicle/equipment/utility.dm
index fd2ca0cac35..3d33fe60637 100644
--- a/code/modules/heavy_vehicle/equipment/utility.dm
+++ b/code/modules/heavy_vehicle/equipment/utility.dm
@@ -681,7 +681,7 @@
to_chat(user, SPAN_WARNING("\The [src] doesn't have an anomaly core installed!"))
return TRUE
to_chat(user, SPAN_NOTICE("You remove \the [AC] from \the [src]."))
- playsound(loc, attacking_item.usesound, 50, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 50)
user.put_in_hands(AC)
cut_overlay(anomaly_overlay)
qdel(anomaly_overlay)
diff --git a/code/modules/heavy_vehicle/mech_interaction.dm b/code/modules/heavy_vehicle/mech_interaction.dm
index 33ab464522c..38908f654ec 100644
--- a/code/modules/heavy_vehicle/mech_interaction.dm
+++ b/code/modules/heavy_vehicle/mech_interaction.dm
@@ -452,7 +452,7 @@
user.put_in_hands(body.cell)
to_chat(user, "You remove \the [body.cell] from \the [src].")
- playsound(user.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
visible_message("\The [user] pries out \the [body.cell] using the \the [attacking_item].")
power = MECH_POWER_OFF
hud_power_control.update_icon()
diff --git a/code/modules/holodeck/HolodeckControl.dm b/code/modules/holodeck/HolodeckControl.dm
index ff2a7d558bb..449a60321f9 100644
--- a/code/modules/holodeck/HolodeckControl.dm
+++ b/code/modules/holodeck/HolodeckControl.dm
@@ -309,7 +309,7 @@ GLOBAL_LIST_EMPTY_TYPED(holodeck_controls, /obj/machinery/computer/holodeck_cont
if(M.mind)
linkedholodeck.play_ambience(M)
- linkedholodeck.sound_env = A.sound_env
+ linkedholodeck.sound_environment = A.sound_environment
spawn(30)
for(var/obj/effect/landmark/L in linkedholodeck)
diff --git a/code/modules/hydroponics/seed_storage.dm b/code/modules/hydroponics/seed_storage.dm
index cb50909df93..c05357c907c 100644
--- a/code/modules/hydroponics/seed_storage.dm
+++ b/code/modules/hydroponics/seed_storage.dm
@@ -390,7 +390,7 @@
to_chat(user, SPAN_WARNING("There are no seeds in \the [attacking_item.name]."))
return
else if(attacking_item.iswrench())
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
to_chat(user, SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src]."))
diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm
index 877f410b37f..22947091ebd 100644
--- a/code/modules/hydroponics/trays/tray.dm
+++ b/code/modules/hydroponics/trays/tray.dm
@@ -591,7 +591,7 @@
if(locate(/obj/machinery/atmospherics/portables_connector/) in loc)
return ..()
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm
index f0713a60d85..7e827132ac5 100644
--- a/code/modules/integrated_electronics/core/assemblies.dm
+++ b/code/modules/integrated_electronics/core/assemblies.dm
@@ -248,7 +248,7 @@
return TRUE
else if(attacking_item.iswrench() && can_anchor)
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
if(anchored)
on_anchored()
@@ -258,7 +258,7 @@
return TRUE
else if(attacking_item.iscrowbar())
- playsound(get_turf(src), attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
opened = !opened
to_chat(user, "You [opened ? "open" : "close"] \the [src].")
update_icon()
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index 2293d208813..d28dfe161c1 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -38,7 +38,7 @@
else
name = ("bookcase ([newname])")
else if(attacking_item.iswrench())
- playsound(src.loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, (anchored ? "You unfasten \the [src] from the floor." : "You secure \the [src] to the floor."))
anchored = !anchored
else if(attacking_item.isscrewdriver())
diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm
index 51be6807023..ae45c8ea398 100644
--- a/code/modules/library/lib_machines.dm
+++ b/code/modules/library/lib_machines.dm
@@ -418,7 +418,7 @@
return
user.drop_from_inventory(attacking_item,src)
if(attacking_item.iswrench())
- playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 75)
if(anchored)
user.visible_message(SPAN_NOTICE("\The [user] unsecures \the [src] from the floor."),
SPAN_NOTICE("You unsecure \the [src] from the floor."),
@@ -506,7 +506,7 @@
qdel(attacking_item)
return
if(attacking_item.iswrench())
- playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 75)
if(anchored)
user.visible_message(SPAN_NOTICE("\The [user] unsecures \the [src] from the floor."), \
SPAN_NOTICE("You unsecure \the [src] from the floor."), \
diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm
index 224431cc6e8..69d72f0d05c 100644
--- a/code/modules/mining/drilling/drill.dm
+++ b/code/modules/mining/drilling/drill.dm
@@ -542,7 +542,7 @@
connected.system_error("Unexpected user interface error.")
return
- playsound(get_turf(src), attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, SPAN_NOTICE("You [anchored ? "un" : ""]anchor the brace."))
anchored = !anchored
diff --git a/code/modules/mob/abstract/new_player/menu.dm b/code/modules/mob/abstract/new_player/menu.dm
index 5eba562c651..a6ab847ce8f 100644
--- a/code/modules/mob/abstract/new_player/menu.dm
+++ b/code/modules/mob/abstract/new_player/menu.dm
@@ -317,7 +317,7 @@
var/mob/abstract/observer/observer = new /mob/abstract/observer(src)
spawning = 1
- sound_to(src, sound(null, repeat = 0, wait = 0, volume = 85, channel = 1))
+ src.stop_sound_channel(CHANNEL_LOBBYMUSIC) // stop the jams for observers
observer.started_as_observer = 1
close_spawn_windows()
diff --git a/code/modules/mob/abstract/new_player/new_player.dm b/code/modules/mob/abstract/new_player/new_player.dm
index 3aec41f6baf..e213a90ca48 100644
--- a/code/modules/mob/abstract/new_player/new_player.dm
+++ b/code/modules/mob/abstract/new_player/new_player.dm
@@ -393,7 +393,7 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
client.autohiss_mode = client.prefs.autohiss_setting
- src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo)
+ src.stop_sound_channel(CHANNEL_LOBBYMUSIC) // MAD JAMS cant last forever yo)
if(mind)
mind.active = 0 //we wish to transfer the key manually
diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm
index 3ea0c53c67e..04f9bf8c033 100644
--- a/code/modules/mob/hear_say.dm
+++ b/code/modules/mob/hear_say.dm
@@ -73,7 +73,7 @@
on_hear_say("[track][accent_icon ? accent_icon + " " : ""][speaker_name][alt_name] [verb], \"[message]\"")
if (speech_sound && (get_dist(speaker, src) <= world.view && src.z == speaker.z))
var/turf/source = speaker? get_turf(speaker) : get_turf(src)
- playsound_simple(source, speech_sound, sound_vol, use_random_freq = TRUE)
+ playsound(source, speech_sound, sound_vol, vary = TRUE)
return TRUE
/mob/proc/cant_hear()
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index ba20691a832..46803a653cb 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -1157,7 +1157,7 @@
if(isturf(loc) && rand(1,1000) == 1)
var/turf/T = loc
if (T.get_lumcount() < 0.01) // give a little bit of tolerance for near-dark areas.
- playsound_simple(null, pick(GLOB.scarySounds), 50, TRUE)
+ playsound(null, pick(GLOB.scarySounds), 50, TRUE)
if(HAS_TRAIT(src, TRAIT_ORIGIN_DARK_AFRAID))
if(T.get_lumcount() < 0.1)
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index b92a3ef5535..d47b2f1d9ba 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -253,7 +253,7 @@
if(has_jetpack)
jetpack = new /obj/item/tank/jetpack/carbondioxide/synthetic(src)
- playsound(get_turf(src), spawn_sound, 75, pitch_toggle)
+ playsound(get_turf(src), spawn_sound, 75, pitch_toggle, ignore_walls = FALSE)
/mob/living/silicon/robot/SetName(pickedName as text)
custom_name = pickedName
diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm
index 218265d6cff..77bf1ec1b12 100644
--- a/code/modules/mob/living/simple_animal/hostile/bear.dm
+++ b/code/modules/mob/living/simple_animal/hostile/bear.dm
@@ -393,14 +393,14 @@
//This is triggered randomly periodically by the bear
/mob/living/simple_animal/hostile/bear/proc/growl_soft()
var/sound = pick(quiet_sounds)
- playsound(src, sound, 50, 1,3, usepressure = 0)
+ playsound(src, sound, 50, 1,3, pressure_affected = 0)
//Plays a loud sound from a selection of four
//Played when bear is attacking or dies
/mob/living/simple_animal/hostile/bear/proc/growl_loud()
var/sound = pick(loud_sounds)
- playsound(src, sound, 85, 1, 5, usepressure = 0)
+ playsound(src, sound, 85, 1, 5, pressure_affected = 0)
//A special bear subclass which is more powerful and has the ability to teleport around to seek out prey.
//It dislikes other bears and refuses to cooperate with them. If two of them see each other, one or both will teleport away
diff --git a/code/modules/mob/living/simple_animal/hostile/changeling.dm b/code/modules/mob/living/simple_animal/hostile/changeling.dm
index f1109e9acb8..cb304041bfa 100644
--- a/code/modules/mob/living/simple_animal/hostile/changeling.dm
+++ b/code/modules/mob/living/simple_animal/hostile/changeling.dm
@@ -68,7 +68,7 @@
if(prob(10))
custom_emote(VISIBLE_MESSAGE, pick( list("shrieks!","roars!", "screeches!", "snarls!", "bellows!", "screams!") ) )
var/sound = pick(loud_sounds)
- playsound(src, sound, 90, 1, 15, usepressure = 0)
+ playsound(src, sound, 90, 1, 15, pressure_affected = 0)
/mob/living/simple_animal/hostile/true_changeling/death(gibbed)
diff --git a/code/modules/mob/living/simple_animal/hostile/sarlacc.dm b/code/modules/mob/living/simple_animal/hostile/sarlacc.dm
index d9fd68986bf..1ec95d3feaa 100644
--- a/code/modules/mob/living/simple_animal/hostile/sarlacc.dm
+++ b/code/modules/mob/living/simple_animal/hostile/sarlacc.dm
@@ -346,7 +346,7 @@
faction = "worms"
/mob/living/simple_animal/hostile/greatwormking/Destroy()
- playsound(src.loc, 'sound/hallucinations/wail.ogg', 200, 1, usepressure = 0)
+ playsound(src.loc, 'sound/hallucinations/wail.ogg', 200, 1, pressure_affected = 0)
for(var/mob/living/L in SSmobs.greatworms)
L.death()
for(var/obj/structure/S in SSmobs.greatasses)
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index 888091644a8..a522e4ab751 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -251,6 +251,9 @@
var/authed = TRUE
var/player_age = "Requires database"
+ ///Override for sound_environmentironments. If this is set the user will always hear a specific type of reverb (Instead of the area defined reverb)
+ var/sound_environment_override = SOUND_ENVIRONMENT_NONE
+
///the icon currently used for the typing indicator's bubble
var/atom/movable/typing_indicator/typing_indicator
/// User is thinking in character. Used to revert to thinking state after stop_typing
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index ff3799845e7..abf7cf20e51 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -1314,3 +1314,7 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT)
/mob/get_client()
return client
+
+///Can the mob hear
+/mob/proc/can_hear()
+ return !isdeaf(src)
diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm
index 88687ee3baa..cf145eb3d16 100644
--- a/code/modules/mob/transform_procs.dm
+++ b/code/modules/mob/transform_procs.dm
@@ -105,7 +105,7 @@
/mob/proc/AIize(move=1)
if(client)
- src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // stop the jams for AIs)
+ src.stop_sound_channel(CHANNEL_LOBBYMUSIC) // stop the jams for AIs)
//The destination the mob will be spawned at
var/final_destination = loc
diff --git a/code/modules/modular_computers/NTNet/NTNet_relay.dm b/code/modules/modular_computers/NTNet/NTNet_relay.dm
index 67e804eaf08..714f1fdd2a0 100644
--- a/code/modules/modular_computers/NTNet/NTNet_relay.dm
+++ b/code/modules/modular_computers/NTNet/NTNet_relay.dm
@@ -123,7 +123,7 @@
/obj/machinery/ntnet_relay/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.isscrewdriver())
- playsound(get_turf(src), attacking_item.usesound, 50, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 50)
panel_open = !panel_open
to_chat(user, SPAN_NOTICE("You [panel_open ? "open" : "close"] the maintenance hatch."))
return
@@ -131,7 +131,7 @@
if(!panel_open)
to_chat(user, SPAN_WARNING("Open the maintenance panel first."))
return
- playsound(get_turf(src), attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, SPAN_NOTICE("You disassemble \the [src]!"))
for(var/atom/movable/A in component_parts)
diff --git a/code/modules/overmap/exoplanets/decor/_areas.dm b/code/modules/overmap/exoplanets/decor/_areas.dm
index c9abfa98c46..79a86058c0a 100644
--- a/code/modules/overmap/exoplanets/decor/_areas.dm
+++ b/code/modules/overmap/exoplanets/decor/_areas.dm
@@ -43,7 +43,7 @@
/area/exoplanet/grass/play_ambience(var/mob/living/L)
..()
if(L && L.client && (L.client.prefs.sfx_toggles & ASFX_AMBIENCE) && !L.ear_deaf)
- L.playsound_to(get_turf(L),sound('sound/ambience/jungle.ogg', repeat = 1, wait = 0, volume = 25, channel = 1))
+ L.playsound_local(get_turf(L),sound('sound/ambience/jungle.ogg', repeat = 1, wait = 0, volume = 25, channel = CHANNEL_AMBIENCE))
/area/exoplanet/grass/grove
base_turf = /turf/simulated/floor/exoplanet/grass/grove
diff --git a/code/modules/overmap/ship_weaponry/_ship_ammunition.dm b/code/modules/overmap/ship_weaponry/_ship_ammunition.dm
index a4d989edfef..82d44dd5c9e 100644
--- a/code/modules/overmap/ship_weaponry/_ship_ammunition.dm
+++ b/code/modules/overmap/ship_weaponry/_ship_ammunition.dm
@@ -224,7 +224,7 @@
for(var/mob/living/carbon/human/H in GLOB.human_mob_list)
if(AreConnectedZLevels(H.z, z))
to_chat(H, SPAN_WARNING("The flooring below you vibrates a little as shells fly by the hull of the ship!"))
- H.playsound_simple(null, 'sound/effects/explosionfar.ogg', 25)
+ H.playsound_local(null, 'sound/effects/explosionfar.ogg', 25)
shake_camera(H, 2, 2)
..()
if(ammo.touch_map_edge(z))
diff --git a/code/modules/overmap/ships/engines/gas_thruster.dm b/code/modules/overmap/ships/engines/gas_thruster.dm
index 23a06328943..f6ba67ead2b 100644
--- a/code/modules/overmap/ships/engines/gas_thruster.dm
+++ b/code/modules/overmap/ships/engines/gas_thruster.dm
@@ -198,7 +198,7 @@
if(!removed)
return 0
. = calculate_thrust(removed)
- playsound(loc, 'sound/machines/thruster.ogg', 100 * thrust_limit * power_modifier, 0, world.view * 4, 0.1, is_global = TRUE)
+ playsound(loc, 'sound/machines/thruster.ogg', 70 * thrust_limit * power_modifier, 0, world.view * 4, 0.1)
if(network)
network.update = 1
diff --git a/code/modules/overmap/ships/ship.dm b/code/modules/overmap/ships/ship.dm
index aa456731acd..bd82a8faaa9 100644
--- a/code/modules/overmap/ships/ship.dm
+++ b/code/modules/overmap/ships/ship.dm
@@ -349,7 +349,7 @@ var/const/OVERMAP_SPEED_CONSTANT = (1 SECOND)
else
to_chat(L, SPAN_WARNING("The ship turns beneath you, but the artificial gravity keeps you on your feet."))
shake_camera(L, 1 SECOND, 2)
- L.playsound_simple(soundin = 'sound/machines/thruster.ogg', volume = 50)
+ L.playsound_local(soundin = 'sound/machines/thruster.ogg', vol = 50)
last_combat_turn = world.time
/obj/effect/overmap/visitable/ship/proc/combat_roll(var/new_dir)
diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm
index 42e387e7b3a..ca251229936 100644
--- a/code/modules/paperwork/filingcabinet.dm
+++ b/code/modules/paperwork/filingcabinet.dm
@@ -64,7 +64,7 @@
icon_state = initial(icon_state)
updateUsrDialog()
else if(attacking_item.iswrench())
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
else
diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm
index ab84e180b2f..abb827f4f31 100644
--- a/code/modules/paperwork/papershredder.dm
+++ b/code/modules/paperwork/papershredder.dm
@@ -22,7 +22,7 @@
return
else if (attacking_item.iswrench())
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
user.visible_message(
SPAN_NOTICE("[anchored ? "\The [user] fastens \the [src] to \the [loc]." : "\The unfastens \the [src] from \the [loc]."]"),
diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm
index 6c20d9a3f9b..31de973df4b 100644
--- a/code/modules/paperwork/photocopier.dm
+++ b/code/modules/paperwork/photocopier.dm
@@ -129,7 +129,7 @@
flick("photocopier_notoner", src)
playsound(loc, 'sound/machines/buzz-two.ogg', 75, 1)
else if(attacking_item.iswrench())
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
anchored = !anchored
to_chat(user, SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src]."))
return
diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm
index a7e4a87aab7..120fb552393 100644
--- a/code/modules/power/antimatter/control.dm
+++ b/code/modules/power/antimatter/control.dm
@@ -73,7 +73,7 @@
power_cycle = 0
/obj/machinery/power/am_control_unit/proc/produce_power()
- playsound(get_turf(src), 'sound/effects/air_seal.ogg', 25, TRUE, environment = SEWER_PIPE)
+ playsound(get_turf(src), 'sound/effects/air_seal.ogg', 25, TRUE)
for(var/thing in linked_cores)
flick("core2", thing)
if(reported_core_efficiency <= 0)
@@ -135,7 +135,7 @@
/obj/machinery/power/am_control_unit/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.iswrench())
if(!anchored)
- playsound(get_turf(src), attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message("[user.name] secures \the [src] to the floor.", \
SPAN_NOTICE("You secure the anchor bolts to the floor."), \
SPAN_NOTICE("You hear a ratcheting noise."))
@@ -144,7 +144,7 @@
check_shield_icons()
connect_to_network()
else if(!LAZYLEN(linked_shielding))
- playsound(get_turf(src), attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message("[user] unsecures \the [src].", \
SPAN_NOTICE("You remove the anchor bolts."), \
SPAN_NOTICE("You hear a ratcheting noise."))
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 879190df6c1..1e0d5d426c1 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -815,12 +815,12 @@
if (has_electronics == HAS_ELECTRONICS_CONNECT && terminal)
has_electronics = HAS_ELECTRONICS_SECURED
stat &= ~MAINT
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You screw the circuit electronics into place.")
else if (has_electronics == HAS_ELECTRONICS_SECURED)
has_electronics = HAS_ELECTRONICS_CONNECT
stat |= MAINT
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You unfasten the electronics.")
else /* has_electronics == HAS_ELECTRONICS_NONE */
to_chat(user, SPAN_WARNING("There is nothing to secure."))
diff --git a/code/modules/power/batteryrack.dm b/code/modules/power/batteryrack.dm
index e7eb17e6227..b54293c09e5 100644
--- a/code/modules/power/batteryrack.dm
+++ b/code/modules/power/batteryrack.dm
@@ -44,7 +44,7 @@
if(attacking_item.iscrowbar())
if (charge < (capacity / 100))
if (!output_attempt && !input_attempt)
- playsound(get_turf(src), attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
M.state = 2
M.icon_state = "box_1"
diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm
index 55a4e9feccc..be2e39b0f2f 100644
--- a/code/modules/power/generator.dm
+++ b/code/modules/power/generator.dm
@@ -129,7 +129,7 @@
else
air2.temperature = air2.temperature + heat/air2_heat_capacity
air1.temperature = air1.temperature - energy_transfer/air1_heat_capacity
- playsound(get_turf(src), 'sound/effects/beam.ogg', 25, FALSE, 10, , required_preferences = ASFX_AMBIENCE)
+ playsound(get_turf(src), 'sound/effects/beam.ogg', 25, FALSE, 10, , required_preferences = ASFX_AMBIENCE, channel = CHANNEL_AMBIENCE)
//Transfer the air
if (air1)
@@ -172,7 +172,7 @@
/obj/machinery/power/generator/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.iswrench())
- playsound(src.loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
"You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor.", \
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index eac1ca6f4ac..e4551fd461b 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -205,7 +205,7 @@
if(GRAV_NEEDS_SCREWDRIVER)
if(attacking_item.isscrewdriver())
to_chat(user, "You secure the screws of the framework.")
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
broken_state++
if(GRAV_NEEDS_WELDING)
if(attacking_item.iswelder())
@@ -227,17 +227,17 @@
if(GRAV_NEEDS_WRENCH)
if(attacking_item.iswrench())
to_chat(user, "You secure the plating to the framework.")
- playsound(src.loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
set_fix()
else
..()
if(attacking_item.iscrowbar())
if(backpanelopen)
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You replace the back panel.")
backpanelopen = 0
else
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You open the back panel.")
backpanelopen = 1
@@ -430,7 +430,7 @@
if(M.client)
if(!M) return
shake_camera(M, 5, 1)
- M.playsound_simple(our_turf, 'sound/effects/alert.ogg', 100, use_random_freq = TRUE, falloff = 0.5)
+ M.playsound_local(our_turf, 'sound/effects/alert.ogg', 100, vary = TRUE, falloff_distance = 0.5)
/obj/machinery/gravity_generator/main/proc/update_list(var/gravity_changed = FALSE)
var/turf/T = get_turf(src.loc)
diff --git a/code/modules/power/lights/construction.dm b/code/modules/power/lights/construction.dm
index b5c6491a0f8..1de81758975 100644
--- a/code/modules/power/lights/construction.dm
+++ b/code/modules/power/lights/construction.dm
@@ -129,7 +129,7 @@
user.visible_message(SPAN_NOTICE("\The [user] closes \the [src]'s casing."),
SPAN_NOTICE("You close \the [src]'s casing."),
SPAN_WARNING("You hear something being screwed in."))
- playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 75)
switch(fixture_type)
if("tube")
@@ -181,7 +181,7 @@
to_chat(user, SPAN_WARNING("\The [src] does not have a power cell installed."))
return
- playsound(get_turf(src), attacking_item.usesound, 50, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 50)
visible_message(SPAN_NOTICE("\The [user] removes \the [cell] from the [src]."),
SPAN_NOTICE("You remove \the [cell] from \the [src]."))
cell.forceMove(get_turf(src))
diff --git a/code/modules/power/lights/fixtures.dm b/code/modules/power/lights/fixtures.dm
index ecec1b22065..e2250c1b611 100644
--- a/code/modules/power/lights/fixtures.dm
+++ b/code/modules/power/lights/fixtures.dm
@@ -459,7 +459,7 @@
// attempt to stick weapon into light socket
else if(status == LIGHT_EMPTY)
if(attacking_item.isscrewdriver()) //If it's a screwdriver open it.
- playsound(get_turf(src), attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message(SPAN_NOTICE("\The [user] opens \the [src]'s casing."), SPAN_NOTICE("You open \the [src]'s casing."), SPAN_NOTICE("You hear a noise."))
var/obj/machinery/light_construct/newlight = null
switch(fitting)
diff --git a/code/modules/power/portgen.dm b/code/modules/power/portgen.dm
index b81915f7249..5b3588d8484 100644
--- a/code/modules/power/portgen.dm
+++ b/code/modules/power/portgen.dm
@@ -17,7 +17,7 @@
/obj/machinery/power/portgen/Initialize()
. = ..()
- soundloop = new(list(src), active)
+ soundloop = new(src, active)
/obj/machinery/power/portgen/Destroy()
QDEL_NULL(soundloop)
@@ -291,7 +291,7 @@
else if(attacking_item.isscrewdriver())
open = !open
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
if(open)
to_chat(user, SPAN_NOTICE("You open the access panel."))
else
diff --git a/code/modules/power/radial_floodlight.dm b/code/modules/power/radial_floodlight.dm
index 6e335098723..be0b8111827 100644
--- a/code/modules/power/radial_floodlight.dm
+++ b/code/modules/power/radial_floodlight.dm
@@ -42,7 +42,7 @@
toggle_active(FALSE)
else
connect_to_network()
- playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 75)
return
return ..()
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index 03ad6d9d63a..baa2e21e252 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -169,14 +169,14 @@
switch(state)
if(EMITTER_LOOSE)
state = EMITTER_BOLTED
- playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message(SPAN_NOTICE("\The [user] secures \the [src] to the floor."), \
SPAN_NOTICE("You secure \the [src]'s external reinforcing bolts to the floor."), \
SPAN_WARNING("You hear a ratcheting noise."))
anchored = TRUE
if(EMITTER_BOLTED)
state = EMITTER_LOOSE
- playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message(SPAN_NOTICE("\The [user] unsecures \the [src]'s reinforcing bolts from the floor."), \
SPAN_NOTICE("You undo \the [src]'s external reinforcing bolts."), \
SPAN_WARNING("You hear a ratcheting noise."))
diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm
index e6f12df418d..62eac8d2646 100644
--- a/code/modules/power/singularity/field_generator.dm
+++ b/code/modules/power/singularity/field_generator.dm
@@ -101,7 +101,7 @@ field_generator power level display
switch(state)
if(0)
state = 1
- playsound(src.loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message("[user.name] secures [src.name] to the floor.",
"You secure the external reinforcing bolts to the floor.",
"You hear ratchet")
@@ -109,7 +109,7 @@ field_generator power level display
update_icon()
if(1)
state = 0
- playsound(src.loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.",
"You undo the external reinforcing bolts.",
"You hear ratchet")
diff --git a/code/modules/power/singularity/generator.dm b/code/modules/power/singularity/generator.dm
index 22c7c30be08..f99c4552753 100644
--- a/code/modules/power/singularity/generator.dm
+++ b/code/modules/power/singularity/generator.dm
@@ -27,7 +27,7 @@
/obj/machinery/the_singularitygen/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.iswrench())
anchored = !anchored
- playsound(src.loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
if(anchored)
user.visible_message("[user.name] secures [src.name] to the floor.",
"You secure the [src.name] to the floor.",
diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
index bc1cd8cb290..adc0b95c70e 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
@@ -165,7 +165,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
return FALSE
-/obj/structure/particle_accelerator/proc/process_tool_hit(var/obj/O, var/mob/user)
+/obj/structure/particle_accelerator/proc/process_tool_hit(var/obj/item/O, var/mob/user)
if(!O || !user)
return FALSE
if(!ismob(user) || !isobj(O))
@@ -175,14 +175,14 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
switch(construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps
if(0)
if(O.iswrench())
- playsound(get_turf(src), O.usesound, 75, TRUE)
+ O.play_tool_sound(get_turf(src), 75)
anchored = TRUE
user.visible_message(SPAN_NOTICE("\The [user] secures \the [src] to the floor."), \
SPAN_NOTICE("You secure the external bolts."))
temp_state++
if(1)
if(O.iswrench())
- playsound(get_turf(src), O.usesound, 75, TRUE)
+ O.play_tool_sound(get_turf(src), 75)
anchored = FALSE
user.visible_message(SPAN_NOTICE("\The [user] detaches \the [src] from the floor."), \
SPAN_NOTICE("You remove the external bolts."))
@@ -272,7 +272,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
/obj/machinery/particle_accelerator/proc/update_state()
return FALSE
-/obj/machinery/particle_accelerator/proc/process_tool_hit(var/obj/O, var/mob/user)
+/obj/machinery/particle_accelerator/proc/process_tool_hit(var/obj/item/O, var/mob/user)
if(!O || !user)
return FALSE
if(!ismob(user) || !isobj(O))
@@ -281,14 +281,14 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
switch(construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps
if(0)
if(O.iswrench())
- playsound(get_turf(src), O.usesound, 75, TRUE)
+ O.play_tool_sound(get_turf(src), 75)
anchored = TRUE
user.visible_message(SPAN_NOTICE("\The [user] secures \the [src] to the floor."), \
SPAN_NOTICE("You secure the external bolts."))
temp_state++
if(1)
if(O.iswrench())
- playsound(get_turf(src), O.usesound, 75, TRUE)
+ O.play_tool_sound(get_turf(src), 75)
anchored = FALSE
user.visible_message(SPAN_NOTICE("\The [user] detaches \the [src] from the floor."), \
SPAN_NOTICE("You remove the external bolts."))
diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm
index 183bee1f6db..96daaf7e496 100644
--- a/code/modules/power/smes_construction.dm
+++ b/code/modules/power/smes_construction.dm
@@ -433,7 +433,7 @@
to_chat(user, "You have to disassemble the terminal first!")
return
- playsound(get_turf(src), attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You begin to disassemble the [src]!")
if (do_after(usr, 100 * cur_coils, src, DO_REPAIR_CONSTRUCT)) // More coils = takes longer to disassemble. It's complex so largest one with 5 coils will take 50s
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index 3010b6a266c..aaa445c331c 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -223,13 +223,13 @@
if(attacking_item.iswrench())
anchored = 1
user.visible_message("[user] wrenches the solar assembly into place.")
- playsound(src.loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
return 1
else
if(attacking_item.iswrench())
anchored = 0
user.visible_message("[user] unwrenches the solar assembly from it's place.")
- playsound(src.loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
return 1
if(istype(attacking_item, /obj/item/stack/material) && (attacking_item.get_material_name() == "glass" || attacking_item.get_material_name() == MATERIAL_GLASS_REINFORCED))
diff --git a/code/modules/power/tesla/coil.dm b/code/modules/power/tesla/coil.dm
index ffd07a111da..a030963542f 100644
--- a/code/modules/power/tesla/coil.dm
+++ b/code/modules/power/tesla/coil.dm
@@ -37,7 +37,7 @@
return
if(attacking_item.iswrench())
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You [anchored ? "unfasten" : "fasten"] [src] to the flooring.")
anchored = !anchored
update_icon()
@@ -91,7 +91,7 @@
return
if(attacking_item.iswrench())
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You [anchored ? "unfasten" : "fasten"] [src] to the flooring.")
anchored = !anchored
update_icon()
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 4d0d9670c46..b16ae692204 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -507,7 +507,7 @@
if(suppressed)
playsound(loc, suppressed_sound, suppressed_volume, vary_fire_sound)
else
- playsound(loc, fire_sound, fire_sound_volume, vary_fire_sound, falloff = 0.5, is_global = TRUE)
+ playsound(loc, fire_sound, fire_sound_volume, vary_fire_sound, falloff_distance = 0.5)
/obj/item/gun/proc/process_point_blank(obj/projectile, mob/user, atom/target)
var/obj/item/projectile/P = projectile
diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm
index 37d125f409a..e058c2561d6 100644
--- a/code/modules/reagents/Chemistry-Machinery.dm
+++ b/code/modules/reagents/Chemistry-Machinery.dm
@@ -95,7 +95,7 @@
else if(attacking_item.iswrench())
anchored = !anchored
to_chat(user, "You [anchored ? "attach" : "detach"] the [src] [anchored ? "to" : "from"] the ground")
- playsound(src.loc, attacking_item.usesound, 75, 1)
+ attacking_item.play_tool_sound(get_turf(src), 75)
if(ui?.user)
ui = SStgui.try_update_ui(user, src, ui)
diff --git a/code/modules/reagents/reagent_containers/food/cans.dm b/code/modules/reagents/reagent_containers/food/cans.dm
index fa51b18a624..427b6995c39 100644
--- a/code/modules/reagents/reagent_containers/food/cans.dm
+++ b/code/modules/reagents/reagent_containers/food/cans.dm
@@ -84,7 +84,7 @@
user.visible_message(SPAN_NOTICE("[user] removes \the [name] from the grenade casing."),
SPAN_NOTICE("You remove \the [name] from the grenade casing."))
new /obj/item/grenade/chem_grenade/large(get_turf(src))
- playsound(loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
update_icon()
if(istype(attacking_item, /obj/item/steelwool))
diff --git a/code/modules/reagents/reagent_containers/welding_backpack.dm b/code/modules/reagents/reagent_containers/welding_backpack.dm
index b4d19ccacb2..1c0a74027af 100644
--- a/code/modules/reagents/reagent_containers/welding_backpack.dm
+++ b/code/modules/reagents/reagent_containers/welding_backpack.dm
@@ -33,7 +33,7 @@
atom_flags &= ~ATOM_FLAG_OPEN_CONTAINER
else
atom_flags = ATOM_FLAG_OPEN_CONTAINER
- playsound(src, attacking_item.usesound, 70)
+ attacking_item.play_tool_sound(get_turf(src), 70)
to_chat(user, SPAN_NOTICE("You wrench \the [src]'s fuel cap [(atom_flags & ATOM_FLAG_OPEN_CONTAINER) ? "open" : "closed"]."))
return
else if(attacking_item.iswelder())
diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm
index 10e4f289633..14bc17e07af 100644
--- a/code/modules/reagents/reagent_dispenser.dm
+++ b/code/modules/reagents/reagent_dispenser.dm
@@ -309,7 +309,7 @@
/obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/attacking_item, mob/user)
if (attacking_item.isscrewdriver())
src.add_fingerprint(user)
- playsound(src.loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
if(do_after(user, 20))
if(!src) return
switch (anchored)
diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm
index ea08aa3bad5..6e5ec152e0a 100644
--- a/code/modules/recycling/disposal-construction.dm
+++ b/code/modules/recycling/disposal-construction.dm
@@ -255,7 +255,7 @@
else if(ptype != 15)
density = 1 // We don't want disposal bins or outlets to go density 0
to_chat(user, "You attach the [nicetype] to the underfloor.")
- playsound(src.loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
update()
else if(attacking_item.iswelder())
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index 37241defdd0..4f26fbe68c4 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -128,7 +128,7 @@
if(contents_count())
to_chat(user, SPAN_WARNING("Eject the items first!"))
return TRUE
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
switch(mode)
if(MODE_OFF)
mode = MODE_UNSCREWED
@@ -1613,12 +1613,12 @@
if(attacking_item.isscrewdriver())
if(mode==0)
mode=1
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You remove the screws around the power connection.")
return
else if(mode==1)
mode=0
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You attach the screws around the power connection.")
return
else if(attacking_item.iswelder() && mode==1)
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index 88b225bf294..fc4233acf9d 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -362,12 +362,12 @@
if(attacking_item.isscrewdriver())
if(c_mode==0)
c_mode=1
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You remove the screws around the power connection.")
return
else if(c_mode==1)
c_mode=0
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You attach the screws around the power connection.")
return
else if(attacking_item.iswelder() && c_mode==1)
diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm
index ab9d9725c26..b38cc583832 100644
--- a/code/modules/shieldgen/emergency_shield.dm
+++ b/code/modules/shieldgen/emergency_shield.dm
@@ -303,7 +303,7 @@
/obj/machinery/shieldgen/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.isscrewdriver())
- playsound(src.loc, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
if(is_open)
to_chat(user, "You close the panel.")
is_open = FALSE
@@ -327,7 +327,7 @@
to_chat(user, "The bolts are covered, unlocking this would retract the covers.")
return
if(anchored)
- playsound(src.loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, "You unsecure the [src] from the floor!")
if(active)
to_chat(user, "The [src] shuts off!")
@@ -335,7 +335,7 @@
anchored = FALSE
else
if(istype(get_turf(src), /turf/space)) return //No wrenching these in space!
- playsound(src.loc, attacking_item.usesound, 100, 1)
+ attacking_item.play_tool_sound(get_turf(src), 100)
to_chat(user, "You secure the [src] to the floor!")
anchored = TRUE
diff --git a/code/modules/shieldgen/shieldwallgen.dm b/code/modules/shieldgen/shieldwallgen.dm
index c3d99211e2d..8b9757fe9f1 100644
--- a/code/modules/shieldgen/shieldwallgen.dm
+++ b/code/modules/shieldgen/shieldwallgen.dm
@@ -151,7 +151,7 @@
wrenched = !wrenched
anchored = wrenched
- playsound(loc, attacking_item.usesound, 75, TRUE)
+ attacking_item.play_tool_sound(get_turf(src), 75)
add_fingerprint(user)
var/others_msg = wrenched ? "[user] secures the external reinforcing bolts to the floor." : "[user] unsecures the external reinforcing bolts."
var/self_msg = wrenched ? "You secure the external reinforcing bolts to the floor." : "You unsecure the external reinforcing bolts."
diff --git a/code/modules/shuttles/shuttle.dm b/code/modules/shuttles/shuttle.dm
index 8c22221ee74..0e0c6af4b5f 100644
--- a/code/modules/shuttles/shuttle.dm
+++ b/code/modules/shuttles/shuttle.dm
@@ -92,7 +92,7 @@
if(sound_takeoff)
if(!fuel_check(TRUE)) // Check for fuel, but don't use any.
return
- playsound(current_location, sound_takeoff, 25, 20, is_global = TRUE)
+ playsound(current_location, sound_takeoff, 25, 20)
spawn(warmup_time*10)
if(moving_status == SHUTTLE_IDLE)
return //someone cancelled the launch
@@ -118,7 +118,7 @@
if(sound_takeoff)
if(!fuel_check(TRUE)) // Check for fuel, but don't use any.
return
- playsound(current_location, sound_takeoff, 50, 20, is_global = TRUE)
+ playsound(current_location, sound_takeoff, 50, 20)
spawn(warmup_time*10)
if(moving_status == SHUTTLE_IDLE)
return //someone cancelled the launch
@@ -138,7 +138,7 @@
while (world.time < arrive_time)
if(!fwooshed && (arrive_time - world.time) < 100)
fwooshed = 1
- playsound(destination, sound_landing, 50, 20, is_global = TRUE)
+ playsound(destination, sound_landing, 50, 20)
sleep(5)
if(!attempt_move(destination))
destination.clear_landing_indicators()
diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm
index 20148a0d97a..eb800d1c878 100644
--- a/code/modules/supermatter/supermatter.dm
+++ b/code/modules/supermatter/supermatter.dm
@@ -119,7 +119,7 @@
/obj/machinery/power/supermatter/Initialize()
. = ..()
radio = new /obj/item/device/radio{channels=list("Engineering")}(src)
- soundloop = new(list(src), TRUE)
+ soundloop = new(src, TRUE)
/obj/machinery/power/supermatter/Destroy()
QDEL_NULL(radio)
diff --git a/code/modules/synthesized_instruments/sound_token.dm b/code/modules/synthesized_instruments/sound_token.dm
index 821445478f3..ba6ee3014b4 100644
--- a/code/modules/synthesized_instruments/sound_token.dm
+++ b/code/modules/synthesized_instruments/sound_token.dm
@@ -44,7 +44,7 @@
return sound.environment
else
var/area/A = get_area(listener)
- return A && PrivIsValidEnvironment(A.sound_env) ? A.sound_env : sound.environment
+ return A && PrivIsValidEnvironment(A.sound_environment) ? A.sound_environment : sound.environment
/datum/sound_token/instrument/Stop()
player.unsubscribe(src)
diff --git a/code/modules/telesci/telepad.dm b/code/modules/telesci/telepad.dm
index c3143676597..f551e2952b2 100644
--- a/code/modules/telesci/telepad.dm
+++ b/code/modules/telesci/telepad.dm
@@ -61,7 +61,7 @@
/obj/machinery/telepad_cargo/attackby(obj/item/attacking_item, mob/user, params)
if(attacking_item.iswrench())
anchored = 0
- playsound(src, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
if(anchored)
anchored = 0
to_chat(user, "\The [src] can now be moved.")
@@ -70,11 +70,11 @@
to_chat(user, "\The [src] is now secured.")
if(attacking_item.isscrewdriver())
if(stage == 0)
- playsound(src, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You unscrew the telepad's tracking beacon.")
stage = 1
else if(stage == 1)
- playsound(src, attacking_item.usesound, 50, 1)
+ attacking_item.play_tool_sound(get_turf(src), 50)
to_chat(user, "You screw in the telepad's tracking beacon.")
stage = 0
if(attacking_item.iswelder() && stage == 1)
diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm
index b9243023e90..22fe44ec7c1 100644
--- a/code/modules/telesci/telesci_computer.dm
+++ b/code/modules/telesci/telesci_computer.dm
@@ -212,7 +212,7 @@
dest = target
flick("pad-beam", telepad)
- playsound(telepad.loc, 'sound/weapons/emitter2.ogg', 25, 1, extrarange = 3, falloff = 5)
+ playsound(telepad.loc, 'sound/weapons/emitter2.ogg', 25, 1, extrarange = 3, falloff_distance = 5)
var/total_lifespawn = 25 * crystals.len
diff --git a/code/modules/turbolift/turbolift_areas.dm b/code/modules/turbolift/turbolift_areas.dm
index bada7ec2373..87ad28e0c85 100644
--- a/code/modules/turbolift/turbolift_areas.dm
+++ b/code/modules/turbolift/turbolift_areas.dm
@@ -4,7 +4,7 @@
base_turf = /turf/simulated/open
requires_power = 0
station_area = 1
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_ELEVATOR
var/lift_floor_label = null
diff --git a/code/modules/vehicles/cargo_train.dm b/code/modules/vehicles/cargo_train.dm
index ee20b452879..565cd4c0785 100644
--- a/code/modules/vehicles/cargo_train.dm
+++ b/code/modules/vehicles/cargo_train.dm
@@ -195,7 +195,7 @@
..()
to_chat(user, SPAN_NOTICE("You turn on \the [src]\s ignition."))
playsound(src, 'sound/machines/vehicles/button.ogg', 50, FALSE)
- playsound_in(src, 'sound/machines/vehicles/start.ogg', 50, FALSE, time = 1 SECOND)
+ addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(playsound), src, 'sound/machines/vehicles/start.ogg', 50, FALSE), 1 SECONDS)
else
turn_off(user)
update_stats()
diff --git a/code/modules/vehicles/train.dm b/code/modules/vehicles/train.dm
index a2d7319aa04..fa5e3d332bd 100644
--- a/code/modules/vehicles/train.dm
+++ b/code/modules/vehicles/train.dm
@@ -104,7 +104,7 @@
/obj/vehicle/train/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.iswrench())
- playsound(loc, attacking_item.usesound, 70, FALSE)
+ attacking_item.play_tool_sound(get_turf(src), 70)
unattach(user)
return
return ..()
diff --git a/html/changelogs/fluffyghost-updatesoundinfrastructure.yml b/html/changelogs/fluffyghost-updatesoundinfrastructure.yml
new file mode 100644
index 00000000000..e8fbc7df82f
--- /dev/null
+++ b/html/changelogs/fluffyghost-updatesoundinfrastructure.yml
@@ -0,0 +1,42 @@
+################################
+# Example Changelog File
+#
+# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
+#
+# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
+# When it is, any changes listed below will disappear.
+#
+# Valid Prefixes:
+# bugfix
+# wip (For works in progress)
+# tweak
+# soundadd
+# sounddel
+# rscadd (general adding of nice things)
+# rscdel (general deleting of nice things)
+# imageadd
+# imagedel
+# maptweak
+# spellcheck (typo fixes)
+# experiment
+# balance
+# admin
+# backend
+# security
+# refactor
+#################################
+
+# Your name.
+author: FluffyGhost
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
+# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - backend: "Updated the sound system with an adapted version of TG's one."
+ - backend: "Updated the looping sounds with TG's version."
diff --git a/maps/_common/areas/ai.dm b/maps/_common/areas/ai.dm
index d10f205031d..d873d10ec43 100644
--- a/maps/_common/areas/ai.dm
+++ b/maps/_common/areas/ai.dm
@@ -25,13 +25,13 @@
/area/turret_protected/ai_upload_foyer
name = "AI Upload Access"
icon_state = "ai_foyer"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_AI
/area/turret_protected/ai_server_room
name = "Messaging Server Room"
icon_state = "ai_server"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_AI
/area/turret_protected/ai
@@ -42,7 +42,7 @@
/area/turret_protected/ai_cyborg_station
name = "Cyborg Station"
icon_state = "ai_cyborg"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_AI
/area/turret_protected/aisat
diff --git a/maps/_common/areas/asteroid_areas.dm b/maps/_common/areas/asteroid_areas.dm
index 1debc39055b..f8950cfb8b0 100644
--- a/maps/_common/areas/asteroid_areas.dm
+++ b/maps/_common/areas/asteroid_areas.dm
@@ -3,7 +3,7 @@
/area/mine
icon_state = "mining"
music = list('sound/music/ambimine.ogg', 'sound/music/song_game.ogg')
- sound_env = ASTEROID
+ sound_environment = SOUND_AREA_ASTEROID
/area/mine/explored
name = "Mine"
diff --git a/maps/_common/areas/holodeck.dm b/maps/_common/areas/holodeck.dm
index a04c9c85466..c410ac43f4f 100644
--- a/maps/_common/areas/holodeck.dm
+++ b/maps/_common/areas/holodeck.dm
@@ -1,7 +1,7 @@
/area/holodeck
name = "Holodeck"
icon_state = "Holodeck"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
no_light_control = TRUE
station_area = TRUE
dynamic_lighting = FALSE
@@ -19,35 +19,35 @@
/area/holodeck/source_gym
name = "Holodeck - Gym"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/holodeck/source_range
name = "Holodeck - Range"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/holodeck/source_emptycourt
name = "Holodeck - Empty Court"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/holodeck/source_boxingcourt
name = "Holodeck - Boxing Court"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/holodeck/source_basketball
name = "Holodeck - Basketball Court"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/holodeck/source_thunderdomecourt
name = "Holodeck - Thunderdome Court"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/holodeck/source_courtroom
name = "Holodeck - Courtroom"
- sound_env = AUDITORIUM
+ sound_environment = SOUND_ENVIRONMENT_AUDITORIUM
/area/holodeck/source_beach
name = "Holodeck - Beach"
- sound_env = PLAIN
+ sound_environment = SOUND_ENVIRONMENT_PLAIN
/area/holodeck/source_burntest
name = "Holodeck - Atmospheric Burn Test"
@@ -57,36 +57,36 @@
/area/holodeck/source_meetinghall
name = "Holodeck - Meeting Hall"
- sound_env = AUDITORIUM
+ sound_environment = SOUND_ENVIRONMENT_AUDITORIUM
/area/holodeck/source_theatre
name = "Holodeck - Theatre"
- sound_env = CONCERT_HALL
+ sound_environment = SOUND_ENVIRONMENT_CONCERT_HALL
/area/holodeck/source_picnicarea
name = "Holodeck - Picnic Area"
- sound_env = PLAIN
+ sound_environment = SOUND_ENVIRONMENT_PLAIN
/area/holodeck/source_dininghall
name = "Holodeck - Dining Hall"
- sound_env = PLAIN
+ sound_environment = SOUND_ENVIRONMENT_PLAIN
/area/holodeck/source_snowfield
name = "Holodeck - Snow Field"
- sound_env = FOREST
+ sound_environment = SOUND_ENVIRONMENT_FOREST
/area/holodeck/source_desert
name = "Holodeck - Desert"
- sound_env = PLAIN
+ sound_environment = SOUND_ENVIRONMENT_PLAIN
/area/holodeck/source_space
name = "Holodeck - Space"
has_gravity = 0
- sound_env = SPACE
+ sound_environment = SOUND_AREA_SPACE
/area/holodeck/source_battlemonsters
name = "Holodeck - Battlemonsters Arena"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/holodeck/source_chessboard
name = "Holodeck - Chessboard"
diff --git a/maps/_common/areas/shuttles.dm b/maps/_common/areas/shuttles.dm
index 8884a885ff2..15c869d2037 100644
--- a/maps/_common/areas/shuttles.dm
+++ b/maps/_common/areas/shuttles.dm
@@ -5,7 +5,7 @@
name = "Shuttle"
icon_state = "shuttle"
requires_power = 0
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
no_light_control = 1
area_flags = AREA_FLAG_RAD_SHIELDED | AREA_FLAG_SPAWN_ROOF
centcomm_area = 1
@@ -32,7 +32,7 @@
/area/shuttle/escape
name = "Transfer Shuttle"
base_turf = /turf/unsimulated/floor/plating
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/shuttle/escape_pod
name = "Escape pod"
@@ -81,7 +81,7 @@
/area/shuttle/administration
name = "Unidentified Corvette"
base_turf = /turf/unsimulated/floor/plating
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/shuttle/research
name = "Research Shuttle"
@@ -99,5 +99,5 @@
/area/shuttle/merchant
name = "Merchant Ship"
base_turf = /turf/space
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
area_flags = AREA_FLAG_RAD_SHIELDED | AREA_FLAG_SPAWN_ROOF | AREA_FLAG_NO_CREW_EXPECTED
diff --git a/maps/_common/areas/special.dm b/maps/_common/areas/special.dm
index e77aa5dae13..f599c1756a4 100644
--- a/maps/_common/areas/special.dm
+++ b/maps/_common/areas/special.dm
@@ -28,6 +28,7 @@
/area/centcom/start
name = "New Player Spawn"
dynamic_lighting = 0
+ sound_environment = SOUND_ENVIRONMENT_NONE
/area/centcom/evac
name = "Centcom Emergency Shuttle"
@@ -57,7 +58,7 @@
/area/centcom/creed
name = "Creed's Office"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/centcom/holding
name = "Holding Facility"
@@ -85,7 +86,7 @@
name = "BLV The Tower - Hangar 5"
icon_state = "blvhangar5"
ambience = AMBIENCE_HANGAR
- sound_env = HANGAR
+ sound_environment = SOUND_ENVIRONMENT_HANGAR
/area/centcom/distress_prep
name = "Distress Team Preparation"
@@ -104,7 +105,7 @@
/area/merchant_station/warehouse
name = "Merchant Warehouse"
icon_state = "merchant_ware"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
// Antagonist Bases
@@ -152,7 +153,7 @@
name = "Thunderdome"
icon_state = "thunder"
requires_power = 0
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
no_light_control = 1
centcomm_area = 1
area_flags = AREA_FLAG_NO_CREW_EXPECTED
@@ -226,6 +227,6 @@
name = "Ship"
icon_state = "ship"
requires_power = 0
- sound_env = STANDARD_STATION
+ sound_environment = SOUND_AREA_STANDARD_STATION
no_light_control = 1
area_flags = AREA_FLAG_RAD_SHIELDED | AREA_FLAG_SPAWN_ROOF
diff --git a/maps/_common/areas/station/civilian.dm b/maps/_common/areas/station/civilian.dm
index d868605354a..5696a605c98 100644
--- a/maps/_common/areas/station/civilian.dm
+++ b/maps/_common/areas/station/civilian.dm
@@ -14,7 +14,7 @@
/area/crew_quarters/toilet
name = "Surface - Washroom"
icon_state = "toilet"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/crew_quarters/sleep
name = "Dormitories"
@@ -24,7 +24,7 @@
/area/crew_quarters/sleep/bedrooms
name = "Dormitory Bedroom One"
icon_state = "Sleep"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/crew_quarters/sleep/cryo
name = "Cryogenic Storage"
@@ -62,7 +62,7 @@
/area/crew_quarters/locker/locker_toilet
name = "Main Level Toilets"
icon_state = "toilet"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/crew_quarters/fitness
name = "Surface - Fitness Center"
@@ -75,7 +75,7 @@
/area/crew_quarters/fitness/changing
name = "Surface - Changing Room"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/crew_quarters/fitness/running
name = "Surface - Running Track"
@@ -91,30 +91,30 @@
/area/crew_quarters/kitchen/freezer
name = "Kitchen Freezer"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/crew_quarters/bar
name = "Bar"
icon_state = "bar"
- sound_env = LARGE_SOFTFLOOR
+ sound_environment = SOUND_AREA_LARGE_SOFTFLOOR
lightswitch = TRUE
allow_nightmode = 0
/area/crew_quarters/bar/below
name = "Bar - Sublevel"
icon_state = "red"
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP
/area/crew_quarters/theatre
name = "Theatre"
icon_state = "Theatre"
- sound_env = LARGE_SOFTFLOOR
+ sound_environment = SOUND_AREA_LARGE_SOFTFLOOR
/area/library
name = "Library"
icon_state = "library"
- sound_env = LARGE_SOFTFLOOR
+ sound_environment = SOUND_AREA_LARGE_SOFTFLOOR
station_area = 1
/area/chapel
@@ -124,7 +124,7 @@
/area/chapel/main
name = "Chapel"
icon_state = "chapel"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
ambience = AMBIENCE_CHAPEL
/area/chapel/office
@@ -135,7 +135,7 @@
name = "Diplomatic Reception"
icon_state = "law"
station_area = TRUE
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
holomap_color = HOLOMAP_AREACOLOR_CIVILIAN
/area/lawoffice/consular
@@ -167,7 +167,7 @@
/area/quartermaster/office
name = "Cargo Office"
icon_state = "quartoffice"
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
/area/quartermaster/lobby
name = "Cargo Lobby"
@@ -184,7 +184,7 @@
/area/quartermaster/storage
name = "Cargo Warehouse"
icon_state = "quartstorage"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/quartermaster/loading
name = "Cargo Bay"
@@ -193,7 +193,7 @@
/area/quartermaster/qm
name = "Cargo - Operations Manager's Office"
icon_state = "quart"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/quartermaster/miningdock
name = "Cargo Mining Dock"
@@ -226,4 +226,4 @@
/area/journalistoffice
name = "Journalist's Office"
station_area = 1
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
diff --git a/maps/_common/areas/station/command.dm b/maps/_common/areas/station/command.dm
index 993d2aa7bb0..07a20a10942 100644
--- a/maps/_common/areas/station/command.dm
+++ b/maps/_common/areas/station/command.dm
@@ -46,7 +46,7 @@
name = "Command - Conference Room"
icon_state = "bridge"
ambience = list()
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
area_blurb = "A place for behind-closed-doors meetings to get things done, or to argue for hours in..."
area_blurb_category = "command_meeting"
area_flags = AREA_FLAG_RAD_SHIELDED
@@ -54,7 +54,7 @@
/area/bridge/cciaroom
name = "Command - Human Resources Meeting Room"
icon_state = "hr"
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
area_blurb = "You might feel dread when you enter this meeting room."
area_blurb_category = "hr_meeting"
area_flags = AREA_FLAG_RAD_SHIELDED
@@ -62,7 +62,7 @@
/area/bridge/cciaroom/lounge
name = "Command - Human Resources Lounge"
icon_state = "hrlounge"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
area_blurb = "A place that may worsen any anxiety surrounding meetings with your bosses' boss."
area_blurb_category = "hr_lounge"
area_flags = AREA_FLAG_RAD_SHIELDED
@@ -80,7 +80,7 @@
/area/crew_quarters/captain
name = "Command - Captain's Office"
icon_state = "captain"
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
holomap_color = HOLOMAP_AREACOLOR_COMMAND
/area/crew_quarters/heads
diff --git a/maps/_common/areas/station/engineering.dm b/maps/_common/areas/station/engineering.dm
index cec0cdc035d..b829455f667 100644
--- a/maps/_common/areas/station/engineering.dm
+++ b/maps/_common/areas/station/engineering.dm
@@ -11,7 +11,7 @@
/area/engineering/atmos
name = "Engineering - Atmospherics"
icon_state = "atmos"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
no_light_control = 1
ambience = list(AMBIENCE_ENGINEERING, AMBIENCE_ATMOS)
area_blurb = "Many volume tanks filled with gas reside here, some providing vital gases for the vessel's life support systems."
@@ -20,28 +20,28 @@
/area/engineering/atmos/monitoring
name = "Engineering - Atmospherics Monitoring Room"
icon_state = "atmos_monitoring"
- sound_env = STANDARD_STATION
+ sound_environment = SOUND_AREA_STANDARD_STATION
/area/engineering/atmos/storage
name = "Engineering - Atmospherics Storage"
icon_state = "atmos_storage"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/engineering/drone_fabrication
name = "Engineering - Drone Fabrication"
icon_state = "drone_fab"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/engineering/engine_smes
name = "Engineering - Main Lvl. SMES Room"
icon_state = "engine_smes"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_SINGULARITY
/area/engineering/engine_room
name = "Engineering - Engine Room"
icon_state = "engine"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
no_light_control = 1
ambience = AMBIENCE_SINGULARITY
@@ -95,7 +95,7 @@
/area/engineering/break_room
name = "Engineering - Break Room"
icon_state = "engineering_break"
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
area_blurb = "The smell of coffee intermixed with oil linger in the air."
area_blurb_category = "engi_breakroom"
@@ -118,7 +118,7 @@
/area/engineering/cooling
name = "Engineering - Engine Cooling Radiator"
icon_state = "engine_monitoring"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/engineering/gravity_gen
name = "Engineering - Gravity Generator"
@@ -127,4 +127,4 @@
/area/engineering/backup_SMES
name = "Engineering - Backup Power Storage"
icon_state = "substation"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
diff --git a/maps/_common/areas/station/hallways.dm b/maps/_common/areas/station/hallways.dm
index 2c1c5c9e37e..af1eb12a919 100644
--- a/maps/_common/areas/station/hallways.dm
+++ b/maps/_common/areas/station/hallways.dm
@@ -1,6 +1,6 @@
// Hallways
/area/hallway
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
allow_nightmode = TRUE
station_area = TRUE
lightswitch = TRUE
diff --git a/maps/_common/areas/station/maintenance.dm b/maps/_common/areas/station/maintenance.dm
index eb7973f863e..03869815d70 100644
--- a/maps/_common/areas/station/maintenance.dm
+++ b/maps/_common/areas/station/maintenance.dm
@@ -2,7 +2,7 @@
/area/maintenance
area_flags = AREA_FLAG_RAD_SHIELDED | AREA_FLAG_HIDE_FROM_HOLOMAP
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
turf_initializer = new /datum/turf_initializer/maintenance()
ambience = AMBIENCE_MAINTENANCE
station_area = 1
@@ -241,7 +241,7 @@
/area/maintenance/elevator
name = "Primary Elevator Shaft Maintenance"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
icon_state = "green"
/area/maintenance/vault
@@ -253,7 +253,7 @@
/area/maintenance/substation
name = "Substation"
icon_state = "substation"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_SUBSTATION
area_blurb = "The hum of the substation's machinery fills the room, holding equipment made to transform voltage and manage power supply to various rooms, and to act as an emergency battery. In comparison to the maintenance tunnels, these stations are far less dusty."
area_blurb_category = "substation"
@@ -334,30 +334,30 @@
/area/maintenance/auxsolarport
name = "Solar Maintenance - Fore Port"
icon_state = "SolarcontrolP"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/maintenance/starboardsolar
name = "Solar Maintenance - Aft"
icon_state = "SolarcontrolS"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/maintenance/portsolar
name = "Solar Maintenance - Port"
icon_state = "SolarcontrolP"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/maintenance/auxsolarstarboard
name = "Solar Maintenance - Fore Starboard"
icon_state = "SolarcontrolS"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/maintenance/foresolar
name = "Solar Maintenance - Fore"
icon_state = "SolarcontrolA"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/maintenance/workshop
name = "Research Maintenance - Auxiliary"
icon_state = "workshop"
turf_initializer = null
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
diff --git a/maps/_common/areas/station/security.dm b/maps/_common/areas/station/security.dm
index 0d8272e9278..7ebd52f8221 100644
--- a/maps/_common/areas/station/security.dm
+++ b/maps/_common/areas/station/security.dm
@@ -64,7 +64,7 @@
/area/security/warden
name = "Security - Warden's Office"
icon_state = "Warden"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
no_light_control = 0
/area/security/armory
@@ -87,13 +87,13 @@
/area/security/forensics_office
name = "Security - Forensic Office"
icon_state = "investigations_office"
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
no_light_control = 0
/area/security/forensics_laboratory
name = "Security - Forensic Laboratory"
icon_state = "investigations_office"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
no_light_control = 0
/area/security/forensics_morgue
@@ -105,7 +105,7 @@
/area/security/break_room
name = "Security - Break Room"
icon_state = "security"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
no_light_control = 0
/area/security/training
@@ -117,13 +117,13 @@
/area/security/training_theoretical
name = "Security - Theoretical Training"
icon_state = "training_office"
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
no_light_control = 0
/area/security/training_crimescene
name = "Security - Crime Scene Training"
icon_state = "training_office"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
no_light_control = 0
/area/security/range
@@ -213,15 +213,15 @@
icon_state = "security"
holomap_color = null
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP | AREA_FLAG_PRISON
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
ambience = AMBIENCE_HIGHSEC
/area/security/penal_colony/warden
name = "\improper Security - Remote Warden's Office"
icon_state = "Warden"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/security/penal_colony/prison
name = "\improper Security - Remote Prison Wing"
icon_state = "sec_prison"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
diff --git a/maps/away/away_site/abandoned_diner/abandoned_diner_areas.dm b/maps/away/away_site/abandoned_diner/abandoned_diner_areas.dm
index b5587bc277b..2ce8ffca2a1 100644
--- a/maps/away/away_site/abandoned_diner/abandoned_diner_areas.dm
+++ b/maps/away/away_site/abandoned_diner/abandoned_diner_areas.dm
@@ -29,19 +29,19 @@
/area/abandoned_diner/restroom
name = "Restrooms"
icon_state = "restrooms"
- sound_env = BATHROOM
+ sound_environment = SOUND_ENVIRONMENT_BATHROOM
area_blurb = "Once clean and well-maintained, these restrooms have fallen into a horrific state of disrepair and stench."
/area/abandoned_diner/crew_quarters
name = "Crew Quarters"
icon_state = "crew_quarters"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/abandoned_diner/maintenance
name = "Station Maintenance"
icon_state = "engineering"
ambience = AMBIENCE_ENGINEERING
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
area_blurb = "The machinery in this room chugs away, evidently creaky and in desperate need of maintenance and lubrication. Somehow, though, they're still functional."
/area/abandoned_diner/storage
diff --git a/maps/away/away_site/blueriver/blueriver_areas.dm b/maps/away/away_site/blueriver/blueriver_areas.dm
index 3c16a83845c..95c2ef6ca77 100644
--- a/maps/away/away_site/blueriver/blueriver_areas.dm
+++ b/maps/away/away_site/blueriver/blueriver_areas.dm
@@ -3,7 +3,7 @@
icon_state = "underground"
icon = 'maps/away/away_site/blueriver/blueriver.dmi'
ambience = list('sound/effects/wind/spooky0.ogg','sound/effects/wind/spooky1.ogg')
- sound_env = ASTEROID
+ sound_environment = SOUND_AREA_ASTEROID
area_blurb = "A strange, glowing blue river can be seen flowing through the cave. In it you can see yourself touching it, becoming one with it. As you see that image, smells of the past, of pleasant memories waft through the air. For just a flicker of a second you consider it before common sense kicks in. This is unnatural, this is wrong. Touching that is a horrible idea."
/area/bluespaceriver/ground
@@ -11,7 +11,7 @@
icon_state = "ground"
icon = 'maps/away/away_site/blueriver/blueriver.dmi'
ambience = list('sound/effects/wind/tundra0.ogg','sound/effects/wind/tundra1.ogg','sound/effects/wind/tundra2.ogg','sound/effects/wind/spooky0.ogg','sound/effects/wind/spooky1.ogg')
- sound_env = ASTEROID
+ sound_environment = SOUND_AREA_ASTEROID
/area/bluespaceriver/ship
name = "\improper EERV Eureka"
diff --git a/maps/away/away_site/konyang/point_verdant/point_verdant_areas.dm b/maps/away/away_site/konyang/point_verdant/point_verdant_areas.dm
index fc8ad61aab9..9661cf37454 100644
--- a/maps/away/away_site/konyang/point_verdant/point_verdant_areas.dm
+++ b/maps/away/away_site/konyang/point_verdant/point_verdant_areas.dm
@@ -5,7 +5,7 @@
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP | AREA_FLAG_RAD_SHIELDED | AREA_FLAG_INDESTRUCTIBLE_TURFS
base_turf = /turf/simulated/floor/exoplanet/dirt_konyang
ambience = AMBIENCE_KONYANG_TRAFFIC
- sound_env = CITY
+ sound_environment = SOUND_ENVIRONMENT_CITY
is_outside = TRUE
var/lighting = FALSE //Is this area automatically lit?
@@ -17,7 +17,7 @@
/area/point_verdant/outer
name = "Point Verdant - Outskirts"
- sound_env = FOREST
+ sound_environment = SOUND_ENVIRONMENT_FOREST
lighting = TRUE
/area/point_verdant/coast
@@ -29,19 +29,19 @@
/area/point_verdant/reservoir
name = "Point Verdant - Reservoir"
- sound_env = PLAIN
+ sound_environment = SOUND_ENVIRONMENT_PLAIN
ambience = AMBIENCE_KONYANG_WATER
lighting = TRUE
/area/point_verdant/sewer
name = "Point Verdant - Sewers"
- sound_env = SEWER_PIPE
+ sound_environment = SOUND_ENVIRONMENT_SEWER_PIPE
area_blurb = "Tainted water flows through these dark and grimy sewers, it smells utterly horrible down here. It's best not to think what you are breathing in, or touching."
area_blurb_category = "verdant_sewers"
//All walls and interior stuff uses this area, otherwise rain will appear over walls. suboptimal!
/area/point_verdant/interior
name = "Point Verdant - Indoors"
- sound_env = LARGE_SOFTFLOOR
+ sound_environment = SOUND_AREA_LARGE_SOFTFLOOR
ambience = AMBIENCE_KONYANG_RAIN_MUFFLED
is_outside = FALSE
@@ -129,7 +129,7 @@
area_blurb_category = "verdant_tunnels"
/area/point_verdant/interior/shallow//For open-walled areas, like awnings and balconies
- sound_env = CITY
+ sound_environment = SOUND_ENVIRONMENT_CITY
/area/point_verdant/outdoors
name = "Point Verdant - Outdoors"
diff --git a/maps/away/ships/coc/coc_scarab/coc_scarab_areas.dm b/maps/away/ships/coc/coc_scarab/coc_scarab_areas.dm
index aff8fec42ad..1fa4bb4c93a 100644
--- a/maps/away/ships/coc/coc_scarab/coc_scarab_areas.dm
+++ b/maps/away/ships/coc/coc_scarab/coc_scarab_areas.dm
@@ -23,32 +23,32 @@
/area/ship/coc_scarab/cryogenics
name = "Scarab Salvage Vessel - Cryogenics Bay"
icon_state = "cryo"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/coc_scarab/washroom
name = "Scarab Salvage Vessel - Washroom"
icon_state = "washroom"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/coc_scarab/engihallway
name = "Scarab Salvage Vessel - Engineering Hallway"
icon_state = "maint_engineering"
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
/area/ship/coc_scarab/forehallway
name = "Scarab Salvage Vessel - Fore Hallway"
icon_state = "maintcentral"
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
/area/ship/coc_scarab/porthallway
name = "Scarab Salvage Vessel - Port Hallway"
icon_state = "maintenance"
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
/area/ship/coc_scarab/starboardhallway
name = "Scarab Salvage Vessel - Starboard Hallway"
icon_state = "maintenance"
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
/area/ship/coc_scarab/armory
name = "Scarab Salvage Vessel - Armory"
@@ -96,7 +96,7 @@
name = "Scarab Salvage Vessel - Telecommunications Closet"
icon_state = "tcomsatcham"
ambience = AMBIENCE_HIGHSEC
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/coc_scarab/atmospherics
name = "Scarab Salvage Vessel - Atmospherics"
diff --git a/maps/away/ships/coc/gadpathur_patrol/gadpathur_patrol_areas.dm b/maps/away/ships/coc/gadpathur_patrol/gadpathur_patrol_areas.dm
index 9ce9863fced..d81489c836b 100644
--- a/maps/away/ships/coc/gadpathur_patrol/gadpathur_patrol_areas.dm
+++ b/maps/away/ships/coc/gadpathur_patrol/gadpathur_patrol_areas.dm
@@ -12,7 +12,7 @@
requires_power = FALSE
area_flags = null
ambience = AMBIENCE_SPACE
- sound_env = SPACE
+ sound_environment = SOUND_AREA_SPACE
has_gravity = FALSE
/area/ship/gadpathur_patrol/cic
@@ -45,11 +45,11 @@
/area/ship/gadpathur_patrol/officer
name = "Gadpathurian Corvette - Officer's Quarters"
icon_state = "head_quarters"
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
/area/ship/gadpathur_patrol/officer_bath
name = "Gadpathurian Corvette - Officer's Restroom"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/gadpathur_patrol/quarters
name = "Gadpathurian Corvette - General Quarters"
@@ -61,21 +61,21 @@
/area/ship/gadpathur_patrol/armanent/francisca
name = "Gadpathurian Corvette - Light Armanent"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/ship/gadpathur_patrol/armanent/longbow
name = "Gadpathurian Corvette - Main Armanent"
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
/area/ship/gadpathur_patrol/ammo
name = "Gadpathurian Corvette - Ammo Stowage"
ambience = AMBIENCE_SUBSTATION
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
icon_state = "auxstorage"
/area/ship/gadpathur_patrol/telecomms
name = "Gadpathurian Corvette - Telecommunications Closet"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_AI
icon_state = "server"
diff --git a/maps/away/ships/dominia/dominian_corvette/dominian_corvette.dm b/maps/away/ships/dominia/dominian_corvette/dominian_corvette.dm
index ad65c5b21c3..29b4a0732b5 100644
--- a/maps/away/ships/dominia/dominian_corvette/dominian_corvette.dm
+++ b/maps/away/ships/dominia/dominian_corvette/dominian_corvette.dm
@@ -21,7 +21,7 @@
/area/ship/dominian_corvette/janitor
name = "Dominian Corvette Custodial Closet"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/dominian_corvette/hangar
name = "Dominian Corvette Hangar"
@@ -54,17 +54,17 @@
/area/ship/dominian_corvette/franny
name = "Dominian Corvette Francisca Compartment"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_HIGHSEC
/area/ship/dominian_corvette/officer
name = "Dominian Corvette Officer Quarters"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/ship/dominian_corvette/armory
name = "Dominian Corvette Armory"
icon_state = "security"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_HIGHSEC
/area/ship/dominian_corvette/temple
@@ -98,7 +98,7 @@
/area/ship/dominian_corvette/cannon
name = "Dominian Corvette Cannon Compartment"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
ambience = AMBIENCE_HIGHSEC
/area/ship/dominian_corvette/exterior
diff --git a/maps/away/ships/dominia/dominian_unathi_privateer/dominian_unathi_privateer_areas.dm b/maps/away/ships/dominia/dominian_unathi_privateer/dominian_unathi_privateer_areas.dm
index 753b1e4882c..79845566c25 100644
--- a/maps/away/ships/dominia/dominian_unathi_privateer/dominian_unathi_privateer_areas.dm
+++ b/maps/away/ships/dominia/dominian_unathi_privateer/dominian_unathi_privateer_areas.dm
@@ -55,7 +55,7 @@
/area/ship/dominian_unathi/captain
name = "Kazhkz Privateer Ship - Captain's Quarters"
icon_state = "captain"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/ship/dominian_unathi/canteen
name = "Kazhkz Privateer Ship - Canteen"
@@ -84,12 +84,12 @@
/area/ship/dominian_unathi/toilet
name = "Kazhkz Privateer Ship - Head"
icon_state = "toilet"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/dominian_unathi/storage
name = "Kazhkz Privateer Ship - Storeroom"
icon_state = "storage"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/dominian_unathi/dock
name = "Kazhkz Privateer Ship - Docking Arm"
diff --git a/maps/away/ships/elyra/elyra_corvette/elyra_corvette_areas.dm b/maps/away/ships/elyra/elyra_corvette/elyra_corvette_areas.dm
index 58b70b5c32a..9bdba8cc97b 100644
--- a/maps/away/ships/elyra/elyra_corvette/elyra_corvette_areas.dm
+++ b/maps/away/ships/elyra/elyra_corvette/elyra_corvette_areas.dm
@@ -24,17 +24,17 @@
/area/ship/elyran_corvette/washroom
name = "Elyran Corvette - Washroom"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/elyran_corvette/brig
name = "Elyran Corvette - Brig"
ambience = AMBIENCE_GENERIC
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/elyran_corvette/hangar
name = "Elyran Corvette - Hangar"
ambience = AMBIENCE_HANGAR
- sound_env = HANGAR
+ sound_environment = SOUND_ENVIRONMENT_HANGAR
/area/ship/elyran_corvette/starboardwep
name = "Elyran Corvette - Starboard Armament"
diff --git a/maps/away/ships/hegemony/hegemony_corvette/hegemony_corvette_areas.dm b/maps/away/ships/hegemony/hegemony_corvette/hegemony_corvette_areas.dm
index 67c89084108..4350a49cfbf 100644
--- a/maps/away/ships/hegemony/hegemony_corvette/hegemony_corvette_areas.dm
+++ b/maps/away/ships/hegemony/hegemony_corvette/hegemony_corvette_areas.dm
@@ -28,7 +28,7 @@
/area/hegemony_ship/temple
name = "Hegemony Corvette - Temple"
icon_state = "chapel"
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
ambience = AMBIENCE_CHAPEL
/area/hegemony_ship/warpriests_quarters
@@ -43,7 +43,7 @@
/area/hegemony_ship/ammo_storage
name = "Hegemony Corvette - Ammo Storage"
icon_state = "red"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/hegemony_ship/gun_deck_bruiser
name = "Hegemony Corvette - Gunnery Deck"
@@ -60,7 +60,7 @@
/area/hegemony_ship/tcomms
name = "Hegemony Corvette - Telecommunications"
icon_state = "server"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/hegemony_ship/canteen
name = "Hegemony Corvette - Canteen"
@@ -77,7 +77,7 @@
/area/hegemony_ship/crew_quarters
name = "Hegemony Corvette - Crew Quarters"
icon_state = "crew_quarters"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/hegemony_ship/trophy_room
name = "Hegemony Corvette - Trophy Room"
@@ -94,7 +94,7 @@
/area/hegemony_ship/captains_quarters
name = "Hegemony Corvette - Captain's Quarters"
icon_state = "captain"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/hegemony_ship/brig
name = "Hegemony Corvette - Brig"
@@ -107,7 +107,7 @@
/area/hegemony_ship/armory
name = "Hegemony Corvette - Armory"
icon_state = "armory"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_HIGHSEC
/area/hegemony_ship/gun_deck_flak
diff --git a/maps/away/ships/hegemony/miners_guild/miners_guild_areas.dm b/maps/away/ships/hegemony/miners_guild/miners_guild_areas.dm
index 50b22d3b637..a7878fcfcaf 100644
--- a/maps/away/ships/hegemony/miners_guild/miners_guild_areas.dm
+++ b/maps/away/ships/hegemony/miners_guild/miners_guild_areas.dm
@@ -35,7 +35,7 @@
name = "Miners' Guild Outpost - Hangar"
icon_state = "green"
ambience = AMBIENCE_HANGAR
- sound_env = HANGAR
+ sound_environment = SOUND_ENVIRONMENT_HANGAR
/area/miners_guild/solars_port
name = "Miners' Guild Outpost - Port Solar Array"
@@ -51,7 +51,7 @@
name = "Miners' Guild Outpost - Fuel Bay"
icon_state = "hangar"
ambience = AMBIENCE_HANGAR
- sound_env = HANGAR
+ sound_environment = SOUND_ENVIRONMENT_HANGAR
/area/miners_guild/cryo
name = "Miners' Guild Outpost - Cryogenic Storage"
diff --git a/maps/away/ships/idris/idris_cruiser_areas.dm b/maps/away/ships/idris/idris_cruiser_areas.dm
index 038fa28c35c..b216c842230 100644
--- a/maps/away/ships/idris/idris_cruiser_areas.dm
+++ b/maps/away/ships/idris/idris_cruiser_areas.dm
@@ -95,7 +95,7 @@
name = "Engineering"
icon_state = "engineering"
ambience = AMBIENCE_ENGINEERING
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/ship/idris_cruiser/engineering/reactor
name = "Reactor"
@@ -110,7 +110,7 @@
/area/ship/idris_cruiser/suite
name = "Suite"
icon_state = "Sleep"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/ship/idris_cruiser/suite/suite_1
name = "Suite 1"
@@ -128,7 +128,7 @@
/area/ship/idris_cruiser/restroom
name = "Generic Restroom"
icon_state = "restrooms"
- sound_env = BATHROOM
+ sound_environment = SOUND_ENVIRONMENT_BATHROOM
/area/ship/idris_cruiser/restroom/suite_1
name = "Suite 1 Restroom"
diff --git a/maps/away/ships/kataphracts/kataphract_areas.dm b/maps/away/ships/kataphracts/kataphract_areas.dm
index 7cd1a70ab5e..4cc57a89116 100644
--- a/maps/away/ships/kataphracts/kataphract_areas.dm
+++ b/maps/away/ships/kataphracts/kataphract_areas.dm
@@ -15,7 +15,7 @@
/area/kataphract_chapter/sparring_chamber
name = "Kataphract Chapter - Sparring Chamber"
icon_state = "security"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/kataphract_chapter/commissary
name = "Kataphract Chapter - Commissary"
@@ -40,17 +40,17 @@
/area/kataphract_chapter/dorms
name = "Kataphract Chapter - Dormitory"
icon_state = "Sleep"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/kataphract_chapter/toilets
name = "Kataphract Chapter - Toilets"
icon_state = "toilet"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/kataphract_chapter/office
name = "Kataphract Chapter - Knight's Office"
icon_state = "law"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
/area/kataphract_chapter/cafeteria
name = "Kataphract Chapter - Cafeteria"
@@ -104,13 +104,13 @@
/area/kataphract_chapter/warehouse
name = "Kataphract Chapter - Warehouse"
icon_state = "quartstorage"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/kataphract_chapter/hangar
name = "Kataphract Chapter - Hangar"
icon_state = "green"
ambience = AMBIENCE_HANGAR
- sound_env = HANGAR
+ sound_environment = SOUND_ENVIRONMENT_HANGAR
/area/kataphract_chapter/cic
name = "Kataphract Chapter - Combat Information Center"
diff --git a/maps/away/ships/konyang/kasf_ship/kasf_ship_areas.dm b/maps/away/ships/konyang/kasf_ship/kasf_ship_areas.dm
index 3484737e209..05892e6597a 100644
--- a/maps/away/ships/konyang/kasf_ship/kasf_ship_areas.dm
+++ b/maps/away/ships/konyang/kasf_ship/kasf_ship_areas.dm
@@ -25,7 +25,7 @@
/area/ship/kasf_corvette/hangar
name = "KASF Corvette - Hangar"
ambience = AMBIENCE_HANGAR
- sound_env = HANGAR
+ sound_environment = SOUND_ENVIRONMENT_HANGAR
/area/ship/kasf_corvette/armory
name = "KASF Corvette - Armory"
@@ -76,7 +76,7 @@
/area/ship/kasf_corvette/washroom
name = "KASF Corvette - Washroom"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/kasf_corvette/brig
name = "KASF Corvette - Brig"
diff --git a/maps/away/ships/sadar_scout/sadar_scout_areas.dm b/maps/away/ships/sadar_scout/sadar_scout_areas.dm
index eec520cd621..bbf17dd5add 100644
--- a/maps/away/ships/sadar_scout/sadar_scout_areas.dm
+++ b/maps/away/ships/sadar_scout/sadar_scout_areas.dm
@@ -18,17 +18,17 @@
/area/ship/sadar_scout/solars
name = "Ancient Expeditionary Vessel - Solar Access"
ambience = AMBIENCE_ENGINEERING
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
/area/ship/sadar_scout/tools
name = "Ancient Expeditionary Vessel - Tool Storage"
ambience = AMBIENCE_ENGINEERING
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/sadar_scout/utility
name = "Ancient Expeditionary Vessel - Utility Storage"
ambience = AMBIENCE_ENGINEERING
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/sadar_scout/atmos
name = "Ancient Expeditionary Vessel - Atmospherics"
@@ -37,17 +37,17 @@
/area/ship/sadar_scout/mainhall
name = "Ancient Expeditionary Vessel - Main Hallway"
ambience = AMBIENCE_MAINTENANCE
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
/area/ship/sadar_scout/forehall
name = "Ancient Expeditionary Vessel - Fore Hallway"
ambience = AMBIENCE_MAINTENANCE
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
/area/ship/sadar_scout/eva
name = "Ancient Expeditionary Vessel - EVA"
ambience = AMBIENCE_MAINTENANCE
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
/area/ship/sadar_scout/hydro
name = "Ancient Expeditionary Vessel - Hydroponics"
@@ -60,27 +60,27 @@
/area/ship/sadar_scout/med
name = "Ancient Expeditionary Vessel - Medbay"
ambience = AMBIENCE_GENERIC
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/sadar_scout/crew
name = "Ancient Expeditionary Vessel - Crew Quarters"
ambience = AMBIENCE_GENERIC
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/sadar_scout/bridge
name = "Ancient Expeditionary Vessel - Bridge"
ambience = AMBIENCE_HIGHSEC
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/sadar_scout/cic
name = "Ancient Expeditionary Vessel - Auxillary Bridge"
ambience = AMBIENCE_HIGHSEC
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/ship/sadar_scout/wep
name = "Ancient Expeditionary Vessel - Ship Armament"
ambience = AMBIENCE_HIGHSEC
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
// Shuttle
/area/shuttle/sadar_shuttle
diff --git a/maps/random_ruins/exoplanets/konyang/abandoned/factory_arms.dm b/maps/random_ruins/exoplanets/konyang/abandoned/factory_arms.dm
index 5b359929a43..dbd03dfa1c2 100644
--- a/maps/random_ruins/exoplanets/konyang/abandoned/factory_arms.dm
+++ b/maps/random_ruins/exoplanets/konyang/abandoned/factory_arms.dm
@@ -11,4 +11,4 @@
name = "Arms Production Plant"
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP | AREA_FLAG_RAD_SHIELDED | AREA_FLAG_INDESTRUCTIBLE_TURFS
base_turf = /turf/simulated/floor/exoplanet/dirt_konyang
- sound_env = HANGAR
+ sound_environment = SOUND_ENVIRONMENT_HANGAR
diff --git a/maps/random_ruins/exoplanets/konyang/abandoned/factory_refinery.dm b/maps/random_ruins/exoplanets/konyang/abandoned/factory_refinery.dm
index 8bc354e4eff..19b267b03f7 100644
--- a/maps/random_ruins/exoplanets/konyang/abandoned/factory_refinery.dm
+++ b/maps/random_ruins/exoplanets/konyang/abandoned/factory_refinery.dm
@@ -11,4 +11,4 @@
name = "Planetary Material Refinery"
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP | AREA_FLAG_RAD_SHIELDED | AREA_FLAG_INDESTRUCTIBLE_TURFS
base_turf = /turf/simulated/floor/exoplanet/dirt_konyang
- sound_env = HANGAR
+ sound_environment = SOUND_ENVIRONMENT_HANGAR
diff --git a/maps/random_ruins/exoplanets/konyang/abandoned/factory_robotics.dm b/maps/random_ruins/exoplanets/konyang/abandoned/factory_robotics.dm
index 0f2a9c2fc68..a9b3a4153d6 100644
--- a/maps/random_ruins/exoplanets/konyang/abandoned/factory_robotics.dm
+++ b/maps/random_ruins/exoplanets/konyang/abandoned/factory_robotics.dm
@@ -11,4 +11,4 @@
name = "Robotics Assembly Plant"
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP | AREA_FLAG_RAD_SHIELDED | AREA_FLAG_INDESTRUCTIBLE_TURFS
base_turf = /turf/simulated/floor/exoplanet/dirt_konyang
- sound_env = HANGAR
+ sound_environment = SOUND_ENVIRONMENT_HANGAR
diff --git a/maps/random_ruins/exoplanets/konyang/abandoned/garage.dm b/maps/random_ruins/exoplanets/konyang/abandoned/garage.dm
index 1bf99ddb04f..fea18c7b578 100644
--- a/maps/random_ruins/exoplanets/konyang/abandoned/garage.dm
+++ b/maps/random_ruins/exoplanets/konyang/abandoned/garage.dm
@@ -11,4 +11,4 @@
name = "Konyang Garage"
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP | AREA_FLAG_RAD_SHIELDED | AREA_FLAG_INDESTRUCTIBLE_TURFS
base_turf = /turf/simulated/floor/exoplanet/dirt_konyang
- sound_env = HANGAR
+ sound_environment = SOUND_ENVIRONMENT_HANGAR
diff --git a/maps/random_ruins/exoplanets/konyang/abandoned/house _small.dm b/maps/random_ruins/exoplanets/konyang/abandoned/house _small.dm
index abb3276d2d9..635d6747625 100644
--- a/maps/random_ruins/exoplanets/konyang/abandoned/house _small.dm
+++ b/maps/random_ruins/exoplanets/konyang/abandoned/house _small.dm
@@ -11,4 +11,4 @@
name = "Konyang Residence"
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP | AREA_FLAG_RAD_SHIELDED | AREA_FLAG_INDESTRUCTIBLE_TURFS
base_turf = /turf/simulated/floor/exoplanet/dirt_konyang
- sound_env = LIVINGROOM
+ sound_environment = SOUND_ENVIRONMENT_LIVINGROOM
diff --git a/maps/random_ruins/exoplanets/konyang/abandoned/office.dm b/maps/random_ruins/exoplanets/konyang/abandoned/office.dm
index 2a1cc95b671..b45021a0ace 100644
--- a/maps/random_ruins/exoplanets/konyang/abandoned/office.dm
+++ b/maps/random_ruins/exoplanets/konyang/abandoned/office.dm
@@ -11,4 +11,4 @@
name = "Konyang Office"
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP | AREA_FLAG_RAD_SHIELDED | AREA_FLAG_INDESTRUCTIBLE_TURFS
base_turf = /turf/simulated/floor/exoplanet/dirt_konyang
- sound_env = ROOM
+ sound_environment = SOUND_ENVIRONMENT_ROOM
diff --git a/maps/random_ruins/exoplanets/konyang/abandoned/rural_clinic.dm b/maps/random_ruins/exoplanets/konyang/abandoned/rural_clinic.dm
index 6325d63dd97..dc6f4a8b2e8 100644
--- a/maps/random_ruins/exoplanets/konyang/abandoned/rural_clinic.dm
+++ b/maps/random_ruins/exoplanets/konyang/abandoned/rural_clinic.dm
@@ -11,7 +11,7 @@
name = "Konyang Rural Clinic"
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP | AREA_FLAG_RAD_SHIELDED
base_turf = /turf/simulated/floor/exoplanet/dirt_konyang
- sound_env = ROOM
+ sound_environment = SOUND_ENVIRONMENT_ROOM
/obj/effect/landmark/corpse/konyang_cop
name = "Konyang National Police Patrolman"
diff --git a/maps/random_ruins/exoplanets/konyang/hivebot_burrows_1.dm b/maps/random_ruins/exoplanets/konyang/hivebot_burrows_1.dm
index 39b0446bdfb..256d7d49292 100644
--- a/maps/random_ruins/exoplanets/konyang/hivebot_burrows_1.dm
+++ b/maps/random_ruins/exoplanets/konyang/hivebot_burrows_1.dm
@@ -17,7 +17,7 @@
base_turf = /turf/simulated/floor/exoplanet/basalt/cave
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP | AREA_FLAG_INDESTRUCTIBLE_TURFS
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
ambience = AMBIENCE_FOREBODING
/obj/effect/landmark/corpse/miner/hivebot_burrows
diff --git a/maps/random_ruins/exoplanets/konyang/hivebot_burrows_2.dm b/maps/random_ruins/exoplanets/konyang/hivebot_burrows_2.dm
index b7f0d02677a..a9b5c6f9169 100644
--- a/maps/random_ruins/exoplanets/konyang/hivebot_burrows_2.dm
+++ b/maps/random_ruins/exoplanets/konyang/hivebot_burrows_2.dm
@@ -17,7 +17,7 @@
base_turf = /turf/simulated/floor/exoplanet/basalt/cave
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP | AREA_FLAG_INDESTRUCTIBLE_TURFS
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
ambience = AMBIENCE_FOREBODING
/obj/machinery/door/airlock/hatch/broken
diff --git a/maps/sccv_horizon/code/sccv_horizon_areas.dm b/maps/sccv_horizon/code/sccv_horizon_areas.dm
index 5079e2ecb8a..e4c6398ea75 100644
--- a/maps/sccv_horizon/code/sccv_horizon_areas.dm
+++ b/maps/sccv_horizon/code/sccv_horizon_areas.dm
@@ -22,7 +22,7 @@
/area/engineering/smes
name = "Engineering - SM SMES"
icon_state = "engine_smes"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_SINGULARITY
/area/engineering/smes/rust
@@ -67,7 +67,7 @@
/area/medical/emergency_storage
name = "Medical - Lower Deck Emergency Storage"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/medical/morgue/lower
name = "Medical - Morgue"
@@ -111,17 +111,17 @@
name = "Hangar"
icon_state = "bluenew"
ambience = AMBIENCE_HANGAR
- sound_env = HANGAR
+ sound_environment = SOUND_ENVIRONMENT_HANGAR
station_area = TRUE
holomap_color = HOLOMAP_AREACOLOR_HANGAR
/area/hangar/briefing
name = "Expedition Briefing Room"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/hangar/control
name = "Hangar Control Room"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/hangar/intrepid
name = "Intrepid Hangar"
@@ -163,7 +163,7 @@
/area/operations/storage
name = "Operations Equipment Storage"
icon_state = "dark160"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
area_blurb = "Scuff marks scar the floor from the movement of many crates and stored goods."
area_blurb_category = "ops_warehouse"
@@ -187,12 +187,12 @@
/area/operations/office
name = "Operations Office"
icon_state = "quartoffice"
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
/area/operations/office_aux
name = "Operations Office (Aux)"
icon_state = "quartoffice"
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
/area/operations/mail_room
name = "Operations Mail Room"
@@ -201,7 +201,7 @@
/area/operations/qm
name = "Operations Manager's Office"
icon_state = "quart"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
//Wings
@@ -247,7 +247,7 @@
/area/engineering/atmos/propulsion
name = "Port Propulsion"
icon_state = "blue2"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/engineering/atmos/propulsion/starboard
name = "Starboard Propulsion"
@@ -347,7 +347,7 @@
name = "Horizon - Maintenance (PARENT AREA - DON'T USE)"
icon_state = "maintenance"
area_flags = AREA_FLAG_RAD_SHIELDED | AREA_FLAG_HIDE_FROM_HOLOMAP
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
turf_initializer = new /datum/turf_initializer/maintenance()
ambience = AMBIENCE_MAINTENANCE
@@ -366,7 +366,7 @@
// Hallways
/area/horizon/hallway
name = "Horizon - Hallway (PARENT AREA - DON'T USE)"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
allow_nightmode = TRUE
lightswitch = TRUE
holomap_color = HOLOMAP_AREACOLOR_HALLWAYS
@@ -407,12 +407,12 @@
/area/horizon/stairwell/central
name = "Horizon - Central Stairwell"
icon_state = "stairwell"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/horizon/stairwell/bridge
name = "Horizon - Bridge Stairwell"
icon_state = "bridge_stairs"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_HIGHSEC
/********** Stairwells End **********/
@@ -430,7 +430,7 @@
/area/horizon/crew_quarters/cryo/living_quarters_lift
name = "Horizon - Living Quarters Lift"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/horizon/crew_quarters/cryo/dormitories
name = "Horizon - Cryogenic Storage - Dormitories"
@@ -438,12 +438,12 @@
/area/horizon/crew_quarters/cryo/washroom
name = "Horizon - Cryogenic Storage - Washroom"
icon_state = "washroom"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/horizon/crew_quarters/cryo/showers
name = "Horizon - Cryogenic Storage - Showers"
icon_state = "showers"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
// Fitness Center
/area/horizon/crew_quarters/fitness
@@ -469,29 +469,29 @@
/area/horizon/crew_quarters/fitness/washroom
name = "Horizon - Fitness Center - Washroom"
icon_state = "washroom"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/horizon/crew_quarters/fitness/showers
name = "Horizon - Fitness Center - Showers"
icon_state = "showers"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/horizon/crew_quarters/fitness/lounge
name = "Horizon - Fitness Center - Lounge"
icon_state = "fitness_lounge"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
// Lounges
/area/horizon/crew_quarters/lounge/bar
name = "Horizon - Bar Lounge"
icon_state = "lounge"
- sound_env = SMALL_SOFTFLOOR
+ sound_environment = SOUND_AREA_SMALL_SOFTFLOOR
// Miscellanous
/area/horizon/crew_quarters/washroom/central
name = "Horizon - Central Washroom"
icon_state = "washroom"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/********** Crew Quarters End **********/
@@ -508,7 +508,7 @@
/area/horizon/holodeck
name = "Horizon - Holodeck (PARENT AREA - DON'T USE)"
icon_state = "Holodeck"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
no_light_control = TRUE
dynamic_lighting = FALSE
area_flags = AREA_FLAG_RAD_SHIELDED | AREA_FLAG_NO_GHOST_TELEPORT_ACCESS
@@ -530,31 +530,31 @@
/area/horizon/holodeck/source_gym
name = "Horizon - Holodeck - Gym"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/horizon/holodeck/source_range
name = "Horizon - Holodeck - Range"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/horizon/holodeck/source_emptycourt
name = "Horizon - Holodeck - Empty Court"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/horizon/holodeck/source_boxingcourt
name = "Horizon - Holodeck - Boxing Court"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/horizon/holodeck/source_basketball
name = "Horizon - Holodeck - Basketball Court"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/horizon/holodeck/source_thunderdomecourt
name = "Horizon - Holodeck - Thunderdome Court"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/horizon/holodeck/source_courtroom
name = "Horizon - Holodeck - Courtroom"
- sound_env = AUDITORIUM
+ sound_environment = SOUND_ENVIRONMENT_AUDITORIUM
/area/horizon/holodeck/source_burntest
name = "Horizon - Holodeck - Atmospheric Burn Test"
@@ -564,36 +564,36 @@
/area/horizon/holodeck/source_meetinghall
name = "Horizon - Holodeck - Meeting Hall"
- sound_env = AUDITORIUM
+ sound_environment = SOUND_ENVIRONMENT_AUDITORIUM
/area/horizon/holodeck/source_theatre
name = "Horizon - Holodeck - Callistean Theatre"
- sound_env = CONCERT_HALL
+ sound_environment = SOUND_ENVIRONMENT_CONCERT_HALL
/area/horizon/holodeck/source_picnicarea
name = "Horizon - Holodeck - Picnic Area"
- sound_env = PLAIN
+ sound_environment = SOUND_ENVIRONMENT_PLAIN
/area/horizon/holodeck/source_dininghall
name = "Horizon - Holodeck - Dining Hall"
- sound_env = PLAIN
+ sound_environment = SOUND_ENVIRONMENT_PLAIN
/area/horizon/holodeck/source_snowfield
name = "Horizon - Holodeck - Bursa Tundra"
- sound_env = FOREST
+ sound_environment = SOUND_ENVIRONMENT_FOREST
/area/horizon/holodeck/source_desert
name = "Horizon - Holodeck - Desert"
- sound_env = PLAIN
+ sound_environment = SOUND_ENVIRONMENT_PLAIN
/area/horizon/holodeck/source_space
name = "Horizon - Holodeck - Space"
has_gravity = FALSE
- sound_env = SPACE
+ sound_environment = SOUND_AREA_SPACE
/area/horizon/holodeck/source_battlemonsters
name = "Horizon - Holodeck - Battlemonsters Arena"
- sound_env = ARENA
+ sound_environment = SOUND_ENVIRONMENT_ARENA
/area/horizon/holodeck/source_chessboard
name = "Horizon - Holodeck - Chessboard"
@@ -603,7 +603,7 @@
/area/horizon/holodeck/source_beach
name = "Horizon - Holodeck - Silversunner Coast"
- sound_env = PLAIN
+ sound_environment = SOUND_ENVIRONMENT_PLAIN
/area/horizon/holodeck/source_pool
name = "Horizon - Holodeck - Swimming Pool"
@@ -648,7 +648,7 @@
/area/horizon/library
name = "Horizon - Library"
icon_state = "library"
- sound_env = LARGE_SOFTFLOOR
+ sound_environment = SOUND_AREA_LARGE_SOFTFLOOR
holomap_color = HOLOMAP_AREACOLOR_CIVILIAN
// Kitchen
@@ -663,7 +663,7 @@
/area/horizon/kitchen/freezer
name = "Horizon - Kitchen - Freezer"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
// Bar
/area/horizon/bar
@@ -690,7 +690,7 @@
name = "Horizon - Custodial Closet"
icon_state = "janitor"
allow_nightmode = FALSE
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
ambience = list(AMBIENCE_FOREBODING, AMBIENCE_ENGINEERING)
holomap_color = HOLOMAP_AREACOLOR_CIVILIAN
area_blurb = "A strong, concentrated smell of many cleaning supplies linger within this room."
@@ -705,14 +705,14 @@
/area/horizon/custodial/auxiliary
name = "Horizon - Auxiliary Custodial Closet"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
holomap_color = HOLOMAP_AREACOLOR_CIVILIAN
// Crew Armoury
/area/horizon/crew_armoury
name = "Horizon - Crew Armoury"
icon_state = "crew_armoury"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
ambience = AMBIENCE_HIGHSEC
allow_nightmode = FALSE
holomap_color = HOLOMAP_AREACOLOR_COMMAND
@@ -720,7 +720,7 @@
/area/horizon/crew_armoury/foyer
name = "Horizon - Crew Armoury - Foyer"
icon_state = "crew_armoury_foyer"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_FOREBODING
holomap_color = HOLOMAP_AREACOLOR_HALLWAYS
@@ -736,7 +736,7 @@
/area/horizon/security/office
name = "Horizon - Security - Office"
icon_state = "security"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/horizon/security/hallway
name = "Horizon - Security - Main Hallway"
@@ -749,7 +749,7 @@
/area/horizon/security/washroom
name = "Horizon - Security - Washroom"
icon_state = "security"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/horizon/security/brig
name = "Horizon - Security - Brig"
@@ -770,21 +770,21 @@
icon_state = "head_quarters"
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP
ambience = AMBIENCE_HIGHSEC
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/horizon/security/warden
name = "Horizon - Security - Warden's Office"
icon_state = "Warden"
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP
ambience = AMBIENCE_HIGHSEC
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/horizon/security/armoury
name = "Horizon - Security - Armoury"
icon_state = "Warden"
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP
ambience = AMBIENCE_HIGHSEC
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
// Security (Deck 3)
/area/horizon/security/investigations_hallway
@@ -798,18 +798,18 @@
/area/horizon/security/firing_range
name = "Horizon - Security - Firing Range"
icon_state = "security"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
/area/horizon/security/investigators_office
name = "Horizon - Security - Investigators' Office"
icon_state = "investigations_office"
- sound_env = MEDIUM_SOFTFLOOR
+ sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR
/area/horizon/security/interrogation
name = "Horizon - Security - Interrogation"
icon_state = "investigations"
ambience = list(AMBIENCE_HIGHSEC, AMBIENCE_FOREBODING)
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
/area/horizon/security/interrogation/monitoring
name = "Horizon - Security - Interrogation Monitoring"
@@ -827,7 +827,7 @@
name = "Horizon - Security - Evidence Storage"
icon_state = "evidence"
ambience = AMBIENCE_FOREBODING
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
// Commissary
/area/horizon/commissary
@@ -838,7 +838,7 @@
// Secure Ammunition Storage
/area/horizon/secure_ammunition_storage
name = "Horizon - Secure Ammunitions Storage"
- sound_env = SMALL_ENCLOSED
+ sound_environment = SOUND_AREA_SMALL_ENCLOSED
ambience = AMBIENCE_FOREBODING
holomap_color = HOLOMAP_AREACOLOR_OPERATIONS
@@ -846,7 +846,7 @@
/area/horizon/zta
name = "Horizon - ZTA Weapon System"
icon_state = "zta"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
ambience = AMBIENCE_SINGULARITY
area_blurb = "A gargantuan machine dominates the room, covered in components and moving parts. Its name is befitting of its size."
area_blurb_category = "leviathan"
@@ -856,14 +856,14 @@
/area/horizon/longbow
name = "Horizon - Longbow Weapon System"
icon_state = "bridge_weapon"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
ambience = AMBIENCE_HIGHSEC
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP
/area/horizon/grauwolf
name = "Horizon - Grauwolf Weapon System"
icon_state = "bridge_weapon"
- sound_env = LARGE_ENCLOSED
+ sound_environment = SOUND_AREA_LARGE_ENCLOSED
ambience = AMBIENCE_HIGHSEC
area_flags = AREA_FLAG_HIDE_FROM_HOLOMAP
diff --git a/maps/sccv_horizon/code/sccv_horizon_lifts.dm b/maps/sccv_horizon/code/sccv_horizon_lifts.dm
index 884abcbc2d2..89db8e37213 100644
--- a/maps/sccv_horizon/code/sccv_horizon_lifts.dm
+++ b/maps/sccv_horizon/code/sccv_horizon_lifts.dm
@@ -100,7 +100,7 @@
/area/turbolift/scc_ship/morgue_lift
name = "Morgue Lift"
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
ambience = AMBIENCE_GHOSTLY
//Operations Lift
@@ -140,7 +140,7 @@
/area/turbolift/scc_ship/operations_lift
name = "Operations Lift"
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
ambience = AMBIENCE_GHOSTLY
@@ -184,7 +184,7 @@
/area/turbolift/scc_ship/robotics_lift
name = "Robotics Lift"
- sound_env = TUNNEL_ENCLOSED
+ sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
ambience = AMBIENCE_GHOSTLY
diff --git a/tools/ci/check_grep.sh b/tools/ci/check_grep.sh
index 1d77ab443d0..6e1b495966c 100755
--- a/tools/ci/check_grep.sh
+++ b/tools/ci/check_grep.sh
@@ -113,7 +113,7 @@ fi
# Check that all the files in sound/ are referenced with static paths
echo "Verifying sounds are referenced with static paths" >> code_error.log
-DYNAMIC_SOUNDS_REFERENCES=`grep -r --include \*.dm -E --regexp='"(sound\/.*)"'`
+DYNAMIC_SOUNDS_REFERENCES=`grep -r --include \*.dm -E --regexp='"(sound\/.+)"'`
if [[ $DYNAMIC_SOUNDS_REFERENCES != '' ]]; then
ERROR_COUNT=$(($ERROR_COUNT+1))
echo "FAIL: Found sound files referenced with dynamic paths:" >> code_error.log