Files
Bubberstation/code/game/objects/items/AI_modules/repair.dm
MrMelbert 430e3b8af3 Adds the "Law panel", a control center for admins interacting with silicon laws (#73747)
Adds the Law Panel.

The Law Panel shows all silicons in the world and their lawsets.

From this panel, an admin can add new laws, remove old laws, edit
existing laws, or even re-arrange law order.

This allows for admins to get a lot more creative in creating custom
silicon lawsets. It also gives a much easier way for admins to deal with
law grief at a glance.

Additionally, the panel allows for admins to force a silicon to state
laws, privately announce the laws to the player, or give them a the
"laws updated" alert as normal.
2023-03-04 16:34:31 +00:00

65 lines
1.9 KiB
Plaintext

/* 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.can_perform_action(src, FORBID_TELEKINESIS_REACH))
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, LAW_SUPPLIED)))
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)