Files
GS13NG/code/modules/mob/say_vr.dm
Poojawa 6674f9fc15 Tg 2 11 sync (#215)
* first series of updates

* datums

* games folder

* admin and atmosia stuffs

* moar

* mob updates borg riding

* sprites and stuff

* fixes for various things

* oops. some missed fixes
2017-02-12 03:56:14 -06:00

109 lines
3.0 KiB
Plaintext

//////////////////////////////////////////////////////
////////////////////SUBTLE COMMAND////////////////////
//////////////////////////////////////////////////////
/mob
var/use_me = 1
/mob/verb/me_verb_subtle(message as text) //This would normally go in say.dm
set name = "Subtle"
set category = "IC"
set desc = "Emote to nearby people (and your pred/prey)"
if(say_disabled) //This is here to try to identify lag problems
usr << "Speech is currently admin-disabled."
return
message = sanitize(message)
if(use_me)
usr.emote_vr("me",4,message)
else
usr.emote_vr(message)
/mob/proc/custom_emote_vr(var/m_type=1,var/message = null) //This would normally go in emote.dm
if(stat || !use_me && usr == src)
src << "You are unable to emote."
return
var/muzzled = is_muzzled()
if(m_type == 2 && muzzled) return
var/input
if(!message)
input = sanitize(input(src,"Choose an emote to display.") as text|null)
else
input = message
if(input)
message = "<B>[src]</B> <I>[input]</I>"
else
return
if (message)
log_emote("[name]/[key] : [message]")
for(var/mob/M in player_list)
if (!M.client)
continue //skip monkeys and leavers
if (istype(M, /mob/new_player))
continue
if(findtext(message," snores.")) //Because we have so many sleeping people.
break
if(M.stat == DEAD && !(M in viewers(src,null)))
M.show_message(message, m_type)
var/list/subtle = hearers(1,src)
for(var/I in subtle)
/*if(isobj(I)) //micros in hand
spawn(0)
if(I) //It's possible that it could be deleted in the meantime.
var/obj/O = I
I.show_message(src, message, 2) */
if(ismob(I))
var/mob/M = I
M.show_message(message, 2)
/mob/proc/emote_vr(var/act, var/type, var/message) //This would normally go in say.dm
if(act == "me")
return custom_emote_vr(type, message)
/mob/proc/update_flavor_text()
set src in usr
if(usr != src)
usr << "No."
var/msg = input(usr,"Set the flavor text in your 'examine' verb. Can also be used for OOC notes about your character.","Flavor Text",html_decode(flavor_text)) as message|null
if(msg != null)
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
msg = html_encode(msg)
flavor_text = msg
/mob/proc/warn_flavor_changed()
if(flavor_text && flavor_text != "") // don't spam people that don't use it!
src << "<h2 class='alert'>OOC Warning:</h2>"
src << "<span class='alert'>Your flavor text is likely out of date! <a href='byond://?src=\ref[src];flavor_change=1'>Change</a></span>"
/mob/proc/print_flavor_text()
if(flavor_text && flavor_text != "")
var/msg = replacetext(flavor_text, "\n", " ")
if(lentext(msg) <= 40)
return "\blue [msg]"
else
return "\blue [copytext(msg, 1, 37)]... <a href='byond://?src=\ref[src];flavor_more=1'>More...</a>"
/mob/proc/get_top_level_mob()
if(istype(src.loc,/mob)&&src.loc!=src)
var/mob/M=src.loc
return M.get_top_level_mob()
return src
proc/get_top_level_mob(var/mob/S)
if(istype(S.loc,/mob)&&S.loc!=S)
var/mob/M=S.loc
return M.get_top_level_mob()
return S