From 116dddc1344c4d7aa7e454505cc25a79aa01e9ff Mon Sep 17 00:00:00 2001 From: Lex <41524861+Phoenix4O4@users.noreply.github.com> Date: Thu, 9 Feb 2023 10:32:53 +0300 Subject: [PATCH] added datum and verbs for chane ai laws --- code/modules/admin/admin_verbs.dm | 3 ++- code/modules/admin/verbs/borgpanel.dm | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index dba4ec5b46..05c68bfdcf 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -87,7 +87,8 @@ GLOBAL_PROTECT(admin_verbs_admin) /client/proc/admin_cmd_remove_ghost_respawn_timer, //CIT /client/proc/addbunkerbypass, //CIT /client/proc/revokebunkerbypass, //CIT - /datum/admins/proc/open_borgopanel + /datum/admins/proc/open_borgopanel, + /datum/admins/proc/change_laws //change AI laws ) GLOBAL_LIST_INIT(admin_verbs_ban, list(/client/proc/unban_panel, /client/proc/DB_ban_panel, /client/proc/stickybanpanel)) GLOBAL_PROTECT(admin_verbs_ban) diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm index 4b60ecc0ff..ec03afff36 100644 --- a/code/modules/admin/verbs/borgpanel.dm +++ b/code/modules/admin/verbs/borgpanel.dm @@ -214,3 +214,25 @@ borg.lawsync() . = TRUE + +/datum/admins/proc/change_laws() + set category = "Admin.Player Interaction" + set name = "Change Silicon Laws" + set desc = "Change Silicon Laws" + + if(!check_rights(R_ADMIN)) + return + var/chosensilicon = input("Select a Silicon", "Select a Silicon", null, null) as null|anything in GLOB.silicon_mobs + if (!istype(chosensilicon, /mob/living/silicon)) + to_chat(usr, "Silicon is required for law changes", confidential=TRUE) + return + var/chosen = pick_closest_path(null, make_types_fancy(typesof(/obj/item/aiModule))) + if (!chosen) + return + var/new_board = new chosen(src) + var/obj/item/aiModule/chosenboard = new_board + var/mob/living/silicon/beepboop = chosensilicon + chosenboard.install(beepboop.laws, usr) + message_admins("[key_name_admin(usr)] added [chosenboard] to [ADMIN_LOOKUPFLW(beepboop)].") + log_admin("[key_name(usr)] added [chosenboard] to [key_name(beepboop)].") + qdel(new_board)