From 4fc55bcd0058410f6a8ef008cf4302124c4476b5 Mon Sep 17 00:00:00 2001 From: "noisomehollow@lycos.com" Date: Mon, 23 May 2011 00:13:07 +0000 Subject: [PATCH] Changed holopad speaking to :h on request. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1609 316c924e-a436-60f5-8080-3fe189b3f50e --- code/modules/mob/living/silicon/say.dm | 66 ++++++++++++++++---------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index 8c5780b0bc6..53980f9c459 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -18,11 +18,52 @@ message = copytext(message, 3) message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) robot_talk(message) + else if (copytext(message, 1, 3) == ":h") + if(isAI(src)&&client)//For patching directly into AI holopads. + message = copytext(message, 3) + message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) + holopad_talk(message) + else//Will not allow anyone by an active AI to use this function. + src << "This function is not available to you." + return else return ..(message) else return ..(message) +//For holopads only. Usable by AI. +/mob/living/proc/holopad_talk(var/message) + + log_say("[key_name(src)] : [message]") + + message = trim(message) + + if (!message) + return + + var/obj/machinery/holopad/T = client.eye//Client eye centers on an object. + if(istype(T)&&T.hologram&&T.master==src)//If there is a hologram and its master is the user. + var/message_a = say_quote(message) + + //Human-like, sorta, heard by those who understand humans. + var/rendered_a = "[name] [message_a]" + + //Speach distorted, heard by those who do not understand AIs. + message = stars(message) + var/message_b = say_quote(message) + var/rendered_b = "[voice_name] [message_b]" + + src << "Holopad transmitted, [real_name] [message_a]"//The AI can "hear" its own message. + for(var/mob/M in hearers(T.loc))//The location is the object, default distance. + if(M.say_understands(src))//If they understand AI speak. Humans and the like will be able to. + M.show_message(rendered_a, 2) + else//If they do not. + M.show_message(rendered_b, 2) + /*Radios "filter out" this conversation channel so we don't need to account for them. + This is another way of saying that we won't bother dealing with them.*/ + else + src << "No holopad connected." + return /mob/living/proc/robot_talk(var/message) @@ -33,30 +74,7 @@ if (!message) return - var/message_a = say_quote(message)//Here so I don't have to define it again. - - if(isAI(src)&&client)//For patching directly into AI holopads. - var/obj/machinery/holopad/T = client.eye//Client eye centers on an object. - if(istype(T)&&T.hologram&&T.master==src)//If there is a hologram and its master is the user. - - //Human-like, sorta, heard by those who understand humans. - var/rendered_a = "[name] [message_a]" - - //Speach distorted, heard by those who do not understand AIs. - message = stars(message) - var/message_b = say_quote(message) - var/rendered_b = "[voice_name] [message_b]" - - src << "Holopad transmitted, [real_name] [message_a]"//The AI can "hear" its own message. - for(var/mob/M in hearers(T.loc))//The location is the object, default distance. - if(M.say_understands(src))//If they understand AI speak. Humans and the like will be able to. - M.show_message(rendered_a, 2) - else//If they do not. - M.show_message(rendered_b, 2) - /*Radios "filter out" this conversation channel so we don't need to account for them. - This is another way of saying that we won't bother dealing with them.*/ - return - + var/message_a = say_quote(message) var/rendered = "Robotic Talk, [name] [message_a]" for (var/mob/living/S in world) if(!S.stat)