Files
vgstation13/code/game/sound.dm
elly1989@rocketmail.com 1aaf44e076 Moved a lot of preference related toggles to the Preferences verb tab.
You can now modify specialrole candidacy mid-round and it will save changes to your savefile.
Added a BE_NINJA flag. Doesn't do anything yet. If somebody wants to implement it, go for it.
Moved prefrences stuff from new_player to the folder /code/modules/client/
Renamed toggles so they appear in a nice order.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5146 316c924e-a436-60f5-8080-3fe189b3f50e
2012-11-21 08:06:44 +00:00

81 lines
3.9 KiB
Plaintext

/proc/playsound(var/atom/source, soundin, vol as num, vary, extrarange as num)
//Frequency stuff only works with 45kbps oggs.
switch(soundin)
if ("shatter") soundin = pick('sound/effects/Glassbr1.ogg','sound/effects/Glassbr2.ogg','sound/effects/Glassbr3.ogg')
if ("explosion") soundin = pick('sound/effects/Explosion1.ogg','sound/effects/Explosion2.ogg')
if ("sparks") soundin = pick('sound/effects/sparks1.ogg','sound/effects/sparks2.ogg','sound/effects/sparks3.ogg','sound/effects/sparks4.ogg')
if ("rustle") soundin = pick('sound/effects/rustle1.ogg','sound/effects/rustle2.ogg','sound/effects/rustle3.ogg','sound/effects/rustle4.ogg','sound/effects/rustle5.ogg')
if ("punch") soundin = pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg')
if ("clownstep") soundin = pick('sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg')
if ("swing_hit") soundin = pick('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg')
if ("hiss") soundin = pick('sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg')
if ("pageturn") soundin = pick('sound/effects/pageturn1.ogg', 'sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg')
var/sound/S = sound(soundin)
S.wait = 0 //No queue
S.channel = 0 //Any channel
S.volume = vol
if (vary)
S.frequency = rand(32000, 55000)
for (var/mob/M in range(world.view+extrarange, source)) // Plays for people in range.
if(locate(/mob/, M))
var/mob/M2 = locate(/mob/, M)
if (M2.client)
if(M2.ear_deaf <= 0 || !M.ear_deaf)
if(isturf(source))
var/dx = source.x - M2.x
S.pan = max(-100, min(100, dx/8.0 * 100))
M2 << S
if (M.client)
if(M.ear_deaf <= 0 || !M.ear_deaf)
if(isturf(source))
var/dx = source.x - M.x
S.pan = max(-100, min(100, dx/8.0 * 100))
M << S
for(var/obj/structure/closet/L in range(world.view+extrarange, source))
if(locate(/mob/, L))
for(var/mob/M in L)
if (M.client)
if(M.ear_deaf <= 0 || !M.ear_deaf)
if(isturf(source))
var/dx = source.x - M.x
S.pan = max(-100, min(100, dx/8.0 * 100))
M << S
// Now plays for people in lockers! -- Polymorph
/mob/proc/playsound_local(var/atom/source, soundin, vol as num, vary, extrarange as num)
if(!src.client || ear_deaf > 0) return
switch(soundin)
if ("shatter") soundin = pick('sound/effects/Glassbr1.ogg','sound/effects/Glassbr2.ogg','sound/effects/Glassbr3.ogg')
if ("explosion") soundin = pick('sound/effects/Explosion1.ogg','sound/effects/Explosion2.ogg')
if ("sparks") soundin = pick('sound/effects/sparks1.ogg','sound/effects/sparks2.ogg','sound/effects/sparks3.ogg','sound/effects/sparks4.ogg')
if ("rustle") soundin = pick('sound/effects/rustle1.ogg','sound/effects/rustle2.ogg','sound/effects/rustle3.ogg','sound/effects/rustle4.ogg','sound/effects/rustle5.ogg')
if ("punch") soundin = pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg')
if ("clownstep") soundin = pick('sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg')
if ("swing_hit") soundin = pick('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg')
if ("hiss") soundin = pick('sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg')
var/sound/S = sound(soundin)
S.wait = 0 //No queue
S.channel = 0 //Any channel
S.volume = vol
if (vary)
S.frequency = rand(32000, 55000)
if(isturf(source))
var/dx = source.x - src.x
S.pan = max(-100, min(100, dx/8.0 * 100))
src << S
/client/proc/playtitlemusic()
if(!ticker || !ticker.login_music) return
if(prefs.toggles & SOUND_LOBBY)
src << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS