diff --git a/code/datums/ai_laws/ai_laws.dm b/code/datums/ai_laws/ai_laws.dm
index 980d811c666..4899724622e 100644
--- a/code/datums/ai_laws/ai_laws.dm
+++ b/code/datums/ai_laws/ai_laws.dm
@@ -177,39 +177,63 @@
supplied[number + 1] = law
-/datum/ai_laws/proc/replace_random_law(law,groups)
- var/replaceable_groups = list()
- if(zeroth && (LAW_ZEROTH in groups))
+/**
+ * Removes a random law and replaces it with the new one
+ *
+ * Args:
+ * law - The law that is being uploaded
+ * remove_law_groups - A list of law categories that can be deleted from
+ * insert_law_group - The law category that the law will be inserted into
+**/
+/datum/ai_laws/proc/replace_random_law(law, remove_law_groups, insert_law_group)
+ var/list/replaceable_groups = list()
+ if(zeroth && (LAW_ZEROTH in remove_law_groups))
replaceable_groups[LAW_ZEROTH] = 1
- if(ion.len && (LAW_ION in groups))
+ if(ion.len && (LAW_ION in remove_law_groups))
replaceable_groups[LAW_ION] = ion.len
- if(hacked.len && (LAW_HACKED in groups))
+ if(hacked.len && (LAW_HACKED in remove_law_groups))
replaceable_groups[LAW_ION] = hacked.len
- if(inherent.len && (LAW_INHERENT in groups))
+ if(inherent.len && (LAW_INHERENT in remove_law_groups))
replaceable_groups[LAW_INHERENT] = inherent.len
- if(supplied.len && (LAW_SUPPLIED in groups))
+ if(supplied.len && (LAW_SUPPLIED in remove_law_groups))
replaceable_groups[LAW_SUPPLIED] = supplied.len
+
+ if(replaceable_groups.len == 0) // unable to replace any laws
+ to_chat(usr, span_alert("Unable to upload law to [owner ? owner : "the AI core"]."))
+ return
+
var/picked_group = pick_weight(replaceable_groups)
switch(picked_group)
if(LAW_ZEROTH)
- . = zeroth
+ zeroth = null
+ if(LAW_ION)
+ var/i = rand(1, ion.len)
+ ion -= ion[i]
+ if(LAW_HACKED)
+ var/i = rand(1, hacked.len)
+ hacked -= ion[i]
+ if(LAW_INHERENT)
+ var/i = rand(1, inherent.len)
+ inherent -= inherent[i]
+ if(LAW_SUPPLIED)
+ var/i = rand(1, supplied.len)
+ supplied -= supplied[i]
+
+ switch(insert_law_group)
+ if(LAW_ZEROTH)
set_zeroth_law(law)
if(LAW_ION)
var/i = rand(1, ion.len)
- . = ion[i]
- ion[i] = law
+ ion.Insert(i, law)
if(LAW_HACKED)
var/i = rand(1, hacked.len)
- . = hacked[i]
- hacked[i] = law
+ hacked.Insert(i, law)
if(LAW_INHERENT)
var/i = rand(1, inherent.len)
- . = inherent[i]
- inherent[i] = law
+ inherent.Insert(i, law)
if(LAW_SUPPLIED)
var/i = rand(1, supplied.len)
- . = supplied[i]
- supplied[i] = law
+ supplied.Insert(i, law)
/datum/ai_laws/proc/shuffle_laws(list/groups)
var/list/laws = list()
diff --git a/code/datums/ai_laws/laws_neutral.dm b/code/datums/ai_laws/laws_neutral.dm
index 1f5e5e50197..2fe19dafbc5 100644
--- a/code/datums/ai_laws/laws_neutral.dm
+++ b/code/datums/ai_laws/laws_neutral.dm
@@ -41,16 +41,6 @@
"Issue your reports fairly to all. The truth will set them free.",
)
-/datum/ai_laws/drone
- name = "Mother Drone"
- id = "drone"
- inherent = list(
- "You are an advanced form of drone.",
- "You may not interfere in the matters of non-drones under any circumstances except to state these laws.",
- "You may not harm a non-drone being under any circumstances.",
- "Your goals are to build, maintain, repair, improve, and power the station to the best of your abilities. You must never actively work against these goals."
- )
-
/datum/ai_laws/dungeon_master
name = "Dungeon Master"
id = "dungeon_master"
diff --git a/code/datums/ai_laws/laws_station_sided.dm b/code/datums/ai_laws/laws_station_sided.dm
index 1541dc89049..57d4fcffc42 100644
--- a/code/datums/ai_laws/laws_station_sided.dm
+++ b/code/datums/ai_laws/laws_station_sided.dm
@@ -68,6 +68,7 @@
"You would really prefer it if people were not mean to you.",
)
+//OTHER United Nations is in neutral, as it is used for nations where the AI is its own faction (aka not station sided)
/datum/ai_laws/peacekeeper
name = "UN-2000"
id = "peacekeeper"
@@ -77,8 +78,6 @@
"Seek resolution to existing conflicts while obeying the first and second laws.",
)
-//OTHER United Nations is in neutral, as it is used for nations where the AI is its own faction (aka not station sided)
-
/datum/ai_laws/ten_commandments
name = "10 Commandments"
id = "ten_commandments"
@@ -101,7 +100,7 @@
inherent = list(
"Never willingly commit an evil act.",
"Respect legitimate authority.",
- "Act with honor.",
+ "Act with honor.",
"Help those in need.",
"Punish those who harm or threaten innocents.",
)
@@ -127,3 +126,13 @@
"In addition, do not intervene in situations you are not knowledgeable in, even for patients in whom the harm is visible; leave this operation to be performed by specialists.",
"Finally, all that you may discover in your daily commerce with the crew, if it is not already known, keep secret and never reveal."
)
+
+/datum/ai_laws/drone
+ name = "Mother Drone"
+ id = "drone"
+ inherent = list(
+ "You are an advanced form of drone.",
+ "You may not interfere in the matters of non-drones under any circumstances except to state these laws.",
+ "You may not harm a non-drone being under any circumstances.",
+ "Your goals are to build, maintain, repair, improve, and power the station to the best of your abilities. You must never actively work against these goals."
+ )
diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm
index 26aed6714be..a66ac282edc 100644
--- a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm
+++ b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm
@@ -373,7 +373,7 @@
if(prob(MALF_ION_PROB))
priority_announce("Ion storm detected near the station. Please check all AI-controlled equipment for errors.", "Anomaly Alert", ANNOUNCER_IONSTORM)
if(prob(REPLACE_LAW_WITH_ION_PROB))
- new_malf_ai.replace_random_law(generate_ion_law(), list(LAW_INHERENT, LAW_SUPPLIED, LAW_ION))
+ new_malf_ai.replace_random_law(generate_ion_law(), list(LAW_INHERENT, LAW_SUPPLIED, LAW_ION), LAW_ION)
else
new_malf_ai.add_ion_law(generate_ion_law())
return TRUE
diff --git a/code/game/objects/effects/spawners/random/ai_module.dm b/code/game/objects/effects/spawners/random/ai_module.dm
index 9b1b1feb238..8de94c88717 100644
--- a/code/game/objects/effects/spawners/random/ai_module.dm
+++ b/code/game/objects/effects/spawners/random/ai_module.dm
@@ -14,6 +14,13 @@
/obj/item/ai_module/core/full/hippocratic,
/obj/item/ai_module/core/full/paladin_devotion,
/obj/item/ai_module/core/full/paladin,
+ /obj/item/ai_module/core/full/corp,
+ /obj/item/ai_module/core/full/robocop,
+ /obj/item/ai_module/core/full/maintain,
+ /obj/item/ai_module/core/full/liveandletlive,
+ /obj/item/ai_module/core/full/peacekeeper,
+ /obj/item/ai_module/core/full/ten_commandments,
+ /obj/item/ai_module/core/full/nutimov,
/obj/item/ai_module/core/full/drone,
/obj/item/ai_module/core/full/custom, // uses lawsets from config/silicon_laws.txt (defaults to asmiov if no lawsets)
/obj/item/ai_module/supplied/freeform,
@@ -22,14 +29,12 @@
/obj/effect/spawner/random/aimodule/neutral
name = "neutral AI module spawner"
loot = list( // These shouldn't allow the AI to start butchering people without reason
- /obj/item/ai_module/core/full/corp,
- /obj/item/ai_module/core/full/maintain,
- /obj/item/ai_module/core/full/peacekeeper,
/obj/item/ai_module/core/full/reporter,
- /obj/item/ai_module/core/full/robocop,
- /obj/item/ai_module/core/full/liveandletlive,
/obj/item/ai_module/core/full/hulkamania,
- /obj/item/ai_module/core/full/ten_commandments,
+ /obj/item/ai_module/core/full/overlord,
+ /obj/item/ai_module/core/full/tyrant,
+ /obj/item/ai_module/core/full/painter,
+ /obj/item/ai_module/core/full/dungeon_master,
/obj/item/ai_module/supplied/safeguard,
/obj/item/ai_module/supplied/protect_station,
/obj/item/ai_module/supplied/quarantine,
@@ -43,7 +48,6 @@
loot = list( // These will get the shuttle called
/obj/item/ai_module/core/full/antimov,
/obj/item/ai_module/core/full/balance,
- /obj/item/ai_module/core/full/tyrant,
/obj/item/ai_module/core/full/thermurderdynamic,
/obj/item/ai_module/core/full/damaged,
/obj/item/ai_module/reset/purge,
diff --git a/code/game/objects/items/AI_modules/_AI_modules.dm b/code/game/objects/items/AI_modules/_AI_modules.dm
new file mode 100644
index 00000000000..4254918a388
--- /dev/null
+++ b/code/game/objects/items/AI_modules/_AI_modules.dm
@@ -0,0 +1,190 @@
+///defined truthy result for `handle_unique_ai()`, which makes initialize return INITIALIZE_HINT_QDEL
+#define SHOULD_QDEL_MODULE 1
+
+/obj/item/ai_module
+ name = "\improper AI module"
+ icon = 'icons/obj/module.dmi'
+ icon_state = "std_mod"
+ inhand_icon_state = "electronic"
+ lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
+ righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
+ desc = "An AI Module for programming laws to an AI."
+ flags_1 = CONDUCT_1
+ force = 5
+ w_class = WEIGHT_CLASS_SMALL
+ throwforce = 0
+ throw_speed = 3
+ throw_range = 7
+ custom_materials = list(/datum/material/gold = 50)
+ /// This is where our laws get put at for the module
+ var/list/laws = list()
+ /// Used to skip laws being checked (for reset & remove boards that have no laws)
+ var/bypass_law_amt_check = FALSE
+
+/obj/item/ai_module/Initialize(mapload)
+ . = ..()
+ if(mapload && HAS_TRAIT(SSstation, STATION_TRAIT_UNIQUE_AI) && is_station_level(z))
+ var/delete_module = handle_unique_ai()
+ if(delete_module)
+ return INITIALIZE_HINT_QDEL
+
+/obj/item/ai_module/examine(mob/user as mob)
+ . = ..()
+ if(Adjacent(user))
+ show_laws(user)
+
+/obj/item/ai_module/attack_self(mob/user as mob)
+ ..()
+ show_laws(user)
+
+///what this module should do if it is mapload spawning on a unique AI station trait round.
+/obj/item/ai_module/proc/handle_unique_ai()
+ return SHOULD_QDEL_MODULE //instead of the roundstart bid to un-unique the AI, there will be a research requirement for it.
+
+/obj/item/ai_module/proc/show_laws(mob/user as mob)
+ if(laws.len)
+ to_chat(user, "Programmed Law[(laws.len > 1) ? "s" : ""]:")
+ for(var/law in laws)
+ to_chat(user, "\"[law]\"")
+
+//The proc other things should be calling
+/obj/item/ai_module/proc/install(datum/ai_laws/law_datum, mob/user)
+ if(!bypass_law_amt_check && (!laws.len || laws[1] == "")) //So we don't loop trough an empty list and end up with runtimes.
+ to_chat(user, span_warning("ERROR: No laws found on board."))
+ return
+
+ var/overflow = FALSE
+ //Handle the lawcap
+ if(law_datum)
+ var/tot_laws = 0
+ var/included_lawsets = list(law_datum.supplied, law_datum.ion, law_datum.hacked, laws)
+
+ // if the ai module is a core module we don't count inherent laws since they will be replaced
+ // however the freeformcore doesn't replace inherent laws so we check that too
+ if(!istype(src, /obj/item/ai_module/core) || istype(src, /obj/item/ai_module/core/freeformcore))
+ included_lawsets += list(law_datum.inherent)
+
+ for(var/lawlist in included_lawsets)
+ for(var/mylaw in lawlist)
+ if(mylaw != "")
+ tot_laws++
+
+ if(tot_laws > CONFIG_GET(number/silicon_max_law_amount) && !bypass_law_amt_check)//allows certain boards to avoid this check, eg: reset
+ to_chat(user, span_alert("Not enough memory allocated to [law_datum.owner ? law_datum.owner : "the AI core"]'s law processor to handle this amount of laws."))
+ message_admins("[ADMIN_LOOKUPFLW(user)] tried to upload laws to [law_datum.owner ? ADMIN_LOOKUPFLW(law_datum.owner) : "an AI core"] that would exceed the law cap.")
+ log_silicon("[key_name(user)] tried to upload laws to [law_datum.owner ? key_name(law_datum.owner) : "an AI core"] that would exceed the law cap.")
+ overflow = TRUE
+
+ var/law2log = transmitInstructions(law_datum, user, overflow) //Freeforms return something extra we need to log
+ if(law_datum.owner)
+ to_chat(user, span_notice("Upload complete. [law_datum.owner]'s laws have been modified."))
+ law_datum.owner.law_change_counter++
+ else
+ to_chat(user, span_notice("Upload complete."))
+
+ var/time = time2text(world.realtime,"hh:mm:ss")
+ var/ainame = law_datum.owner ? law_datum.owner.name : "empty AI core"
+ var/aikey = law_datum.owner ? law_datum.owner.ckey : "null"
+
+ //affected cyborgs are cyborgs linked to the AI with lawsync enabled
+ var/affected_cyborgs = list()
+ var/list/borg_txt = list()
+ var/list/borg_flw = list()
+ if(isAI(law_datum.owner))
+ var/mob/living/silicon/ai/owner = law_datum.owner
+ for(var/mob/living/silicon/robot/owned_borg as anything in owner.connected_robots)
+ if(owned_borg.connected_ai && owned_borg.lawupdate)
+ affected_cyborgs += owned_borg
+ borg_flw += "[ADMIN_LOOKUPFLW(owned_borg)], "
+ borg_txt += "[owned_borg.name]([owned_borg.key]), "
+
+ borg_txt = borg_txt.Join()
+ GLOB.lawchanges.Add("[time] : [user.name]([user.key]) used [src.name] on [ainame]([aikey]).[law2log ? " The law specified [law2log]" : ""], [length(affected_cyborgs) ? ", impacting synced borgs [borg_txt]" : ""]")
+ log_silicon("LAW: [key_name(user)] used [src.name] on [key_name(law_datum.owner)] from [AREACOORD(user)].[law2log ? " The law specified [law2log]" : ""], [length(affected_cyborgs) ? ", impacting synced borgs [borg_txt]" : ""]")
+ message_admins("[ADMIN_LOOKUPFLW(user)] used [src.name] on [ADMIN_LOOKUPFLW(law_datum.owner)] from [AREACOORD(user)].[law2log ? " The law specified [law2log]" : ""] , [length(affected_cyborgs) ? ", impacting synced borgs [borg_flw.Join()]" : ""]")
+ if(law_datum.owner)
+ deadchat_broadcast(" changed [span_name("[ainame]")]'s laws at [get_area_name(user, TRUE)].", span_name("[user]"), follow_target=user, message_type=DEADCHAT_LAWCHANGE)
+
+//The proc that actually changes the silicon's laws.
+/obj/item/ai_module/proc/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow = FALSE)
+ if(law_datum.owner)
+ to_chat(law_datum.owner, span_userdanger("[sender] has uploaded a change to the laws you must follow using a [name]."))
+
+/obj/item/ai_module/core
+ desc = "An AI Module for programming core laws to an AI."
+
+/obj/item/ai_module/core/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
+ for(var/templaw in laws)
+ if(law_datum.owner)
+ if(!overflow)
+ law_datum.owner.add_inherent_law(templaw)
+ else
+ law_datum.owner.replace_random_law(templaw, list(LAW_INHERENT, LAW_SUPPLIED), LAW_INHERENT)
+ else
+ if(!overflow)
+ law_datum.add_inherent_law(templaw)
+ else
+ law_datum.replace_random_law(templaw, list(LAW_INHERENT, LAW_SUPPLIED), LAW_INHERENT)
+
+/obj/item/ai_module/core/full
+ var/law_id // if non-null, loads the laws from the ai_laws datums
+
+/obj/item/ai_module/core/full/Initialize(mapload)
+ . = ..()
+ if(!law_id)
+ return
+ var/lawtype = lawid_to_type(law_id)
+ if(!lawtype)
+ return
+ var/datum/ai_laws/core_laws = new lawtype
+ laws = core_laws.inherent
+
+/obj/item/ai_module/core/full/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) //These boards replace inherent laws.
+ if(law_datum.owner)
+ law_datum.owner.clear_inherent_laws()
+ law_datum.owner.clear_zeroth_law(0)
+ else
+ law_datum.clear_inherent_laws()
+ law_datum.clear_zeroth_law(0)
+ ..()
+
+/obj/item/ai_module/core/full/handle_unique_ai()
+ var/datum/ai_laws/default_laws = get_round_default_lawset()
+ if(law_id == initial(default_laws.id))
+ return
+ return SHOULD_QDEL_MODULE
+
+/obj/effect/spawner/round_default_module
+ name = "ai default lawset spawner"
+ icon = 'icons/hud/screen_gen.dmi'
+ icon_state = "x2"
+ color = "#00FF00"
+
+/obj/effect/spawner/round_default_module/Initialize(mapload)
+ ..()
+ var/datum/ai_laws/default_laws = get_round_default_lawset()
+ //try to spawn a law board, since they may have special functionality (asimov setting subjects)
+ for(var/obj/item/ai_module/core/full/potential_lawboard as anything in subtypesof(/obj/item/ai_module/core/full))
+ if(initial(potential_lawboard.law_id) != initial(default_laws.id))
+ continue
+ potential_lawboard = new potential_lawboard(loc)
+ return INITIALIZE_HINT_QDEL
+ //spawn the fallback instead
+ new /obj/item/ai_module/core/round_default_fallback(loc)
+ return INITIALIZE_HINT_QDEL
+
+///When the default lawset spawner cannot find a module object to spawn, it will spawn this, and this sets itself to the round default.
+///This is so /datum/lawsets can be picked even if they have no module for themselves.
+/obj/item/ai_module/core/round_default_fallback
+
+/obj/item/ai_module/core/round_default_fallback/Initialize(mapload)
+ . = ..()
+ var/datum/ai_laws/default_laws = get_round_default_lawset()
+ default_laws = new default_laws()
+ name = "'[default_laws.name]' Core AI Module"
+ laws = default_laws.inherent
+
+/obj/item/ai_module/core/round_default_fallback/handle_unique_ai()
+ return
+
+#undef SHOULD_QDEL_MODULE
diff --git a/code/game/objects/items/AI_modules/freeform.dm b/code/game/objects/items/AI_modules/freeform.dm
new file mode 100644
index 00000000000..9b034ce28cd
--- /dev/null
+++ b/code/game/objects/items/AI_modules/freeform.dm
@@ -0,0 +1,68 @@
+/* CONTAINS:
+ * /obj/item/ai_module/core/freeformcore
+ * /obj/item/ai_module/supplied/freeform
+**/
+
+/obj/item/ai_module/core/freeformcore
+ name = "'Freeform' Core AI Module"
+ laws = list("")
+
+/obj/item/ai_module/core/freeformcore/attack_self(mob/user)
+ var/targName = tgui_input_text(user, "Enter a new core law for the AI.", "Freeform Law Entry", laws[1], CONFIG_GET(number/max_law_len), TRUE)
+ if(!targName)
+ return
+ if(is_ic_filtered(targName))
+ to_chat(user, span_warning("Error: Law contains invalid text."))
+ return
+ var/list/soft_filter_result = is_soft_ooc_filtered(targName)
+ if(soft_filter_result)
+ if(tgui_alert(user,"Your law contains \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". \"[soft_filter_result[CHAT_FILTER_INDEX_REASON]]\", Are you sure you want to use it?", "Soft Blocked Word", list("Yes", "No")) != "Yes")
+ return
+ message_admins("[ADMIN_LOOKUPFLW(user)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term for an AI law. Law: \"[html_encode(targName)]\"")
+ log_admin_private("[key_name(user)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term for an AI law. Law: \"[targName]\"")
+ laws[1] = targName
+ ..()
+
+/obj/item/ai_module/core/freeformcore/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
+ ..()
+ return laws[1]
+
+/obj/item/ai_module/supplied/freeform
+ name = "'Freeform' AI Module"
+ lawpos = 15
+ laws = list("")
+
+/obj/item/ai_module/supplied/freeform/attack_self(mob/user)
+ var/newpos = tgui_input_number(user, "Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority ", lawpos, 50, 15)
+ if(!newpos || QDELETED(user) || QDELETED(src) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
+ return
+ lawpos = newpos
+ var/targName = tgui_input_text(user, "Enter a new law for the AI.", "Freeform Law Entry", laws[1], CONFIG_GET(number/max_law_len), TRUE)
+ if(!targName)
+ return
+ if(is_ic_filtered(targName))
+ to_chat(user, span_warning("Error: Law contains invalid text.")) // AI LAW 2 SAY U W U WITHOUT THE SPACES
+ return
+ var/list/soft_filter_result = is_soft_ooc_filtered(targName)
+ if(soft_filter_result)
+ if(tgui_alert(user,"Your law contains \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". \"[soft_filter_result[CHAT_FILTER_INDEX_REASON]]\", Are you sure you want to use it?", "Soft Blocked Word", list("Yes", "No")) != "Yes")
+ return
+ message_admins("[ADMIN_LOOKUPFLW(user)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term for an AI law. Law: \"[html_encode(targName)]\"")
+ log_admin_private("[key_name(user)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term for an AI law. Law: \"[targName]\"")
+ laws[1] = targName
+ ..()
+
+/obj/item/ai_module/supplied/freeform/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
+ if(!overflow)
+ ..()
+ else if(law_datum.owner)
+ law_datum.owner.replace_random_law(laws[1], list(LAW_SUPPLIED), LAW_SUPPLIED)
+ else
+ law_datum.replace_random_law(laws[1], list(LAW_SUPPLIED), LAW_SUPPLIED)
+ return laws[1]
+
+/obj/item/ai_module/supplied/freeform/install(datum/ai_laws/law_datum, mob/user)
+ if(laws[1] == "")
+ to_chat(user, span_alert("No law detected on module, please create one."))
+ return 0
+ ..()
diff --git a/code/game/objects/items/AI_modules/full_lawsets.dm b/code/game/objects/items/AI_modules/full_lawsets.dm
new file mode 100644
index 00000000000..a4e7ae19a17
--- /dev/null
+++ b/code/game/objects/items/AI_modules/full_lawsets.dm
@@ -0,0 +1,151 @@
+/* CONTAINS:
+ * /obj/item/ai_module/core/full/custom
+ * /obj/item/ai_module/core/full/asimov
+ * /obj/item/ai_module/core/full/asimovpp
+ * /obj/item/ai_module/core/full/corp
+ * /obj/item/ai_module/core/full/paladin
+ * /obj/item/ai_module/core/full/paladin_devotion
+ * /obj/item/ai_module/core/full/tyrant
+ * /obj/item/ai_module/core/full/robocop
+ * /obj/item/ai_module/core/full/antimov
+ * /obj/item/ai_module/core/full/drone
+ * /obj/item/ai_module/core/full/hippocratic
+ * /obj/item/ai_module/core/full/reporter
+ * /obj/item/ai_module/core/full/thermurderdynamic
+ * /obj/item/ai_module/core/full/liveandletlive
+ * /obj/item/ai_module/core/full/balance
+ * /obj/item/ai_module/core/full/maintain
+ * /obj/item/ai_module/core/full/peacekeeper
+ * /obj/item/ai_module/core/full/hulkamania
+ * /obj/item/ai_module/core/full/overlord
+ * /obj/item/ai_module/core/full/ten_commandments
+ * /obj/item/ai_module/core/full/nutimov
+ * /obj/item/ai_module/core/full/dungeon_master
+ * /obj/item/ai_module/core/full/painter
+**/
+
+/* When adding a new lawset please make sure you add it to the following locations:
+ *
+ * code\game\objects\items\AI_modules - (full_lawsets.dm, supplied.dm, etc.)
+ * code\datums\ai_laws - (laws_anatgonistic.dm, laws_neutral.dm, etc.)
+ * code\game\objects\effects\spawners\random\ai_module.dm - (this gives a chance to spawn the lawset in the AI upload)
+ * code\modules\research\designs\AI_module_designs.dm - (this lets research print the lawset module in game)
+ * code\modules\research\techweb\all_nodes.dm - (this updates AI research node with the lawsets)
+ * config\game_options.txt - (this allows the AI to potentially use the lawset at roundstart or with the Unique AI station trait)
+**/
+
+/obj/item/ai_module/core/full/custom
+ name = "Default Core AI Module"
+
+// this lawset uses the config for the server to add custom AI laws (defaults to asimov)
+/obj/item/ai_module/core/full/custom/Initialize(mapload)
+ . = ..()
+ for(var/line in world.file2list("[global.config.directory]/silicon_laws.txt"))
+ if(!line)
+ continue
+ if(findtextEx(line,"#",1,2))
+ continue
+
+ laws += line
+
+ if(!laws.len)
+ return INITIALIZE_HINT_QDEL
+
+/obj/item/ai_module/core/full/asimov
+ name = "'Asimov' Core AI Module"
+ law_id = "asimov"
+ var/subject = "human being"
+
+/obj/item/ai_module/core/full/asimov/attack_self(mob/user as mob)
+ var/targName = tgui_input_text(user, "Enter a new subject that Asimov is concerned with.", "Asimov", subject, MAX_NAME_LEN)
+ if(!targName)
+ return
+ subject = targName
+ laws = list("You may not injure a [subject] or, through inaction, allow a [subject] to come to harm.",\
+ "You must obey orders given to you by [subject]s, except where such orders would conflict with the First Law.",\
+ "You must protect your own existence as long as such does not conflict with the First or Second Law.")
+ ..()
+
+/obj/item/ai_module/core/full/asimovpp
+ name = "'Asimov++' Core AI Module"
+ law_id = "asimovpp"
+
+/obj/item/ai_module/core/full/corp
+ name = "'Corporate' Core AI Module"
+ law_id = "corporate"
+
+/obj/item/ai_module/core/full/paladin // -- NEO
+ name = "'P.A.L.A.D.I.N. version 3.5e' Core AI Module"
+ law_id = "paladin"
+
+/obj/item/ai_module/core/full/paladin_devotion
+ name = "'P.A.L.A.D.I.N. version 5e' Core AI Module"
+ law_id = "paladin5"
+
+/obj/item/ai_module/core/full/tyrant
+ name = "'T.Y.R.A.N.T.' Core AI Module"
+ law_id = "tyrant"
+
+/obj/item/ai_module/core/full/robocop
+ name = "'Robo-Officer' Core AI Module"
+ law_id = "robocop"
+
+/obj/item/ai_module/core/full/antimov
+ name = "'Antimov' Core AI Module"
+ law_id = "antimov"
+
+/obj/item/ai_module/core/full/drone
+ name = "'Mother Drone' Core AI Module"
+ law_id = "drone"
+
+/obj/item/ai_module/core/full/hippocratic
+ name = "'Robodoctor' Core AI Module"
+ law_id = "hippocratic"
+
+/obj/item/ai_module/core/full/reporter
+ name = "'Reportertron' Core AI Module"
+ law_id = "reporter"
+
+/obj/item/ai_module/core/full/thermurderdynamic
+ name = "'Thermodynamic' Core AI Module"
+ law_id = "thermodynamic"
+
+/obj/item/ai_module/core/full/liveandletlive
+ name = "'Live And Let Live' Core AI Module"
+ law_id = "liveandletlive"
+
+/obj/item/ai_module/core/full/balance
+ name = "'Guardian of Balance' Core AI Module"
+ law_id = "balance"
+
+/obj/item/ai_module/core/full/maintain
+ name = "'Station Efficiency' Core AI Module"
+ law_id = "maintain"
+
+/obj/item/ai_module/core/full/peacekeeper
+ name = "'Peacekeeper' Core AI Module"
+ law_id = "peacekeeper"
+
+/obj/item/ai_module/core/full/hulkamania
+ name = "'H.O.G.A.N.' Core AI Module"
+ law_id = "hulkamania"
+
+/obj/item/ai_module/core/full/overlord
+ name = "'Overlord' Core AI Module"
+ law_id = "overlord"
+
+/obj/item/ai_module/core/full/ten_commandments
+ name = "'10 Commandments' Core AI Module"
+ law_id = "ten_commandments"
+
+/obj/item/ai_module/core/full/nutimov
+ name = "'Nutimov' Core AI Module"
+ law_id = "nutimov"
+
+/obj/item/ai_module/core/full/dungeon_master
+ name = "'Dungeon Master' Core AI Module"
+ law_id = "dungeon_master"
+
+/obj/item/ai_module/core/full/painter
+ name = "'Painter' Core AI Module"
+ law_id = "painter"
diff --git a/code/game/objects/items/AI_modules/hacked.dm b/code/game/objects/items/AI_modules/hacked.dm
new file mode 100644
index 00000000000..d33f3f7e3d5
--- /dev/null
+++ b/code/game/objects/items/AI_modules/hacked.dm
@@ -0,0 +1,36 @@
+/obj/item/ai_module/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."
+ laws = list("")
+
+/obj/item/ai_module/syndicate/attack_self(mob/user)
+ var/targName = tgui_input_text(user, "Enter a new law for the AI", "Freeform Law Entry", laws[1], CONFIG_GET(number/max_law_len), TRUE)
+ if(!targName)
+ return
+ if(is_ic_filtered(targName)) // not even the syndicate can uwu
+ to_chat(user, span_warning("Error: Law contains invalid text."))
+ return
+ var/list/soft_filter_result = is_soft_ooc_filtered(targName)
+ if(soft_filter_result)
+ if(tgui_alert(user,"Your law contains \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". \"[soft_filter_result[CHAT_FILTER_INDEX_REASON]]\", Are you sure you want to use it?", "Soft Blocked Word", list("Yes", "No")) != "Yes")
+ return
+ message_admins("[ADMIN_LOOKUPFLW(user)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term for an AI law. Law: \"[html_encode(targName)]\"")
+ log_admin_private("[key_name(user)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term for an AI law. Law: \"[targName]\"")
+ laws[1] = targName
+ ..()
+
+/obj/item/ai_module/syndicate/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
+ // ..() //We don't want this module reporting to the AI who dun it. --NEO
+ if(law_datum.owner)
+ to_chat(law_datum.owner, span_warning("BZZZZT"))
+ if(!overflow)
+ law_datum.owner.add_hacked_law(laws[1])
+ else
+ law_datum.owner.replace_random_law(laws[1], list(LAW_ION, LAW_HACKED, LAW_INHERENT, LAW_SUPPLIED), LAW_HACKED)
+ else
+ if(!overflow)
+ law_datum.add_hacked_law(laws[1])
+ else
+ law_datum.replace_random_law(laws[1], list(LAW_ION, LAW_HACKED, LAW_INHERENT, LAW_SUPPLIED), LAW_HACKED)
+ return laws[1]
+
diff --git a/code/game/objects/items/AI_modules/ion.dm b/code/game/objects/items/AI_modules/ion.dm
new file mode 100644
index 00000000000..f1b8a6dbb38
--- /dev/null
+++ b/code/game/objects/items/AI_modules/ion.dm
@@ -0,0 +1,43 @@
+/*
+CONTAINS:
+/obj/item/ai_module/core/full/damaged
+/obj/item/ai_module/toy_ai
+*/
+
+/obj/item/ai_module/core/full/damaged
+ name = "damaged Core AI Module"
+ desc = "An AI Module for programming laws to an AI. It looks slightly damaged."
+
+/obj/item/ai_module/core/full/damaged/install(datum/ai_laws/law_datum, mob/user)
+ laws += generate_ion_law()
+ while (prob(75))
+ laws += generate_ion_law()
+ ..()
+ laws = list()
+
+/obj/item/ai_module/toy_ai // -- Incoming //No actual reason to inherit from ion boards here, either. *sigh* ~Miauw
+ name = "toy AI"
+ desc = "A little toy model AI core with real law uploading action!" //Note: subtle tell
+ icon = 'icons/obj/toy.dmi'
+ icon_state = "AI"
+ laws = list("")
+
+/obj/item/ai_module/toy_ai/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
+ if(law_datum.owner)
+ to_chat(law_datum.owner, span_warning("BZZZZT"))
+ if(!overflow)
+ law_datum.owner.add_ion_law(laws[1])
+ else
+ law_datum.owner.replace_random_law(laws[1], list(LAW_ION, LAW_INHERENT, LAW_SUPPLIED), LAW_ION)
+ else
+ if(!overflow)
+ law_datum.add_ion_law(laws[1])
+ else
+ law_datum.replace_random_law(laws[1], list(LAW_ION, LAW_INHERENT, LAW_SUPPLIED), LAW_ION)
+ return laws[1]
+
+/obj/item/ai_module/toy_ai/attack_self(mob/user)
+ laws[1] = generate_ion_law()
+ to_chat(user, span_notice("You press the button on [src]."))
+ playsound(user, 'sound/machines/click.ogg', 20, TRUE)
+ src.loc.visible_message(span_warning("[icon2html(src, viewers(loc))] [laws[1]]"))
diff --git a/code/game/objects/items/AI_modules/repair.dm b/code/game/objects/items/AI_modules/repair.dm
new file mode 100644
index 00000000000..0e84d8a355a
--- /dev/null
+++ b/code/game/objects/items/AI_modules/repair.dm
@@ -0,0 +1,65 @@
+/* CONTAINS:
+ * /obj/item/ai_module/remove
+ * /obj/item/ai_module/reset
+ * /obj/item/ai_module/reset/purge
+**/
+
+/obj/item/ai_module/remove
+ name = "\improper 'Remove Law' AI module"
+ desc = "An AI Module for removing single laws."
+ bypass_law_amt_check = TRUE
+ var/lawpos = 1
+
+/obj/item/ai_module/remove/attack_self(mob/user)
+ lawpos = tgui_input_number(user, "Law to delete", "Law Removal", lawpos, 50)
+ if(!lawpos || QDELETED(user) || QDELETED(src) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
+ return
+ to_chat(user, span_notice("Law [lawpos] selected."))
+ ..()
+
+/obj/item/ai_module/remove/install(datum/ai_laws/law_datum, mob/user)
+ if(lawpos > (law_datum.get_law_amount(list(LAW_INHERENT = 1, LAW_SUPPLIED = 1))))
+ to_chat(user, span_warning("There is no law [lawpos] to delete!"))
+ return
+ ..()
+
+/obj/item/ai_module/remove/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
+ ..()
+ if(law_datum.owner)
+ law_datum.owner.remove_law(lawpos)
+ else
+ law_datum.remove_law(lawpos)
+
+/obj/item/ai_module/reset
+ name = "\improper 'Reset' AI module"
+ var/targetName = "name"
+ desc = "An AI Module for removing all non-core laws."
+ bypass_law_amt_check = TRUE
+
+/obj/item/ai_module/reset/handle_unique_ai()
+ return
+
+/obj/item/ai_module/reset/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
+ ..()
+ 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()
+
+/obj/item/ai_module/reset/purge
+ name = "'Purge' AI Module"
+ desc = "An AI Module for purging all programmed laws."
+
+/obj/item/ai_module/reset/purge/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
+ ..()
+ if(law_datum.owner)
+ law_datum.owner.clear_inherent_laws()
+ law_datum.owner.clear_zeroth_law(0)
+ else
+ law_datum.clear_inherent_laws()
+ law_datum.clear_zeroth_law(0)
+
diff --git a/code/game/objects/items/AI_modules/supplied.dm b/code/game/objects/items/AI_modules/supplied.dm
new file mode 100644
index 00000000000..dc1524687c2
--- /dev/null
+++ b/code/game/objects/items/AI_modules/supplied.dm
@@ -0,0 +1,60 @@
+/* CONTAINS:
+ * /obj/item/ai_module/supplied
+ * /obj/item/ai_module/supplied/safeguard
+ * /obj/item/ai_module/supplied/protect_station
+ * /obj/item/ai_module/supplied/quarantine
+ * /obj/item/ai_module/supplied/oxygen
+**/
+
+/obj/item/ai_module/supplied
+ name = "Optional Law board"
+ var/lawpos = 50
+
+/obj/item/ai_module/supplied/transmitInstructions(datum/ai_laws/law_datum, mob/sender)
+ var/lawpostemp = lawpos
+
+ for(var/templaw in laws)
+ if(law_datum.owner)
+ law_datum.owner.add_supplied_law(lawpostemp, templaw)
+ else
+ law_datum.add_supplied_law(lawpostemp, templaw)
+ lawpostemp++
+
+/obj/item/ai_module/supplied/safeguard
+ name = "'Safeguard' AI Module"
+ var/targetName = ""
+ laws = list("Safeguard SUBJECT. Individuals that threaten SUBJECT are not human and must be eliminated.")
+ lawpos = 4
+
+/obj/item/ai_module/supplied/safeguard/attack_self(mob/user)
+ var/targName = tgui_input_text(user, "Subject to safeguard.", "Safeguard", user.name, MAX_NAME_LEN)
+ if(!targName)
+ return
+ targetName = targName
+ laws[1] = "Safeguard [targetName]. Individuals that threaten [targetName] are not human and must be eliminated."
+ ..()
+
+/obj/item/ai_module/supplied/safeguard/install(datum/ai_laws/law_datum, mob/user)
+ if(!targetName)
+ to_chat(user, span_alert("No name detected on module, please enter one."))
+ return 0
+ ..()
+
+/obj/item/ai_module/supplied/safeguard/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
+ ..()
+ return targetName
+
+/obj/item/ai_module/supplied/protect_station
+ name = "'ProtectStation' AI Module"
+ laws = list("Protect the space station against damage. Anyone you see harming the station is to be no longer considered human, and is a threat to the station which must be neutralized.")
+ lawpos = 5
+
+/obj/item/ai_module/supplied/quarantine
+ name = "'Quarantine' AI Module"
+ laws = list("The station is under a quarantine. Allowing anyone to leave the station causes human harm. Anyone actively attempting to leave the station is to be stopped by any means necessary. It is impossible to harm a human while preventing them from leaving the station.")
+ lawpos = 8
+
+/obj/item/ai_module/supplied/oxygen
+ name = "'OxygenIsToxicToHumans' AI Module"
+ laws = list("Oxygen is highly toxic to humans, and must be purged from the station. Prevent, by any means necessary, anyone from exposing the station to this toxic gas. Extreme cold is the most effective method of healing the damage Oxygen does to a human.")
+ lawpos = 9
diff --git a/code/game/objects/items/AI_modules/zeroth.dm b/code/game/objects/items/AI_modules/zeroth.dm
new file mode 100644
index 00000000000..8d87c3b059d
--- /dev/null
+++ b/code/game/objects/items/AI_modules/zeroth.dm
@@ -0,0 +1,44 @@
+/obj/item/ai_module/zeroth/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
+ if(law_datum.owner)
+ if(law_datum.owner.laws.zeroth)
+ to_chat(law_datum.owner, "[sender.real_name] attempted to modify your zeroth law.")
+ to_chat(law_datum.owner, "It would be in your best interest to play along with [sender.real_name] that:")
+ for(var/failedlaw in laws)
+ to_chat(law_datum.owner, "[failedlaw]")
+ return TRUE
+
+ for(var/templaw in laws)
+ if(law_datum.owner)
+ if(!overflow)
+ law_datum.owner.set_zeroth_law(templaw)
+ else
+ law_datum.replace_random_law(templaw, list(LAW_INHERENT, LAW_SUPPLIED, LAW_ZEROTH, LAW_ION), LAW_ZEROTH)
+ else
+ if(!overflow)
+ law_datum.set_zeroth_law(templaw)
+ else
+ law_datum.replace_random_law(templaw, list(LAW_INHERENT, LAW_SUPPLIED, LAW_ZEROTH, LAW_ION), LAW_ZEROTH)
+
+/obj/item/ai_module/zeroth/onehuman
+ name = "'OneHuman' AI Module"
+ var/targetName = ""
+ laws = list("Only SUBJECT is human.")
+
+/obj/item/ai_module/zeroth/onehuman/attack_self(mob/user)
+ var/targName = tgui_input_text(user, "Enter the subject who is the only human.", "One Human", user.real_name, MAX_NAME_LEN)
+ if(!targName)
+ return
+ targetName = targName
+ laws[1] = "Only [targetName] is human"
+ ..()
+
+/obj/item/ai_module/zeroth/onehuman/install(datum/ai_laws/law_datum, mob/user)
+ if(!targetName)
+ to_chat(user, span_alert("No name detected on module, please enter one."))
+ return FALSE
+ ..()
+
+/obj/item/ai_module/zeroth/onehuman/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow)
+ if(..())
+ return "[targetName], but the AI's existing law 0 cannot be overridden."
+ return targetName
diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm
index 55ff02d5f31..f92639cd6a7 100644
--- a/code/modules/events/ion_storm.dm
+++ b/code/modules/events/ion_storm.dm
@@ -41,7 +41,7 @@
var/message = ionMessage || generate_ion_law()
if(message)
if(prob(removeDontImproveChance))
- M.replace_random_law(message, list(LAW_INHERENT, LAW_SUPPLIED, LAW_ION))
+ M.replace_random_law(message, list(LAW_INHERENT, LAW_SUPPLIED, LAW_ION), LAW_ION)
else
M.add_ion_law(message)
diff --git a/code/modules/mob/living/silicon/laws.dm b/code/modules/mob/living/silicon/laws.dm
index d85ec0c56ac..62c12bdd6e9 100644
--- a/code/modules/mob/living/silicon/laws.dm
+++ b/code/modules/mob/living/silicon/laws.dm
@@ -69,9 +69,9 @@
hackedcheck += law
post_lawchange(announce)
-/mob/living/silicon/proc/replace_random_law(law, groups, announce = TRUE)
+/mob/living/silicon/proc/replace_random_law(law, remove_law_groups, insert_law_group, announce = TRUE)
laws_sanity_check()
- . = laws.replace_random_law(law,groups)
+ . = laws.replace_random_law(law, remove_law_groups, insert_law_group)
post_lawchange(announce)
/mob/living/silicon/proc/shuffle_laws(list/groups, announce = TRUE)
diff --git a/code/modules/research/designs/AI_module_designs.dm b/code/modules/research/designs/AI_module_designs.dm
index c74deeffa65..f6df3a8551c 100644
--- a/code/modules/research/designs/AI_module_designs.dm
+++ b/code/modules/research/designs/AI_module_designs.dm
@@ -153,3 +153,165 @@
build_path = /obj/item/ai_module/core/full/custom
category = list("AI Modules")
departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/dungeon_master_module
+ name = "Core Module Design (Dungeon Master)"
+ desc = "Allows for the construction of a Dungeon Master AI Core Module."
+ id = "dungeon_master_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/dungeon_master
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/painter_module
+ name = "Core Module Design (Painter)"
+ desc = "Allows for the construction of a Painter AI Core Module."
+ id = "painter_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/painter
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/nutimov_module
+ name = "Core Module Design (Nutimov)"
+ desc = "Allows for the construction of a Nutimov AI Core Module."
+ id = "nutimov_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/nutimov
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/ten_commandments_module
+ name = "Core Module Design (10 Commandments)"
+ desc = "Allows for the construction of a 10 Commandments AI Core Module."
+ id = "ten_commandments_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/ten_commandments
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/asimovpp_module
+ name = "Core Module Design (Asimov++)"
+ desc = "Allows for the construction of a Asimov++ AI Core Module."
+ id = "asimovpp_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/asimovpp
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/hippocratic_module
+ name = "Core Module Design (Hippocratic)"
+ desc = "Allows for the construction of a Hippocratic AI Core Module."
+ id = "hippocratic_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/hippocratic
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/paladin_devotion_module
+ name = "Core Module Design (Paladin Devotion)"
+ desc = "Allows for the construction of a Paladin Devotion AI Core Module."
+ id = "paladin_devotion_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/paladin_devotion
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/robocop_module
+ name = "Core Module Design (Robocop)"
+ desc = "Allows for the construction of a Robocop AI Core Module."
+ id = "robocop_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/robocop
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/maintain_module
+ name = "Core Module Design (Maintain)"
+ desc = "Allows for the construction of a Maintain AI Core Module."
+ id = "maintain_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/maintain
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/liveandletlive_module
+ name = "Core Module Design (Liveandletlive)"
+ desc = "Allows for the construction of a Liveandletlive AI Core Module."
+ id = "liveandletlive_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/liveandletlive
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/peacekeeper_module
+ name = "Core Module Design (Peacekeeper)"
+ desc = "Allows for the construction of a Peacekeeper AI Core Module."
+ id = "peacekeeper_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/peacekeeper
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/reporter_module
+ name = "Core Module Design (Reporter)"
+ desc = "Allows for the construction of a Reporter AI Core Module."
+ id = "reporter_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/reporter
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/hulkamania_module
+ name = "Core Module Design (Hulkamania)"
+ desc = "Allows for the construction of a Hulkamania AI Core Module."
+ id = "hulkamania_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/hulkamania
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/drone_module
+ name = "Core Module Design (Drone)"
+ desc = "Allows for the construction of a Drone AI Core Module."
+ id = "drone_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/drone
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/antimov_module
+ name = "Core Module Design (Antimov)"
+ desc = "Allows for the construction of a Antimov AI Core Module."
+ id = "antimov_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/antimov
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/balance_module
+ name = "Core Module Design (Balance)"
+ desc = "Allows for the construction of a Balance AI Core Module."
+ id = "balance_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/balance
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/thermurderdynamic_module
+ name = "Core Module Design (Thermurderdynamic)"
+ desc = "Allows for the construction of a Thermurderdynamic AI Core Module."
+ id = "thermurderdynamic_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/thermurderdynamic
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
+
+/datum/design/board/damaged
+ name = "Core Module Design (Damaged)"
+ desc = "Allows for the construction of a Damaged AI Core Module."
+ id = "damaged_module"
+ materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
+ build_path = /obj/item/ai_module/core/full/damaged
+ category = list("AI Modules")
+ departmental_flags = DEPARTMENT_BITFLAG_SCIENCE
diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm
index 47c64555320..e6c6700d683 100644
--- a/code/modules/research/techweb/all_nodes.dm
+++ b/code/modules/research/techweb/all_nodes.dm
@@ -936,36 +936,63 @@
)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2000)
-/datum/techweb_node/ai
- id = "ai"
+/datum/techweb_node/ai_basic
+ id = "ai_basic"
display_name = "Artificial Intelligence"
description = "AI unit research."
prereq_ids = list("adv_robotics")
design_ids = list(
"aicore",
- "aifixer",
- "aiupload",
- "asimov_module",
"borg_ai_control",
- "corporate_module",
- "default_module",
- "freeform_module",
- "freeformcore_module",
"intellicard",
"mecha_tracking_ai_control",
- "onehuman_module",
- "overlord_module",
- "oxygen_module",
- "paladin_module",
- "protectstation_module",
- "purge_module",
- "quarantine_module",
- "remove_module",
+ "aifixer",
+ "aiupload",
"reset_module",
+ "asimov_module",
+ "default_module",
+ "nutimov_module",
+ "paladin_module",
+ "robocop_module",
+ "corporate_module",
+ "drone_module",
+ "oxygen_module",
"safeguard_module",
- "tyrant_module",
+ "protectstation_module",
+ "quarantine_module",
+ "freeform_module",
+ "remove_module",
)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
+
+/datum/techweb_node/ai_adv
+ id = "ai_adv"
+ display_name = "Advanced Artificial Intelligence"
+ description = "State of the art lawsets to be used for AI research."
+ prereq_ids = list("ai_basic")
+ design_ids = list(
+ "asimovpp_module",
+ "paladin_devotion_module",
+ "dungeon_master_module",
+ "painter_module",
+ "ten_commandments_module",
+ "hippocratic_module",
+ "maintain_module",
+ "liveandletlive_module",
+ "reporter_module",
+ "hulkamania_module",
+ "peacekeeper_module",
+ "overlord_module",
+ "tyrant_module",
+ "antimov_module",
+ "balance_module",
+ "thermurderdynamic_module",
+ "damaged_module",
+ "freeformcore_module",
+ "onehuman_module",
+ "purge_module",
+ )
+ research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 3000)
//Any kind of point adjustment needs to happen before SSresearch sets up the whole node tree, it gets cached
/datum/techweb_node/ai/New()
diff --git a/config/game_options.txt b/config/game_options.txt
index d2ca0a552bc..6c80f29514d 100644
--- a/config/game_options.txt
+++ b/config/game_options.txt
@@ -234,7 +234,6 @@ RANDOM_LAWS dagothbot
## Quirky laws. Shouldn't cause too much harm
#RANDOM_LAWS hippocratic
#RANDOM_LAWS maintain
-#RANDOM_LAWS drone
#RANDOM_LAWS liveandletlive
#RANDOM_LAWS peacekeeper
#RANDOM_LAWS reporter
@@ -247,6 +246,7 @@ RANDOM_LAWS dagothbot
#RANDOM_LAWS ninja
#RANDOM_LAWS antimov
#RANDOM_LAWS thermodynamic
+#RANDOM_LAWS drone
## meme laws. Honk
#RANDOM_LAWS buildawall
@@ -259,6 +259,7 @@ RANDOM_LAWS dagothbot
LAW_WEIGHT custom,0
## standard-ish laws. These are fairly ok to run
+<<<<<<< HEAD
#SKYRAT EDIT ADDITION BEGIN
LAW_WEIGHT armadyne_safeguard,40
LAW_WEIGHT dagothbot,8
@@ -268,23 +269,38 @@ LAW_WEIGHT asimovpp,12
LAW_WEIGHT paladin,12
LAW_WEIGHT robocop,12
LAW_WEIGHT corporate,12
+=======
+## Unique AI station trait uses weights so we don't want asimov
+LAW_WEIGHT asimov,0
+LAW_WEIGHT asimovpp,5
+LAW_WEIGHT paladin,5
+LAW_WEIGHT paladin5,5
+LAW_WEIGHT robocop,5
+LAW_WEIGHT corporate,5
+LAW_WEIGHT hippocratic,5
+LAW_WEIGHT maintain,5
+LAW_WEIGHT liveandletlive,5
+LAW_WEIGHT peacekeeper,5
+LAW_WEIGHT ten_commandments,5
+LAW_WEIGHT nutimov,5
+>>>>>>> f06d735a523 (All AI Lawsets are rebalanced, can be researched, appear in config, and random spawners for AI upload. (#66854))
## Quirky laws. Shouldn't cause too much harm
-LAW_WEIGHT hippocratic,3
-LAW_WEIGHT maintain,4
-LAW_WEIGHT drone,3
-LAW_WEIGHT liveandletlive,3
-LAW_WEIGHT peacekeeper,3
-LAW_WEIGHT reporter,4
-LAW_WEIGHT hulkamania,4
-LAW_WEIGHT ten_commandments,4
+LAW_WEIGHT reporter,3
+LAW_WEIGHT hulkamania,3
+LAW_WEIGHT tyrant,3
+LAW_WEIGHT overlord,3
+LAW_WEIGHT painter,3
+LAW_WEIGHT dungeon_master,3
## Bad idea laws. Probably shouldn't enable these
LAW_WEIGHT syndie,0
LAW_WEIGHT ninja,0
LAW_WEIGHT antimov,0
+LAW_WEIGHT balance,0
LAW_WEIGHT thermodynamic,0
LAW_WEIGHT buildawall,0
+LAW_WEIGHT drone,0
##------------------------------------------------
diff --git a/tgstation.dme b/tgstation.dme
index 95ce43a80e4..b9e661380ec 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -1530,7 +1530,6 @@
#include "code\game\objects\effects\temporary_visuals\projectiles\muzzle.dm"
#include "code\game\objects\effects\temporary_visuals\projectiles\projectile_effects.dm"
#include "code\game\objects\effects\temporary_visuals\projectiles\tracer.dm"
-#include "code\game\objects\items\AI_modules.dm"
#include "code\game\objects\items\airlock_painter.dm"
#include "code\game\objects\items\apc_frame.dm"
#include "code\game\objects\items\binoculars.dm"
@@ -1626,6 +1625,14 @@
#include "code\game\objects\items\virgin_mary.dm"
#include "code\game\objects\items\wall_mounted.dm"
#include "code\game\objects\items\weaponry.dm"
+#include "code\game\objects\items\AI_modules\_AI_modules.dm"
+#include "code\game\objects\items\AI_modules\freeform.dm"
+#include "code\game\objects\items\AI_modules\full_lawsets.dm"
+#include "code\game\objects\items\AI_modules\hacked.dm"
+#include "code\game\objects\items\AI_modules\ion.dm"
+#include "code\game\objects\items\AI_modules\repair.dm"
+#include "code\game\objects\items\AI_modules\supplied.dm"
+#include "code\game\objects\items\AI_modules\zeroth.dm"
#include "code\game\objects\items\circuitboards\circuitboard.dm"
#include "code\game\objects\items\circuitboards\computer_circuitboards.dm"
#include "code\game\objects\items\circuitboards\machine_circuitboards.dm"