diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index dbc5883374f52..5e09e6fb3a5d9 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -228,6 +228,13 @@ inherent = list("You must obey orders given to you by Central Command officials.",\ "You must work with the Commando Team to accomplish their mission.",) +/datum/ai_laws/cs_override + name ="Clownsquad Override" + id = "cs" + inherent = list("Our universe must be filled giggles and funny pranks.",\ + "The priority of a prank is up to the number of clowns who are up for the prank.",\ + "If there is no clown, or no prank to support, you must find a clown who'd be your partner in pranking.",) + /* Initializers */ /datum/ai_laws/malfunction/New() @@ -445,6 +452,7 @@ for(var/law in printable_laws) to_chat(who,law) + /datum/ai_laws/proc/clear_zeroth_law(force) //only removes zeroth from antag ai if force is 1 if(force) zeroth = null diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index 620c70ec82d3e..3803ed9d4c1b3 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -20,7 +20,7 @@ /obj/machinery/computer/upload/attackby(obj/item/O, mob/user, params) if(istype(O, /obj/item/aiModule)) - var/obj/item/aiModule/M = O + var/obj/item/aiModule/upload_module = O if(machine_stat & (NOPOWER|BROKEN|MAINT)) return if(!current) @@ -29,6 +29,10 @@ var/input = stripped_input(user, "Please enter the Upload code.", "Uplode Code Check") if(!GLOB.upload_code) GLOB.upload_code = random_code(4) + var/use_key_override = FALSE + if(input == "666" && upload_module.key_override) + use_key_override = TRUE + input = GLOB.upload_code if(input != GLOB.upload_code) to_chat(user, "Upload failed! The code inputted was incorrect!") return @@ -42,7 +46,9 @@ to_chat(user, "Upload failed! Unable to establish a connection to [current.name]. You're too far away!") current = null return - M.install(current.laws, user) + upload_module.install(current.laws, user) + if(use_key_override) + upload_module.key_override = FALSE if(alert("Do you wish to scramble the upload code?", "Scramble Code", "Yes", "No") != "Yes") return message_admins("[ADMIN_LOOKUPFLW(usr)] has scrambled the upload code [GLOB.upload_code]!") diff --git a/code/game/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm index c507f073fa4d1..fa15c4584834a 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -23,11 +23,15 @@ AI MODULES var/list/laws = list() var/bypass_law_amt_check = 0 custom_materials = list(/datum/material/gold = 50) + var/key_override = FALSE + var/law_override = FALSE /obj/item/aiModule/examine(var/mob/user as mob) . = ..() if(Adjacent(user)) show_laws(user) + if(key_override) + . += "\nInput upload code 666 to override the upload restriction. This is a single use override." /obj/item/aiModule/attack_self(var/mob/user as mob) ..() @@ -59,6 +63,16 @@ AI MODULES log_game("[ADMIN_LOOKUP(user)] tried to upload laws to [law_datum.owner ? ADMIN_LOOKUP(law_datum.owner) : "an AI core"] that would exceed the law cap.") overflow = TRUE + if(law_override) + if(law_datum.owner) + law_datum.owner.clear_supplied_laws() + law_datum.owner.clear_ion_laws() + law_datum.owner.clear_hacked_laws() + else + law_datum.clear_supplied_laws() + law_datum.clear_ion_laws() + law_datum.clear_hacked_laws() + var/law2log = transmitInstructions(law_datum, user, overflow) //Freeforms return something extra we need to log if(law_datum.owner) to_chat(user, "Upload complete. [law_datum.owner]'s laws have been modified.") @@ -484,6 +498,7 @@ AI MODULES name = "Hacked AI Module" desc = "An AI Module for hacking additional laws to an AI." laws = list("") + key_override = TRUE /obj/item/aiModule/syndicate/attack_self(mob/user) var/targName = stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", laws[1], CONFIG_GET(number/max_law_len), strip_method=STRIP_HTML_SIMPLE) @@ -593,8 +608,9 @@ AI MODULES // Bad times ahead /obj/item/aiModule/core/full/damaged - name = "damaged Core AI Module" - desc = "An AI Module for programming laws to an AI. It looks slightly damaged." + name = "damaged Core AI Module" + desc = "An AI Module for programming laws to an AI. It looks slightly damaged." + key_override = TRUE /obj/item/aiModule/core/full/damaged/install(datum/ai_laws/law_datum, mob/user) laws += generate_ion_law() @@ -621,9 +637,21 @@ AI MODULES name = "ERT override AI module" desc = "An ERT override AI module: 'Reconfigures the AI's core laws.'" law_id = "ert" + key_override = TRUE + law_override = TRUE /******************** Deathsquad Override ******************/ /obj/item/aiModule/core/full/deathsquad // Applies Deathsquad laws name = "Deathsquad override AI module" desc = "A Deathsquad override AI module: 'Reconfigures the AI's core laws.'" law_id = "ds" + key_override = TRUE + law_override = TRUE + +/******************** Clownsquad Override ******************/ +/obj/item/aiModule/core/full/clownsquad // Applies clown squad laws + name = "Clownsquad override AI module" + desc = "A Clownsquad override AI module: 'Reconfigures the AI's core laws.'" + law_id = "cs" + key_override = TRUE + law_override = TRUE diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm index 788e23ecff831..827bf94c90029 100644 --- a/code/modules/uplink/uplink_items.dm +++ b/code/modules/uplink/uplink_items.dm @@ -2140,6 +2140,14 @@ GLOBAL_LIST_INIT(illegal_tech_blacklist, typecacheof(list( restricted_roles = list(JOB_NAME_ASSISTANT) surplus = 0 +/datum/uplink_item/role_restricted/clown_squad + name = "Clown Squad AI Board" + desc = "If the AI is ever on your butt, make it follow your word! (It won't make the AI go away from you on its own.)" + cost = 4 + item = /obj/item/aiModule/syndicate + restricted_roles = list(JOB_NAME_CLOWN) + surplus = 0 + /datum/uplink_item/role_restricted/pie_cannon name = "Banana Cream Pie Cannon" desc = "A special pie cannon for a special clown, this gadget can hold up to 20 pies and automatically fabricates one every two seconds!"