mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 02:24:11 +01:00
Vox sound updates
This commit is contained in:
@@ -280,7 +280,7 @@
|
||||
|
||||
//send resources to the client. It's here in its own proc so we can move it around easiliy if need be
|
||||
/client/proc/send_resources()
|
||||
// preload_vox()
|
||||
preload_vox()
|
||||
getFiles(
|
||||
// 'nano/js/libraries.min.js',
|
||||
'nano/js/libraries/1-jquery.js',
|
||||
|
||||
@@ -84,10 +84,10 @@
|
||||
prefs.save_preferences()
|
||||
if(prefs.toggles & SOUND_MIDI)
|
||||
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
|
||||
else
|
||||
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!
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
|
||||
var/announcing_vox = 0 // Stores the time of the last announcement
|
||||
var/const/VOX_CHANNEL = 200
|
||||
var/const/VOX_DELAY = 600
|
||||
var/const/VOX_DELAY = 100
|
||||
var/const/VOX_PATH = "sound/vox_fem/"
|
||||
|
||||
/mob/living/silicon/ai/verb/announcement_help()
|
||||
|
||||
@@ -61,45 +62,53 @@ var/const/VOX_DELAY = 600
|
||||
|
||||
/mob/living/silicon/ai/verb/announcement()
|
||||
|
||||
set name = "Announcement"
|
||||
set desc = "Create a vocal announcement by typing in the available words to create a sentence."
|
||||
set category = "AI Commands"
|
||||
set name = "Announcement"
|
||||
set desc = "Create a vocal announcement by typing in the available words to create a sentence."
|
||||
set category = "AI Commands"
|
||||
if(src.stat == 2)
|
||||
src << "You can't call the shuttle because you are dead!"
|
||||
return
|
||||
if(istype(usr,/mob/living/silicon/ai))
|
||||
var/mob/living/silicon/ai/AI = src
|
||||
if(AI.control_disabled)
|
||||
usr << "Wireless control is disabled!"
|
||||
return
|
||||
|
||||
if(announcing_vox > world.time)
|
||||
src << "<span class='notice'>Please wait [round((announcing_vox - world.time) / 10)] seconds.</span>"
|
||||
return
|
||||
if(announcing_vox > world.time)
|
||||
src << "<span class='notice'>Please wait [round((announcing_vox - world.time) / 10)] seconds.</span>"
|
||||
return
|
||||
|
||||
var/message = input(src, "WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", src.last_announcement) as text
|
||||
var/message = input(src, "WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", src.last_announcement) as text
|
||||
|
||||
last_announcement = message
|
||||
last_announcement = message
|
||||
|
||||
if(!message || announcing_vox > world.time)
|
||||
return
|
||||
if(!message || announcing_vox > world.time)
|
||||
return
|
||||
|
||||
var/list/words = stringsplit(trim(message), " ")
|
||||
var/list/incorrect_words = list()
|
||||
var/list/words = stringsplit(trim(message), " ")
|
||||
var/list/incorrect_words = list()
|
||||
|
||||
if(words.len > 30)
|
||||
words.len = 30
|
||||
if(words.len > 30)
|
||||
words.len = 30
|
||||
|
||||
for(var/word in words)
|
||||
word = trim(word)
|
||||
if(!word)
|
||||
words -= word
|
||||
continue
|
||||
if(!vox_sounds[word])
|
||||
incorrect_words += word
|
||||
for(var/word in words)
|
||||
word = lowertext(trim(word))
|
||||
if(!word)
|
||||
words -= word
|
||||
continue
|
||||
if(!vox_sounds[word])
|
||||
incorrect_words += word
|
||||
|
||||
if(incorrect_words.len)
|
||||
src << "<span class='notice'>These words are not available on the announcement system: [english_list(incorrect_words)].</span>"
|
||||
return
|
||||
if(incorrect_words.len)
|
||||
src << "<span class='notice'>These words are not available on the announcement system: [english_list(incorrect_words)].</span>"
|
||||
return
|
||||
|
||||
announcing_vox = world.time + VOX_DELAY
|
||||
announcing_vox = world.time + VOX_DELAY
|
||||
|
||||
log_game("[key_name_admin(src)] made a vocal announcement with the following message: [message].")
|
||||
log_game("[key_name_admin(src)] made a vocal announcement with the following message: [message].")
|
||||
|
||||
for(var/word in words)
|
||||
play_vox_word(word, src.z, null)
|
||||
for(var/word in words)
|
||||
play_vox_word(word, src.z, null)
|
||||
|
||||
|
||||
/proc/play_vox_word(var/word, var/z_level, var/mob/only_listener)
|
||||
@@ -125,4 +134,11 @@ var/const/VOX_DELAY = 600
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// VOX sounds moved to /code/defines/vox_sounds.dm
|
||||
// VOX sounds moved to /code/defines/vox_sounds.dm
|
||||
|
||||
/client/proc/preload_vox()
|
||||
var/list/vox_files = flist(VOX_PATH)
|
||||
for(var/file in vox_files)
|
||||
// src << "Downloading [file]"
|
||||
var/sound/S = sound("[VOX_PATH][file]")
|
||||
src << browse_rsc(S)
|
||||
Reference in New Issue
Block a user