Merge pull request #7124 from mwerezak/whisper

Updates whispering messages
This commit is contained in:
PsiOmegaDelta
2014-11-25 10:42:31 +01:00
2 changed files with 24 additions and 2 deletions
+13
View File
@@ -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"
@@ -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 = "<span class='game say'><span class='name'>[src.name]</span> whispers something.</span>"
var/rendered = "<span class='game say'><span class='name'>[src.name]</span> [not_heard].</span>"
for (var/mob/M in watching)
M.show_message(rendered, 2)