Files
Paradise/code/modules/mob/living/silicon/say.dm
noisomehollow@lycos.com ca2af1cde2 Created new icon dmi for ai icons. Threw all AI- related stuff in there.
Replaced swat gear in assassin equip list with black gloves and shoes. CentCom Commander equip now includes a bullet-proof vest.
Upgraded holograms. It is now possible to create them dybamically through getHologramIcon(). If you want to tweak how they look, change that proc.
AI can now project holograms for anyone registered on the crew. Holograms that do no fit this category can also be added now (like the one the AI starts with).
Added generic holographic projection machinery category. Should now be possible to create wanted hologram projections and two-way communication using holograms. Unfinished but someone else can work on it.
Fixed regular cigar sprite from another commit.
Fixed deathsquad helmet down sprite. Also, adjusted it to look more unique.
Updated swat mask.
Made the swat boots use the jackboot sprite. Made swatboots actually as fast as other boots.
Added a Honker destroyed and open sprites.
Some misc icon tweaks.

Ninjas:
Adrenaline boost now resets player stat to 0. Due to lag, it was possible to adrenaline boost but remain helpless while life.dm resets stat. It's technically possible to come back from crit health (momentarily, before life.dm knocks you right back in crit) but I think it's a fair tradeoff.
Some minor fixes.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1769 316c924e-a436-60f5-8080-3fe189b3f50e
2011-07-05 04:41:35 +00:00

118 lines
3.8 KiB
Plaintext

/mob/living/silicon/say(var/message)
if (!message)
return
if (muted)
return
if (stat == 2)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
return say_dead(message)
// wtf?
if (stat)
return
if (length(message) >= 2)
if (copytext(message, 1, 3) == ":s")
if(istype(src, /mob/living/silicon/pai))
return ..(message)
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/hologram/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 = "<span class='game say'><span class='name'>[name]</span> <span class='message'>[message_a]</span></span>"
//Speach distorted, heard by those who do not understand AIs.
message = stars(message)
var/message_b = say_quote(message)
var/rendered_b = "<span class='game say'><span class='name'>[voice_name]</span> <span class='message'>[message_b]</span></span>"
src << "<i><span class='game say'>Holopad transmitted, <span class='name'>[real_name]</span> <span class='message'>[message_a]</span></span></i>"//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)
log_say("[key_name(src)] : [message]")
message = trim(message)
if (!message)
return
var/message_a = say_quote(message)
var/rendered = "<i><span class='game say'>Robotic Talk, <span class='name'>[name]</span> <span class='message'>[message_a]</span></span></i>"
for (var/mob/living/S in world)
if(!S.stat)
if(S.robot_talk_understand)
if(S.robot_talk_understand == robot_talk_understand)
S.show_message(rendered, 2)
else if (S.binarycheck())
S.show_message(rendered, 2)
var/list/listening = hearers(1, src)
listening -= src
listening += src
var/list/heard = list()
for (var/mob/M in listening)
if(!istype(M, /mob/living/silicon) && !M.robot_talk_understand)
heard += M
if (length(heard))
var/message_b
message_b = "beep beep beep"
message_b = say_quote(message_b)
message_b = "<i>[message_b]</i>"
rendered = "<i><span class='game say'><span class='name'>[voice_name]</span> <span class='message'>[message_b]</span></span></i>"
for (var/mob/M in heard)
M.show_message(rendered, 2)
message = say_quote(message)
rendered = "<i><span class='game say'>Robotic Talk, <span class='name'>[name]</span> <span class='message'>[message_a]</span></span></i>"
for (var/mob/M in world)
if (istype(M, /mob/new_player))
continue
if (M.stat > 1)
M.show_message(rendered, 2)