From 7174cca74abf02544b26ce85342df4ba8579d6a4 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sun, 23 Nov 2014 19:46:10 -0500 Subject: [PATCH] Updates whispering messages Certain languages can specify a certain verb for whispering and the message seen when someone whispers outside of hearing range now hints at the language. --- code/modules/mob/language.dm | 13 +++++++++++++ code/modules/mob/living/carbon/human/whisper.dm | 13 +++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/language.dm b/code/modules/mob/language.dm index b9fcefbddec..2e627330a06 100755 --- a/code/modules/mob/language.dm +++ b/code/modules/mob/language.dm @@ -8,6 +8,7 @@ var/speech_verb = "says" // 'says', 'hisses', 'farts'. var/ask_verb = "asks" // Used when sentence ends in a ? var/exclaim_verb = "exclaims" // Used when sentence ends in a ! + var/whisper_verb // Optional. When not specified speech_verb + quietly/softly is used instead. var/signlang_verb = list() // list of emotes that might be displayed if this language has NONVERBAL or SIGNLANG flags var/colour = "body" // CSS style to use for strings in this language. var/key = "x" // Character used to speak in language eg. :o for Unathi. @@ -97,9 +98,11 @@ name = "Galactic Common" desc = "The common galactic tongue." speech_verb = "says" + whisper_verb = "whispers" key = "0" flags = RESTRICTED +//TODO flag certain languages to use the mob-type specific say_quote and then get rid of these. /datum/language/common/get_spoken_verb(var/msg_end) switch(msg_end) if("!") @@ -111,10 +114,20 @@ /datum/language/human name = "Sol Common" desc = "A bastardized hybrid of informal English and elements of Mandarin Chinese; the common language of the Sol system." + speech_verb = "says" + whisper_verb = "whispers" colour = "rough" key = "1" flags = RESTRICTED +/datum/language/human/get_spoken_verb(var/msg_end) + switch(msg_end) + if("!") + return pick("exclaims","shouts","yells") //TODO: make the basic proc handle lists of verbs. + if("?") + return ask_verb + return speech_verb + // Galactic common languages (systemwide accepted standards). /datum/language/trader name = "Tradeband" diff --git a/code/modules/mob/living/carbon/human/whisper.dm b/code/modules/mob/living/carbon/human/whisper.dm index 58a8bb66d5e..dc81d3d1b5b 100644 --- a/code/modules/mob/living/carbon/human/whisper.dm +++ b/code/modules/mob/living/carbon/human/whisper.dm @@ -41,8 +41,17 @@ var/watching_range = 5 var/italics = 1 + var/not_heard //the message displayed to people who could not hear the whispering if (speaking) - verb = speaking.speech_verb + pick(" quietly", " softly") + if (speaking.whisper_verb) + verb = speaking.whisper_verb + not_heard = "[verb] something" + else + var/adverb = pick("quietly", "softly") + verb = "[speaking.speech_verb] [adverb]" + not_heard = "[verb] something [adverb]" + else + not_heard = "[verb] something" //TODO get rid of the null language and just prevent speech if language is null message = capitalize(trim(message)) @@ -144,6 +153,6 @@ M.hear_say(new_message, verb, speaking, alt_name, italics, src) if (watching.len) - var/rendered = "[src.name] whispers something." + var/rendered = "[src.name] [not_heard]." for (var/mob/M in watching) M.show_message(rendered, 2)