mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 11:05:03 +01:00
Merge pull request #7875 from Fox-McCloud/sound-update
Sound Update/Refactor
This commit is contained in:
@@ -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]" : ""]."
|
||||
|
||||
@@ -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++
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user