- If someone enters the name of an AI or the word 'AI' in an adminhelp, a (CL) link is displayed along with the others, which is a shortcut to the 'check laws' secret panel button.

- The 'check laws' secret panel button now outputs AI laws, cyborg laws and also pai laws. It used to just be AI laws.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4190 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz
2012-07-27 07:13:08 +00:00
parent d5738657cc
commit f908a610b7
2 changed files with 36 additions and 7 deletions

View File

@@ -1153,6 +1153,10 @@ var/global/BSACooldown = 0
sleep(2)
cl.jumptomob(M)
if (href_list["adminchecklaws"])
if(src && src.owner)
output_ai_laws()
if (href_list["adminmoreinfo"])
var/mob/M = locate(href_list["adminmoreinfo"])
if(!M)
@@ -2101,12 +2105,7 @@ var/global/BSACooldown = 0
if("check_antagonist")
check_antagonists()
if("showailaws")
for(var/mob/living/silicon/ai/ai in mob_list)
usr << "[key_name(ai, usr)]'s Laws:"
if (ai.laws == null)
usr << "[key_name(ai, usr)]'s Laws are null??"
else
ai.laws.show_laws(usr)
output_ai_laws()
if("showgm")
if(!ticker)
alert("The game hasn't started yet!")
@@ -2996,6 +2995,25 @@ var/global/BSACooldown = 0
feedback_add_details("admin_verb","UJBP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
/obj/admins/proc/output_ai_laws()
var/ai_number = 0
for(var/mob/living/silicon/S in mob_list)
ai_number++
if(isAI(S))
usr << "<b>AI [key_name(S, usr)]'s laws:</b>"
else if(isrobot(S))
usr << "<b>CYBORG [key_name(S, usr)]'s laws:</b>"
else if (ispAI(S))
usr << "<b>pAI [key_name(S, usr)]'s laws:</b>"
else
usr << "<b>SOMETHING SILICON [key_name(S, usr)]'s laws:</b>"
if (S.laws == null)
usr << "[key_name(S, usr)]'s laws are null?? Contact a coder."
else
S.laws.show_laws(usr)
if(!ai_number)
usr << "<b>No AIs located</b>" //Just so you know the thing is actually working and not just ignoring you.
//
//

View File

@@ -41,6 +41,8 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
//So if this list has the value list("John","Jane") and msg is, at the end, "This is <20> and he griffed <20>" the text to
//display will be "This is John and he griffe Jane". The strings in this list are a bit more complex than 'John' and 'Jane' tho.
var/ai_found = 0 //If an AI name or 'ai' word is found in the text, the additional (CL) = Check Laws button gets added. Not added every time so it doesn't spam.
//we will try to locate each word of the message in our lists of names and clients
//for each mob that we have found
//split the mob's info into a list. "John Arnolds" becomes list("John","Arnolds") so we can iterate through this
@@ -58,6 +60,9 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
word = dd_replaceText(word, ")", "")
if(lowertext(word) in adminhelp_ignored_words)
continue
if(lowertext(word) == "ai")
ai_found = 1
continue
for(var/mob/M in mobs)
var/list/namelist = dd_text2list("[M.name] [M.real_name] [M.original_name] [M.ckey] [M.key]", " ")
var/word_is_match = 0 //Used to break from this mob for loop if a match is found
@@ -70,6 +75,8 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
word_is_match = 1
break
if(word_is_match)
if(isAI(M))
ai_found = 1
break //Breaks execution of the mob loop, since a match was already found.
var/j = 1 //index to the next element in the replacement_value list
@@ -92,7 +99,11 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
admin_number_afk++
if(X.sound_adminhelp)
X << 'adminhelp.ogg'
var/msg_to_send = "\blue <b><font color=red>HELP: </font>[key_name(src, X)] (<A HREF='?src=\ref[X.holder];adminmoreinfo=[ref_mob]'>?</A>) (<A HREF='?src=\ref[X.holder];adminplayeropts=[ref_mob]'>PP</A>) (<A HREF='?src=\ref[X.holder];adminplayervars=[ref_mob]'>VV</A>) (<A HREF='?src=\ref[X.holder];adminplayersubtlemessage=[ref_mob]'>SM</A>) (<A HREF='?src=\ref[X.holder];adminplayerobservejump=[ref_mob]'>JMP</A>) (<A HREF='?src=\ref[X.holder];secretsadmin=check_antagonist'>CA</A>):</b> [msg]"
var/check_laws_text = ""
if(ai_found)
check_laws_text = (" (<A HREF='?src=\ref[X.holder];adminchecklaws=[ref_mob]'>CL</A>)")
var/msg_to_send = "\blue <b><font color=red>HELP: </font>[key_name(src, X)] (<A HREF='?src=\ref[X.holder];adminmoreinfo=[ref_mob]'>?</A>) (<A HREF='?src=\ref[X.holder];adminplayeropts=[ref_mob]'>PP</A>) (<A HREF='?src=\ref[X.holder];adminplayervars=[ref_mob]'>VV</A>) (<A HREF='?src=\ref[X.holder];adminplayersubtlemessage=[ref_mob]'>SM</A>) (<A HREF='?src=\ref[X.holder];adminplayerobservejump=[ref_mob]'>JMP</A>) (<A HREF='?src=\ref[X.holder];secretsadmin=check_antagonist'>CA</A>) [check_laws_text]:</b> [msg]"
msg_to_send = dd_replaceText(msg_to_send, "HOLDERREF", "\ref[X.holder]")
msg_to_send = dd_replaceText(msg_to_send, "ADMINREF", "\ref[X]")
X << msg_to_send