Made ion storms more robust

Ion laws are now listed before all other laws, making them the kings of law priority
  AIs can have multiple Ion laws
  They are still resettable as normal

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@648 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
n3ophyt3@gmail.com
2010-12-17 16:52:57 +00:00
parent 3fb07a86d9
commit d83868e9ab
8 changed files with 98 additions and 22 deletions
+12
View File
@@ -166,6 +166,14 @@
// src << text ("Switching Law [L]'s report status to []", src.lawcheck[L+1])
src.checklaws()
if (href_list["lawi"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
var/L = text2num(href_list["lawi"])
switch(src.ioncheck[L])
if ("Yes") src.ioncheck[L] = "No"
if ("No") src.ioncheck[L] = "Yes"
// src << text ("Switching Law [L]'s report status to []", src.lawcheck[L+1])
src.checklaws()
if (href_list["laws"]) // With how my law selection code works, I changed statelaws from a verb to a proc, and call it through my law selection panel. --NeoFite
src.statelaws()
@@ -306,6 +314,10 @@
else
// world <<"They don't match"
src.network = "SS13"
src << "\blue Switched to [src.network] camera network."
return
// world <<"Oh shit there isn't a malf AI"
src.network = "SS13"
else
src.network = "SS13"
else //(src.network == "SS13")
+38 -5
View File
@@ -24,9 +24,21 @@
src.laws_sanity_check()
src.laws_object.set_zeroth_law(law)
/mob/living/silicon/ai/proc/add_inherent_law(var/number, var/law)
/mob/living/silicon/ai/proc/add_inherent_law(var/law)
src.laws_sanity_check()
src.laws_object.add_inherent_law(number, law)
src.laws_object.add_inherent_law(law)
/mob/living/silicon/ai/proc/clear_inherent_laws()
src.laws_sanity_check()
src.laws_object.clear_inherent_laws()
/mob/living/silicon/ai/proc/add_ion_law(var/law)
src.laws_sanity_check()
src.laws_object.add_ion_law(law)
/mob/living/silicon/ai/proc/clear_ion_laws()
src.laws_sanity_check()
src.laws_object.clear_ion_laws()
/mob/living/silicon/ai/proc/add_supplied_law(var/number, var/law)
src.laws_sanity_check()
@@ -36,9 +48,9 @@
src.laws_sanity_check()
src.laws_object.clear_supplied_laws()
/mob/living/silicon/ai/proc/clear_inherent_laws()
src.laws_sanity_check()
src.laws_object.clear_inherent_laws()
/mob/living/silicon/ai/proc/statelaws() // -- TLE
// set category = "AI Commands"
@@ -48,6 +60,15 @@
//src.laws_object.show_laws(world)
var/number = 1
sleep(10)
for (var/index = 1, index <= src.laws_object.ion.len, index++)
var/law = src.laws_object.ion[index]
var/num = ionnum()
if (length(law) > 0)
if (src.ioncheck[index] == "Yes")
src.say("[num]. [law]")
sleep(10)
if (src.laws_object.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_object.zeroth]")
@@ -78,6 +99,18 @@
set name = "State Laws"
var/list = "<b>Which laws do you want to include when stating them for the crew?</b><br><br>"
for (var/index = 1, index <= src.laws_object.ion.len, index++)
var/law = src.laws_object.ion[index]
if (length(law) > 0)
if (!src.ioncheck[index])
src.ioncheck[index] = "Yes"
list += {"<A href='byond://?src=\ref[src];lawi=[index]'>[src.ioncheck[index]] [ionnum()]:</A> [law]<BR>"}
src.ioncheck.len += 1
if (src.laws_object.zeroth)
if (!src.lawcheck[1])
src.lawcheck[1] = "No" //Given Law 0's usual nature, it defaults to NOT getting reported. --NeoFite
+17 -4
View File
@@ -58,6 +58,11 @@
var/datum/ai_laws/master = src.connected_ai.laws_object
var/temp
if (master)
src.laws.ion.len = master.ion.len
for (var/index = 1, index <= master.ion.len, index++)
temp = master.ion[index]
if (length(temp) > 0)
src.laws.ion[index] = temp
temp = master.zeroth
src.laws.zeroth = temp
@@ -82,9 +87,13 @@
src.laws_sanity_check()
src.laws.set_zeroth_law(law)
/mob/living/silicon/robot/proc/add_inherent_law(var/number, var/law)
/mob/living/silicon/robot/proc/add_inherent_law(var/law)
src.laws_sanity_check()
src.laws.add_inherent_law(number, law)
src.laws.add_inherent_law(law)
/mob/living/silicon/robot/proc/clear_inherent_laws()
src.laws_sanity_check()
src.laws.clear_inherent_laws()
/mob/living/silicon/robot/proc/add_supplied_law(var/number, var/law)
src.laws_sanity_check()
@@ -94,6 +103,10 @@
src.laws_sanity_check()
src.laws.clear_supplied_laws()
/mob/living/silicon/robot/proc/clear_inherent_laws()
/mob/living/silicon/robot/proc/add_ion_law(var/law)
src.laws_sanity_check()
src.laws.clear_inherent_laws()
src.laws.add_ion_law(law)
/mob/living/silicon/robot/proc/clear_ion_laws()
src.laws_sanity_check()
src.laws.clear_ion_laws()