From c8c67da6ac4073952b503af268d57bac7a440b60 Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Sun, 4 May 2014 12:55:30 -0500 Subject: [PATCH] Dionaea nymphs now using new say code and get languages again. dionaea will understand and be understood by humans if they have stolen any blood, it's assumed they learned common. and a minor fix in hear_say for observers to not get not see simple_animals in (parens) since they have no real_name. --- code/modules/mob/hear_say.dm | 2 +- code/modules/mob/living/carbon/human/say.dm | 4 ++ .../modules/mob/living/carbon/monkey/diona.dm | 48 +++++++++++++++++++ .../mob/living/carbon/monkey/monkey.dm | 6 +-- 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index 77e122d8cc0..ab500a96307 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -32,7 +32,7 @@ if(istype(src, /mob/dead/observer)) if(italics && client.prefs.toggles & CHAT_GHOSTRADIO) return - if(speaker_name != speaker.real_name) + if(speaker_name != speaker.real_name && speaker.real_name) speaker_name = "[speaker.real_name] ([speaker_name])" track = "(follow) " if(client.prefs.toggles & CHAT_GHOSTEARS && speaker in view(src)) diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 8103d3f9509..066d5a5fd8f 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -148,6 +148,10 @@ if(has_brain_worms()) //Brain worms translate everything. Even mice and alien speak. return 1 + if (istype(other, /mob/living/carbon/monkey/diona) && !speaking) + if(other.languages.len >= 2) //They've sucked down some blood and can speak common now. + return 1 + if (istype(other, /mob/living/silicon)) return 1 if (istype(other, /mob/living/carbon/brain)) diff --git a/code/modules/mob/living/carbon/monkey/diona.dm b/code/modules/mob/living/carbon/monkey/diona.dm index eb8dedb4f0c..1cb0979c89c 100644 --- a/code/modules/mob/living/carbon/monkey/diona.dm +++ b/code/modules/mob/living/carbon/monkey/diona.dm @@ -252,3 +252,51 @@ src << "\green You feel your awareness expand, and realize you know how to understand the creatures around you." else src << "\green The blood seeps into your small form, and you draw out the echoes of memories and personality from it, working them into your budding mind." + + +/mob/living/carbon/monkey/diona/say_understands(var/mob/other,var/datum/language/speaking = null) + + if (istype(other, /mob/living/carbon/human) && !speaking) + if(languages.len >= 2) // They have sucked down some blood. + return 1 + return ..() + +/mob/living/carbon/monkey/diona/say(var/message) + var/verb = "says" + var/message_range = world.view + + if(client) + if(client.prefs.muted & MUTE_IC) + src << "\red You cannot speak in IC (Muted)." + return + + message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) + + + if(stat == 2) + return say_dead(message) + + var/datum/language/speaking = null + + + + if(length(message) >= 2) + var/channel_prefix = copytext(message, 1 ,3) + if(languages.len) + for(var/datum/language/L in languages) + if(lowertext(channel_prefix) == ":[L.key]") + verb = L.speech_verb + speaking = L + break + + if(speaking) + message = trim(copytext(message,3)) + + message = capitalize(trim_left(message)) + + if(!message || stat) + return + + + + ..(message, speaking, verb, null, null, message_range, null) diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 1471ea2d02a..4eb294c8a49 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -515,7 +515,7 @@ /mob/living/carbon/monkey/IsAdvancedToolUser()//Unless its monkey mode monkeys cant use advanced tools return 0 -/mob/living/carbon/monkey/say(var/message) +/mob/living/carbon/monkey/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="", var/italics=0, var/message_range = world.view, var/list/used_radios = list()) if(stat) return @@ -525,11 +525,9 @@ if(stat) return - var/verb = "says" - if(speak_emote.len) verb = pick(speak_emote) message = capitalize(trim_left(message)) - ..(message, null, verb) + ..(message, speaking, verb, alt_name, italics, message_range, used_radios)