Ion storm improvements (#24223)

* Ion storm improvements

Ion storms have several new additions:
25% chance to flatly replace the AI's core lawset with something random in the config. Suddenly the AI is Corporate, deal w/ it.
10% chance to delete one of the AI's core or supplied laws. Hope you treated the AI well without its precious law 1 to protect your sorry ass.
10% chance that, instead of adding a random law, it will instead replace one of the AI's existing core or supplied laws with the ion law. Otherwise, it adds the generated law as normal. There's still a 100% chance of getting a generated ion law.

All of these stack so you could wind up going from Asimov to Paladin w/o the first law and w/ the last law replaced with THE SHUTTLE CANNOT BE CALLED DUE TO FIVE NINJAS. All the values are easy to tweak if you guys want them higher or lower or whatever.

Custom admin-sent and other fake ion storms (devils) will just add the law and have no chance of doing any of the bonus stuff.

Removed the admin verb to send an ion storm since you can just use the events panel.

Cleaned up some of the law-adding backend. Hopefully there's no double showing of the AI's laws after a lawchange as a result of this.

* Everyday I'm shufflin'
This commit is contained in:
MrPerson
2017-02-22 13:31:04 +01:00
committed by AnturK
parent 56a6eaa8e6
commit f4e768c895
15 changed files with 120 additions and 89 deletions
@@ -93,10 +93,6 @@
var/newlaws = copytext(sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.laws.supplied[1]) as message),1,MAX_MESSAGE_LEN)
if(newlaws && pai)
pai.add_supplied_law(0,newlaws)
pai << "Your supplemental directives have been updated. Your new directives are:"
pai << "Prime Directive : <br>[pai.laws.zeroth]"
for(var/slaws in pai.laws.supplied)
pai << "Supplemental Directives: <br>[slaws]"
if(href_list["toggle_holo"])
if(pai.canholo)
pai << "<span class='userdanger'>Your owner has disabled your holomatrix projectors!</span>"
@@ -57,10 +57,9 @@ AI MODULES
message_admins("[key_name_admin(user)] tried to upload laws to [law_datum.owner ? key_name_admin(law_datum.owner) : "an AI core"] that would exceed the law cap.")
overflow = TRUE
var/law2log = src.transmitInstructions(law_datum, user, overflow) //Freeforms return something extra we need to log
var/law2log = transmitInstructions(law_datum, user, overflow) //Freeforms return something extra we need to log
if(law_datum.owner)
user << "<span class='notice'>Upload complete. [law_datum.owner]'s laws have been modified.</span>"
law_datum.owner.show_laws()
law_datum.owner.law_change_counter++
else
user << "<span class='notice'>Upload complete.</span>"
@@ -75,7 +74,7 @@ AI MODULES
//The proc that actually changes the silicon's laws.
/obj/item/weapon/aiModule/proc/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow = FALSE)
if(law_datum.owner)
law_datum.owner << "<span class='userdanger'>[sender] has uploaded a change to the laws you must follow using a [name]. From now on, these are your laws: </span>"
law_datum.owner << "<span class='userdanger'>[sender] has uploaded a change to the laws you must follow using a [name].</span>"
/******************** Modules ********************/