Merge pull request #7875 from Fox-McCloud/sound-update

Sound Update/Refactor
This commit is contained in:
Crazy Lemon
2017-08-01 22:09:46 -07:00
committed by GitHub
18 changed files with 124 additions and 121 deletions
-4
View File
@@ -297,10 +297,6 @@
#define FLAMMABLE 0
#define ON_FIRE 1
// Sound
#define SOUND_MINIMUM_PRESSURE 10
#define FALLOFF_SOUNDS 0.5
// Bluespace shelter deploy checks
#define SHELTER_DEPLOY_ALLOWED "allowed"
#define SHELTER_DEPLOY_BAD_TURFS "bad turfs"
+16
View File
@@ -0,0 +1,16 @@
//max channel is 1024. Only go lower from here, because byond tends to pick the first availiable channel to play sounds on
#define CHANNEL_LOBBYMUSIC 1024
#define CHANNEL_ADMIN 1023
#define CHANNEL_VOX 1022
#define CHANNEL_HEARTBEAT 1021 //sound channel for heartbeats
#define CHANNEL_BUZZ 1020
#define CHANNEL_AMBIENCE 1019
//THIS SHOULD ALWAYS BE THE LOWEST ONE!
//KEEP IT UPDATED
#define CHANNEL_HIGHEST_AVAILABLE 1018
#define SOUND_MINIMUM_PRESSURE 10
#define FALLOFF_SOUNDS 0.5
+4 -3
View File
@@ -313,14 +313,15 @@
// Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch
if(L && L.client && !L.client.ambience_playing && (L.client.prefs.sound & SOUND_BUZZ)) //split off the white noise from the rest of the ambience because of annoyance complaints - Kluys
L.client.ambience_playing = 1
L << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2)
else if(L && L.client && !(L.client.prefs.sound & SOUND_BUZZ)) L.client.ambience_playing = 0
L << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = CHANNEL_BUZZ)
else if(L && L.client && !(L.client.prefs.sound & SOUND_BUZZ))
L.client.ambience_playing = 0
if(prob(35) && L && L.client && (L.client.prefs.sound & SOUND_AMBIENCE))
var/sound = pick(ambientsounds)
if(!L.client.played)
L << sound(sound, repeat = 0, wait = 0, volume = 25, channel = 1)
L << sound(sound, repeat = 0, wait = 0, volume = 25, channel = CHANNEL_AMBIENCE)
L.client.played = 1
spawn(600) //ewww - this is very very bad
if(L.&& L.client)
+6 -2
View File
@@ -171,14 +171,18 @@
/obj/effect/meteor/proc/meteor_effect(var/sound=1)
if(sound)
for(var/mob/M in player_list)
var/sound/meteor_sound = sound(meteorsound)
var/random_frequency = get_rand_frequency()
for(var/P in player_list)
var/mob/M = P
var/turf/T = get_turf(M)
if(!T || T.z != src.z)
continue
var/dist = get_dist(M.loc, src.loc)
if(prob(50))
shake_camera(M, dist > 20 ? 3 : 5, dist > 20 ? 1 : 3)
M.playsound_local(src.loc, meteorsound, 50, 1, get_rand_frequency(), 10)
M.playsound_local(src.loc, null, 50, 1, random_frequency, 10, S = meteor_sound)
///////////////////////
//Meteor types
+8 -14
View File
@@ -40,7 +40,11 @@
if(!silent)
var/frequency = get_rand_frequency()
for(var/mob/M in player_list)
var/sound/explosion_sound = sound(get_sfx("explosion"))
var/sound/global_boom = sound('sound/effects/explosionfar.ogg')
for(var/P in player_list)
var/mob/M = P
// Double check for client
if(M && M.client)
var/turf/M_turf = get_turf(M)
@@ -48,20 +52,10 @@
var/dist = get_dist(M_turf, epicenter)
// If inside the blast radius + world.view - 2
if(dist <= round(max_range + world.view - 2, 1))
M.playsound_local(epicenter, get_sfx("explosion"), 100, 1, frequency, falloff = 5) // get_sfx() is so that everyone gets the same sound
M.playsound_local(epicenter, null, 100, 1, frequency, falloff = 5, S = explosion_sound)
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else if(dist <= far_dist)
var/far_volume = Clamp(far_dist, 30, 50) // Volume is based on explosion size and dist
far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion
M.playsound_local(epicenter, 'sound/effects/explosionfar.ogg', far_volume, 1, frequency, falloff = 5)
var/close = range(world.view+round(devastation_range,1), epicenter)
// to all distanced mobs play a different sound
for(var/mob/M in world)
if(M.z == epicenter.z && !(M in close))
// check if the mob can hear
if(M.can_hear() && !istype(M.loc,/turf/space))
M << 'sound/effects/explosionfar.ogg'
else if(M.can_hear() && !isspaceturf(M.loc))
M << global_boom
if(heavy_impact_range > 1)
if(smoke)
+2 -1
View File
@@ -57,10 +57,11 @@
return
// and play
var/turf/source = get_turf(instrumentObj)
var/sound/music_played = sound(soundfile)
for(var/mob/M in hearers(15, source))
if(!M.client || !(M.client.prefs.sound & SOUND_INSTRUMENTS))
continue
M.playsound_local(source, soundfile, 100, falloff = 5)
M.playsound_local(source, null, 100, falloff = 5, S = music_played)
/datum/song/proc/shouldStopPlaying(mob/user)
if(instrumentObj)
+57 -67
View File
@@ -1,35 +1,15 @@
var/list/shatter_sound = list('sound/effects/Glassbr1.ogg','sound/effects/Glassbr2.ogg','sound/effects/Glassbr3.ogg')
var/list/explosion_sound = list('sound/effects/Explosion1.ogg','sound/effects/Explosion2.ogg')
var/list/spark_sound = list('sound/effects/sparks1.ogg','sound/effects/sparks2.ogg','sound/effects/sparks3.ogg','sound/effects/sparks4.ogg')
var/list/rustle_sound = list('sound/effects/rustle1.ogg','sound/effects/rustle2.ogg','sound/effects/rustle3.ogg','sound/effects/rustle4.ogg','sound/effects/rustle5.ogg')
var/list/bodyfall_sound = list('sound/effects/bodyfall1.ogg','sound/effects/bodyfall2.ogg','sound/effects/bodyfall3.ogg','sound/effects/bodyfall4.ogg')
var/list/punch_sound = list('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg')
var/list/clown_sound = list('sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg')
var/list/jackboot_sound = list('sound/effects/jackboot1.ogg','sound/effects/jackboot2.ogg')
var/list/swing_hit_sound = list('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg')
var/list/hiss_sound = list('sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg')
var/list/page_sound = list('sound/effects/pageturn1.ogg', 'sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg')
var/list/gun_sound = list('sound/weapons/Gunshot.ogg', 'sound/weapons/Gunshot2.ogg','sound/weapons/Gunshot3.ogg','sound/weapons/Gunshot4.ogg')
var/list/computer_ambience = list('sound/goonstation/machines/ambicomp1.ogg', 'sound/goonstation/machines/ambicomp2.ogg', 'sound/goonstation/machines/ambicomp3.ogg')
var/list/ricochet = list('sound/weapons/effects/ric1.ogg', 'sound/weapons/effects/ric2.ogg','sound/weapons/effects/ric3.ogg','sound/weapons/effects/ric4.ogg','sound/weapons/effects/ric5.ogg')
var/list/terminal_type = list('sound/machines/terminal_button01.ogg', 'sound/machines/terminal_button02.ogg', 'sound/machines/terminal_button03.ogg',
'sound/machines/terminal_button04.ogg', 'sound/machines/terminal_button05.ogg', 'sound/machines/terminal_button06.ogg',
'sound/machines/terminal_button07.ogg', 'sound/machines/terminal_button08.ogg')
var/list/growls = list('sound/goonstation/voice/growl1.ogg', 'sound/goonstation/voice/growl2.ogg', 'sound/goonstation/voice/growl3.ogg')
/proc/playsound(var/atom/source, soundin, vol as num, vary, extrarange as num, falloff, var/is_global, var/pitch)
soundin = get_sfx(soundin) // same sound for everyone
/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, frequency = null, channel = 0, pressure_affected = TRUE)
if(isarea(source))
error("[source] is an area and is trying to make the sound: [soundin]")
return
var/frequency = pitch
var/turf/turf_source = get_turf(source)
//allocate a channel if necessary now so its the same for everyone
channel = channel || open_sound_channel()
// Looping through the player list has the added bonus of working for mobs inside containers
var/sound/S = sound(soundin)
var/sound/S = sound(get_sfx(soundin))
var/maxdistance = (world.view + extrarange) * 3
for(var/P in player_list)
var/mob/M = P
@@ -41,18 +21,19 @@ var/list/growls = list('sound/goonstation/voice/growl1.ogg', 'sound/goonstation/
var/turf/T = get_turf(M)
if(T && T.z == turf_source.z)
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, is_global, S)
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, channel, pressure_affected, S)
/mob/proc/playsound_local(var/turf/turf_source, soundin, vol as num, vary, frequency, falloff, is_global, sound/S)
if(!src.client || !can_hear())
/mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff, channel = 0, pressure_affected = TRUE, sound/S)
if(!client || !can_hear())
return
if(!S)
S = sound(get_sfx(soundin))
S.wait = 0 //No queue
S.channel = 0 //Any channel
S.channel = channel || open_sound_channel()
S.volume = vol
S.environment = -1
if(vary)
if(frequency)
S.frequency = frequency
@@ -60,7 +41,6 @@ var/list/growls = list('sound/goonstation/voice/growl1.ogg', 'sound/goonstation/
S.frequency = get_rand_frequency()
if(isturf(turf_source))
// 3D sounds, the technology is here!
var/turf/T = get_turf(src)
//sound volume falloff with distance
@@ -68,27 +48,27 @@ var/list/growls = list('sound/goonstation/voice/growl1.ogg', 'sound/goonstation/
S.volume -= max(distance - world.view, 0) * 2 //multiplicative falloff to add on top of natural audio falloff.
//sound volume falloff with pressure
var/pressure_factor = 1.0
if(pressure_affected)
//Atmosphere affects sound
var/pressure_factor = 1
var/datum/gas_mixture/hearer_env = T.return_air()
var/datum/gas_mixture/source_env = turf_source.return_air()
var/datum/gas_mixture/hearer_env = T.return_air()
var/datum/gas_mixture/source_env = turf_source.return_air()
if(hearer_env && source_env)
var/pressure = min(hearer_env.return_pressure(), source_env.return_pressure())
if(pressure < ONE_ATMOSPHERE)
pressure_factor = max((pressure - SOUND_MINIMUM_PRESSURE)/(ONE_ATMOSPHERE - SOUND_MINIMUM_PRESSURE), 0)
else //space
pressure_factor = 0
if(hearer_env && source_env)
var/pressure = min(hearer_env.return_pressure(), source_env.return_pressure())
if(distance <= 1)
pressure_factor = max(pressure_factor, 0.15) //touching the source of the sound
if(pressure < ONE_ATMOSPHERE)
pressure_factor = max((pressure - SOUND_MINIMUM_PRESSURE)/(ONE_ATMOSPHERE - SOUND_MINIMUM_PRESSURE), 0)
else //in space
pressure_factor = 0
if(distance <= 1)
pressure_factor = max(pressure_factor, 0.15) //hearing through contact
S.volume *= pressure_factor
S.volume *= pressure_factor
//End Atmosphere affecting sound
if(S.volume <= 0)
return //no volume means no sound
return //No sound
var/dx = turf_source.x - T.x // Hearing from the right/left
S.x = dx
@@ -97,15 +77,23 @@ var/list/growls = list('sound/goonstation/voice/growl1.ogg', 'sound/goonstation/
// The y value is for above your head, but there is no ceiling in 2d spessmens.
S.y = 1
S.falloff = (falloff ? falloff : FALLOFF_SOUNDS)
if(!is_global)
S.environment = 2
src << S
/client/proc/playtitlemusic()
if(!ticker || !ticker.login_music || config.disable_lobby_music) return
if(!ticker || !ticker.login_music || config.disable_lobby_music)
return
if(prefs.sound & SOUND_LOBBY)
src << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS
src << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = CHANNEL_LOBBYMUSIC) // MAD JAMS
/proc/open_sound_channel()
var/static/next_channel = 1 //loop through the available 1024 - (the ones we reserve) channels and pray that its not still being used
. = ++next_channel
if(next_channel > CHANNEL_HIGHEST_AVAILABLE)
next_channel = 1
/mob/proc/stop_sound_channel(chan)
src << sound(null, repeat = 0, wait = 0, channel = chan)
/proc/get_rand_frequency()
return rand(32000, 55000) //Frequency stuff only works with 45kbps oggs.
@@ -114,35 +102,37 @@ var/list/growls = list('sound/goonstation/voice/growl1.ogg', 'sound/goonstation/
if(istext(soundin))
switch(soundin)
if("shatter")
soundin = pick(shatter_sound)
soundin = pick('sound/effects/Glassbr1.ogg','sound/effects/Glassbr2.ogg','sound/effects/Glassbr3.ogg')
if("explosion")
soundin = pick(explosion_sound)
soundin = pick('sound/effects/Explosion1.ogg','sound/effects/Explosion2.ogg')
if("sparks")
soundin = pick(spark_sound)
soundin = pick('sound/effects/sparks1.ogg','sound/effects/sparks2.ogg','sound/effects/sparks3.ogg','sound/effects/sparks4.ogg')
if("rustle")
soundin = pick(rustle_sound)
soundin = pick('sound/effects/rustle1.ogg','sound/effects/rustle2.ogg','sound/effects/rustle3.ogg','sound/effects/rustle4.ogg','sound/effects/rustle5.ogg')
if("bodyfall")
soundin = pick(bodyfall_sound)
soundin = pick('sound/effects/bodyfall1.ogg','sound/effects/bodyfall2.ogg','sound/effects/bodyfall3.ogg','sound/effects/bodyfall4.ogg')
if("punch")
soundin = pick(punch_sound)
soundin = pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg')
if("clownstep")
soundin = pick(clown_sound)
soundin = pick('sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg')
if("jackboot")
soundin = pick(jackboot_sound)
soundin = pick('sound/effects/jackboot1.ogg','sound/effects/jackboot2.ogg')
if("swing_hit")
soundin = pick(swing_hit_sound)
soundin = pick('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg')
if("hiss")
soundin = pick(hiss_sound)
soundin = pick('sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg')
if("pageturn")
soundin = pick(page_sound)
soundin = pick('sound/effects/pageturn1.ogg', 'sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg')
if("gunshot")
soundin = pick(gun_sound)
soundin = pick('sound/weapons/Gunshot.ogg', 'sound/weapons/Gunshot2.ogg','sound/weapons/Gunshot3.ogg','sound/weapons/Gunshot4.ogg')
if("computer_ambience")
soundin = pick(computer_ambience)
soundin = pick('sound/goonstation/machines/ambicomp1.ogg', 'sound/goonstation/machines/ambicomp2.ogg', 'sound/goonstation/machines/ambicomp3.ogg')
if("ricochet")
soundin = pick(ricochet)
soundin = pick('sound/weapons/effects/ric1.ogg', 'sound/weapons/effects/ric2.ogg','sound/weapons/effects/ric3.ogg','sound/weapons/effects/ric4.ogg','sound/weapons/effects/ric5.ogg')
if("terminal_type")
soundin = pick(terminal_type)
soundin = pick('sound/machines/terminal_button01.ogg', 'sound/machines/terminal_button02.ogg', 'sound/machines/terminal_button03.ogg',
'sound/machines/terminal_button04.ogg', 'sound/machines/terminal_button05.ogg', 'sound/machines/terminal_button06.ogg',
'sound/machines/terminal_button07.ogg', 'sound/machines/terminal_button08.ogg')
if("growls")
soundin = pick(growls)
soundin = pick('sound/goonstation/voice/growl1.ogg', 'sound/goonstation/voice/growl2.ogg', 'sound/goonstation/voice/growl3.ogg')
return soundin
+2 -2
View File
@@ -6,7 +6,7 @@ var/list/sounds_cache = list()
if(!check_rights(R_SOUNDS))
return
var/sound/awful_sound = sound(null, repeat = 0, wait = 0, channel = 777)
var/sound/awful_sound = sound(null, repeat = 0, wait = 0, channel = CHANNEL_ADMIN)
log_admin("[key_name(src)] stopped admin sounds.")
message_admins("[key_name_admin(src)] stopped admin sounds.", 1)
@@ -18,7 +18,7 @@ var/list/sounds_cache = list()
set name = "Play Global Sound"
if(!check_rights(R_SOUNDS)) return
var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = 777)
var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = CHANNEL_ADMIN)
uploaded_sound.priority = 250
sounds_cache += S
@@ -2036,10 +2036,10 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if("lobby_music")
sound ^= SOUND_LOBBY
if(sound & SOUND_LOBBY)
user << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1)
if((sound & SOUND_LOBBY) && user.client)
user.client.playtitlemusic()
else
user << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1)
user.stop_sound_channel(CHANNEL_LOBBYMUSIC)
if("ghost_ears")
toggles ^= CHAT_GHOSTEARS
@@ -95,12 +95,11 @@
prefs.save_preferences(src)
if(prefs.sound & SOUND_LOBBY)
to_chat(src, "You will now hear music in the game lobby.")
if(istype(mob, /mob/new_player))
playtitlemusic()
if(isnewplayer(usr))
usr.client.playtitlemusic()
else
to_chat(src, "You will no longer hear music in the game lobby.")
if(istype(mob, /mob/new_player))
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1)// stop the jamsz
usr.stop_sound_channel(CHANNEL_LOBBYMUSIC)
feedback_add_details("admin_verb","TLobby") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -113,9 +112,7 @@
if(prefs.sound & SOUND_MIDI)
to_chat(src, "You will now hear any sounds uploaded by admins.")
else
var/sound/break_sound = sound(null, repeat = 0, wait = 0, channel = 777)
break_sound.priority = 250
src << break_sound //breaks the client's sound output on channel 777
usr.stop_sound_channel(CHANNEL_ADMIN)
to_chat(src, "You will no longer hear sounds uploaded by admins; any currently playing midis have been disabled.")
feedback_add_details("admin_verb","TMidi") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -150,7 +147,7 @@
to_chat(src, "You will now hear ambient sounds.")
else
to_chat(src, "You will no longer hear ambient sounds.")
src << sound(null, repeat = 0, wait = 0, volume = 0, channel = 1)
usr.stop_sound_channel(CHANNEL_AMBIENCE)
feedback_add_details("admin_verb","TAmbi") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/Toggle_Buzz() //No more headaches because headphones bump up shipambience.ogg to insanity levels.
@@ -163,7 +160,7 @@
to_chat(src, "You will now hear ambient white noise.")
else
to_chat(src, "You will no longer hear ambient white noise.")
src << sound(null, repeat = 0, wait = 0, volume = 0, channel = 2)
usr.stop_sound_channel(CHANNEL_BUZZ)
feedback_add_details("admin_verb","TBuzz") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -177,8 +174,7 @@
to_chat(src, "You will now hear heartbeat sounds.")
else
to_chat(src, "You will no longer hear heartbeat sounds.")
src << sound(null, repeat = 0, wait = 0, volume = 0, channel = 1)
src << sound(null, repeat = 0, wait = 0, volume = 0, channel = 2)
usr.stop_sound_channel(CHANNEL_HEARTBEAT)
feedback_add_details("admin_verb","Thb") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
// This needs a toggle because you people are awful and spammed terrible music
@@ -734,9 +734,9 @@
message = "<B>[src]</B> [species.scream_verb][M ? " at [M]" : ""]!"
m_type = 2
if(gender == FEMALE)
playsound(loc, "[species.female_scream_sound]", 80, 1, 0, pitch = get_age_pitch())
playsound(loc, "[species.female_scream_sound]", 80, 1, frequency = get_age_pitch())
else
playsound(loc, "[species.male_scream_sound]", 80, 1, 0, pitch = get_age_pitch()) //default to male screams if no gender is present.
playsound(loc, "[species.male_scream_sound]", 80, 1, frequency = get_age_pitch()) //default to male screams if no gender is present.
else
message = "<B>[src]</B> makes a very loud noise[M ? " at [M]" : ""]."
+3 -3
View File
@@ -1041,7 +1041,7 @@
if(heartbeat >= rate)
heartbeat = 0
src << sound('sound/effects/electheart.ogg',0,0,0,30)//Credit to GhostHack (www.ghosthack.de) for sound.
src << sound('sound/effects/electheart.ogg',0,0,CHANNEL_HEARTBEAT,30)//Credit to GhostHack (www.ghosthack.de) for sound.
else
heartbeat++
@@ -1060,9 +1060,9 @@
if(heartbeat >= rate)
heartbeat = 0
if(H.status & ORGAN_ASSISTED)
src << sound('sound/effects/pacemakebeat.ogg',0,0,0,50)
src << sound('sound/effects/pacemakebeat.ogg',0,0,CHANNEL_HEARTBEAT,50)
else
src << sound('sound/effects/singlebeat.ogg',0,0,0,50)
src << sound('sound/effects/singlebeat.ogg',0,0,CHANNEL_HEARTBEAT,50)
else
heartbeat++
+5 -3
View File
@@ -66,7 +66,6 @@
*/
var/announcing_vox = 0 // Stores the time of the last announcement
var/const/VOX_CHANNEL = 200
var/const/VOX_DELAY = 100
var/const/VOX_PATH = "sound/vox_fem/"
@@ -136,11 +135,14 @@ var/const/VOX_PATH = "sound/vox_fem/"
play_vox_word(word, src.z, null)
/proc/play_vox_word(var/word, var/z_level, var/mob/only_listener)
/proc/play_vox_word(word, z_level, mob/only_listener)
word = lowertext(word)
if(vox_sounds[word])
var/sound_file = vox_sounds[word]
var/sound/voice = sound(sound_file, wait = 1, channel = VOX_CHANNEL)
var/sound/voice = sound(sound_file, wait = 1, channel = CHANNEL_VOX)
voice.status = SOUND_STREAM
// If there is no single listener, broadcast to everyone in the same z level
+2 -2
View File
@@ -123,7 +123,7 @@
var/mob/dead/observer/observer = new()
src << browse(null, "window=playersetup")
spawning = 1
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1)// MAD JAMS cant last forever yo
stop_sound_channel(CHANNEL_LOBBYMUSIC)
observer.started_as_observer = 1
@@ -451,7 +451,7 @@
client.prefs.real_name = random_name(client.prefs.gender)
client.prefs.copy_to(new_character)
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1)// MAD JAMS cant last forever yo
stop_sound_channel(CHANNEL_LOBBYMUSIC)
if(mind)
+1 -1
View File
@@ -20,7 +20,7 @@
/mob/proc/AIize()
if(client)
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1)// stop the jams for AIs
stop_sound_channel(CHANNEL_LOBBYMUSIC)
var/mob/living/silicon/ai/O = new (loc,,,1)//No MMI but safety is in effect.
O.invisibility = 0
+4 -2
View File
@@ -373,13 +373,15 @@ var/const/GRAV_NEEDS_WRENCH = 3
// Shake everyone on the z level to let them know that gravity was enagaged/disenagaged.
/obj/machinery/gravity_generator/main/proc/shake_everyone()
var/turf/our_turf = get_turf(src)
for(var/mob/M in mob_list)
var/sound/alert_sound = sound('sound/effects/alert.ogg')
for(var/shaked in mob_list)
var/mob/M = shaked
var/turf/their_turf = get_turf(M)
if(their_turf && their_turf.z == our_turf.z)
M.update_gravity(M.mob_has_gravity())
if(M.client)
shake_camera(M, 15, 1)
M.playsound_local(our_turf, 'sound/effects/alert.ogg', 100, 1, 0.5)
M.playsound_local(our_turf, null, 100, 1, 0.5, S = alert_sound)
// TODO: Make the gravity generator cooperate with the space manager
/obj/machinery/gravity_generator/main/proc/gravity_in_level()
+1 -1
View File
@@ -284,7 +284,7 @@
return
var/sound/S = sound(mysound)
S.wait = 0 //No queue
S.channel = 0 //Any channel
S.channel = open_sound_channel()
S.volume = 50
for(var/mob/M in passengers | pilot)
M << S
+1
View File
@@ -49,6 +49,7 @@
#include "code\__DEFINES\rolebans.dm"
#include "code\__DEFINES\sight.dm"
#include "code\__DEFINES\snpc.dm"
#include "code\__DEFINES\sound.dm"
#include "code\__DEFINES\stat.dm"
#include "code\__DEFINES\tick.dm"
#include "code\__DEFINES\zlevel.dm"