Merge pull request #7280 from Neerti/12_7_14_holopad_and_emotes

Adds see_emote(), other cool things.
This commit is contained in:
Mloc
2014-12-18 22:10:54 +00:00
7 changed files with 90 additions and 6 deletions

View File

@@ -24,6 +24,8 @@
if (message)
log_emote("[name]/[key] : [message]")
var/list/seeing_obj = list() //For objs that need to see emotes. You can use see_emote(), which is based off of hear_talk()
//Hearing gasp and such every five seconds is not good emotes were not global for a reason.
// Maybe some people are okay with that.
@@ -37,10 +39,21 @@
if(M.stat == 2 && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
M.show_message(message)
for(var/I in view(world.view, get_turf(usr))) //get_turf is needed to stop weirdness with x-ray.
if(istype(I, /mob/))
var/mob/M = I
for(var/obj/O in M.contents)
seeing_obj |= O
else if(istype(I, /obj/))
var/obj/O = I
seeing_obj |= O
// Type 1 (Visual) emotes are sent to anyone in view of the item
if (m_type & 1)
for (var/mob/O in viewers(src, null))
//for (var/mob/O in viewers(src, null))
for (var/mob/O in viewers(get_turf(src), null)) //This may break people with x-ray being able to see emotes across walls,
//but this saves many headaches down the road, involving mechs and pAIs.
//x-ray is so rare these days anyways.
if(O.status_flags & PASSEMOTES)
@@ -52,8 +65,13 @@
O.show_message(message, m_type)
for(var/obj/O in seeing_obj)
spawn(0)
if(O) //It's possible that it could be deleted in the meantime.
O.see_emote(src, message, 1)
// Type 2 (Audible) emotes are sent to anyone in hear range
// of the *LOCATION* -- this is important for pAIs to be heard
// of the *LOCATION* -- this is important for AIs/pAIs to be heard
else if (m_type & 2)
for (var/mob/O in hearers(get_turf(src), null))
@@ -67,6 +85,11 @@
O.show_message(message, m_type)
for(var/obj/O in seeing_obj)
spawn(0)
if(O) //It's possible that it could be deleted in the meantime.
O.see_emote(src, message, 2)
/mob/proc/emote_dead(var/message)
if(client.prefs.muted & MUTE_DEADCHAT)

View File

@@ -110,7 +110,7 @@
log_say("[key_name(src)] : [message]")
return P.radio.talk_into(src,message,message_mode,verb,speaking)
return 0
if("general")
switch(bot_type)
if(IS_AI)
@@ -166,7 +166,7 @@
//Speach distorted, heard by those who do not understand AIs.
var/message_stars = stars(message)
var/rendered_b
if(speaking)
rendered_a = "<span class='game say'><span class='name'>[name]</span> [speaking.format_message(message, verb)]</span>"
rendered_b = "<span class='game say'><span class='name'>[voice_name]</span> [speaking.format_message(message_stars, verb)]</span>"
@@ -188,6 +188,34 @@
return
return 1
/mob/living/silicon/ai/proc/holopad_emote(var/message) //This is called when the AI uses the 'me' verb while using a holopad.
log_emote("[key_name(src)] : [message]")
message = trim(message)
if (!message)
return
var/obj/machinery/hologram/holopad/T = src.holo
if(T && T.hologram && T.master == src)
var/rendered = "<span class='game say'><span class='name'>[name]</span> <span class='message'>[message]</span></span>"
src << "<i><span class='game say'>Holopad action relayed, <span class='name'>[real_name]</span> <span class='message'>[message]</span></span></i>"
for(var/mob/M in viewers(T.loc))
M.show_message(rendered, 2)
else //This shouldn't occur, but better safe then sorry.
src << "No holopad connected."
return
return 1
/mob/living/silicon/ai/emote(var/act, var/type, var/message)
var/obj/machinery/hologram/holopad/T = src.holo
if(T && T.hologram && T.master == src) //Is the AI using a holopad?
src.holopad_emote(message)
else //Emote normally, then.
..()
#undef IS_AI
#undef IS_ROBOT
#undef IS_PAI