diff --git a/code/datums/emotes.dm b/code/datums/emotes.dm index 0e81db43791..e25baf18ea2 100644 --- a/code/datums/emotes.dm +++ b/code/datums/emotes.dm @@ -20,8 +20,13 @@ var/list/mob_type_blacklist_typecache //Types that are NOT allowed to use that emote var/list/mob_type_ignore_stat_typecache var/stat_allowed = CONSCIOUS + var/sound //Sound to play when emote is called + var/vary = FALSE //used for the honk borg emote + var/only_forced_audio = FALSE //can only code call this event instead of the player. + var/static/list/emote_list = list() + /datum/emote/New() if(key_third_person) emote_list[key_third_person] = src @@ -59,6 +64,10 @@ user.log_message(msg, LOG_EMOTE) msg = "[user] " + msg + var/tmp_sound = get_sound(user) + if(tmp_sound && (!only_forced_audio || !intentional)) + playsound(user, tmp_sound, 50, vary) + for(var/mob/M in GLOB.dead_mob_list) if(!M.client || isnewplayer(M)) continue @@ -71,6 +80,9 @@ else user.visible_message(msg) +/datum/emote/proc/get_sound(mob/living/user) + return sound //by default just return this var. + /datum/emote/proc/replace_pronoun(mob/user, message) if(findtext(message, "their")) message = replacetext(message, "their", user.p_their()) @@ -138,13 +150,3 @@ var/mob/living/L = user if(L.has_trait(TRAIT_EMOTEMUTE)) return FALSE - -/datum/emote/sound - var/sound //Sound to play when emote is called - var/vary = FALSE //used for the honk borg emote - mob_type_allowed_typecache = list(/mob/living/brain, /mob/living/silicon) - -/datum/emote/sound/run_emote(mob/user, params) - . = ..() - if(.) - playsound(user.loc, sound, 50, vary) diff --git a/code/modules/mob/living/carbon/alien/emote.dm b/code/modules/mob/living/carbon/alien/emote.dm index 0ab448d2c59..e1b6ab0cc9c 100644 --- a/code/modules/mob/living/carbon/alien/emote.dm +++ b/code/modules/mob/living/carbon/alien/emote.dm @@ -12,10 +12,9 @@ message_alien = "hisses." message_larva = "hisses softly." -/datum/emote/living/alien/hiss/run_emote(mob/user, params) - . = ..() - if(. && isalienadult(user)) - playsound(user.loc, "hiss", 40, 1, 1) +/datum/emote/living/alien/hiss/get_sound(mob/living/user) + if(isalienadult(user)) + return "hiss" /datum/emote/living/alien/roar key = "roar" @@ -23,8 +22,8 @@ message_alien = "roars." message_larva = "softly roars." emote_type = EMOTE_AUDIBLE + vary = TRUE -/datum/emote/living/alien/roar/run_emote(mob/user, params) - . = ..() - if(. && isalienadult(user)) - playsound(user.loc, 'sound/voice/hiss5.ogg', 40, 1, 1) +/datum/emote/living/alien/roar/get_sound(mob/living/user) + if(isalienadult(user)) + return 'sound/voice/hiss5.ogg' diff --git a/code/modules/mob/living/carbon/emote.dm b/code/modules/mob/living/carbon/emote.dm index 71286ef6913..55a42f779d6 100644 --- a/code/modules/mob/living/carbon/emote.dm +++ b/code/modules/mob/living/carbon/emote.dm @@ -22,19 +22,17 @@ muzzle_ignore = TRUE restraint_check = TRUE emote_type = EMOTE_AUDIBLE + vary = TRUE -/datum/emote/living/carbon/clap/run_emote(mob/living/user, params) - . = ..() - if (.) - if (ishuman(user)) - // Need hands to clap - if (!user.get_bodypart(BODY_ZONE_L_ARM) || !user.get_bodypart(BODY_ZONE_R_ARM)) - return - var/clap = pick('sound/misc/clap1.ogg', - 'sound/misc/clap2.ogg', - 'sound/misc/clap3.ogg', - 'sound/misc/clap4.ogg') - playsound(user, clap, 50, 1, -1) +/datum/emote/living/carbon/clap/get_sound(mob/living/user) + if(ishuman(user)) + if(!user.get_bodypart(BODY_ZONE_L_ARM) || !user.get_bodypart(BODY_ZONE_R_ARM)) + return + else + return pick('sound/misc/clap1.ogg', + 'sound/misc/clap2.ogg', + 'sound/misc/clap3.ogg', + 'sound/misc/clap4.ogg') /datum/emote/living/carbon/gnarl key = "gnarl" diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 0db3d827770..083591814a8 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -45,6 +45,31 @@ message = "mumbles!" emote_type = EMOTE_AUDIBLE +/datum/emote/living/carbon/human/scream + key = "scream" + key_third_person = "screams" + message = "screams!" + emote_type = EMOTE_AUDIBLE + only_forced_audio = TRUE + vary = TRUE + +/datum/emote/living/carbon/human/scream/get_sound(mob/living/user) + if(!ishuman(user)) + return + var/mob/living/carbon/human/H = user + if(!H.mind?.miming) + return + if(ishumanbasic(H) || iscatperson(H)) + if(user.gender == FEMALE) + return pick('sound/voice/human/femalescream_1.ogg', 'sound/voice/human/femalescream_2.ogg', 'sound/voice/human/femalescream_3.ogg', 'sound/voice/human/femalescream_4.ogg', 'sound/voice/human/femalescream_5.ogg') + else + if(prob(1)) + return 'sound/voice/human/wilhelm_scream.ogg' + return pick('sound/voice/human/malescream_1.ogg', 'sound/voice/human/malescream_2.ogg', 'sound/voice/human/malescream_3.ogg', 'sound/voice/human/malescream_4.ogg', 'sound/voice/human/malescream_5.ogg') + else if(ismoth(H)) + return 'sound/voice/moth/scream_moth.ogg' + + /datum/emote/living/carbon/human/pale key = "pale" message = "goes pale for a second." diff --git a/code/modules/mob/living/emote.dm b/code/modules/mob/living/emote.dm index 740997fbf27..1f74eed6639 100644 --- a/code/modules/mob/living/emote.dm +++ b/code/modules/mob/living/emote.dm @@ -204,6 +204,7 @@ message = "laughs." message_mime = "laughs silently!" emote_type = EMOTE_AUDIBLE + vary = TRUE /datum/emote/living/laugh/can_run_emote(mob/living/user, status_check = TRUE) . = ..() @@ -211,15 +212,14 @@ var/mob/living/carbon/C = user return !C.silent -/datum/emote/living/laugh/run_emote(mob/user, params) - . = ..() - if(. && ishuman(user)) +/datum/emote/living/laugh/get_sound(mob/living/user) + if(ishuman(user)) var/mob/living/carbon/human/H = user if(H.dna.species.id == "human" && (!H.mind || !H.mind.miming)) if(user.gender == FEMALE) - playsound(H, 'sound/voice/human/womanlaugh.ogg', 50, 1) + return 'sound/voice/human/womanlaugh.ogg' else - playsound(H, pick('sound/voice/human/manlaugh1.ogg', 'sound/voice/human/manlaugh2.ogg'), 50, 1) + return pick('sound/voice/human/manlaugh1.ogg', 'sound/voice/human/manlaugh2.ogg') /datum/emote/living/look key = "look" @@ -475,12 +475,13 @@ to_chat(user, message) -/datum/emote/sound/beep +/datum/emote/beep key = "beep" key_third_person = "beeps" message = "beeps." message_param = "beeps at %t." sound = 'sound/machines/twobeep.ogg' + mob_type_allowed_typecache = list(/mob/living/brain, /mob/living/silicon) /datum/emote/living/circle key = "circle" diff --git a/code/modules/mob/living/silicon/robot/emote.dm b/code/modules/mob/living/silicon/robot/emote.dm index 7cb92b06bf2..8b5e7823297 100644 --- a/code/modules/mob/living/silicon/robot/emote.dm +++ b/code/modules/mob/living/silicon/robot/emote.dm @@ -2,7 +2,7 @@ mob_type_allowed_typecache = list(/mob/living/silicon) emote_type = EMOTE_AUDIBLE -/datum/emote/sound/silicon +/datum/emote/silicon mob_type_allowed_typecache = list(/mob/living/silicon) emote_type = EMOTE_AUDIBLE @@ -11,50 +11,50 @@ key_third_person = "boops" message = "boops." -/datum/emote/sound/silicon/buzz +/datum/emote/silicon/buzz key = "buzz" key_third_person = "buzzes" message = "buzzes." message_param = "buzzes at %t." sound = 'sound/machines/buzz-sigh.ogg' -/datum/emote/sound/silicon/buzz2 +/datum/emote/silicon/buzz2 key = "buzz2" message = "buzzes twice." sound = 'sound/machines/buzz-two.ogg' -/datum/emote/sound/silicon/chime +/datum/emote/silicon/chime key = "chime" key_third_person = "chimes" message = "chimes." sound = 'sound/machines/chime.ogg' -/datum/emote/sound/silicon/honk +/datum/emote/silicon/honk key = "honk" key_third_person = "honks" message = "honks." vary = TRUE sound = 'sound/items/bikehorn.ogg' -/datum/emote/sound/silicon/ping +/datum/emote/silicon/ping key = "ping" key_third_person = "pings" message = "pings." message_param = "pings at %t." sound = 'sound/machines/ping.ogg' -/datum/emote/sound/silicon/chime +/datum/emote/silicon/chime key = "chime" key_third_person = "chimes" message = "chimes." sound = 'sound/machines/chime.ogg' -/datum/emote/sound/silicon/sad +/datum/emote/silicon/sad key = "sad" message = "plays a sad trombone..." sound = 'sound/misc/sadtrombone.ogg' -/datum/emote/sound/silicon/warn +/datum/emote/silicon/warn key = "warn" message = "blares an alarm!" sound = 'sound/machines/warning-buzzer.ogg' diff --git a/code/modules/mob/living/simple_animal/hostile/gorilla/emotes.dm b/code/modules/mob/living/simple_animal/hostile/gorilla/emotes.dm index 100db06174a..d64406a6149 100644 --- a/code/modules/mob/living/simple_animal/hostile/gorilla/emotes.dm +++ b/code/modules/mob/living/simple_animal/hostile/gorilla/emotes.dm @@ -1,8 +1,8 @@ -/datum/emote/sound/gorilla +/datum/emote/gorilla mob_type_allowed_typecache = /mob/living/simple_animal/hostile/gorilla mob_type_blacklist_typecache = list() -/datum/emote/sound/gorilla/ooga +/datum/emote/gorilla/ooga key = "ooga" key_third_person = "oogas" message = "oogas." diff --git a/sound/voice/human/femalescream_1.ogg b/sound/voice/human/femalescream_1.ogg new file mode 100644 index 00000000000..8e8b5b0e79f Binary files /dev/null and b/sound/voice/human/femalescream_1.ogg differ diff --git a/sound/voice/human/femalescream_2.ogg b/sound/voice/human/femalescream_2.ogg new file mode 100644 index 00000000000..cf7ec9a8101 Binary files /dev/null and b/sound/voice/human/femalescream_2.ogg differ diff --git a/sound/voice/human/femalescream_3.ogg b/sound/voice/human/femalescream_3.ogg new file mode 100644 index 00000000000..910532fabe6 Binary files /dev/null and b/sound/voice/human/femalescream_3.ogg differ diff --git a/sound/voice/human/femalescream_4.ogg b/sound/voice/human/femalescream_4.ogg new file mode 100644 index 00000000000..5abdcb33b2f Binary files /dev/null and b/sound/voice/human/femalescream_4.ogg differ diff --git a/sound/voice/human/femalescream_5.ogg b/sound/voice/human/femalescream_5.ogg new file mode 100644 index 00000000000..8f97929b0a3 Binary files /dev/null and b/sound/voice/human/femalescream_5.ogg differ diff --git a/sound/voice/human/malescream_1.ogg b/sound/voice/human/malescream_1.ogg new file mode 100644 index 00000000000..2484932423e Binary files /dev/null and b/sound/voice/human/malescream_1.ogg differ diff --git a/sound/voice/human/malescream_2.ogg b/sound/voice/human/malescream_2.ogg new file mode 100644 index 00000000000..ab510b19ffb Binary files /dev/null and b/sound/voice/human/malescream_2.ogg differ diff --git a/sound/voice/human/malescream_3.ogg b/sound/voice/human/malescream_3.ogg new file mode 100644 index 00000000000..89ddf483598 Binary files /dev/null and b/sound/voice/human/malescream_3.ogg differ diff --git a/sound/voice/human/malescream_4.ogg b/sound/voice/human/malescream_4.ogg new file mode 100644 index 00000000000..39f722f51cf Binary files /dev/null and b/sound/voice/human/malescream_4.ogg differ diff --git a/sound/voice/human/malescream_5.ogg b/sound/voice/human/malescream_5.ogg new file mode 100644 index 00000000000..68d0d78f971 Binary files /dev/null and b/sound/voice/human/malescream_5.ogg differ diff --git a/sound/voice/human/wilhelm_scream.ogg b/sound/voice/human/wilhelm_scream.ogg new file mode 100644 index 00000000000..e110c8bda6f Binary files /dev/null and b/sound/voice/human/wilhelm_scream.ogg differ diff --git a/sound/voice/moth/scream_moth.ogg b/sound/voice/moth/scream_moth.ogg new file mode 100644 index 00000000000..c94644fc17b Binary files /dev/null and b/sound/voice/moth/scream_moth.ogg differ