[MIRROR] Talk Sound Refactor (#10883)

Co-authored-by: Will <7099514+Willburd@users.noreply.github.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-05-15 11:20:30 -07:00
committed by GitHub
parent 9f4735e365
commit 70aa13c9a6
7 changed files with 30 additions and 107 deletions

View File

@@ -1,46 +1,9 @@
#define DEFAULT_TALK_SOUNDS GLOB.talk_sound
var/list/talk_sound_map = rlist(
list(
"beep-boop",
"goon speak 1",
"goon speak 2",
"goon speak 3",
"goon speak 4",
"goon speak blub",
"goon speak bottalk",
"goon speak buwoo",
"goon speak cow",
"goon speak lizard",
"goon speak pug",
"goon speak pugg",
"goon speak roach",
"goon speak skelly",
"xeno speak" // CHOMPEnable
),
list(
GLOB.talk_sound,
GLOB.goon_speak_one_sound,
GLOB.goon_speak_two_sound,
GLOB.goon_speak_three_sound,
GLOB.goon_speak_four_sound,
GLOB.goon_speak_blub_sound,
GLOB.goon_speak_bottalk_sound,
GLOB.goon_speak_buwoo_sound,
GLOB.goon_speak_cow_sound,
GLOB.goon_speak_lizard_sound,
GLOB.goon_speak_pug_sound,
GLOB.goon_speak_pugg_sound,
GLOB.goon_speak_roach_sound,
GLOB.goon_speak_skelly_sound,
GLOB.xeno_speak_sound // Does not exist on virgo
)
)
/proc/get_talk_sound(var/voice_sound) /proc/get_talk_sound(var/voice_sound)
if(!voice_sound) if(!voice_sound)
return talk_sound_map[1] return DEFAULT_TALK_SOUNDS
return talk_sound_map[2][voice_sound] return SSsounds.talk_sound_map[voice_sound]
/proc/rlist(var/list/keys,var/list/values) //short for reversible list generator /proc/rlist(var/list/keys,var/list/values) //short for reversible list generator
var/list/rlist = list(list(),list(),FALSE,0) var/list/rlist = list(list(),list(),FALSE,0)

View File

@@ -22,9 +22,12 @@ SUBSYSTEM_DEF(sounds)
var/channel_random_low 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. /// 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 var/channel_reserve_high
/// Assoc list of character speaking sounds, contains lists of sounds per key for use with pick()
var/talk_sound_map = list()
/datum/controller/subsystem/sounds/Initialize() /datum/controller/subsystem/sounds/Initialize()
setup_available_channels() setup_available_channels()
create_talk_sound_map()
return SS_INIT_SUCCESS return SS_INIT_SUCCESS
/datum/controller/subsystem/sounds/proc/setup_available_channels() /datum/controller/subsystem/sounds/proc/setup_available_channels()
@@ -132,4 +135,22 @@ SUBSYSTEM_DEF(sounds)
/datum/controller/subsystem/sounds/proc/available_channels_left() /datum/controller/subsystem/sounds/proc/available_channels_left()
return length(channel_list) - random_channels_min return length(channel_list) - random_channels_min
/// Init talking sound lists
/datum/controller/subsystem/sounds/proc/create_talk_sound_map()
talk_sound_map["beep-boop"] = DEFAULT_TALK_SOUNDS // first is DEFAULT
talk_sound_map["goon speak 1"] =list('sound/talksounds/goon/speak_1.ogg', 'sound/talksounds/goon/speak_1_ask.ogg', 'sound/talksounds/goon/speak_1_exclaim.ogg')
talk_sound_map["goon speak 2"] = list('sound/talksounds/goon/speak_2.ogg', 'sound/talksounds/goon/speak_2_ask.ogg', 'sound/talksounds/goon/speak_2_exclaim.ogg')
talk_sound_map["goon speak 3"] = list('sound/talksounds/goon/speak_3.ogg', 'sound/talksounds/goon/speak_3_ask.ogg', 'sound/talksounds/goon/speak_3_exclaim.ogg')
talk_sound_map["goon speak 4"] = list('sound/talksounds/goon/speak_4.ogg', 'sound/talksounds/goon/speak_4_ask.ogg', 'sound/talksounds/goon/speak_4_exclaim.ogg')
talk_sound_map["goon speak blub"] = list('sound/talksounds/goon/blub.ogg', 'sound/talksounds/goon/blub_ask.ogg', 'sound/talksounds/goon/blub_exclaim.ogg')
talk_sound_map["goon speak bottalk"] = list('sound/talksounds/goon/bottalk_1.ogg', 'sound/talksounds/goon/bottalk_2.ogg', 'sound/talksounds/goon/bottalk_3.ogg', 'sound/talksounds/goon/bottalk_4.wav')
talk_sound_map["goon speak buwoo"] = list('sound/talksounds/goon/buwoo.ogg', 'sound/talksounds/goon/buwoo_ask.ogg', 'sound/talksounds/goon/buwoo_exclaim.ogg')
talk_sound_map["goon speak cow"] = list('sound/talksounds/goon/cow.ogg', 'sound/talksounds/goon/cow_ask.ogg', 'sound/talksounds/goon/cow_exclaim.ogg')
talk_sound_map["goon speak lizard"] = list('sound/talksounds/goon/lizard.ogg', 'sound/talksounds/goon/lizard_ask.ogg', 'sound/talksounds/goon/lizard_exclaim.ogg')
talk_sound_map["goon speak pug"] = list('sound/talksounds/goon/pug.ogg', 'sound/talksounds/goon/pug_ask.ogg', 'sound/talksounds/goon/pug_exclaim.ogg')
talk_sound_map["goon speak pugg"] = list('sound/talksounds/goon/pugg.ogg', 'sound/talksounds/goon/pugg_ask.ogg', 'sound/talksounds/goon/pugg_exclaim.ogg')
talk_sound_map["goon speak roach"] = list('sound/talksounds/goon/roach.ogg', 'sound/talksounds/goon/roach_ask.ogg', 'sound/talksounds/goon/roach_exclaim.ogg')
talk_sound_map["goon speak skelly"] = list('sound/talksounds/goon/skelly.ogg', 'sound/talksounds/goon/skelly_ask.ogg', 'sound/talksounds/goon/skelly_exclaim.ogg')
talk_sound_map["xeno speak"] = list('sound/talksounds/xeno/xenotalk.ogg', 'sound/talksounds/xeno/xenotalk2.ogg', 'sound/talksounds/xeno/xenotalk3.ogg')
#undef DATUMLESS #undef DATUMLESS

View File

@@ -315,25 +315,11 @@ GLOBAL_LIST_INIT(bodyfall_sound, list('sound/effects/bodyfall1.ogg','sound/effec
GLOBAL_LIST_INIT(teppi_sound, list('sound/voice/teppi/gyooh1.ogg', 'sound/voice/teppi/gyooh2.ogg', 'sound/voice/teppi/gyooh3.ogg', 'sound/voice/teppi/gyooh4.ogg', 'sound/voice/teppi/gyooh5.ogg', 'sound/voice/teppi/gyooh6.ogg', 'sound/voice/teppi/snoot1.ogg', 'sound/voice/teppi/snoot2.ogg')) GLOBAL_LIST_INIT(teppi_sound, list('sound/voice/teppi/gyooh1.ogg', 'sound/voice/teppi/gyooh2.ogg', 'sound/voice/teppi/gyooh3.ogg', 'sound/voice/teppi/gyooh4.ogg', 'sound/voice/teppi/gyooh5.ogg', 'sound/voice/teppi/gyooh6.ogg', 'sound/voice/teppi/snoot1.ogg', 'sound/voice/teppi/snoot2.ogg'))
GLOBAL_LIST_INIT(talk_sound, list('sound/talksounds/a.ogg','sound/talksounds/b.ogg','sound/talksounds/c.ogg','sound/talksounds/d.ogg','sound/talksounds/e.ogg','sound/talksounds/f.ogg','sound/talksounds/g.ogg','sound/talksounds/h.ogg')) GLOBAL_LIST_INIT(talk_sound, list('sound/talksounds/a.ogg','sound/talksounds/b.ogg','sound/talksounds/c.ogg','sound/talksounds/d.ogg','sound/talksounds/e.ogg','sound/talksounds/f.ogg','sound/talksounds/g.ogg','sound/talksounds/h.ogg'))
GLOBAL_LIST_INIT(emote_sound, list('sound/talksounds/me_a.ogg','sound/talksounds/me_b.ogg','sound/talksounds/me_c.ogg','sound/talksounds/me_d.ogg','sound/talksounds/me_e.ogg','sound/talksounds/me_f.ogg')) GLOBAL_LIST_INIT(emote_sound, list('sound/talksounds/me_a.ogg','sound/talksounds/me_b.ogg','sound/talksounds/me_c.ogg','sound/talksounds/me_d.ogg','sound/talksounds/me_e.ogg','sound/talksounds/me_f.ogg'))
GLOBAL_LIST_INIT(goon_speak_one_sound, list('sound/talksounds/goon/speak_1.ogg', 'sound/talksounds/goon/speak_1_ask.ogg', 'sound/talksounds/goon/speak_1_exclaim.ogg'))
GLOBAL_LIST_INIT(goon_speak_two_sound, list('sound/talksounds/goon/speak_2.ogg', 'sound/talksounds/goon/speak_2_ask.ogg', 'sound/talksounds/goon/speak_2_exclaim.ogg'))
GLOBAL_LIST_INIT(goon_speak_three_sound, list('sound/talksounds/goon/speak_3.ogg', 'sound/talksounds/goon/speak_3_ask.ogg', 'sound/talksounds/goon/speak_3_exclaim.ogg'))
GLOBAL_LIST_INIT(goon_speak_four_sound, list('sound/talksounds/goon/speak_4.ogg', 'sound/talksounds/goon/speak_4_ask.ogg', 'sound/talksounds/goon/speak_4_exclaim.ogg'))
GLOBAL_LIST_INIT(goon_speak_blub_sound, list('sound/talksounds/goon/blub.ogg', 'sound/talksounds/goon/blub_ask.ogg', 'sound/talksounds/goon/blub_exclaim.ogg'))
GLOBAL_LIST_INIT(goon_speak_bottalk_sound, list('sound/talksounds/goon/bottalk_1.ogg', 'sound/talksounds/goon/bottalk_2.ogg', 'sound/talksounds/goon/bottalk_3.ogg', 'sound/talksounds/goon/bottalk_4.wav'))
GLOBAL_LIST_INIT(goon_speak_buwoo_sound, list('sound/talksounds/goon/buwoo.ogg', 'sound/talksounds/goon/buwoo_ask.ogg', 'sound/talksounds/goon/buwoo_exclaim.ogg'))
GLOBAL_LIST_INIT(goon_speak_cow_sound, list('sound/talksounds/goon/cow.ogg', 'sound/talksounds/goon/cow_ask.ogg', 'sound/talksounds/goon/cow_exclaim.ogg'))
GLOBAL_LIST_INIT(goon_speak_lizard_sound, list('sound/talksounds/goon/lizard.ogg', 'sound/talksounds/goon/lizard_ask.ogg', 'sound/talksounds/goon/lizard_exclaim.ogg'))
GLOBAL_LIST_INIT(goon_speak_pug_sound, list('sound/talksounds/goon/pug.ogg', 'sound/talksounds/goon/pug_ask.ogg', 'sound/talksounds/goon/pug_exclaim.ogg'))
GLOBAL_LIST_INIT(goon_speak_pugg_sound, list('sound/talksounds/goon/pugg.ogg', 'sound/talksounds/goon/pugg_ask.ogg', 'sound/talksounds/goon/pugg_exclaim.ogg'))
GLOBAL_LIST_INIT(goon_speak_roach_sound, list('sound/talksounds/goon/roach.ogg', 'sound/talksounds/goon/roach_ask.ogg', 'sound/talksounds/goon/roach_exclaim.ogg'))
GLOBAL_LIST_INIT(goon_speak_skelly_sound, list('sound/talksounds/goon/skelly.ogg', 'sound/talksounds/goon/skelly_ask.ogg', 'sound/talksounds/goon/skelly_exclaim.ogg'))
GLOBAL_LIST_INIT(wf_speak_lure_sound, list ('sound/talksounds/wf/lure_1.ogg', 'sound/talksounds/wf/lure_2.ogg', 'sound/talksounds/wf/lure_3.ogg', 'sound/talksounds/wf/lure_4.ogg', 'sound/talksounds/wf/lure_5.ogg')) GLOBAL_LIST_INIT(wf_speak_lure_sound, list ('sound/talksounds/wf/lure_1.ogg', 'sound/talksounds/wf/lure_2.ogg', 'sound/talksounds/wf/lure_3.ogg', 'sound/talksounds/wf/lure_4.ogg', 'sound/talksounds/wf/lure_5.ogg'))
GLOBAL_LIST_INIT(wf_speak_lyst_sound, list ('sound/talksounds/wf/lyst_1.ogg', 'sound/talksounds/wf/lyst_2.ogg', 'sound/talksounds/wf/lyst_3.ogg', 'sound/talksounds/wf/lyst_4.ogg', 'sound/talksounds/wf/lyst_5.ogg', 'sound/talksounds/wf/lyst_6.ogg')) GLOBAL_LIST_INIT(wf_speak_lyst_sound, list ('sound/talksounds/wf/lyst_1.ogg', 'sound/talksounds/wf/lyst_2.ogg', 'sound/talksounds/wf/lyst_3.ogg', 'sound/talksounds/wf/lyst_4.ogg', 'sound/talksounds/wf/lyst_5.ogg', 'sound/talksounds/wf/lyst_6.ogg'))
GLOBAL_LIST_INIT(wf_speak_void_sound, list ('sound/talksounds/wf/void_1.ogg', 'sound/talksounds/wf/void_2.ogg', 'sound/talksounds/wf/void_3.ogg')) GLOBAL_LIST_INIT(wf_speak_void_sound, list ('sound/talksounds/wf/void_1.ogg', 'sound/talksounds/wf/void_2.ogg', 'sound/talksounds/wf/void_3.ogg'))
GLOBAL_LIST_INIT(wf_speak_vomva_sound, list ('sound/talksounds/wf/vomva_1.ogg', 'sound/talksounds/wf/vomva_2.ogg', 'sound/talksounds/wf/vomva_3.ogg', 'sound/talksounds/wf/vomva_4.ogg')) GLOBAL_LIST_INIT(wf_speak_vomva_sound, list ('sound/talksounds/wf/vomva_1.ogg', 'sound/talksounds/wf/vomva_2.ogg', 'sound/talksounds/wf/vomva_3.ogg', 'sound/talksounds/wf/vomva_4.ogg'))
GLOBAL_LIST_INIT(xeno_speak_sound, list('sound/talksounds/xeno/xenotalk.ogg', 'sound/talksounds/xeno/xenotalk2.ogg', 'sound/talksounds/xeno/xenotalk3.ogg'))
#define canine_sounds list("cough" = null, "sneeze" = null, "scream" = list('sound/voice/scream/canine/wolf_scream.ogg', 'sound/voice/scream/canine/wolf_scream2.ogg', 'sound/voice/scream/canine/wolf_scream3.ogg', 'sound/voice/scream/canine/wolf_scream4.ogg', 'sound/voice/scream/canine/wolf_scream5.ogg', 'sound/voice/scream/canine/wolf_scream6.ogg'), "pain" = list('sound/voice/pain/canine/wolf_pain.ogg', 'sound/voice/pain/canine/wolf_pain2.ogg', 'sound/voice/pain/canine/wolf_pain3.ogg', 'sound/voice/pain/canine/wolf_pain4.ogg'), "gasp" = list('sound/voice/gasp/canine/wolf_gasp.ogg'), "death" = list('sound/voice/death/canine/wolf_death1.ogg', 'sound/voice/death/canine/wolf_death2.ogg', 'sound/voice/death/canine/wolf_death3.ogg', 'sound/voice/death/canine/wolf_death4.ogg', 'sound/voice/death/canine/wolf_death5.ogg')) #define canine_sounds list("cough" = null, "sneeze" = null, "scream" = list('sound/voice/scream/canine/wolf_scream.ogg', 'sound/voice/scream/canine/wolf_scream2.ogg', 'sound/voice/scream/canine/wolf_scream3.ogg', 'sound/voice/scream/canine/wolf_scream4.ogg', 'sound/voice/scream/canine/wolf_scream5.ogg', 'sound/voice/scream/canine/wolf_scream6.ogg'), "pain" = list('sound/voice/pain/canine/wolf_pain.ogg', 'sound/voice/pain/canine/wolf_pain2.ogg', 'sound/voice/pain/canine/wolf_pain3.ogg', 'sound/voice/pain/canine/wolf_pain4.ogg'), "gasp" = list('sound/voice/gasp/canine/wolf_gasp.ogg'), "death" = list('sound/voice/death/canine/wolf_death1.ogg', 'sound/voice/death/canine/wolf_death2.ogg', 'sound/voice/death/canine/wolf_death3.ogg', 'sound/voice/death/canine/wolf_death4.ogg', 'sound/voice/death/canine/wolf_death5.ogg'))
#define feline_sounds list("cough" = null, "sneeze" = null, "scream" = list('sound/voice/scream/feline/feline_scream.ogg'), "pain" = list('sound/voice/pain/feline/feline_pain.ogg'), "gasp" = list('sound/voice/gasp/feline/feline_gasp.ogg'), "death" = list('sound/voice/death/feline/feline_death.ogg')) #define feline_sounds list("cough" = null, "sneeze" = null, "scream" = list('sound/voice/scream/feline/feline_scream.ogg'), "pain" = list('sound/voice/pain/feline/feline_pain.ogg'), "gasp" = list('sound/voice/gasp/feline/feline_gasp.ogg'), "death" = list('sound/voice/death/feline/feline_death.ogg'))

View File

@@ -76,7 +76,7 @@
character.resize(pref.size_multiplier, animate = FALSE, ignore_prefs = TRUE) character.resize(pref.size_multiplier, animate = FALSE, ignore_prefs = TRUE)
if(!pref.voice_sound) if(!pref.voice_sound)
character.voice_sounds_list = GLOB.talk_sound character.voice_sounds_list = DEFAULT_TALK_SOUNDS
else else
character.voice_sounds_list = get_talk_sound(pref.voice_sound) character.voice_sounds_list = get_talk_sound(pref.voice_sound)
character.custom_speech_bubble = pref.custom_speech_bubble character.custom_speech_bubble = pref.custom_speech_bubble
@@ -181,23 +181,7 @@
pref.voice_freq = choice pref.voice_freq = choice
return TOPIC_REFRESH return TOPIC_REFRESH
else if(href_list["voice_sounds_list"]) else if(href_list["voice_sounds_list"])
var/list/possible_voice_types = list( var/choice = tgui_input_list(user, "Which set of sounds would you like to use for your character's speech sounds?", "Voice Sounds", SSsounds.talk_sound_map)
"beep-boop",
"goon speak 1",
"goon speak 2",
"goon speak 3",
"goon speak 4",
"goon speak blub",
"goon speak bottalk",
"goon speak buwoo",
"goon speak cow",
"goon speak lizard",
"goon speak pug",
"goon speak pugg",
"goon speak roach",
"goon speak skelly",
"xeno speak")
var/choice = tgui_input_list(user, "Which set of sounds would you like to use for your character's speech sounds?", "Voice Sounds", possible_voice_types)
if(!pref.voice_sound) if(!pref.voice_sound)
pref.voice_sound = "goon speak 1" pref.voice_sound = "goon speak 1"
else if(!choice) else if(!choice)
@@ -221,38 +205,7 @@
return TOPIC_REFRESH return TOPIC_REFRESH
else if(href_list["voice_test"]) else if(href_list["voice_test"])
var/sound/S var/sound/S = sound(pick(SSsounds.talk_sound_map[pref.voice_sound])) // talk_sound_map returns a list of sounds
switch(pref.voice_sound)
if("beep-boop")
S = sound(pick(GLOB.talk_sound))
if("goon speak 1")
S = sound(pick(GLOB.goon_speak_one_sound))
if("goon speak 2")
S = sound(pick(GLOB.goon_speak_two_sound))
if("goon speak 3")
S = sound(pick(GLOB.goon_speak_three_sound))
if("goon speak 4")
S = sound(pick(GLOB.goon_speak_four_sound))
if("goon speak blub")
S = sound(pick(GLOB.goon_speak_blub_sound))
if("goon speak bottalk")
S = sound(pick(GLOB.goon_speak_bottalk_sound))
if("goon speak buwoo")
S = sound(pick(GLOB.goon_speak_buwoo_sound))
if("goon speak cow")
S = sound(pick(GLOB.goon_speak_cow_sound))
if("goon speak lizard")
S = sound(pick(GLOB.goon_speak_lizard_sound))
if("goon speak pug")
S = sound(pick(GLOB.goon_speak_pug_sound))
if("goon speak pugg")
S = sound(pick(GLOB.goon_speak_pugg_sound))
if("goon speak roach")
S = sound(pick(GLOB.goon_speak_roach_sound))
if("goon speak skelly")
S = sound(pick(GLOB.goon_speak_skelly_sound))
if("xeno speak")
S = sound(pick(GLOB.xeno_speak_sound))
if(S) if(S)
S.frequency = pick(pref.voice_freq) S.frequency = pick(pref.voice_freq)
S.volume = 50 S.volume = 50

View File

@@ -650,7 +650,7 @@ var/list/preferences_datums = list()
character.species.vars[to_edit] = instance.var_changes[to_edit] character.species.vars[to_edit] = instance.var_changes[to_edit]
character.update_transform() character.update_transform()
if(!voice_sound) if(!voice_sound)
character.voice_sounds_list = GLOB.talk_sound character.voice_sounds_list = DEFAULT_TALK_SOUNDS
else else
character.voice_sounds_list = get_talk_sound(voice_sound) character.voice_sounds_list = get_talk_sound(voice_sound)

View File

@@ -185,7 +185,7 @@
var/list/possible_voice_types = get_talk_sound() var/list/possible_voice_types = get_talk_sound()
var/choice = tgui_input_list(src, "Which set of sounds would you like to use for your character's speech sounds?", "Voice Sounds", possible_voice_types) var/choice = tgui_input_list(src, "Which set of sounds would you like to use for your character's speech sounds?", "Voice Sounds", possible_voice_types)
if(!choice) if(!choice)
voice_sounds_list = GLOB.talk_sound voice_sounds_list = DEFAULT_TALK_SOUNDS
voice_sounds_list = get_talk_sound(choice) voice_sounds_list = get_talk_sound(choice)
/mob/living/proc/save_private_notes(mob/user) /mob/living/proc/save_private_notes(mob/user)

View File

@@ -42,7 +42,7 @@
var/prefsound = client.prefs.voice_sound var/prefsound = client.prefs.voice_sound
voice_sounds_list = get_talk_sound(prefsound) voice_sounds_list = get_talk_sound(prefsound)
else else
voice_sounds_list = GLOB.talk_sound voice_sounds_list = DEFAULT_TALK_SOUNDS
resize(size_multiplier, animate = FALSE, uncapped = has_large_resize_bounds(), ignore_prefs = TRUE, aura_animation = FALSE) resize(size_multiplier, animate = FALSE, uncapped = has_large_resize_bounds(), ignore_prefs = TRUE, aura_animation = FALSE)
return . return .