From b49c6519ee63c3c898b32c8640bbb82d7470debc Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 5 Nov 2021 22:43:04 +0000 Subject: [PATCH] [MIRROR] Makes the scream emote sound use a species proc rather than being a long list [MDB IGNORE] (#9241) * Makes the scream emote sound use a species proc rather than being a long list * Fixing conflicts Co-authored-by: SgtHunk <68669754+SgtHunk@users.noreply.github.com> Co-authored-by: GoldenAlpharex --- code/modules/mob/living/carbon/human/emote.dm | 26 +++---------------- .../mob/living/carbon/human/species.dm | 4 +++ .../carbon/human/species_types/ethereal.dm | 5 ++++ .../carbon/human/species_types/humans.dm | 16 ++++++++++++ .../human/species_types/lizardpeople.dm | 5 ++++ .../carbon/human/species_types/monkeys.dm | 9 +++++++ .../carbon/human/species_types/mothmen.dm | 3 +++ 7 files changed, 45 insertions(+), 23 deletions(-) diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 9457da8d437..e27d8d82129 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -58,30 +58,10 @@ /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) + var/mob/living/carbon/human/human = user + if(human.mind?.miming) return - if(ishumanbasic(H) || isfelinid(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', 'sound/voice/human/malescream_6.ogg') - else if(ismoth(H)) - return 'sound/voice/moth/scream_moth.ogg' - else if(islizard(H)) - return pick('sound/voice/lizard/lizard_scream_1.ogg', 'sound/voice/lizard/lizard_scream_2.ogg', 'sound/voice/lizard/lizard_scream_3.ogg') - else if(isethereal(H)) - return pick('sound/voice/ethereal/ethereal_scream_1.ogg', 'sound/voice/ethereal/ethereal_scream_2.ogg', 'sound/voice/ethereal/ethereal_scream_3.ogg') - else if(ismonkey(user)) //If its a monkey, override it. - return pick('sound/creatures/monkey/monkey_screech_1.ogg', - 'sound/creatures/monkey/monkey_screech_2.ogg', - 'sound/creatures/monkey/monkey_screech_3.ogg', - 'sound/creatures/monkey/monkey_screech_4.ogg', - 'sound/creatures/monkey/monkey_screech_5.ogg', - 'sound/creatures/monkey/monkey_screech_6.ogg', - 'sound/creatures/monkey/monkey_screech_7.ogg') + return human.dna.species.get_scream_sound(human) */ /datum/emote/living/carbon/human/scream/screech //If a human tries to screech it'll just scream. diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 3e09cc65ca3..9e259612ea9 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -2237,3 +2237,7 @@ GLOBAL_LIST_EMPTY(features_by_species) /// This should create a CONSISTENT result, so the icons don't randomly change. /datum/species/proc/prepare_human_for_preview(mob/living/carbon/human/human) return + +/// Returns the species's scream sound. +/datum/species/proc/get_scream_sound(mob/living/carbon/human/human) + return diff --git a/code/modules/mob/living/carbon/human/species_types/ethereal.dm b/code/modules/mob/living/carbon/human/species_types/ethereal.dm index 204a78ea284..bed538f2590 100644 --- a/code/modules/mob/living/carbon/human/species_types/ethereal.dm +++ b/code/modules/mob/living/carbon/human/species_types/ethereal.dm @@ -147,3 +147,8 @@ features += "feature_ethcolor" return features + +/datum/species/ethereal/get_scream_sound(mob/living/carbon/human/ethereal) + return pick('sound/voice/ethereal/ethereal_scream_1.ogg', + 'sound/voice/ethereal/ethereal_scream_2.ogg', + 'sound/voice/ethereal/ethereal_scream_3.ogg') diff --git a/code/modules/mob/living/carbon/human/species_types/humans.dm b/code/modules/mob/living/carbon/human/species_types/humans.dm index a90a1dcb32b..b928876b780 100644 --- a/code/modules/mob/living/carbon/human/species_types/humans.dm +++ b/code/modules/mob/living/carbon/human/species_types/humans.dm @@ -20,3 +20,19 @@ human.hairstyle = "Business Hair" human.hair_color = "#bb9966" // brown human.update_hair() + +/datum/species/human/get_scream_sound(mob/living/carbon/human/human) + if(human.gender == MALE) + 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', + 'sound/voice/human/malescream_6.ogg') + 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') diff --git a/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm b/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm index d98273555ba..7a98b3b3269 100644 --- a/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm @@ -123,6 +123,11 @@ */ //SKYRAT EDIT REMOVAL END +/datum/species/lizard/get_scream_sound(mob/living/carbon/human/lizard) + return pick('sound/voice/lizard/lizard_scream_1.ogg', + 'sound/voice/lizard/lizard_scream_2.ogg', + 'sound/voice/lizard/lizard_scream_3.ogg') + /* Lizard subspecies: ASHWALKERS */ diff --git a/code/modules/mob/living/carbon/human/species_types/monkeys.dm b/code/modules/mob/living/carbon/human/species_types/monkeys.dm index b16936896fb..3ba43179497 100644 --- a/code/modules/mob/living/carbon/human/species_types/monkeys.dm +++ b/code/modules/mob/living/carbon/human/species_types/monkeys.dm @@ -104,3 +104,12 @@ if(SSevents.holidays && SSevents.holidays[MONKEYDAY]) return TRUE return ..() + +/datum/species/monkey/get_scream_sound(mob/living/carbon/human/monkey) + return pick('sound/creatures/monkey/monkey_screech_1.ogg', + 'sound/creatures/monkey/monkey_screech_2.ogg', + 'sound/creatures/monkey/monkey_screech_3.ogg', + 'sound/creatures/monkey/monkey_screech_4.ogg', + 'sound/creatures/monkey/monkey_screech_5.ogg', + 'sound/creatures/monkey/monkey_screech_6.ogg', + 'sound/creatures/monkey/monkey_screech_7.ogg') diff --git a/code/modules/mob/living/carbon/human/species_types/mothmen.dm b/code/modules/mob/living/carbon/human/species_types/mothmen.dm index b0a7e89885a..1b39e832edc 100644 --- a/code/modules/mob/living/carbon/human/species_types/mothmen.dm +++ b/code/modules/mob/living/carbon/human/species_types/mothmen.dm @@ -67,3 +67,6 @@ human_mob.update_body() */ //SKYRAT EDIT REMOVAL END + +/datum/species/moth/get_scream_sound(mob/living/carbon/human/human) + return 'sound/voice/moth/scream_moth.ogg'