From 19d6a19b4a6fa35969f5d5b1544d9afe6c29490b Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Thu, 24 Oct 2019 18:48:33 -0700 Subject: [PATCH] Merge pull request #9548 from Ghommie/Ghommie-cit251 Fixing radio emotes conflict with drunk memes. --- code/modules/mob/living/carbon/human/say.dm | 232 ++++++++++---------- code/modules/mob/living/say.dm | 20 +- code/modules/mob/mob_helpers.dm | 2 +- 3 files changed, 126 insertions(+), 128 deletions(-) diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 8e12ac97..c54f4101 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -1,116 +1,116 @@ -/mob/living/carbon/human/say_mod(input, message_mode) - verb_say = dna.species.say_mod - . = ..() - if(message_mode != MODE_CUSTOM_SAY && message_mode != MODE_WHISPER_CRIT) - switch(slurring) - if(10 to 25) - return "jumbles" - if(25 to 50) - return "slurs" - if(50 to INFINITY) - return "garbles" - -/mob/living/carbon/human/GetVoice() - if(istype(wear_mask, /obj/item/clothing/mask/chameleon)) - var/obj/item/clothing/mask/chameleon/V = wear_mask - if(V.vchange && wear_id) - var/obj/item/card/id/idcard = wear_id.GetID() - if(istype(idcard)) - return idcard.registered_name - else - return real_name - else - return real_name - if(mind) - var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) - if(changeling && changeling.mimicing ) - return changeling.mimicing - if(GetSpecialVoice()) - return GetSpecialVoice() - return real_name - -/mob/living/carbon/human/IsVocal() - // how do species that don't breathe talk? magic, that's what. - if(!HAS_TRAIT_FROM(src, TRAIT_NOBREATH, SPECIES_TRAIT) && !getorganslot(ORGAN_SLOT_LUNGS)) - return FALSE - if(mind) - return !mind.miming - return TRUE - -/mob/living/carbon/human/proc/SetSpecialVoice(new_voice) - if(new_voice) - special_voice = new_voice - return - -/mob/living/carbon/human/proc/UnsetSpecialVoice() - special_voice = "" - return - -/mob/living/carbon/human/proc/GetSpecialVoice() - return special_voice - -/mob/living/carbon/human/binarycheck() - if(ears) - var/obj/item/radio/headset/dongle = ears - if(!istype(dongle)) - return FALSE - if(dongle.translate_binary) - return TRUE - -/mob/living/carbon/human/radio(message, message_mode, list/spans, language) - . = ..() - if(.) - return - - switch(message_mode) - if(MODE_HEADSET) - if (ears) - ears.talk_into(src, message, , spans, language) - return ITALICS | REDUCE_RANGE - - if(MODE_DEPARTMENT) - if (ears) - ears.talk_into(src, message, message_mode, spans, language) - return ITALICS | REDUCE_RANGE - - if(message_mode in GLOB.radiochannels) - if(ears) - ears.talk_into(src, message, message_mode, spans, language) - return ITALICS | REDUCE_RANGE - - return 0 - -/mob/living/carbon/human/get_alt_name() - if(name != GetVoice()) - return " (as [get_id_name("Unknown")])" - -/mob/living/carbon/human/proc/forcesay(list/append) //this proc is at the bottom of the file because quote fuckery makes notepad++ cri - if(stat == CONSCIOUS) - if(client) - var/virgin = 1 //has the text been modified yet? - var/temp = winget(client, "input", "text") - if(findtextEx(temp, "Say \"", 1, 7) && length(temp) > 5) //"case sensitive means - - temp = replacetext(temp, ";", "") //general radio - - if(findtext(trim_left(temp), ":", 6, 7)) //dept radio - temp = copytext(trim_left(temp), 8) - virgin = 0 - - if(virgin) - temp = copytext(trim_left(temp), 6) //normal speech - virgin = 0 - - while(findtext(trim_left(temp), ":", 1, 2)) //dept radio again (necessary) - temp = copytext(trim_left(temp), 3) - - if(findtext(temp, "*", 1, 2)) //emotes - return - - var/trimmed = trim_left(temp) - if(length(trimmed)) - if(append) - temp += pick(append) - - say(temp) - winset(client, "input", "text=[null]") +/mob/living/carbon/human/say_mod(input, message_mode) + verb_say = dna.species.say_mod + . = ..() + if(message_mode != MODE_CUSTOM_SAY && message_mode != MODE_WHISPER_CRIT) + switch(slurring) + if(10 to 25) + return "jumbles" + if(25 to 50) + return "slurs" + if(50 to INFINITY) + return "garbles" + +/mob/living/carbon/human/GetVoice() + if(istype(wear_mask, /obj/item/clothing/mask/chameleon)) + var/obj/item/clothing/mask/chameleon/V = wear_mask + if(V.vchange && wear_id) + var/obj/item/card/id/idcard = wear_id.GetID() + if(istype(idcard)) + return idcard.registered_name + else + return real_name + else + return real_name + if(mind) + var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) + if(changeling && changeling.mimicing ) + return changeling.mimicing + if(GetSpecialVoice()) + return GetSpecialVoice() + return real_name + +/mob/living/carbon/human/IsVocal() + // how do species that don't breathe talk? magic, that's what. + if(!HAS_TRAIT_FROM(src, TRAIT_NOBREATH, SPECIES_TRAIT) && !getorganslot(ORGAN_SLOT_LUNGS)) + return FALSE + if(mind) + return !mind.miming + return TRUE + +/mob/living/carbon/human/proc/SetSpecialVoice(new_voice) + if(new_voice) + special_voice = new_voice + return + +/mob/living/carbon/human/proc/UnsetSpecialVoice() + special_voice = "" + return + +/mob/living/carbon/human/proc/GetSpecialVoice() + return special_voice + +/mob/living/carbon/human/binarycheck() + if(ears) + var/obj/item/radio/headset/dongle = ears + if(!istype(dongle)) + return FALSE + if(dongle.translate_binary) + return TRUE + +/mob/living/carbon/human/radio(message, message_mode, list/spans, language) + . = ..() + if(.) + return + + switch(message_mode) + if(MODE_HEADSET) + if (ears) + ears.talk_into(src, message, , spans, language) + return ITALICS | REDUCE_RANGE + + if(MODE_DEPARTMENT) + if (ears) + ears.talk_into(src, message, message_mode, spans, language) + return ITALICS | REDUCE_RANGE + + if(message_mode in GLOB.radiochannels) + if(ears) + ears.talk_into(src, message, message_mode, spans, language) + return ITALICS | REDUCE_RANGE + + return 0 + +/mob/living/carbon/human/get_alt_name() + if(name != GetVoice()) + return " (as [get_id_name("Unknown")])" + +/mob/living/carbon/human/proc/forcesay(list/append) //this proc is at the bottom of the file because quote fuckery makes notepad++ cri + if(stat == CONSCIOUS) + if(client) + var/virgin = 1 //has the text been modified yet? + var/temp = winget(client, "input", "text") + if(findtextEx(temp, "Say \"", 1, 7) && length(temp) > 5) //"case sensitive means + + temp = replacetext(temp, ";", "") //general radio + + if(findtext(trim_left(temp), ":", 6, 7)) //dept radio + temp = copytext(trim_left(temp), 8) + virgin = 0 + + if(virgin) + temp = copytext(trim_left(temp), 6) //normal speech + virgin = 0 + + while(findtext(trim_left(temp), ":", 1, 2)) //dept radio again (necessary) + temp = copytext(trim_left(temp), 3) + + if(findtext(temp, "*", 1, 2)) //emotes + return + + var/trimmed = trim_left(temp) + if(length(trimmed)) + if(append) + temp += pick(append) + + say(temp) + winset(client, "input", "text=[null]") diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 3d0424f0..6e3ed2e3 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -413,18 +413,16 @@ GLOBAL_LIST_INIT(department_radio_keys, list( return 0 /mob/living/say_mod(input, message_mode) - if(message_mode == MODE_WHISPER) - . = verb_whisper - else if(message_mode == MODE_WHISPER_CRIT) + . = ..() + if(message_mode == MODE_WHISPER_CRIT) . = "[verb_whisper] in [p_their()] last breath" - else if(stuttering) - . = "stammers" - else if(derpspeech) - . = "gibbers" - else if(message_mode == MODE_SING) - . = verb_sing - else - . = ..() + else if(message_mode != MODE_CUSTOM_SAY) + if(message_mode == MODE_WHISPER) + . = verb_whisper + else if(stuttering) + . = "stammers" + else if(derpspeech) + . = "gibbers" /mob/living/whisper(message, bubble_type, list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null) say("#[message]", bubble_type, spans, sanitize, language, ignore_spam, forced) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 7063ed51..b504f96d 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -88,7 +88,7 @@ if(newletter==" ") newletter="...huuuhhh..." if(newletter==".") - newletter=" *BURP*." + newletter=" BURP!" if(rand(1,100) <= strength*0.5) if(rand(1,5) == 1) newletter+="'"