Files
CHOMPStation2/code/modules/mob/say.dm
Ccomp5950 77c733b17c Mentor permissions fixes and such.
Created a helper proc /proc/is_mentor(client) use this when determining if someone is a mentor and they aren't the usr of the proc (rights_check uses usr)

Mentors will no longer hear ghosts while playing
Mentors will no longer see orange text around names in check_player_age panel if they have special_roles
Mentors will no longer be able to tell players with special roles through the use of player_panel
Mentors will no longer be able to aghost, use antagHUD, then return to their bodies.
2014-06-10 19:48:41 -05:00

173 lines
4.9 KiB
Plaintext

/mob/proc/say()
return
/mob/verb/whisper()
set name = "Whisper"
set category = "IC"
return
/mob/verb/say_verb(message as text)
set name = "Say"
set category = "IC"
if(say_disabled) //This is here to try to identify lag problems
usr << "\red Speech is currently admin-disabled."
return
usr.say(message)
/mob/verb/me_verb(message as text)
set name = "Me"
set category = "IC"
if(say_disabled) //This is here to try to identify lag problems
usr << "\red Speech is currently admin-disabled."
return
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if(use_me)
usr.emote("me",usr.emote_type,message)
else
usr.emote(message)
/mob/proc/say_dead(var/message)
var/name = src.real_name
var/alt_name = ""
if(say_disabled) //This is here to try to identify lag problems
usr << "\red Speech is currently admin-disabled."
return
if(!src.client.holder)
if(!dsay_allowed)
src << "\red Deadchat is globally muted"
return
if(client && !(client.prefs.toggles & CHAT_DEAD))
usr << "\red You have deadchat muted."
return
if(mind && mind.name)
name = "[mind.name]"
else
name = real_name
if(name != real_name)
alt_name = " (died as [real_name])"
var/rendered = "<span class='game deadsay'><span class='prefix'>DEAD:</span> <span class='name'>[name]</span>[alt_name] [pick("complains","moans","whines","laments","blubbers")], <span class='message'>\"[message]\"</span></span>"
for(var/mob/M in player_list)
if(istype(M, /mob/new_player))
continue
if(M.client && M.stat == DEAD && (M.client.prefs.toggles & CHAT_DEAD))
M << rendered
continue
if(M.client && M.client.holder && !is_mentor(M.client) && (M.client.prefs.toggles & CHAT_DEAD) ) // Show the message to admins/mods with deadchat toggled on
M << rendered //Admins can hear deadchat, if they choose to, no matter if they're blind/deaf or not.
return
/mob/proc/say_understands(var/mob/other,var/datum/language/speaking = null)
if(!other)
return 1
//Universal speak makes everything understandable, for obvious reasons.
else if(other.universal_speak || src.universal_speak || src.universal_understand)
return 1
else if (src.stat == 2)
return 1
else if (speaking) //Language check.
var/understood
for(var/datum/language/L in src.languages)
if(speaking.name == L.name)
understood = 1
break
if(understood || universal_speak)
return 1
else
return 0
else if(other.universal_speak || src.universal_speak || src.universal_understand)
return 1
else if(isAI(src) && ispAI(other))
return 1
else if (istype(other, src.type) || istype(src, other.type))
return 1
return 0
/mob/proc/say_quote(var/text,var/datum/language/speaking)
if(!text)
return "says, \"...\""; //not the best solution, but it will stop a large number of runtimes. The cause is somewhere in the Tcomms code
//tcomms code is still runtiming somewhere here
var/ending = copytext(text, length(text))
var/speech_verb = "says"
var/speech_style = "body"
if (speaking)
speech_verb = speaking.speech_verb
speech_style = speaking.colour
else if(speak_emote && speak_emote.len)
speech_verb = pick(speak_emote)
else if (src.stuttering)
speech_verb = "stammers"
else if (src.slurring)
speech_verb = "slurrs"
else if (ending == "?")
speech_verb = "asks"
else if (ending == "!")
speech_verb = "exclaims"
else if(isliving(src))
var/mob/living/L = src
if (L.getBrainLoss() >= 60)
speech_verb = "gibbers"
return "<span class='say_quote'>[speech_verb],</span> \"<span class='[speech_style]'>[text]</span>\""
/mob/proc/emote(var/act, var/type, var/message)
if(act == "me")
return custom_emote(type, message)
/mob/proc/get_ear()
// returns an atom representing a location on the map from which this
// mob can hear things
// should be overloaded for all mobs whose "ear" is separate from their "mob"
return get_turf(src)
/mob/proc/say_test(var/text)
var/ending = copytext(text, length(text))
if (ending == "?")
return "1"
else if (ending == "!")
return "2"
return "0"
//parses the message mode code (e.g. :h, ;) from text, such as that supplied to say.
//returns the message mode string or null for no message mode.
/mob/proc/parse_message_mode(var/message)
if(length(message) >= 1 && copytext(message,1,2) == ";")
return "headset"
if(length(message) >= 2)
var/channel_prefix = copytext(message, 1 ,3)
return department_radio_keys[channel_prefix]
return null
//parses the language code (e.g. :j) from text, such as that supplied to say.
//returns the language object only if the code corresponds to a language that src knows, otherwise null.
/mob/proc/parse_language(var/message)
if(length(message) >= 2)
var/language_prefix = lowertext(copytext(message, 1 ,3))
for(var/datum/language/L in src.languages)
if(language_prefix == ":[L.key]")
return L
return null