diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index b3dbc46806..c8909fc80d 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -244,6 +244,8 @@ // #define HEARING_SPANS 6 #define HEARING_MESSAGE_MODE 7 // #define HEARING_SOURCE 8 +#define COMSIG_MOVABLE_BARK "movable_bark" //from base of atom/movable/proc/bark(): (list/hearers, distance, volume, pitch) +#define COMSIG_MOVABLE_QUEUE_BARK "movable_queue_bark" //from base of atom/movable/proc/send_speech(): (list/hearers, message, range, atom/movable/source, bubble_type, list/spans, datum/language/message_language, message_mode) #define COMSIG_MOVABLE_DISPOSING "movable_disposing" //called when the movable is added to a disposal holder object for disposal movement: (obj/structure/disposalholder/holder, obj/machinery/disposal/source) #define COMSIG_MOVABLE_TELEPORTED "movable_teleported" //from base of do_teleport(): (channel, turf/origin, turf/destination) #define COMSIG_MOVABLE_CHASM_DROP "movable_chasm_drop" //from base of /datum/component/chasm/drop() (/datum/component/chasm) diff --git a/code/__DEFINES/say.dm b/code/__DEFINES/say.dm index 9debb3a699..9d90e7aa9b 100644 --- a/code/__DEFINES/say.dm +++ b/code/__DEFINES/say.dm @@ -115,6 +115,8 @@ #define BARK_DO_VARY(pitch, variance) (rand(((pitch * 100) - (variance*50)), ((pitch*100) + (variance*50))) / 100) +#define BARK_SOUND_FALLOFF_EXPONENT(distance) (distance/7) //At lower ranges, we want the exponent to be below 1 so that whispers don't sound too awkward. At higher ranges, we want the exponent fairly high to make yelling less obnoxious + // Is something in the IC chat filter? This is config dependent. #define CHAT_FILTER_CHECK(T) (config.ic_filter_regex && findtext(T, config.ic_filter_regex)) diff --git a/code/datums/bark.dm b/code/datums/bark.dm index a7119273c3..2bf3d7c69a 100644 --- a/code/datums/bark.dm +++ b/code/datums/bark.dm @@ -72,8 +72,8 @@ /datum/bark/chitter name = "Chittery" id = "chitter" - minspeed = 6 //This is a pretty long sound - soundpath = 'sound/items/Ratchet.ogg' + minspeed = 4 //Even with the sound being replaced with a unique, shorter sound, this is still a little too long for higher speeds + soundpath = 'sound/voice/barks/chitter.ogg' /datum/bark/synthetic_grunt name = "Synthetic (Grunt)" @@ -91,6 +91,11 @@ maxpitch = 1.6 //This works well with higher pitches! soundpath = 'sound/weapons/bulletflyby.ogg' //This works... Surprisingly well as a bark? It's neat! +/datum/bark/coggers + name = "Brassy" + id = "coggers" + soundpath = 'sound/machines/clockcult/integration_cog_install.ogg' //Yet another unexpectedly good bark sound + // Genetics-only/admin-only sounds. These either clash hard with the audio design of the above sounds, or have some other form of audio design issue, but aren't *too* awful as a sometimes thing. // Rule of fun very much applies to this section. Audio design is extremely important for the above section, but down here? No gods, no masters, pure anarchy. @@ -137,3 +142,9 @@ id = "weh" soundpath = 'modular_citadel/sound/voice/weh.ogg' ignore = TRUE + +/datum/bark/honk + name = "Annoying Honk" + id = "honk" + soundpath = 'sound/creatures/goose1.ogg' + ignore = TRUE diff --git a/code/datums/dna.dm b/code/datums/dna.dm index dd3b8de7fe..5619a09f05 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -138,9 +138,9 @@ L[DNA_SKIN_TONE_BLOCK] = construct_block(GLOB.skin_tones.Find(H.skin_tone), GLOB.skin_tones.len) L[DNA_LEFT_EYE_COLOR_BLOCK] = sanitize_hexcolor(H.left_eye_color) L[DNA_RIGHT_EYE_COLOR_BLOCK] = sanitize_hexcolor(H.right_eye_color) - L[DNA_COLOR_ONE_BLOCK] = sanitize_hexcolor(features["mcolor"], 6) - L[DNA_COLOR_TWO_BLOCK] = sanitize_hexcolor(features["mcolor2"], 6) - L[DNA_COLOR_THREE_BLOCK] = sanitize_hexcolor(features["mcolor3"], 6) + L[DNA_COLOR_ONE_BLOCK] = sanitize_hexcolor(features["mcolor"]) + L[DNA_COLOR_TWO_BLOCK] = sanitize_hexcolor(features["mcolor2"]) + L[DNA_COLOR_THREE_BLOCK] = sanitize_hexcolor(features["mcolor3"]) if(!GLOB.mam_tails_list.len) init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/mam_tails, GLOB.mam_tails_list) L[DNA_MUTANTTAIL_BLOCK] = construct_block(GLOB.mam_tails_list.Find(features["mam_tail"]), GLOB.mam_tails_list.len) @@ -252,11 +252,11 @@ if(DNA_HAIR_STYLE_BLOCK) setblock(uni_identity, blocknumber, construct_block(GLOB.hair_styles_list.Find(H.hair_style), GLOB.hair_styles_list.len)) if(DNA_COLOR_ONE_BLOCK) - setblock(uni_identity, blocknumber, sanitize_hexcolor(features["mcolor"], 6)) + setblock(uni_identity, blocknumber, sanitize_hexcolor(features["mcolor"])) if(DNA_COLOR_TWO_BLOCK) - setblock(uni_identity, blocknumber, sanitize_hexcolor(features["mcolor2"], 6)) + setblock(uni_identity, blocknumber, sanitize_hexcolor(features["mcolor2"])) if(DNA_COLOR_THREE_BLOCK) - setblock(uni_identity, blocknumber, sanitize_hexcolor(features["mcolor3"], 6)) + setblock(uni_identity, blocknumber, sanitize_hexcolor(features["mcolor3"])) if(DNA_MUTANTTAIL_BLOCK) setblock(uni_identity, blocknumber, construct_block(GLOB.mam_tails_list.Find(features["mam_tail"]), GLOB.mam_tails_list.len)) if(DNA_MUTANTEAR_BLOCK) @@ -504,7 +504,7 @@ if(mutations_overlay_update) update_mutations_overlay() set_bark(GLOB.bark_list[deconstruct_block(getblock(structure, DNA_BARK_SOUND_BLOCK), GLOB.bark_list.len)]) - vocal_speed = (deconstruct_block(getblock(structure, DNA_BARK_PITCH_BLOCK), 16) / 4) + vocal_speed = (deconstruct_block(getblock(structure, DNA_BARK_SPEED_BLOCK), 16) / 4) vocal_pitch = (deconstruct_block(getblock(structure, DNA_BARK_PITCH_BLOCK), 48) / 30) vocal_pitch_range = (deconstruct_block(getblock(structure, DNA_BARK_VARIANCE_BLOCK), 48) / 48) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index ca133f882e..bace332ef2 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -72,6 +72,8 @@ var/vocal_volume = 70 //Baseline. This gets modified by yelling and other factors var/vocal_speed = 4 //Lower values are faster, higher values are slower + var/vocal_current_bark //When barks are queued, this gets passed to the bark proc. If vocal_current_bark doesn't match the args passed to the bark proc (if passed at all), then the bark simply doesn't play. Basic curtailing of spam~ + /atom/movable/Initialize(mapload) . = ..() switch(blocks_emissive) @@ -225,6 +227,10 @@ if(NAMEOF(src, glide_size)) set_glide_size(var_value) . = TRUE + if(NAMEOF(src, vocal_bark)) + if(isfile(var_value)) + vocal_bark = sound(var_value) //bark() expects vocal_bark to already be a sound datum, for performance reasons. adminbus QoL! + . = TRUE if(!isnull(.)) datum_flags |= DF_VAR_EDITED diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 1fb2405584..62b2a6da8d 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -106,6 +106,7 @@ Class Procs: vocal_bark_id = "synth" vocal_pitch = 0.6 + vocal_volume = 40 var/stat = 0 var/use_power = IDLE_POWER_USE diff --git a/code/game/say.dm b/code/game/say.dm index 205ddc2f0e..44f020e7c4 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -31,14 +31,18 @@ GLOBAL_LIST_INIT(freqtospan, list( /atom/movable/proc/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source) SEND_SIGNAL(src, COMSIG_MOVABLE_HEAR, args) -/atom/movable/proc/bark(list/hearers, distance, volume, pitch) +/atom/movable/proc/bark(list/hearers, distance, volume, pitch, queue_time) + if(queue_time && vocal_current_bark != queue_time) + return + if(SEND_SIGNAL(src, COMSIG_MOVABLE_BARK, hearers, distance, volume, pitch)) + return //bark interception. this probably counts as some flavor of BDSM if(!vocal_bark) if(!vocal_bark_id || !set_bark(vocal_bark_id)) //just-in-time bark generation return volume = min(volume, 100) var/turf/T = get_turf(src) for(var/mob/M in hearers) - M.playsound_local(T, vol = volume, vary = TRUE, frequency = pitch, max_distance = distance, falloff_distance = distance * 0.75, S = vocal_bark, distance_multiplier = 1) + M.playsound_local(T, vol = volume, vary = TRUE, frequency = pitch, max_distance = distance, falloff_distance = 0, falloff_exponent = BARK_SOUND_FALLOFF_EXPONENT(distance), S = vocal_bark, distance_multiplier = 1) /atom/movable/proc/can_speak() return 1 @@ -49,7 +53,7 @@ GLOBAL_LIST_INIT(freqtospan, list( for(var/_AM in hearers) var/atom/movable/AM = _AM AM.Hear(rendered, src, message_language, message, , spans, message_mode, source) - if(vocal_bark || vocal_bark_id) + if(SEND_SIGNAL(src, COMSIG_MOVABLE_QUEUE_BARK, hearers, args) || vocal_bark || vocal_bark_id) for(var/mob/M in hearers) if(!M.client) continue @@ -57,10 +61,11 @@ GLOBAL_LIST_INIT(freqtospan, list( hearers -= M var/barks = min(round((LAZYLEN(message) / vocal_speed)) + 1, BARK_MAX_BARKS) var/total_delay + vocal_current_bark = world.time //this is juuuuust random enough to reliably be unique every time send_speech() is called, in most scenarios for(var/i in 1 to barks) if(total_delay > BARK_MAX_TIME) break - addtimer(CALLBACK(src, .proc/bark, hearers, range, vocal_volume, BARK_DO_VARY(vocal_pitch, vocal_pitch_range)), total_delay) + addtimer(CALLBACK(src, .proc/bark, hearers, range, vocal_volume, BARK_DO_VARY(vocal_pitch, vocal_pitch_range), vocal_current_bark), total_delay) total_delay += rand(DS2TICKS(vocal_speed / BARK_SPEED_BASELINE), DS2TICKS(vocal_speed / BARK_SPEED_BASELINE) + DS2TICKS(vocal_speed / BARK_SPEED_BASELINE)) TICKS /atom/movable/proc/compose_message(atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, face_name = FALSE, atom/movable/source) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index b90909adf7..02a3e3684e 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -311,7 +311,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( 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) + if(SEND_SIGNAL(src, COMSIG_MOVABLE_QUEUE_BARK, listening, args) || vocal_bark || vocal_bark_id) for(var/mob/M in listening) if(!M.client) continue @@ -319,11 +319,12 @@ GLOBAL_LIST_INIT(department_radio_keys, list( listening -= M var/barks = min(round((LAZYLEN(message) / vocal_speed)) + 1, BARK_MAX_BARKS) var/total_delay + vocal_current_bark = world.time 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 + 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), vocal_current_bark), total_delay) + total_delay += rand(DS2TICKS(vocal_speed / BARK_SPEED_BASELINE), 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) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index c05aba8227..fe1ee35428 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -44,6 +44,10 @@ emote_hear = list("squawks.","bawks!") emote_see = list("flutters its wings.") + vocal_bark_id = "banjoc4" + vocal_pitch = 1.4 + vocal_pitch_range = 0.4 + speak_chance = 1 //1% (1 in 100) chance every tick; So about once per 150 seconds, assuming an average tick is 1.5s turns_per_move = 5 butcher_results = list(/obj/item/reagent_containers/food/snacks/cracker/ = 1) diff --git a/sound/voice/barks/chitter.ogg b/sound/voice/barks/chitter.ogg new file mode 100644 index 0000000000..0d162fa303 Binary files /dev/null and b/sound/voice/barks/chitter.ogg differ