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
+139
View File
@@ -0,0 +1,139 @@
//Datums for barks and bark accessories
/datum/bark
var/name = "Default"
var/id = "Default"
var/soundpath //Path for the actual sound file used for the bark
// Pitch vars. The actual range for a bark is [(pitch - (maxvariance*0.5)) to (pitch + (maxvariance*0.5))]
// Make absolutely sure to take variance into account when curating a sound for bark purposes.
var/minpitch = BARK_DEFAULT_MINPITCH
var/maxpitch = BARK_DEFAULT_MAXPITCH
var/minvariance = BARK_DEFAULT_MINVARY
var/maxvariance = BARK_DEFAULT_MAXVARY
// Speed vars. Speed determines the number of characters required for each bark, with lower speeds being faster with higher bark density
var/minspeed = BARK_DEFAULT_MINSPEED
var/maxspeed = BARK_DEFAULT_MAXSPEED
// Visibility vars. Regardless of what's set below, these can still be obtained via adminbus and genetics. Rule of fun.
var/list/ckeys_allowed
var/ignore = FALSE //Controls whether or not this can be chosen in chargen
var/allow_random = FALSE //Allows chargen randomization to use this. This is mainly to restrict the pool to sounds that fit well for most characters
// So the basic jist of the sound design here: We make use primarily of shorter instrument samples for barks. We would've went with animalese instead, but doing so would've involved quite a bit of overhead to saycode.
// Short instrument samples tend to sound surprisingly nice for barks, being able to be played in rapid succession without being outright obnoxious.
// It isn't just instruments that work well here, however. Anything that works well as a stab? Short attack, no sustain, a decent amount of release? Also works extremely well for barks.
/datum/bark/mutedc2
name = "Muted String (Low)"
id = "mutedc2"
soundpath = 'sound/instruments/synthesis_samples/guitar/crisis_muted/C2.ogg'
allow_random = TRUE
/datum/bark/mutedc3
name = "Muted String (Medium)"
id = "mutedc3"
soundpath = 'sound/instruments/synthesis_samples/guitar/crisis_muted/C3.ogg'
allow_random = TRUE
/datum/bark/mutedc4
name = "Muted String (High)"
id = "mutedc4"
soundpath = 'sound/instruments/synthesis_samples/guitar/crisis_muted/C4.ogg'
allow_random = TRUE
/datum/bark/banjoc3
name = "Banjo (Medium)"
id = "banjoc3"
soundpath = 'sound/instruments/banjo/Cn3.ogg'
allow_random = TRUE
/datum/bark/banjoc4
name = "Banjo (High)"
id = "banjoc4"
soundpath = 'sound/instruments/banjo/Cn4.ogg'
allow_random = TRUE
/datum/bark/squeaky
name = "Squeaky"
id = "squeak"
soundpath = 'sound/items/toysqueak1.ogg'
maxspeed = 4
/datum/bark/beep
name = "Beepy"
id = "beep"
soundpath = 'sound/machines/terminal_select.ogg'
maxpitch = 1 //Bringing the pitch higher just hurts your ears :<
maxspeed = 4 //This soundbyte's too short for larger speeds to not sound awkward
/datum/bark/chitter
name = "Chittery"
id = "chitter"
minspeed = 6 //This is a pretty long sound
soundpath = 'sound/items/Ratchet.ogg'
/datum/bark/synthetic_grunt
name = "Synthetic (Grunt)"
id = "synthgrunt"
soundpath = 'sound/misc/bloop.ogg'
/datum/bark/synthetic
name = "Synthetic (Normal)"
id = "synth"
soundpath = 'sound/machines/uplinkerror.ogg'
/datum/bark/bullet
name = "Windy"
id = "bullet"
maxpitch = 1.6 //This works well with higher pitches!
soundpath = 'sound/weapons/bulletflyby.ogg' //This works... Surprisingly well as a bark? It's neat!
// 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.
// The min/max variables simply don't apply to these, as only chargen cares about them. As such, there's no need to define those.
/datum/bark/bikehorn
name = "Bikehorn"
id = "horn"
soundpath = 'sound/instruments/bikehorn/Cn4.ogg'
ignore = TRUE // This is an unusually quiet sound.
/datum/bark/bwoink
name = "Bwoink"
id = "bwoink"
soundpath = 'sound/effects/adminhelp.ogg'
ignore = TRUE // Emergent heart attack generation
/datum/bark/merp
name = "Merp"
id = "merp"
soundpath = 'modular_citadel/sound/voice/merp.ogg'
ignore = TRUE
/datum/bark/bark
name = "Bark"
id = "bark"
soundpath = 'modular_citadel/sound/voice/bark1.ogg'
ignore = TRUE
/datum/bark/nya
name = "Nya"
id = "nya"
soundpath = 'modular_citadel/sound/voice/nya.ogg'
ignore = TRUE
/datum/bark/moff
name = "Moff"
id = "moff"
soundpath = 'modular_citadel/sound/voice/mothsqueak.ogg'
ignore = TRUE
/datum/bark/weh
name = "Weh"
id = "weh"
soundpath = 'modular_citadel/sound/voice/weh.ogg'
ignore = TRUE
+23 -7
View File
@@ -153,6 +153,10 @@
if(!GLOB.taur_list.len)
init_sprite_accessory_subtypes(/datum/sprite_accessory/taur, GLOB.taur_list)
L[DNA_TAUR_BLOCK] = construct_block(GLOB.taur_list.Find(features["taur"]), GLOB.taur_list.len)
L[DNA_BARK_SOUND_BLOCK] = construct_block(GLOB.bark_list.Find(H.vocal_bark_id), GLOB.bark_list.len)
L[DNA_BARK_SPEED_BLOCK] = construct_block(H.vocal_speed * 4, 16)
L[DNA_BARK_PITCH_BLOCK] = construct_block(H.vocal_pitch * 30, 48)
L[DNA_BARK_VARIANCE_BLOCK] = construct_block(H.vocal_pitch_range * 48, 48)
for(var/i=1, i<=DNA_UNI_IDENTITY_BLOCKS, i++)
if(L[i])
@@ -248,19 +252,19 @@
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)
sanitize_hexcolor(features["mcolor"], 6)
setblock(uni_identity, blocknumber, sanitize_hexcolor(features["mcolor"], 6))
if(DNA_COLOR_TWO_BLOCK)
sanitize_hexcolor(features["mcolor2"], 6)
setblock(uni_identity, blocknumber, sanitize_hexcolor(features["mcolor2"], 6))
if(DNA_COLOR_THREE_BLOCK)
sanitize_hexcolor(features["mcolor3"], 6)
setblock(uni_identity, blocknumber, sanitize_hexcolor(features["mcolor3"], 6))
if(DNA_MUTANTTAIL_BLOCK)
construct_block(GLOB.mam_tails_list.Find(features["mam_tail"]), GLOB.mam_tails_list.len)
setblock(uni_identity, blocknumber, construct_block(GLOB.mam_tails_list.Find(features["mam_tail"]), GLOB.mam_tails_list.len))
if(DNA_MUTANTEAR_BLOCK)
construct_block(GLOB.mam_ears_list.Find(features["mam_ears"]), GLOB.mam_ears_list.len)
setblock(uni_identity, blocknumber, construct_block(GLOB.mam_ears_list.Find(features["mam_ears"]), GLOB.mam_ears_list.len))
if(DNA_MUTANTMARKING_BLOCK)
construct_block(GLOB.mam_body_markings_list.Find(features["mam_body_markings"]), GLOB.mam_body_markings_list.len)
setblock(uni_identity, blocknumber, construct_block(GLOB.mam_body_markings_list.Find(features["mam_body_markings"]), GLOB.mam_body_markings_list.len))
if(DNA_TAUR_BLOCK)
construct_block(GLOB.taur_list.Find(features["taur"]), GLOB.taur_list.len)
setblock(uni_identity, blocknumber, construct_block(GLOB.taur_list.Find(features["taur"]), GLOB.taur_list.len))
if(species.mutant_bodyparts["taur"] && ishuman(holder))
var/datum/sprite_accessory/taur/T = GLOB.taur_list[features["taur"]]
switch(T?.taur_mode)
@@ -272,6 +276,14 @@
H.physiology.footstep_type = FOOTSTEP_MOB_CRAWL
else
H.physiology.footstep_type = null
if(DNA_BARK_SOUND_BLOCK)
setblock(uni_identity, blocknumber, construct_block(GLOB.bark_list.Find(H.vocal_bark_id), GLOB.bark_list.len))
if(DNA_BARK_SPEED_BLOCK)
setblock(uni_identity, blocknumber, construct_block(H.vocal_speed * 4, 16))
if(DNA_BARK_PITCH_BLOCK)
setblock(uni_identity, blocknumber, construct_block(H.vocal_pitch * 30, 48))
if(DNA_BARK_VARIANCE_BLOCK)
setblock(uni_identity, blocknumber, construct_block(H.vocal_pitch_range * 48, 48))
//Please use add_mutation or activate_mutation instead
/datum/dna/proc/force_give(datum/mutation/human/HM)
@@ -491,6 +503,10 @@
update_body_parts()
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_pitch = (deconstruct_block(getblock(structure, DNA_BARK_PITCH_BLOCK), 48) / 30)
vocal_pitch_range = (deconstruct_block(getblock(structure, DNA_BARK_VARIANCE_BLOCK), 48) / 48)
/mob/proc/domutcheck()