Allows the AI to select which channel to state laws on.

This commit is contained in:
PsiOmega
2014-07-16 16:02:10 +02:00
parent 1e2cc5c7ca
commit f8ff7a5510
2 changed files with 27 additions and 14 deletions

View File

@@ -27,6 +27,7 @@ var/list/ai_list = list()
var/viewalerts = 0
var/lawcheck[1]
var/ioncheck[1]
var/lawchannel = "Common" // Default channel on which to state laws
var/icon/holo_icon//Default is assigned when AI is created.
var/obj/item/device/pda/ai/aiPDA = null
var/obj/item/device/multitool/aiMulti = null
@@ -390,6 +391,14 @@ var/list/ai_list = list()
// src << text ("Switching Law [L]'s report status to []", lawcheck[L+1])
checklaws()
if (href_list["lawr"]) // Selects on which channel to state laws
var/setchannel = input(usr, "Specify channel.", "Channel selection") in list("State","Common","Science","Command","Medical","Engineering","Security","Supply","Cancel")
if(setchannel == "Cancel")
return
lawchannel = setchannel
checklaws()
//Uncomment this line of code if you are enabling the AI Vocal (VOX) announcements.
/*
if(href_list["say_word"])

View File

@@ -51,24 +51,28 @@
src.laws_sanity_check()
src.laws.clear_supplied_laws()
/mob/living/silicon/ai/proc/statelaws() // -- TLE
// set category = "AI Commands"
// set name = "State Laws"
src.say("Current Active Laws:")
/var/prefix = ""
switch(lawchannel)
if("Common") prefix = ";"
if("Science") prefix = ":n "
if("Command") prefix = ":c "
if("Medical") prefix = ":m "
if("Engineering") prefix = ":e "
if("Security") prefix = ":s "
if("Supply") prefix = ":u "
src.say("[prefix]Current Active Laws:")
//src.laws_sanity_check()
//src.laws.show_laws(world)
var/number = 1
sleep(10)
if (src.laws.zeroth)
if (src.lawcheck[1] == "Yes") //This line and the similar lines below make sure you don't state a law unless you want to. --NeoFite
src.say("0. [src.laws.zeroth]")
src.say("[prefix]0. [src.laws.zeroth]")
sleep(10)
for (var/index = 1, index <= src.laws.ion.len, index++)
@@ -76,7 +80,7 @@
var/num = ionnum()
if (length(law) > 0)
if (src.ioncheck[index] == "Yes")
src.say("[num]. [law]")
src.say("[prefix][num]. [law]")
sleep(10)
for (var/index = 1, index <= src.laws.inherent.len, index++)
@@ -84,22 +88,20 @@
if (length(law) > 0)
if (src.lawcheck[index+1] == "Yes")
src.say("[number]. [law]")
src.say("[prefix][number]. [law]")
sleep(10)
number++
for (var/index = 1, index <= src.laws.supplied.len, index++)
var/law = src.laws.supplied[index]
if (length(law) > 0)
if(src.lawcheck.len >= number+1)
if (src.lawcheck[number+1] == "Yes")
src.say("[number]. [law]")
src.say("[prefix][number]. [law]")
sleep(10)
number++
/mob/living/silicon/ai/verb/checklaws() //Gives you a link-driven interface for deciding what laws the statelaws() proc will share with the crew. --NeoFite
set category = "AI Commands"
set name = "State Laws"
@@ -144,6 +146,8 @@
src.lawcheck[number+1] = "Yes"
list += {"<A href='byond://?src=\ref[src];lawc=[number]'>[src.lawcheck[number+1]] [number]:</A> [law]<BR>"}
number++
list += {"<br><br><A href='byond://?src=\ref[src];laws=1'>State Laws</A>"}
list += {"<br><A href='byond://?src=\ref[src];lawr=1'>Channel: [src.lawchannel]</A><br>"}
list += {"<A href='byond://?src=\ref[src];laws=1'>State Laws</A>"}
usr << browse(list, "window=laws")