mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-25 14:00:18 +01:00
Updated the sound system (#18724)
* sdaf * sdaf * sdfa * sadf * sfda * gfd * reduce thrusters volume * sdafsadsdaf * sdfa * Reduced some sound ranges and made some/more not ignore walls for loops * health analyzers too * ivdrip adjustment * most tools now use play_tool_sound to have the sound played, reduced range for it
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
TIMER_SUBSYSTEM_DEF(sound_loops)
|
||||
name = "Sound Loops"
|
||||
priority = FIRE_PRIORITY_SOUND_LOOPS
|
||||
@@ -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
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
to_chat(player.current, "<span class='notice'>[welcome_text]</span>")
|
||||
|
||||
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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
if(connected_port)
|
||||
disconnect()
|
||||
to_chat(user, "<span class='notice'>You disconnect \the [src] from the port.</span>")
|
||||
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, "<span class='notice'>You connect \the [src] to the port.</span>")
|
||||
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
|
||||
|
||||
@@ -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, "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>")
|
||||
|
||||
return TRUE
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
panel_open = !panel_open
|
||||
user.visible_message("<span class='warning'>[user] screws the camera's panel [panel_open ? "open" : "closed"]!</span>",
|
||||
"<span class='notice'>You screw the camera's panel [panel_open ? "open" : "closed"].</span>")
|
||||
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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, "<span class='notice'>You screw the circuit board into place.</span>")
|
||||
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, "<span class='notice'>You remove the circuit board.</span>")
|
||||
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, "<span class='notice'>You unfasten the circuit board.</span>")
|
||||
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, "<span class='notice'>You remove the brain.</span>")
|
||||
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, "<span class='notice'>You remove the glass panel.</span>")
|
||||
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, "<span class='notice'>You connect the monitor.</span>")
|
||||
if(!brain)
|
||||
var/open_for_latejoin = alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", "Yes", "Yes", "No") == "Yes"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 = "<center><h1>Orion Trail[emagged ? ": Realism Edition" : ""]</h1><br>Learn how our ancestors got to Orion, and have fun in the process!</center><br><P ALIGN=Right><a href='?src=\ref[src];continue=1'>Start New Game</a></P>"
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
event_actions = "<a href='?src=\ref[src];continue=1'>Continue your journey</a><br>"
|
||||
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 = "<a href='?src=\ref[src];continue=1'>Start New Game</a><br>"
|
||||
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 = "<a href='?src=\ref[src];continue=1;risky=25'>Continue as normal</a><BR>"
|
||||
event_actions += "<a href='?src=\ref[src];continue=1;slow=1;'>Take it slow</a><BR>"
|
||||
@@ -146,14 +146,14 @@
|
||||
if(supplies["3"] != 0)
|
||||
event_actions += "<a href='?src=\ref[src];continue=1;fix=3'>Fix using a part.</a><BR>"
|
||||
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 = "<a href='?src=\ref[src];continue=1;risky=25'>Continue as normal</a><BR>"
|
||||
if(supplies["2"] != 0)
|
||||
event_actions += "<a href='?src=\ref[src];continue=1;fix=2'>Fix using a part.</a><BR>"
|
||||
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 = "<a href='?src=\ref[src];continue=1;risky=25'>Continue as normal</a><BR>"
|
||||
@@ -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!<br>"
|
||||
@@ -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.")
|
||||
|
||||
@@ -49,13 +49,13 @@
|
||||
to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>")
|
||||
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, "<span class='notice'>You screw the circuit board into place and screw the drawer shut.</span>")
|
||||
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, "<span class='notice'>You remove the circuit board.</span>")
|
||||
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, "<span class='notice'>You unfasten the circuit board.</span>")
|
||||
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, "<span class='notice'>You remove the glass keyboard.</span>")
|
||||
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, "<span class='notice'>You connect the glass keyboard.</span>")
|
||||
var/B = new src.circuit.build_path ( src.loc )
|
||||
src.circuit.construct(B)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
take_damage(damage)
|
||||
else
|
||||
visible_message("<span class='notice'>\The [user] bonks \the [src] harmlessly.</span>")
|
||||
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, "<span class='notice'>You remove \the [repairing].</span>")
|
||||
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("<span class='danger'>\The [user] hits \the [src] with \the [W] with no visible effect.</span>")
|
||||
else
|
||||
user.visible_message("<span class='danger'>\The [user] forcefully strikes \the [src] with \the [W]!</span>")
|
||||
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)
|
||||
|
||||
@@ -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("<span class='warning'>[user] has [anchored ? "" : "un" ]secured \the [src]!</span>",
|
||||
"You have [anchored ? "" : "un" ]secured \the [src]!")
|
||||
update_icon()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <b>[src]</b> 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 <b>[src]</b> 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 <b>[src]</b> 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 <b>[src]</b> 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("<b>[usr]</b> secures the mask over \the <b>[breather]'s</b> 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("<b>[usr]</b> 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("<b>[usr]</b> 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("<b>[usr]</b> 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"
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
StopPlaying()
|
||||
user.visible_message("<span class='warning'>[user] has [anchored ? "un" : ""]secured \the [src].</span>", "<span class='notice'>You [anchored ? "un" : ""]secure \the [src].</span>")
|
||||
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
|
||||
|
||||
@@ -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, "<span class='notice'>You [panel_open ? "open" : "close"] the maintenance hatch of [src].</span>")
|
||||
update_icon()
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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].", \
|
||||
"<span class='notice'>You have fastened the [src].</span>", \
|
||||
@@ -1534,7 +1534,7 @@
|
||||
to_chat(user, "<span class='warning'>You need to fasten it to a pipe</span>")
|
||||
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, "<span class='notice'>You have fastened the meter to the pipe</span>")
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
@@ -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, "<span class='notice'>You secure the exterior bolts on the turret.</span>")
|
||||
else if(anchored)
|
||||
playsound(loc, attacking_item.usesound, 100, 1)
|
||||
attacking_item.play_tool_sound(get_turf(src), 100)
|
||||
anchored = 0
|
||||
to_chat(user, "<span class='notice'>You unsecure the exterior bolts on the turret.</span>")
|
||||
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, "<span class='notice'>You secure the external bolts.</span>")
|
||||
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, "<span class='notice'>You dismantle the turret construction.</span>")
|
||||
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, "<span class='notice'>You unfasten the external bolts.</span>")
|
||||
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, "<span class='notice'>You bolt the metal armor into place.</span>")
|
||||
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, "<span class='notice'>You remove the turret's metal armor bolts.</span>")
|
||||
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, "<span class='notice'>You close the access hatch.</span>")
|
||||
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, "<span class='notice'>You open the access hatch.</span>")
|
||||
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, "<span class='notice'>You pry off the turret's exterior armor.</span>")
|
||||
new /obj/item/stack/material/steel(loc, 2)
|
||||
build_step = 6
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
return TRUE
|
||||
anchored = !anchored
|
||||
user.visible_message("<b>[user]</b> [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
|
||||
|
||||
@@ -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("<span class='notice'>You [] the unit's maintenance panel.</span>",(src.panelopen ? "open up" : "close") ))
|
||||
update_icon()
|
||||
src.updateUsrDialog()
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
return TRUE
|
||||
anchored = !anchored
|
||||
user.visible_message("<span class='notice'>\The [user] [anchored ? "secures" : "unsecures"] \the [src].</span>")
|
||||
playsound(src.loc, attacking_item.usesound, 50, 1)
|
||||
attacking_item.play_tool_sound(get_turf(src), 50)
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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("<b>[user]</b> 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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ BREATH ANALYZER
|
||||
user.visible_message("<b>[user]</b> runs the scanner over the floor.", "<span class='notice'>You run the scanner over the floor.</span>", "<span class='notice'>You hear metal repeatedly clunking against the floor.</span>")
|
||||
to_chat(user, "<span class='notice'><b>Scan results for the ERROR:</b></span>")
|
||||
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, "<span class='warning'>This scanner is designed for humanoid patients only.</span>")
|
||||
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, "<span class='warning'>This scanner is designed for organic humanoid patients only.</span>")
|
||||
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,"<span class='danger'>Alert: No breathing detected.</span>")
|
||||
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,"<span class='notice'>Subject oxygen levels abnormal.</span>")
|
||||
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,"<span class='notice'><b>Severe oxygen deprivation detected.</b></span>")
|
||||
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))
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
if(attacking_item.iscrowbar())
|
||||
amount--
|
||||
to_chat(user, "<span class='notice'>You pry off the steel sheet from the [name].</span>")
|
||||
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)
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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, "<span class='notice'>You switch the [src] on.</span>")
|
||||
else if(T)
|
||||
T.visible_message("<span class='danger'>\The [src] turns on.</span>")
|
||||
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, "<span class='notice'>You switch \the [src] off.</span>")
|
||||
else if(T)
|
||||
T.visible_message("<span class='warning'>\The [src] turns off.</span>")
|
||||
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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."))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
to_chat(user, "<span class='notice'>You unsecured the support struts!</span>")
|
||||
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, "<span class='notice'>\The [src] can now be [reinforcing? "reinforced" : "constructed"]!</span>")
|
||||
return
|
||||
|
||||
@@ -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("<b>[user]</b> 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
|
||||
|
||||
@@ -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 ? "<span class='notice'>\The [user] begins unscrewing \the [src].</span>" : "<span class='notice'>\The [user] begins fastening \the [src].</span>" )
|
||||
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 ? "<span class='notice'>You have unfastened \the [src] from the floor.</span>" : "<span class='notice'>You have fastened \the [src] to the floor.</span>"))
|
||||
anchored = !anchored
|
||||
|
||||
@@ -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, "<span class='notice'>You unanchor \the [src] and it destabilizes.</span>")
|
||||
STOP_PROCESSING(SSfast_process, src)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
+180
-211
@@ -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
|
||||
|
||||
@@ -23,17 +23,17 @@
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You unscrew and remove the [flooring.descriptor].</span>")
|
||||
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, "<span class='notice'>You unwrench and remove the [flooring.descriptor].</span>")
|
||||
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, "<span class='notice'>You shovel off the [flooring.descriptor].</span>")
|
||||
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, "<span class='warning'>You must remove the [flooring.descriptor] first.</span>")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.", \
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -452,7 +452,7 @@
|
||||
|
||||
user.put_in_hands(body.cell)
|
||||
to_chat(user, "<span class='notice'>You remove \the [body.cell] from \the [src].</span>")
|
||||
playsound(user.loc, attacking_item.usesound, 50, 1)
|
||||
attacking_item.play_tool_sound(get_turf(src), 50)
|
||||
visible_message("<span class='notice'>\The [user] pries out \the [body.cell] using the \the [attacking_item].</span>")
|
||||
power = MECH_POWER_OFF
|
||||
hud_power_control.update_icon()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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]."))
|
||||
|
||||
|
||||
@@ -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].")
|
||||
|
||||
|
||||
@@ -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, "<span class='notice'>You [opened ? "open" : "close"] \the [src].</span>")
|
||||
update_icon()
|
||||
|
||||
@@ -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 ? "<span class='notice'>You unfasten \the [src] from the floor.</span>" : "<span class='notice'>You secure \the [src] to the floor.</span>"))
|
||||
anchored = !anchored
|
||||
else if(attacking_item.isscrewdriver())
|
||||
|
||||
@@ -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."), \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
on_hear_say("[track][accent_icon ? accent_icon + " " : ""]<span class='game say'><span class='name'>[speaker_name]</span>[alt_name] [verb], <span class='message'><span class='body'>\"[message]\"</span></span></span>")
|
||||
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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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, "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>")
|
||||
else
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user