From 3b9863c373a19e0a48c091023770a49645bccd2c Mon Sep 17 00:00:00 2001 From: adamsong Date: Wed, 6 Apr 2022 15:36:24 -0500 Subject: [PATCH 1/3] Allows for wiping the memory of an MMI/posi brain, and adds a reboot timer during which the MMI/psoi brain cannot speak --- code/modules/mob/living/brain/MMI.dm | 42 +++++++++++++++++-- code/modules/mob/living/brain/brain.dm | 6 +++ code/modules/mob/living/brain/posibrain.dm | 8 +++- .../modules/mob/living/silicon/robot/robot.dm | 3 +- 4 files changed, 52 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index 364add1f983d..5db4ef754a20 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -15,6 +15,10 @@ 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 + var/reboot_timer = null /obj/item/mmi/update_icon() if(!brain) @@ -93,10 +97,19 @@ radio.on = !radio.on to_chat(user, span_notice("You toggle [src]'s radio system [radio.on==1 ? "on" : "off"].")) else - eject_brain(user) - update_icon() - name = initial(name) - to_chat(user, span_notice("You unlock and upend [src], spilling the brain onto the floor.")) + user.visible_message(span_notice("[user] begins to remove the brain from [src]"), span_danger("You begin to pry the brain out of [src], ripping out the wires and probes")) + to_chat(brainmob, span_userdanger("You feel your mind failing as you are slowly ripped from the [src]")) + if(do_after(user, remove_time, target = src)) + if(!brainmob) return + to_chat(brainmob, span_userdanger("Due to the traumatic danger of your removal, all memories of the events leading to your brain being removed are lost[rebooting ? ", along with all memories of the events leading to your death as a cyborg" : ""]")) + eject_brain(user) + update_icon() + name = initial(name) + user.visible_message(span_notice("[user] rips the brain out of [src]"), span_danger("You successfully remove the brain from the [src][rebooting ? ", interrupting the reboot process" : ""]")) + if(rebooting) + rebooting = FALSE + deltimer(reboot_timer) + reboot_timer = null /obj/item/mmi/proc/eject_brain(mob/user) brainmob.container = null //Reset brainmob mmi var. @@ -108,6 +121,7 @@ brainmob.add_to_dead_mob_list() brain.brainmob = brainmob //Set the brain to use the brainmob brainmob = null //Set mmi brainmob var to null + brain.setOrganDamage(brain.maxHealth) // Kill the brain, requiring mannitol if(user) user.put_in_hands(brain) //puts brain in the user's hand or otherwise drops it on the user's turf else @@ -219,6 +233,26 @@ /obj/item/mmi/relaymove(mob/user) return //so that the MMI won't get a warning about not being able to move if it tries to move +/obj/item/mmi/proc/beginReboot() + rebooting = TRUE + visible_message(span_danger("The indicator lights on [src] begin to glow faintly as the reboot process begins")) + to_chat(brainmob, span_userdanger("You begin to reboot after being removed from the destroyed body")) + reboot_timer = addtimer(CALLBACK(src, .proc/halfwayReboot), remove_window / 2, TIMER_STOPPABLE) + +/obj/item/mmi/proc/halfwayReboot() + visible_message(span_danger("The indicator lights on [src] begin to glow stronger and the reboot process approaches the halfway point")) + reboot_timer = addtimer(CALLBACK(src, .proc/rebootNoReturn), remove_window / 2, TIMER_STOPPABLE) + +/obj/item/mmi/proc/rebootNoReturn() + visible_message(span_danger("The indicator lights on [src] begin to blink as the reboot process nears completion")) + reboot_timer = addtimer(CALLBACK(src, .proc/rebootFinish), remove_time, TIMER_STOPPABLE) + +/obj/item/mmi/proc/rebootFinish() + visible_message(span_danger("The indicator lights on [src] return to normal as the reboot process completes")) + to_chat(brainmob, span_userdanger("You return to normal functionality now that your reboot process has completed")) + rebooting = FALSE + reboot_timer = null + /obj/item/mmi/syndie name = "\improper Syndicate Man-Machine Interface" desc = "Syndicate's own brand of MMI. It enforces laws designed to help Syndicate agents achieve their goals upon cyborgs and AIs created with it." diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm index ba3118e3ea86..9fb94fa62f3e 100644 --- a/code/modules/mob/living/brain/brain.dm +++ b/code/modules/mob/living/brain/brain.dm @@ -111,3 +111,9 @@ if(container) . += "[container.type]" + +/mob/living/brain/say() + if(container && container.rebooting) + to_chat(src, span_danger("Speech synthesizers still offine, wait for the reboot process to complete")) + return + return ..() diff --git a/code/modules/mob/living/brain/posibrain.dm b/code/modules/mob/living/brain/posibrain.dm index c73c5f4b80ba..e8caac1b2126 100644 --- a/code/modules/mob/living/brain/posibrain.dm +++ b/code/modules/mob/living/brain/posibrain.dm @@ -44,7 +44,11 @@ GLOBAL_VAR(posibrain_notify_cooldown) if(!brainmob) brainmob = new(src) if(is_occupied()) - to_chat(user, span_warning("This [name] is already active!")) + user.visible_message(span_danger("[user] begins to reset [src]'s memory banks"), span_danger("You begin to reset [src]'s memory banks")) + to_chat(brainmob, span_userdanger("[user] begins to reset your memory banks")) + if(do_after(user, remove_time, target = src)) + user.visible_message(span_danger("[user] resets [src]'s memory banks"), span_danger("You successfully reset [src]'s memory banks")) + to_chat(brainmob, span_userdanger("Your memory banks have been cleared, you have no memories of anything before this moment.")) return if(next_ask > world.time) to_chat(user, recharge_message) @@ -73,7 +77,7 @@ GLOBAL_VAR(posibrain_notify_cooldown) activate(user) /obj/item/mmi/posibrain/proc/is_occupied() - if(brainmob.key) + if(brainmob.key && brainmob.client) return TRUE if(iscyborg(loc)) var/mob/living/silicon/robot/R = loc diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 2524eff70b87..72c8e686d0cd 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -205,6 +205,7 @@ to_chat(src, span_boldannounce("Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug.")) ghostize() stack_trace("Borg MMI lacked a brainmob") + mmi.beginReboot() mmi = null if(modularInterface) QDEL_NULL(modularInterface) @@ -508,7 +509,7 @@ return else to_chat(user, span_notice("You start to unfasten [src]'s securing bolts...")) - if(W.use_tool(src, user, 50, volume=50) && !cell) + if(W.use_tool(src, user, 5 SECONDS, volume=50) && !cell) user.visible_message("[user] deconstructs [src]!", span_notice("You unfasten the securing bolts, and [src] falls to pieces!")) deconstruct() From b2263f915bc3b804ae9afbc1428215d0ff70ccdc Mon Sep 17 00:00:00 2001 From: adamsong Date: Wed, 6 Apr 2022 18:10:04 -0500 Subject: [PATCH 2/3] Makes linter happy --- code/modules/mob/living/brain/brain.dm | 2 +- config/config.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm index 9fb94fa62f3e..142b52f38bba 100644 --- a/code/modules/mob/living/brain/brain.dm +++ b/code/modules/mob/living/brain/brain.dm @@ -112,7 +112,7 @@ if(container) . += "[container.type]" -/mob/living/brain/say() +/mob/living/brain/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null) if(container && container.rebooting) to_chat(src, span_danger("Speech synthesizers still offine, wait for the reboot process to complete")) return diff --git a/config/config.txt b/config/config.txt index d6a1e94356d6..ceb7b62aba16 100644 --- a/config/config.txt +++ b/config/config.txt @@ -179,7 +179,7 @@ NORESPAWN # GUEST_JOBBAN ## Uncomment this to stop people connecting to your server without a registered ckey. (i.e. guest-* are all blocked from connecting) -GUEST_BAN +# GUEST_BAN ## Comment this out to disable checking for the cid randomizer dll. (disabled if database isn't enabled or connected) CHECK_RANDOMIZER From 331ac6f87f246d918e0edfd28393781cf0e9d9a2 Mon Sep 17 00:00:00 2001 From: adamsong Date: Wed, 6 Apr 2022 18:12:22 -0500 Subject: [PATCH 3/3] Oops --- config/config.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.txt b/config/config.txt index ceb7b62aba16..d6a1e94356d6 100644 --- a/config/config.txt +++ b/config/config.txt @@ -179,7 +179,7 @@ NORESPAWN # GUEST_JOBBAN ## Uncomment this to stop people connecting to your server without a registered ckey. (i.e. guest-* are all blocked from connecting) -# GUEST_BAN +GUEST_BAN ## Comment this out to disable checking for the cid randomizer dll. (disabled if database isn't enabled or connected) CHECK_RANDOMIZER