Merge pull request #15677 from deathride58/vocalbark

Vocal barks - Fully customizable noises for talking!
This commit is contained in:
silicons
2022-06-10 22:10:44 -07:00
committed by GitHub
24 changed files with 416 additions and 16 deletions
@@ -24,6 +24,9 @@
var/rando_race = pick(GLOB.roundstart_races)
pref_species = new rando_race()
features = random_features(pref_species?.id, gender)
bark_id = pick(GLOB.bark_random_list)
bark_pitch = BARK_PITCH_RAND(gender)
bark_variance = BARK_VARIANCE_RAND
age = rand(AGE_MIN,AGE_MAX)
/datum/preferences/proc/update_preview_icon(current_tab)
+21 -2
View File
@@ -297,8 +297,9 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
AM.Hear(rendered, src, message_language, message, null, spans, message_mode, source)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_LIVING_SAY_SPECIAL, src, message)
if(client && !eavesdrop_range && say_test(message) == "2") // Yell hook
process_yelling(listening, rendered, src, message_language, message, spans, message_mode, source)
var/is_yell = (say_test(message) == "2")
if(client && !eavesdrop_range && is_yell) // Yell hook
listening |= process_yelling(listening, rendered, src, message_language, message, spans, message_mode, source)
//speech bubble
var/list/speech_bubble_recipients = list()
@@ -309,6 +310,22 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
INVOKE_ASYNC(GLOBAL_PROC, /.proc/flick_overlay, I, speech_bubble_recipients, 30)
//Listening gets trimmed here if a vocal bark's present. If anyone ever makes this proc return listening, make sure to instead initialize a copy of listening in here to avoid wonkiness
if(vocal_bark || vocal_bark_id)
for(var/mob/M in listening)
if(!M.client)
continue
if(!(M.client.prefs.toggles & SOUND_BARK))
listening -= M
var/barks = min(round((LAZYLEN(message) / vocal_speed)) + 1, BARK_MAX_BARKS)
var/total_delay
for(var/i in 1 to barks)
if(total_delay > BARK_MAX_TIME)
break
addtimer(CALLBACK(src, /atom/movable/proc/bark, listening, (message_range * (is_yell ? 4 : 1)), (vocal_volume * (is_yell ? 1.5 : 1)), BARK_DO_VARY(vocal_pitch, vocal_pitch_range)), total_delay)
total_delay += rand(DS2TICKS((vocal_speed / BARK_SPEED_BASELINE) * (is_yell ? 0.5 : 1)), DS2TICKS(vocal_speed / BARK_SPEED_BASELINE) + DS2TICKS((vocal_speed / BARK_SPEED_BASELINE) * (is_yell ? 0.5 : 1))) TICKS
/atom/movable/proc/process_yelling(list/already_heard, rendered, atom/movable/speaker, datum/language/message_language, message, list/spans, message_mode, obj/source)
if(last_yell > (world.time - 10))
to_chat(src, "<span class='warning'>Your voice doesn't project as far as you try to yell in such quick succession.") // yeah no, no spamming an expensive floodfill.
@@ -333,6 +350,8 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
var/atom/movable/AM = _AM
AM.Hear(rendered, speaker, message_language, message, null, spans, message_mode, source)
return overhearing
/mob/proc/binarycheck()
return FALSE
@@ -50,6 +50,9 @@
typing_indicator_state = /obj/effect/overlay/typing_indicator/machine
vocal_bark_id = "synth"
vocal_pitch_range = 0.1
/mob/living/silicon/Initialize(mapload)
. = ..()
GLOB.silicon_mobs += src
@@ -35,6 +35,9 @@
collar_type = "cat"
var/held_icon = "cat2"
footstep_type = FOOTSTEP_MOB_CLAW
vocal_bark_id = "mutedc4"
vocal_pitch = 1.4
vocal_pitch_range = 0.4
/mob/living/simple_animal/pet/cat/Initialize(mapload)
. = ..()
@@ -20,6 +20,9 @@
footstep_type = FOOTSTEP_MOB_CLAW
vocal_bark_id = "bullet"
vocal_speed = 6
/mob/living/simple_animal/pet/dog/ComponentInitialize()
. = ..()
AddElement(/datum/element/wuv, "yaps happily!", EMOTE_AUDIBLE, /datum/mood_event/pet_animal, "growls!", EMOTE_AUDIBLE)
@@ -639,6 +642,8 @@ GLOBAL_LIST_INIT(strippable_corgi_items, create_strippable_list(list(
mob_size = MOB_SIZE_SMALL
collar_type = "puppy"
vocal_pitch = 1.6
//puppies cannot wear anything.
/mob/living/simple_animal/pet/dog/corgi/puppy/Topic(href, href_list)
if(href_list["remove_inv"] || href_list["add_inv"])
@@ -660,6 +665,8 @@ GLOBAL_LIST_INIT(strippable_corgi_items, create_strippable_list(list(
maxbodytemp = T0C + 40
held_icon = "void_puppy"
vocal_pitch = 0.6
/mob/living/simple_animal/pet/dog/corgi/puppy/void/Process_Spacemove(movement_dir = 0)
return 1 //Void puppies can navigate space.
@@ -36,6 +36,7 @@
var/datum/reagent/milk_reagent = /datum/reagent/consumable/milk
footstep_type = FOOTSTEP_MOB_SHOE
vocal_bark_id = "banjoc3"
/mob/living/simple_animal/hostile/retaliate/goat/Initialize(mapload, /datum/reagent/milk_reagent)
udder = new (null, milk_reagent)
@@ -143,6 +144,8 @@
blood_volume = BLOOD_VOLUME_NORMAL
footstep_type = FOOTSTEP_MOB_SHOE
vocal_bark_id = "mutedc2"
vocal_pitch = 1.2
/mob/living/simple_animal/cow/Initialize(mapload)
udder = new(null, milk_reagent)
@@ -247,6 +250,8 @@
gold_core_spawnable = FRIENDLY_SPAWN
footstep_type = FOOTSTEP_MOB_CLAW
vocal_bark_id = "squeak"
vocal_pitch = 1.4
/mob/living/simple_animal/chick/Initialize(mapload)
. = ..()
@@ -309,6 +314,9 @@
var/static/chicken_count = 0
footstep_type = FOOTSTEP_MOB_CLAW
vocal_bark_id = "synthgrunt"
vocal_pitch = 1.4
vocal_pitch_range = 0.4
/mob/living/simple_animal/chicken/Initialize(mapload)
. = ..()
@@ -403,6 +411,8 @@
var/static/kiwi_count = 0
footstep_type = FOOTSTEP_MOB_CLAW
vocal_bark_id = "squeak"
vocal_pitch = 1.4
/mob/living/simple_animal/kiwi/Destroy()
--kiwi_count
@@ -481,6 +491,8 @@
gold_core_spawnable = FRIENDLY_SPAWN
footstep_type = FOOTSTEP_MOB_CLAW
vocal_bark_id = "squeak"
vocal_pitch = 1.4
/mob/living/simple_animal/babyKiwi/Initialize(mapload)
. = ..()
@@ -557,3 +569,4 @@
maxHealth = 75
blood_volume = BLOOD_VOLUME_NORMAL
footstep_type = FOOTSTEP_MOB_SHOE
vocal_bark_id = "mutedc4"
@@ -23,6 +23,11 @@
gold_core_spawnable = FRIENDLY_SPAWN
footstep_type = FOOTSTEP_MOB_CLAW
vocal_bark_id = "bullet"
vocal_speed = 2
vocal_pitch = 1.6
vocal_pitch_range = 0.4
/mob/living/simple_animal/pet/fox/ComponentInitialize()
. = ..()
AddElement(/datum/element/mob_holder, "fox")
@@ -29,6 +29,8 @@
gold_core_spawnable = FRIENDLY_SPAWN
var/chew_probability = 1
faction = list("rat")
vocal_bark_id = "squeak"
vocal_pitch = 1.4
/mob/living/simple_animal/mouse/Initialize(mapload)
. = ..()
@@ -29,6 +29,8 @@
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
pressure_resistance = 200
vocal_bark_id = "squeak"
vocal_pitch_range = 0.4
/mob/living/simple_animal/pet/plushie/ComponentInitialize()
. = ..()