Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions code/game/objects/items/robot/robot_parts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,15 @@
if(user.mind.assigned_role == "Roboticist") // RD gets nothing
SSachievements.unlock_achievement(/datum/achievement/roboborg, user.client)

if(M.laws && M.laws.id != DEFAULT_AI_LAWID && M.override_cyborg_laws)
if(M.disabled_linksync)
aisync = FALSE
lawsync = FALSE
O.laws = M.laws
M.laws.associate(O)

O.invisibility = 0
//Transfer debug settings to new mob
// Transferring debug settings to new mob:
O.custom_name = created_name
O.locked = panel_locked

if(!aisync)
lawsync = FALSE
O.set_connected_ai(null)
Expand All @@ -315,9 +314,13 @@
O.set_connected_ai(forced_ai)
if(!lawsync)
O.lawupdate = 0
if(M.laws.id == DEFAULT_AI_LAWID)
O.make_laws()
to_chat(user,span_warning("Any laws uploaded to this MMI have not been transferred!"))
if(M.overrides_cyborg_laws && M.laws && !(O.connected_ai && O.lawupdate))
O.laws = M.laws
M.laws.associate(O)
// In case there is no law datum:
if(!O.laws)
O.make_laws()
to_chat(user, span_warning("The MMI flashes in alarm and exclaims: \"Safety enabled! Randomized safe lawset generated!\""))

SSticker.mode.remove_antag_for_borging(BM.mind)
if(!istype(M.laws, /datum/ai_laws/ratvar))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
autoping = FALSE
resistance_flags = FIRE_PROOF | ACID_PROOF
force_replace_ai_name = TRUE
override_cyborg_laws = TRUE
disabled_linksync = TRUE
can_update_laws = TRUE

/obj/item/mmi/posibrain/soul_vessel/Initialize(mapload)
Expand Down
24 changes: 18 additions & 6 deletions code/modules/mob/living/brain/MMI.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,30 @@
var/obj/mecha = null //This does not appear to be used outside of reference in mecha.dm.
var/obj/item/organ/brain/brain = null //The actual brain
var/datum/ai_laws/laws = new()
/// If they become an AI, should their name be replaced with the brainmob's `name`?
var/force_replace_ai_name = FALSE
var/overrides_aicore_laws = TRUE // Whether the laws on the MMI are transferred when it's uploaded as an AI
var/override_cyborg_laws = FALSE // Do custom laws uploaded to the MMI get transferred to borgs? If yes the borg will be unlinked and have lawsync disabled.
var/can_update_laws = TRUE //Can we use a lawboard to change the laws of this MMI?
var/remove_time = 2 SECONDS /// The time to remove the brain or reset the posi brain
var/rebooting = FALSE /// If the MMI is rebooting after being deconstructed
var/remove_window = 10 SECONDS /// The window in which someone has to remove the brain to lose memory of being killed as a borg
/// Whether the laws on the MMI are to be transferred when it is uploaded as an AI.
var/overrides_aicore_laws = TRUE
/// Whether the laws on the MMI are to be transferred when it is inserted into a cyborg.
// Consider setting `disabled_linksync` to `TRUE` if you do not want the AI's laws to override the cyborg's laws.
var/overrides_cyborg_laws = TRUE
/// If they become a cyborg, should they automatically be unlinked (from any AIs) and lawsync disabled?
var/disabled_linksync = FALSE
/// Can law modules be used to change the laws of this MMI?
var/can_update_laws = TRUE
/// How long does it take in seconds to remove the brain / reset the posi-brain?
var/remove_time = 2 SECONDS
/// Whether the MMI is rebooting after being deconstructed (from a cyborg).
var/rebooting = FALSE
/// How many seconds it takes to fully reboot? If brain is removed during this time, the brain will suffer from memory loss (which also includes their death).
var/remove_window = 10 SECONDS
/// Reference for timer.
var/reboot_timer = null
/// Is this a syndicate MMI?
var/syndicate_mmi = FALSE
/// The human that the enslaved the MMI.
var/mob/living/carbon/human/syndicate_master = null
/// The welcome message displayed to the brain when they're inserted into the MMI.
var/welcome_message = "<b>You are a brain within a Man-Machine Interface.\n\
Unless you are slaved as a silicon, you retain crew/antagonist/etc status and should behave as such.\n\
Being placed in a mech does not slave you to any laws.</b>"
Expand Down