From b1e88e0a4ccbc65ab6614a88c57db332bf30f695 Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Tue, 17 Mar 2020 00:59:53 -0400 Subject: [PATCH] Makes Most Emotes Age Pitched (#13022) --- code/modules/mob/hear_say.dm | 4 +- code/modules/mob/living/carbon/human/emote.dm | 40 +++++++++---------- code/modules/mob/living/carbon/human/say.dm | 3 +- code/modules/mob/living/say.dm | 8 ++-- .../mob/living/silicon/ai/freelook/eye.dm | 4 +- .../mob/living/simple_animal/parrot.dm | 2 +- .../mob/living/simple_animal/slime/say.dm | 2 +- 7 files changed, 33 insertions(+), 30 deletions(-) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index a91aeed7bdf..3aa580ff28c 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -47,7 +47,7 @@ . = trim(. + trim(msg)) . += "\"" -/mob/proc/hear_say(var/list/message_pieces, var/verb = "says", var/italics = 0, var/mob/speaker = null, var/sound/speech_sound, var/sound_vol) +/mob/proc/hear_say(list/message_pieces, verb = "says", italics = 0, mob/speaker = null, sound/speech_sound, sound_vol, sound_frequency) if(!client) return 0 @@ -104,7 +104,7 @@ to_chat(src, "[speaker_name][speaker.GetAltName()] [track][message]") if(speech_sound && (get_dist(speaker, src) <= world.view && src.z == speaker.z)) var/turf/source = speaker? get_turf(speaker) : get_turf(src) - src.playsound_local(source, speech_sound, sound_vol, 1) + playsound_local(source, speech_sound, sound_vol, 1, sound_frequency) /mob/proc/hear_radio(list/message_pieces, verb = "says", part_a, part_b, mob/speaker = null, hard_to_hear = 0, vname = "", atom/follow_target) diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 51088f66457..1bb1a8cf536 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -141,76 +141,76 @@ if("howl", "howls") var/M = handle_emote_param(param) //Check to see if the param is valid (mob with the param name is in view). message = "[src] howls[M ? " at [M]" : ""]!" - playsound(loc, 'sound/goonstation/voice/howl.ogg', 100, 0, 10) + playsound(loc, 'sound/goonstation/voice/howl.ogg', 100, 1, 10, frequency = get_age_pitch()) m_type = 2 if("growl", "growls") var/M = handle_emote_param(param) message = "[src] growls[M ? " at [M]" : ""]." - playsound(loc, "growls", 80, 0) + playsound(loc, "growls", 80, 1, frequency = get_age_pitch()) m_type = 2 if("ping", "pings") var/M = handle_emote_param(param) message = "[src] pings[M ? " at [M]" : ""]." - playsound(loc, 'sound/machines/ping.ogg', 50, 0) + playsound(loc, 'sound/machines/ping.ogg', 50, 1, frequency = get_age_pitch()) m_type = 2 if("buzz2") var/M = handle_emote_param(param) message = "[src] emits an irritated buzzing sound[M ? " at [M]" : ""]." - playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0) + playsound(loc, 'sound/machines/buzz-two.ogg', 50, 1, frequency = get_age_pitch()) m_type = 2 if("buzz", "buzzes") var/M = handle_emote_param(param) message = "[src] buzzes[M ? " at [M]" : ""]." - playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0) + playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 1, frequency = get_age_pitch()) m_type = 2 if("beep", "beeps") var/M = handle_emote_param(param) message = "[src] beeps[M ? " at [M]" : ""]." - playsound(loc, 'sound/machines/twobeep.ogg', 50, 0) + playsound(loc, 'sound/machines/twobeep.ogg', 50, 1, frequency = get_age_pitch()) m_type = 2 if("drone", "drones", "hum", "hums", "rumble", "rumbles") var/M = handle_emote_param(param) message = "[src] [M ? "drones at [M]" : "rumbles"]." - playsound(loc, 'sound/voice/drasktalk.ogg', 50, 0) + playsound(loc, 'sound/voice/drasktalk.ogg', 50, 1, frequency = get_age_pitch()) m_type = 2 if("squish", "squishes") var/M = handle_emote_param(param) message = "[src] squishes[M ? " at [M]" : ""]." - playsound(loc, 'sound/effects/slime_squish.ogg', 50, 0) //Credit to DrMinky (freesound.org) for the sound. + playsound(loc, 'sound/effects/slime_squish.ogg', 50, 1, frequency = get_age_pitch()) //Credit to DrMinky (freesound.org) for the sound. m_type = 2 if("clack", "clacks") var/M = handle_emote_param(param) message = "[src] clacks [p_their()] mandibles[M ? " at [M]" : ""]." - playsound(loc, 'sound/effects/Kidanclack.ogg', 50, 0) //Credit to DrMinky (freesound.org) for the sound. + playsound(loc, 'sound/effects/Kidanclack.ogg', 50, 1, frequency = get_age_pitch()) //Credit to DrMinky (freesound.org) for the sound. m_type = 2 if("click", "clicks") var/M = handle_emote_param(param) message = "[src] clicks [p_their()] mandibles[M ? " at [M]" : ""]." - playsound(loc, 'sound/effects/Kidanclack2.ogg', 50, 0) //Credit to DrMinky (freesound.org) for the sound. + playsound(loc, 'sound/effects/Kidanclack2.ogg', 50, 1, frequency = get_age_pitch()) //Credit to DrMinky (freesound.org) for the sound. m_type = 2 if("creaks", "creak") var/M = handle_emote_param(param) message = "[src] creaks[M ? " at [M]" : ""]." - playsound(loc, 'sound/voice/dionatalk1.ogg', 50, 0) //Credit https://www.youtube.com/watch?v=ufnvlRjsOTI [0:13 - 0:16] + playsound(loc, 'sound/voice/dionatalk1.ogg', 50, 1, frequency = get_age_pitch()) //Credit https://www.youtube.com/watch?v=ufnvlRjsOTI [0:13 - 0:16] m_type = 2 if("hiss", "hisses") @@ -218,7 +218,7 @@ if(!muzzled) message = "[src] hisses[M ? " at [M]" : ""]." - playsound(loc, 'sound/effects/unathihiss.ogg', 50, 0) //Credit to Jamius (freesound.org) for the sound. + playsound(loc, 'sound/effects/unathihiss.ogg', 50, 1, frequency = get_age_pitch()) //Credit to Jamius (freesound.org) for the sound. m_type = 2 else message = "[src] makes a weak hissing noise." @@ -228,28 +228,28 @@ var/M = handle_emote_param(param) message = "[src] rustles [p_their()] quills[M ? " at [M]" : ""]." - playsound(loc, 'sound/effects/voxrustle.ogg', 50, 0) //Credit to sound-ideas (freesfx.co.uk) for the sound. + playsound(loc, 'sound/effects/voxrustle.ogg', 50, 1, frequency = get_age_pitch()) //Credit to sound-ideas (freesfx.co.uk) for the sound. m_type = 2 if("warble", "warbles") var/M = handle_emote_param(param) message = "[src] warbles[M ? " at [M]" : ""]." - playsound(loc, 'sound/effects/warble.ogg', 50, 0) // Copyright CC BY 3.0 alienistcog (freesound.org) for the sound. + playsound(loc, 'sound/effects/warble.ogg', 50, 1, frequency = get_age_pitch()) // Copyright CC BY 3.0 alienistcog (freesound.org) for the sound. m_type = 2 if("yes") var/M = handle_emote_param(param) message = "[src] emits an affirmative blip[M ? " at [M]" : ""]." - playsound(loc, 'sound/machines/synth_yes.ogg', 50, 0) + playsound(loc, 'sound/machines/synth_yes.ogg', 50, 1, frequency = get_age_pitch()) m_type = 2 if("no") var/M = handle_emote_param(param) message = "[src] emits a negative blip[M ? " at [M]" : ""]." - playsound(loc, 'sound/machines/synth_no.ogg', 50, 0) + playsound(loc, 'sound/machines/synth_no.ogg', 50, 1, frequency = get_age_pitch()) m_type = 2 if("wag", "wags") @@ -465,10 +465,10 @@ m_type = 2 if(gender == FEMALE) if(dna.species.female_cough_sounds) - playsound(src, pick(dna.species.female_cough_sounds), 120) + playsound(src, pick(dna.species.female_cough_sounds), 120, 1, frequency = get_age_pitch()) else if(dna.species.male_cough_sounds) - playsound(src, pick(dna.species.male_cough_sounds), 120) + playsound(src, pick(dna.species.male_cough_sounds), 120, 1, frequency = get_age_pitch()) else message = "[src] makes a strong noise." m_type = 2 @@ -734,9 +734,9 @@ if(!muzzled) message = "[src] sneezes." if(gender == FEMALE) - playsound(src, dna.species.female_sneeze_sound, 70) + playsound(src, dna.species.female_sneeze_sound, 70, 1, frequency = get_age_pitch()) else - playsound(src, dna.species.male_sneeze_sound, 70) + playsound(src, dna.species.male_sneeze_sound, 70, 1, frequency = get_age_pitch()) m_type = 2 else message = "[src] makes a strange noise." diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 220c3b9df84..2aa8950f7ef 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -238,10 +238,11 @@ return /mob/living/carbon/human/handle_speech_sound() - var/list/returns[2] + var/list/returns[3] if(dna.species.speech_sounds && prob(dna.species.speech_chance)) returns[1] = sound(pick(dna.species.speech_sounds)) returns[2] = 50 + returns[3] = get_age_pitch() return returns /mob/living/carbon/human/binarycheck() diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 2abea9b0709..4d149e0f1ea 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -100,9 +100,10 @@ proc/get_radio_key_from_channel(var/channel) return 0 /mob/living/proc/handle_speech_sound() - var/list/returns[2] + var/list/returns[3] returns[1] = null returns[2] = null + returns[3] = null return returns @@ -180,6 +181,7 @@ proc/get_radio_key_from_channel(var/channel) var/list/handle_v = handle_speech_sound() var/sound/speech_sound = handle_v[1] var/sound_vol = handle_v[2] + var/sound_frequency = handle_v[3] var/italics = 0 var/message_range = world.view @@ -249,7 +251,7 @@ proc/get_radio_key_from_channel(var/channel) if(message_range < world.view && (get_dist(T, M) <= world.view)) listening |= M continue - + if(get_turf(M) in hearturfs) listening |= M @@ -257,7 +259,7 @@ proc/get_radio_key_from_channel(var/channel) var/speech_bubble_test = say_test(message) for(var/mob/M in listening) - M.hear_say(message_pieces, verb, italics, src, speech_sound, sound_vol) + M.hear_say(message_pieces, verb, italics, src, speech_sound, sound_vol, sound_frequency) if(M.client) speech_bubble_recipients.Add(M.client) spawn(0) diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index c3c47235b91..78fcf10a80c 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -142,10 +142,10 @@ acceleration = !acceleration to_chat(usr, "Camera acceleration has been toggled [acceleration ? "on" : "off"].") -/mob/camera/aiEye/hear_say(list/message_pieces, var/verb = "says", var/italics = 0, var/mob/speaker = null, var/sound/speech_sound, var/sound_vol) +/mob/camera/aiEye/hear_say(list/message_pieces, verb = "says", italics = 0, mob/speaker = null, sound/speech_sound, sound_vol, sound_frequency) if(relay_speech) if(istype(ai)) ai.relay_speech(speaker, message_pieces, verb) else var/mob/M = ai - M.hear_say(message_pieces, verb, italics, speaker, speech_sound, sound_vol) + M.hear_say(message_pieces, verb, italics, speaker, speech_sound, sound_vol, sound_frequency) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 0cc174827ae..337b7f093a2 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -710,7 +710,7 @@ ears.talk_into(src, message_pieces, message_mode, verb) used_radios += ears -/mob/living/simple_animal/parrot/hear_say(list/message_pieces, var/verb = "says", var/italics = 0, var/mob/speaker = null) +/mob/living/simple_animal/parrot/hear_say(list/message_pieces, verb = "says", italics = 0, mob/speaker = null, sound/speech_sound, sound_vol, sound_frequency) if(speaker != src && prob(50)) parrot_hear(html_decode(multilingual_to_message(message_pieces))) ..() diff --git a/code/modules/mob/living/simple_animal/slime/say.dm b/code/modules/mob/living/simple_animal/slime/say.dm index 01269aab8aa..74241dc676c 100644 --- a/code/modules/mob/living/simple_animal/slime/say.dm +++ b/code/modules/mob/living/simple_animal/slime/say.dm @@ -9,7 +9,7 @@ return verb -/mob/living/simple_animal/slime/hear_say(list/message_pieces, verb = "says", italics = 0, mob/speaker = null, sound/speech_sound, sound_vol) +/mob/living/simple_animal/slime/hear_say(list/message_pieces, verb = "says", italics = 0, mob/speaker = null, sound/speech_sound, sound_vol, sound_frequency) if(speaker != src && !stat) if(speaker in Friends) speech_buffer = list()