Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions code/__DEFINES/~darkpack/voicepack_emotes.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#define VO_SOUND_PATH "[global.config.directory]/darkpack_config/vo"

#define VOICE_PITCH_MIN 80
#define VOICE_PITCH_MAX 120
#define VOICE_PITCH_DEFAULT 100
#define VOICE_PITCH_VARIATION 8

GLOBAL_LIST_INIT(voicepack_list, list(
"None" = null,
"Masculine (M)" = /datum/voicepack/human/male,
"Normal (M)" = /datum/voicepack/human/male/foppish,
"Stern (M)" = /datum/voicepack/human/male/stern,
"Warrior (M)" = /datum/voicepack/human/male/warrior,
"Knightly (M)" = /datum/voicepack/human/male/knight,
"Dignified (M)" = /datum/voicepack/human/male/elf,
"Bearded (M)" = /datum/voicepack/human/male/dwarf,
"Odd (M)" = /datum/voicepack/human/male/goblin,
"Evil (M)" = /datum/voicepack/human/male/evil,
"Old (M)" = /datum/voicepack/human/male/wizard,
"Stoner (M)" = /datum/voicepack/human/male/jester,
"Deep Voice (M)" = /datum/voicepack/human/male/zeth,
"Feminine (F)" = /datum/voicepack/human/female,
"Noble (F)" = /datum/voicepack/human/female/haughty,
"Noble II (F)" = /datum/voicepack/human/female/warrior,
"Dainty (F)" = /datum/voicepack/human/female/dainty,
"Dignified (F)" = /datum/voicepack/human/female/elf,
"Rough (F)" = /datum/voicepack/human/female/dwarf,
"Odd (F)" = /datum/voicepack/human/female/goblin,
))
16 changes: 10 additions & 6 deletions code/modules/mob/living/carbon/carbon_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,12 @@
to_chat(helper, span_notice("You shake [src] trying to pick [p_them()] up!"))
to_chat(src, span_notice("[helper] shakes you to get you up!"))
else if(check_zone(helper.zone_selected) == BODY_ZONE_HEAD && get_bodypart(BODY_ZONE_HEAD)) //Headpats!
helper.visible_message(span_notice("[helper] gives [src] a pat on the head to make [p_them()] feel better!"), \
// DARKPACK EDIT START - emote sounds port - ORIGINAL: helper.visible_message(span_notice("[helper] gives [src] a pat on the head to make [p_them()] feel better!"))
helper.visible_message(span_notice("[helper] gives [src] a pat on the head."), \
null, span_hear("You hear a soft patter."), DEFAULT_MESSAGE_RANGE, list(helper, src))
to_chat(helper, span_notice("You give [src] a pat on the head to make [p_them()] feel better!"))
to_chat(src, span_notice("[helper] gives you a pat on the head to make you feel better! "))
// DARKPACK EDIT END
to_chat(helper, span_notice("You give [src] a pat on the head.")) // DARKPACK EDIT - emote sounds port - ORIGINAL: to_chat(helper, span_notice("You give [src] a pat on the head to make [p_them()] feel better!"))
to_chat(src, span_notice("[helper] gives you a pat on the head.")) // DARKPACK EDIT - emote sounds port - ORIGINAL: to_chat(src, span_notice("[helper] gives you a pat on the head to make you feel better!"))

share_blood_on_touch(helper, ITEM_SLOT_HEAD|ITEM_SLOT_MASK)
if(HAS_TRAIT(src, TRAIT_BADTOUCH))
Expand Down Expand Up @@ -348,10 +350,12 @@
to_chat(helper, span_notice("You wrap [src] into a tight bear hug!"))
to_chat(src, span_notice("[helper] squeezes you super tightly in a firm bear hug!"))
else
helper.visible_message(span_notice("[helper] hugs [src] to make [p_them()] feel better!"), \
// DARKPACK EDIT START - emote sounds port - ORIGINAL: helper.visible_message(span_notice("[helper] hugs [src] to make [p_them()] feel better!")
helper.visible_message(span_notice("[helper] hugs [src]."), \
null, span_hear("You hear the rustling of clothes."), DEFAULT_MESSAGE_RANGE, list(helper, src))
to_chat(helper, span_notice("You hug [src] to make [p_them()] feel better!"))
to_chat(src, span_notice("[helper] hugs you to make you feel better!"))
// DARKPACK EDIT END
to_chat(helper, span_notice("You hug [src].")) // DARKPACK EDIT - emote sounds port - ORIGINAL: to_chat(helper, span_notice("You hug [src] to make [p_them()] feel better!"))
to_chat(src, span_notice("[helper] hugs you.")) // DARKPACK EDIT - emote sounds port - ORIGINAL: to_chat(src, span_notice("[helper] hugs you to make you feel better!"))

share_blood_on_touch(helper, ITEM_SLOT_HEAD|ITEM_SLOT_MASK|ITEM_SLOT_GLOVES)
// Warm them up with hugs
Expand Down
8 changes: 8 additions & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,10 @@
if(!silent)
to_chat(src, span_notice("You lay down."))
set_lying_down()
// DARKPACK EDIT ADD START - emote sounds port
if(!HAS_TRAIT(source, TRAIT_OBFUSCATED))

Check failure on line 690 in code/modules/mob/living/living.dm

View workflow job for this annotation

GitHub Actions / Run Linters / linters

OD0404: Unknown identifier "_status_traits"

Check warning on line 690 in code/modules/mob/living/living.dm

View workflow job for this annotation

GitHub Actions / Run Linters / linters

field access requires static type: "_status_traits"

Check failure on line 690 in code/modules/mob/living/living.dm

View workflow job for this annotation

GitHub Actions / Run Linters / linters

undefined var: "source"
playsound(src, "[VO_SOUND_PATH]/actions/toggledown.ogg", 50, FALSE)
// DARKPACK EDIT ADD END
else
if(body_position == STANDING_UP)
if(!silent)
Expand All @@ -697,6 +701,10 @@
if(!silent)
to_chat(src, span_notice("You stand up."))
get_up(instant)
// DARKPACK EDIT ADD START - emote sounds port
if(!HAS_TRAIT(source, TRAIT_OBFUSCATED))

Check failure on line 705 in code/modules/mob/living/living.dm

View workflow job for this annotation

GitHub Actions / Run Linters / linters

OD0404: Unknown identifier "_status_traits"

Check warning on line 705 in code/modules/mob/living/living.dm

View workflow job for this annotation

GitHub Actions / Run Linters / linters

field access requires static type: "_status_traits"

Check failure on line 705 in code/modules/mob/living/living.dm

View workflow job for this annotation

GitHub Actions / Run Linters / linters

undefined var: "source"
playsound(src, "[VO_SOUND_PATH]/actions/toggleup.ogg", 50, FALSE)
// DARKPACK EDIT ADD END

SEND_SIGNAL(src, COMSIG_LIVING_RESTING, new_resting, silent, instant)
update_resting()
Expand Down
68 changes: 68 additions & 0 deletions modular_darkpack/master_files/code/datums/emotes.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// hoots and hollers!! emote sounds from azure peak
/datum/emote/proc/tfn_voicepack_sound(mob/living/carbon/human/H, emote_key)
return H.get_voicepack_sound(emote_key)

/datum/emote/get_sound(mob/living/user)
if(ishuman(user))
var/mob/living/carbon/human/H = user
var/sound/S = tfn_voicepack_sound(H, key)
if(S)
return S
return ..()

/datum/emote/living/giggle/get_sound(mob/living/carbon/human/user)
if(istype(user))
var/sound/S = tfn_voicepack_sound(user, "giggle")
if(S)
return S
return ..()

/datum/emote/living/laugh/get_sound(mob/living/carbon/human/user)
if(istype(user))
var/sound/S = tfn_voicepack_sound(user, "laugh")
if(S)
return S
return ..()

/datum/emote/living/scream/get_sound(mob/living/user)
if(ishuman(user))
var/mob/living/carbon/human/H = user
var/sound/S = tfn_voicepack_sound(H, "scream")
if(S)
return S
return ..()

/datum/emote/living/sigh/get_sound(mob/living/carbon/human/user)
if(istype(user))
var/sound/S = tfn_voicepack_sound(user, "sigh")
if(S)
return S
return ..()

/datum/emote/living/sneeze/get_sound(mob/living/carbon/human/user)
if(istype(user))
var/sound/S = tfn_voicepack_sound(user, "sneeze")
if(S)
return S
return ..()

/datum/emote/living/cough/get_sound(mob/living/carbon/human/user)
if(istype(user))
var/sound/S = tfn_voicepack_sound(user, "cough")
if(S)
return S
return ..()

/datum/emote/living/sniff/get_sound(mob/living/carbon/human/user)
if(istype(user))
var/sound/S = tfn_voicepack_sound(user, "sniff")
if(S)
return S
return ..()

/datum/emote/living/snore/get_sound(mob/living/carbon/human/user)
if(istype(user))
var/sound/S = tfn_voicepack_sound(user, "snore")
if(S)
return S
return ..()
84 changes: 84 additions & 0 deletions modular_darkpack/modules/emotes/code/emotes.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/datum/emote/living/hmm
key = "hmm"
key_third_person = "hmms"
message = "hmms."
message_mime = "looks thoughtful."
emote_type = EMOTE_VISIBLE | EMOTE_AUDIBLE

/datum/emote/living/huh
key = "huh"
key_third_person = "sounds confused"
message = "sounds confused."
message_mime = "looks confused."
emote_type = EMOTE_VISIBLE | EMOTE_AUDIBLE

/datum/emote/living/hum
key = "hum"
key_third_person = "hums"
message = "hums quietly."
message_mime = "hums silently."
emote_type = EMOTE_VISIBLE | EMOTE_AUDIBLE

/datum/emote/living/clearthroat
key = "clearthroat"
key_third_person = "clears their throat"
message = "clears their throat."
message_mime = "clears their throat silently."
emote_type = EMOTE_VISIBLE | EMOTE_AUDIBLE

/datum/emote/living/hmph
key = "hmph"
key_third_person = "hmphs"
message = "hmphs."
message_mime = "makes a dismissive gesture."
emote_type = EMOTE_VISIBLE | EMOTE_AUDIBLE

/datum/emote/living/haltyell
key = "haltyell"
key_third_person = "calls out"
message = "calls out!"
message_mime = "gestures forcefully!"
emote_type = EMOTE_VISIBLE | EMOTE_AUDIBLE

/datum/emote/living/shh
key = "shh"
key_third_person = "shushes"
message = "shushes."
message_mime = "makes a shushing motion."
emote_type = EMOTE_VISIBLE | EMOTE_AUDIBLE

/datum/emote/living/pleased
key = "pleased"
key_third_person = "makes a pleased sound"
message = "makes a pleased sound."
message_mime = "looks pleased."
emote_type = EMOTE_VISIBLE | EMOTE_AUDIBLE

/datum/emote/living/warcry
key = "warcry"
key_third_person = "lets out a war cry"
message = "lets out a war cry!"
message_mime = "raises their fists defiantly!"
emote_type = EMOTE_VISIBLE | EMOTE_AUDIBLE

/datum/emote/living/rage
key = "rage"
key_third_person = "lets out a scream in rage"
message = "screams in rage!"
message_mime = "seethes with silent fury!"
emote_type = EMOTE_VISIBLE | EMOTE_AUDIBLE

/datum/emote/living/sob
key = "sob"
key_third_person = "sobs"
message = "sobs."
message_mime = "sobs silently."
emote_type = EMOTE_VISIBLE | EMOTE_AUDIBLE
stat_allowed = SOFT_CRIT

/datum/emote/living/leap
key = "leap"
key_third_person = "leaps"
message = "leaps!"
message_mime = "leaps!"
emote_type = EMOTE_VISIBLE | EMOTE_AUDIBLE
22 changes: 22 additions & 0 deletions modular_darkpack/modules/emotes/code/human_vars.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/mob/living/carbon/human
var/datum/voicepack/voicepack
var/voice_pitch = VOICE_PITCH_DEFAULT

/mob/living/carbon/human/proc/get_voicepack_sound(key)
var/datum/voicepack/voice_pack
if(iscrinos(src) || islupus(src))
voice_pack = new /datum/voicepack/werewolf()
else
voice_pack = voicepack
if(!voice_pack)
return null
var/raw = voice_pack.get_sound(key, src)
if(!raw && istype(voice_pack, /datum/voicepack/human))
var/datum/voicepack/fallback = gender == FEMALE ? new /datum/voicepack/human/female() : new /datum/voicepack/human/male()
raw = fallback.get_sound(key, src)
if(!raw)
return null
var/sound/emote_sound = sound(islist(raw) ? pick(raw) : raw)
var/pitched = clamp(voice_pitch + rand(-VOICE_PITCH_VARIATION, VOICE_PITCH_VARIATION), VOICE_PITCH_MIN, VOICE_PITCH_MAX)
emote_sound.frequency = MIN_EMOTE_PITCH + (pitched - VOICE_PITCH_MIN) * (MAX_EMOTE_PITCH - MIN_EMOTE_PITCH) / (VOICE_PITCH_MAX - VOICE_PITCH_MIN)
return emote_sound
29 changes: 29 additions & 0 deletions modular_darkpack/modules/emotes/code/preferences/middleware.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/datum/preference_middleware/emote_voicepack
COOLDOWN_DECLARE(preview_cooldown)
action_delegations = list(
"preview_voicepack" = PROC_REF(preview_voicepack),
)

/datum/preference_middleware/emote_voicepack/proc/preview_voicepack(list/params, mob/user)
if(!COOLDOWN_FINISHED(src, preview_cooldown))
return TRUE
COOLDOWN_START(src, preview_cooldown, 1 SECONDS)
var/pack_name = preferences.read_preference(/datum/preference/choiced/emote_voicepack)
var/vp_type = GLOB.voicepack_list[pack_name]
if(!vp_type)
return TRUE
var/datum/voicepack/vp = new vp_type()
var/raw
for(var/key in shuffle(list("laugh", "pain", "aggro", "groan", "scream", "hmm", "huh", "painscream")))
raw = vp.get_sound(key)
if(raw)
break
if(!raw)
return TRUE
var/pitch = preferences.read_preference(/datum/preference/numeric/emote_voice_pitch)
var/picked = islist(raw) ? pick(raw) : raw
var/sound/S = sound(picked)
var/t = clamp(pitch + rand(-VOICE_PITCH_VARIATION, VOICE_PITCH_VARIATION), VOICE_PITCH_MIN, VOICE_PITCH_MAX)
S.frequency = MIN_EMOTE_PITCH + (t - VOICE_PITCH_MIN) * (MAX_EMOTE_PITCH - MIN_EMOTE_PITCH) / (VOICE_PITCH_MAX - VOICE_PITCH_MIN)
SEND_SOUND(user, S)
return TRUE
28 changes: 28 additions & 0 deletions modular_darkpack/modules/emotes/code/preferences/voicepack.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/datum/preference/choiced/emote_voicepack
category = PREFERENCE_CATEGORY_VOCALS
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "emote_voicepack"

/datum/preference/choiced/emote_voicepack/init_possible_values()
return assoc_to_keys(GLOB.voicepack_list)

/datum/preference/choiced/emote_voicepack/create_default_value()
return "None"

/datum/preference/choiced/emote_voicepack/apply_to_human(mob/living/carbon/human/target, value)
var/voicepack_type = GLOB.voicepack_list[value]
if(voicepack_type)
target.voicepack = new voicepack_type()

/datum/preference/numeric/emote_voice_pitch
category = PREFERENCE_CATEGORY_VOCALS
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "emote_voice_pitch"
minimum = VOICE_PITCH_MIN
maximum = VOICE_PITCH_MAX

/datum/preference/numeric/emote_voice_pitch/create_default_value()
return VOICE_PITCH_DEFAULT

/datum/preference/numeric/emote_voice_pitch/apply_to_human(mob/living/carbon/human/target, value)
target.voice_pitch = value
29 changes: 29 additions & 0 deletions modular_darkpack/modules/emotes/code/voicepack.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/datum/voicepack

/datum/voicepack/proc/get_sound(key, mob/living/carbon/human/user)
return

/datum/voicepack/human

/datum/voicepack/human/male
/datum/voicepack/human/male/foppish
/datum/voicepack/human/male/stern
/datum/voicepack/human/male/warrior
/datum/voicepack/human/male/knight
/datum/voicepack/human/male/elf
/datum/voicepack/human/male/dwarf
/datum/voicepack/human/male/goblin
/datum/voicepack/human/male/evil
/datum/voicepack/human/male/wizard
/datum/voicepack/human/male/jester
/datum/voicepack/human/male/zeth

/datum/voicepack/human/female
/datum/voicepack/human/female/haughty
/datum/voicepack/human/female/warrior
/datum/voicepack/human/female/dainty
/datum/voicepack/human/female/elf
/datum/voicepack/human/female/dwarf
/datum/voicepack/human/female/goblin

/datum/voicepack/werewolf
34 changes: 34 additions & 0 deletions modular_darkpack/modules/emotes/code/voicepacks/creatures.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/datum/voicepack/werewolf

/datum/voicepack/werewolf/get_sound(key, mob/living/carbon/human/user)
if(user && get_corax_splat(user))
if(iscrinos(user))
if(key == "jump" || key == "leap")
return list("[VO_SOUND_PATH]/mobs/wwolf/jump_1.ogg","[VO_SOUND_PATH]/mobs/wwolf/jump_2.ogg","[VO_SOUND_PATH]/mobs/wwolf/jump_3.ogg")
return 'modular_darkpack/modules/werewolf_the_apocalypse/sounds/emotes/cawcrinos.ogg'
if(islupus(user))
if(key == "jump" || key == "leap")
return 'modular_darkpack/modules/external_organs/sounds/wing_flap_flying.ogg'
return list(
'modular_darkpack/modules/werewolf_the_apocalypse/sounds/emotes/caw.ogg',
'modular_darkpack/modules/emotes/sound/caw.ogg',
'modular_darkpack/modules/emotes/sound/caw2.ogg',
)

var/used
switch(key)
if("aggro", "rage")
used = "[VO_SOUND_PATH]/mobs/wwolf/roar.ogg"
if("deathgurgle")
used = "[VO_SOUND_PATH]/mobs/wwolf/death.ogg"
if("firescream", "agony")
used = "[VO_SOUND_PATH]/mobs/wwolf/painscream.ogg"
if("jump", "leap")
used = list("[VO_SOUND_PATH]/mobs/wwolf/jump_1.ogg","[VO_SOUND_PATH]/mobs/wwolf/jump_2.ogg","[VO_SOUND_PATH]/mobs/wwolf/jump_3.ogg")
if("pain", "paincrit")
used = list("[VO_SOUND_PATH]/mobs/wwolf/pain_1.ogg","[VO_SOUND_PATH]/mobs/wwolf/pain_2.ogg","[VO_SOUND_PATH]/mobs/wwolf/pain_3.ogg")
if("painscream")
used = "[VO_SOUND_PATH]/mobs/wwolf/painscream.ogg"
if("scream", "howl")
used = list("[VO_SOUND_PATH]/mobs/wwolf/howl_1.ogg","[VO_SOUND_PATH]/mobs/wwolf/howl_2.ogg")
return used
Loading
Loading