Adds admin ghost click shortcuts

Also refactors extra mob info code into its own proc.
This commit is contained in:
Krausus
2016-07-25 23:16:21 -04:00
parent 73d13946fc
commit 16500f0f27
4 changed files with 75 additions and 48 deletions
+1 -47
View File
@@ -1565,53 +1565,7 @@
else if(href_list["adminmoreinfo"])
var/mob/M = locate(href_list["adminmoreinfo"])
if(!ismob(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
var/location_description = ""
var/special_role_description = ""
var/health_description = ""
var/gender_description = ""
var/turf/T = get_turf(M)
//Location
if(isturf(T))
if(isarea(T.loc))
location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z] in area <b>[T.loc]</b>)"
else
location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z])"
//Job + antagonist
if(M.mind)
special_role_description = "Role: <b>[M.mind.assigned_role]</b>; Antagonist: <font color='red'><b>[M.mind.special_role]</b></font>; Has been rev: [(M.mind.has_been_rev)?"Yes":"No"]"
else
special_role_description = "Role: <i>Mind datum missing</i> Antagonist: <i>Mind datum missing</i>; Has been rev: <i>Mind datum missing</i>;"
//Health
if(isliving(M))
var/mob/living/L = M
var/status
switch(M.stat)
if(0) status = "Alive"
if(1) status = "<font color='orange'><b>Unconscious</b></font>"
if(2) status = "<font color='red'><b>Dead</b></font>"
health_description = "Status = [status]"
health_description += "<BR>Oxy: [L.getOxyLoss()] - Tox: [L.getToxLoss()] - Fire: [L.getFireLoss()] - Brute: [L.getBruteLoss()] - Clone: [L.getCloneLoss()] - Brain: [L.getBrainLoss()]"
else
health_description = "This mob type has no health to speak of."
//Gener
switch(M.gender)
if(MALE,FEMALE) gender_description = "[M.gender]"
else gender_description = "<font color='red'><b>[M.gender]</b></font>"
to_chat(src.owner, "<b>Info about [M.name]:</b> ")
to_chat(src.owner, "Mob type = [M.type]; Gender = [gender_description] Damage = [health_description]")
to_chat(src.owner, "Name = <b>[M.name]</b>; Real_name = [M.real_name]; Mind_name = [M.mind?"[M.mind.name]":""]; Key = <b>[M.key]</b>;")
to_chat(src.owner, "Location = [location_description];")
to_chat(src.owner, "[special_role_description]")
to_chat(src.owner, "(<a href='?src=\ref[usr];priv_msg=\ref[M]'>PM</a>) (<A HREF='?src=\ref[src];adminplayeropts=\ref[M]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[M]'>VV</A>) (<A HREF='?src=\ref[src];subtlemessage=\ref[M]'>SM</A>) (<A HREF='?src=\ref[src];adminplayerobservefollow=\ref[M]'>FLW</A>) (<A HREF='?src=\ref[src];secretsadmin=check_antagonist'>CA</A>)")
admin_mob_info(M)
else if(href_list["adminspawncookie"])
if(!check_rights(R_ADMIN|R_EVENT)) return