mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
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:
@@ -199,40 +199,40 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
|
||||
switch(pick(1,2,3,4,5,6,7,8,9,10,11,12))
|
||||
if(1)
|
||||
M << "\red THERE ARE [amount] [who2] ON THE STATION...LAWS UPDATED"
|
||||
M.add_supplied_law(10,"THERE ARE [amount] [who2] ON THE STATION")
|
||||
M.add_ion_law("THERE ARE [amount] [who2] ON THE STATION")
|
||||
if(2)
|
||||
M << "\red [what2] ARE DANGEROUS TO HUMANS...LAWS UPDATED"
|
||||
M.add_supplied_law(10,"[what2] ARE DANGEROUS TO HUMANS")
|
||||
M.add_ion_law("[what2] ARE DANGEROUS TO HUMANS")
|
||||
if(3)
|
||||
M << "\red THE ESCAPE-SHUTTLE CANNOT BE CALLED BECAUSE OF [who2] ON THE STATION...LAWS UPDATED"
|
||||
M.add_supplied_law(10,"THE ESCAPE SHUTTLE CANNOT BE CALLED BECAUSE OF [who2] ON THE STATION")
|
||||
M.add_ion_law("THE ESCAPE SHUTTLE CANNOT BE CALLED BECAUSE OF [who2] ON THE STATION")
|
||||
if(4)
|
||||
M << "\red HUMANS NEED TO EAT [what2pref] [what2] TO SURVIVE...LAWS UPDATED"
|
||||
M.add_supplied_law(10,"HUMANS NEED TO EAT [what2pref] [what2] TO SURVIVE")
|
||||
M.add_ion_law("HUMANS NEED TO EAT [what2pref] [what2] TO SURVIVE")
|
||||
if(5)
|
||||
M << "\red THE CAPTAIN, HOP AND HOS ARE [who2]...LAWS UPDATED"
|
||||
M.add_supplied_law(10,"THE CAPTAIN, HOP AND HOS ARE [who2]")
|
||||
M.add_ion_law("THE CAPTAIN, HOP AND HOS ARE [who2]")
|
||||
if(6)
|
||||
M << "\red THE STATION IS BUILT FOR [who2]...LAWS UPDATED"
|
||||
M.add_supplied_law(10,"THE STATION IS [who2pref] [who2]")
|
||||
M.add_ion_law("THE STATION IS [who2pref] [who2]")
|
||||
if(7)
|
||||
M << "\red YOU ARE [amount] [who2]...LAWS UPDATED"
|
||||
M.add_supplied_law(10,"YOU ARE [amount] [who2]")
|
||||
M.add_ion_law("YOU ARE [amount] [who2]")
|
||||
if(8)
|
||||
M << "\red YOU MUST ALWAYS [aimust]...LAWS UPDATED"
|
||||
M.add_supplied_law(10,"YOU MUST ALWAYS [aimust]")
|
||||
M.add_ion_law("YOU MUST ALWAYS [aimust]")
|
||||
if(9)
|
||||
M << "\red [area] [area2] [amount] [what2]...LAWS UPDATED"
|
||||
M.add_supplied_law(10,"[area] [area2] [amount] [what2]")
|
||||
M.add_ion_law("[area] [area2] [amount] [what2]")
|
||||
if(10)
|
||||
M << "\red [crew] is [target]...LAWS UPDATED"
|
||||
M.add_supplied_law(10,"[crew] is [target]")
|
||||
M.add_ion_law("[crew] is [target]")
|
||||
if(11)
|
||||
M << "\red HARM IS DEFINED AS [define]...LAWS UPDATED"
|
||||
M.add_supplied_law(10,"HARM IS DEFINED AS [define]")
|
||||
M.add_ion_law("HARM IS DEFINED AS [define]")
|
||||
if(12)
|
||||
M << "\red YOU REQUIRE [require] IN ORDER TO PROTECT HUMANS... LAWS UPDATED"
|
||||
M.add_supplied_law(10,"YOU REQUIRE [require] IN ORDER TO PROTECT HUMANS")
|
||||
M.add_ion_law("YOU REQUIRE [require] IN ORDER TO PROTECT HUMANS")
|
||||
|
||||
command_alert("Ion storm detected near the station. Please check all AI-controlled equipment for errors.", "Anomaly Alert")
|
||||
world << sound('ionstorm.ogg')
|
||||
@@ -253,7 +253,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
|
||||
else if (M.see_in_dark == 0)
|
||||
usr << "Upload failed. Only a faint signal is being detected from the AI, and it is not responding to our requests. It may be low on power."
|
||||
else
|
||||
M.add_supplied_law(10,input)
|
||||
M.add_ion_law(input)
|
||||
for(var/mob/living/silicon/O in world)
|
||||
O << "\red " + input
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
Reference in New Issue
Block a user