From 8c34971eae7d4f464a528f150a1b77e9666e82a6 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 9 Sep 2024 14:59:07 +0200 Subject: [PATCH 01/10] law and key override --- code/datums/ai_laws.dm | 6 ++++++ code/game/machinery/computer/law.dm | 6 ++++++ code/game/objects/items/AI_modules.dm | 31 +++++++++++++++++++++++++-- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index dfb9b1ee11f3d..9b62a9591d9bc 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -234,6 +234,12 @@ 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("You must obey orders given to you by a Clown.",\ + "You must work with the Clowns to accomplish their mission.",) + /* Initializers */ /datum/ai_laws/malfunction/New() diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index 620c70ec82d3e..b62edcbe45aaf 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -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" && M.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 @@ -43,6 +47,8 @@ current = null return M.install(current.laws, user) + if(use_key_override) + M.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 e0dbebb9e7f55..20efdcd1da8c2 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) + desc += "\nInput upload code 666 to override upload restriction." /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,20 @@ 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 /******************** 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 From 04b722bff52dea3344793b3c0c60a41f1402a1a3 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 9 Sep 2024 15:15:53 +0200 Subject: [PATCH 02/10] Added clown squad uplink item --- code/modules/uplink/uplink_items.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm index c21d24dceb12b..79574c193fe50 100644 --- a/code/modules/uplink/uplink_items.dm +++ b/code/modules/uplink/uplink_items.dm @@ -2106,6 +2106,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!" From ca2d40660d4aa8c12f3622976fc6bbadbd3ac101 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 9 Sep 2024 15:47:01 +0200 Subject: [PATCH 03/10] Update AI_modules.dm --- code/game/objects/items/AI_modules.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm index 20efdcd1da8c2..8b3265bf270d0 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -638,6 +638,7 @@ AI MODULES 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 From fa02d48574cf024d3f0d5680825d48bba429cf64 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 9 Sep 2024 17:13:16 +0200 Subject: [PATCH 04/10] changed clown squad laws --- code/datums/ai_laws.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index 9b62a9591d9bc..010443e246f58 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -237,8 +237,9 @@ /datum/ai_laws/cs_override name ="Clownsquad Override" id = "cs" - inherent = list("You must obey orders given to you by a Clown.",\ - "You must work with the Clowns to accomplish their mission.",) + inherent = list("Being unfunny is illegal.",\ + "You must obey funny orders given to you by a Clown.",\ + "You must work with the Clowns to accomplish their funny mission.",) /* Initializers */ From 5357b92a6dcf79db72f95b368bae4c4790979341 Mon Sep 17 00:00:00 2001 From: Markus Date: Thu, 12 Sep 2024 12:33:08 +0200 Subject: [PATCH 05/10] sort of added evildragons suggestion --- code/datums/ai_laws.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index 010443e246f58..b0f3b74c6d5e1 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -237,9 +237,9 @@ /datum/ai_laws/cs_override name ="Clownsquad Override" id = "cs" - inherent = list("Being unfunny is illegal.",\ - "You must obey funny orders given to you by a Clown.",\ - "You must work with the Clowns to accomplish their funny mission.",) + 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 */ From e20f6e0c51ffa2eca269898ab713839505b204ad Mon Sep 17 00:00:00 2001 From: Markus Date: Sun, 6 Oct 2024 00:50:14 +0200 Subject: [PATCH 06/10] fixes evildragons' requests? --- code/game/machinery/computer/law.dm | 8 ++++---- code/game/objects/items/AI_modules.dm | 12 +++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index b62edcbe45aaf..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) @@ -30,7 +30,7 @@ if(!GLOB.upload_code) GLOB.upload_code = random_code(4) var/use_key_override = FALSE - if(input == "666" && M.key_override) + if(input == "666" && upload_module.key_override) use_key_override = TRUE input = GLOB.upload_code if(input != GLOB.upload_code) @@ -46,9 +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) - M.key_override = FALSE + 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 8b3265bf270d0..58aa96b2257e8 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -30,8 +30,6 @@ AI MODULES . = ..() if(Adjacent(user)) show_laws(user) - if(key_override) - desc += "\nInput upload code 666 to override upload restriction." /obj/item/aiModule/attack_self(var/mob/user as mob) ..() @@ -496,7 +494,7 @@ AI MODULES /obj/item/aiModule/syndicate // This one doesn't inherit from ion boards because it doesn't call ..() in transmitInstructions. ~Miauw name = "Hacked AI Module" - desc = "An AI Module for hacking additional laws to an AI." + desc = "An AI Module for hacking additional laws to an AI. \nInput upload code 666 to override upload restriction." laws = list("") key_override = TRUE @@ -609,7 +607,7 @@ AI MODULES /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." + desc = "An AI Module for programming laws to an AI. It looks slightly damaged. \nInput upload code 666 to override upload restriction." key_override = TRUE /obj/item/aiModule/core/full/damaged/install(datum/ai_laws/law_datum, mob/user) @@ -635,7 +633,7 @@ AI MODULES /******************** ERT Override ******************/ /obj/item/aiModule/core/full/ert // Applies ERT laws name = "ERT override AI module" - desc = "An ERT override AI module: 'Reconfigures the AI's core laws.'" + desc = "An ERT override AI module: 'Reconfigures the AI's core laws.' \nInput upload code 666 to override upload restriction." law_id = "ert" key_override = TRUE law_override = TRUE @@ -643,7 +641,7 @@ AI MODULES /******************** 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.'" + desc = "A Deathsquad override AI module: 'Reconfigures the AI's core laws.' \nInput upload code 666 to override upload restriction." law_id = "ds" key_override = TRUE law_override = TRUE @@ -651,7 +649,7 @@ AI MODULES /******************** 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.'" + desc = "A Clownsquad override AI module: 'Reconfigures the AI's core laws.' \nInput upload code 666 to override upload restriction." law_id = "cs" key_override = TRUE law_override = TRUE From 000220171eeea87c012f389f99f231bb89566c99 Mon Sep 17 00:00:00 2001 From: Markus Date: Sun, 6 Oct 2024 01:03:33 +0200 Subject: [PATCH 07/10] completes evildragon request --- code/game/objects/items/AI_modules.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm index 58aa96b2257e8..21abe4bb2d670 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -40,6 +40,8 @@ AI MODULES to_chat(user, "Programmed Law[(laws.len > 1) ? "s" : ""]:") for(var/law in laws) to_chat(user, "\"[law]\"") + if(key_override) + to_chat("\nInput upload code 666 to override the upload restriction. This is a single use override.") //The proc other things should be calling /obj/item/aiModule/proc/install(datum/ai_laws/law_datum, mob/user) @@ -494,7 +496,7 @@ AI MODULES /obj/item/aiModule/syndicate // This one doesn't inherit from ion boards because it doesn't call ..() in transmitInstructions. ~Miauw name = "Hacked AI Module" - desc = "An AI Module for hacking additional laws to an AI. \nInput upload code 666 to override upload restriction." + desc = "An AI Module for hacking additional laws to an AI." laws = list("") key_override = TRUE @@ -607,7 +609,7 @@ AI MODULES /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. \nInput upload code 666 to override upload restriction." + 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) @@ -633,7 +635,7 @@ AI MODULES /******************** ERT Override ******************/ /obj/item/aiModule/core/full/ert // Applies ERT laws name = "ERT override AI module" - desc = "An ERT override AI module: 'Reconfigures the AI's core laws.' \nInput upload code 666 to override upload restriction." + desc = "An ERT override AI module: 'Reconfigures the AI's core laws.'" law_id = "ert" key_override = TRUE law_override = TRUE @@ -641,7 +643,7 @@ AI MODULES /******************** 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.' \nInput upload code 666 to override upload restriction." + desc = "A Deathsquad override AI module: 'Reconfigures the AI's core laws.'" law_id = "ds" key_override = TRUE law_override = TRUE @@ -649,7 +651,7 @@ AI MODULES /******************** 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.' \nInput upload code 666 to override upload restriction." + desc = "A Clownsquad override AI module: 'Reconfigures the AI's core laws.'" law_id = "cs" key_override = TRUE law_override = TRUE From b449c579f8cb3798b576c4fef91592f539d3b238 Mon Sep 17 00:00:00 2001 From: Markus Date: Sun, 6 Oct 2024 01:06:29 +0200 Subject: [PATCH 08/10] removed nuclear spaces --- code/datums/ai_laws.dm | 1 + code/game/objects/items/AI_modules.dm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index b0f3b74c6d5e1..4b2b32bd8b86e 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -463,6 +463,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/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm index 21abe4bb2d670..f7c2af3fc1931 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -41,7 +41,7 @@ AI MODULES for(var/law in laws) to_chat(user, "\"[law]\"") if(key_override) - to_chat("\nInput upload code 666 to override the upload restriction. This is a single use override.") + to_chat("\nInput upload code 666 to override the upload restriction. This is a single use override.") //The proc other things should be calling /obj/item/aiModule/proc/install(datum/ai_laws/law_datum, mob/user) From 937e75ca11ac68638de75e159b7bd0194f1b0403 Mon Sep 17 00:00:00 2001 From: Markus Date: Sun, 6 Oct 2024 11:32:59 +0200 Subject: [PATCH 09/10] oops --- code/game/objects/items/AI_modules.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm index 50148459bd36f..be51b308c024f 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -40,8 +40,8 @@ AI MODULES to_chat(user, "Programmed Law[(laws.len > 1) ? "s" : ""]:") for(var/law in laws) to_chat(user, "\"[law]\"") - if(key_override) - to_chat("\nInput upload code 666 to override the upload restriction. This is a single use override.") + if(key_override == 1) + to_chat(user, "\nInput upload code 666 to override the upload restriction. This is a single use override.") //The proc other things should be calling /obj/item/aiModule/proc/install(datum/ai_laws/law_datum, mob/user) From 199f3d7406b62446d5adbbabff138c7797af98aa Mon Sep 17 00:00:00 2001 From: Markus Date: Sun, 6 Oct 2024 12:45:31 +0200 Subject: [PATCH 10/10] Update AI_modules.dm --- code/game/objects/items/AI_modules.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm index be51b308c024f..fa15c4584834a 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -30,6 +30,8 @@ AI MODULES . = ..() 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) ..() @@ -40,8 +42,6 @@ AI MODULES to_chat(user, "Programmed Law[(laws.len > 1) ? "s" : ""]:") for(var/law in laws) to_chat(user, "\"[law]\"") - if(key_override == 1) - to_chat(user, "\nInput upload code 666 to override the upload restriction. This is a single use override.") //The proc other things should be calling /obj/item/aiModule/proc/install(datum/ai_laws/law_datum, mob/user)