From dfc2b1b5ec238dcd85d62015b17de76d79c971b3 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 15 Sep 2021 04:33:26 +0200 Subject: [PATCH] [MIRROR] Slight refractor to borg reboot boards, allows them to be reusable (#8183) * Slight refractor to borg reboot boards, allows them to be reusable (#61232) Refractors the cyborg reboot module to be an independent item rather than a subtype of cyborg upgrades. The new item is no longer consumed during use. Rebooting now makes a different sound when rebooting an AI shell or ghostless borg, rather than no sound at all. A recent PR fixed a longstanding apparent bug that allowed reboot boards to be resused. A bug it may have been, but the reboot board being a single-use item is kinda terrible, and doesn't make a lot of sense that the board is somehow destroyed when used. Mothblocks, who merged the bugfix PR, has given me permission to PR this change. Co-authored-by: Watermelon914 <37270891+Watermelon914@ users.noreply.github.com> * Slight refractor to borg reboot boards, allows them to be reusable Co-authored-by: zxaber <37497534+zxaber@users.noreply.github.com> Co-authored-by: Watermelon914 <37270891+Watermelon914@ users.noreply.github.com> --- .../objects/items/robot/robot_upgrades.dm | 53 ++++++++++++------- .../designs/mechfabricator_designs.dm | 2 +- .../modules/vehicles/mecha/mech_fabricator.dm | 3 ++ 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index da086bf2bc4..fbb4598dd2e 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -54,26 +54,6 @@ R.notify_ai(RENAME, oldname, R.real_name) log_game("[key_name(user)] have used a cyborg reclassification board to rename [oldkeyname] to [key_name(R)] at [loc_name(user)]") -/obj/item/borg/upgrade/restart - name = "cyborg emergency reboot module" - desc = "Used to force a reboot of a disabled-but-repaired cyborg, bringing it back online." - icon_state = "cyborg_upgrade1" - one_use = TRUE - -/obj/item/borg/upgrade/restart/action(mob/living/silicon/robot/R, user = usr) - if(R.health < 0) - to_chat(user, span_warning("You have to repair the cyborg before using this module!")) - return FALSE - - if(R.mind) - R.mind.grab_ghost() - playsound(loc, 'sound/voice/liveagain.ogg', 75, TRUE) - - R.revive(full_heal = FALSE, admin_revive = FALSE) - R.logevent("WARN -- System recovered from unexpected shutdown.") - R.logevent("System brought online.") - return TRUE - /obj/item/borg/upgrade/disablercooler name = "cyborg rapid disabler cooling module" desc = "Used to cool a mounted disabler, increasing the potential current in it and thus its recharge rate." @@ -777,3 +757,36 @@ var/obj/item/pushbroom/cyborg/BR = locate() in R.model.modules if (BR) R.model.remove_module(BR, TRUE) + +///This isn't an upgrade or part of the same path, but I'm gonna just stick it here because it's a tool used on cyborgs. +//A reusable tool that can bring borgs back to life. They gotta be repaired first, though. +/obj/item/borg_restart_board + name = "cyborg emergency reboot module" + desc = "A reusable firmware reset tool that can force a reboot of a disabled-but-repaired cyborg, bringing it back online." + w_class = WEIGHT_CLASS_SMALL + icon = 'icons/obj/module.dmi' + icon_state = "cyborg_upgrade1" + +/obj/item/borg_restart_board/pre_attack(mob/living/silicon/robot/borgo, mob/living/user, params) + if(!istype(borgo)) + return ..() + if(!borgo.opened) + to_chat(user, span_warning("You must access the cyborg's internals!")) + return ..() + if(borgo.health < 0) + to_chat(user, span_warning("You have to repair the cyborg before using this module!")) + return ..() + if(!(borgo.stat & DEAD)) + to_chat(user, span_warning("This cyborg is already operational!")) + return ..() + + if(borgo.mind) + borgo.mind.grab_ghost() + playsound(loc, 'sound/voice/liveagain.ogg', 75, TRUE) + else + playsound(loc, 'sound/machines/ping.ogg', 75, TRUE) + + borgo.revive(full_heal = FALSE, admin_revive = FALSE) + borgo.logevent("WARN -- System recovered from unexpected shutdown.") + borgo.logevent("System brought online.") + return ..() diff --git a/code/modules/research/designs/mechfabricator_designs.dm b/code/modules/research/designs/mechfabricator_designs.dm index 4dca862e83e..e1c42c60854 100644 --- a/code/modules/research/designs/mechfabricator_designs.dm +++ b/code/modules/research/designs/mechfabricator_designs.dm @@ -737,7 +737,7 @@ name = "Cyborg Upgrade (Emergency Reboot Board)" id = "borg_upgrade_restart" build_type = MECHFAB - build_path = /obj/item/borg/upgrade/restart + build_path = /obj/item/borg_restart_board materials = list(/datum/material/iron = 20000 , /datum/material/glass = 5000) construction_time = 120 category = list("Cyborg Upgrade Modules") diff --git a/code/modules/vehicles/mecha/mech_fabricator.dm b/code/modules/vehicles/mecha/mech_fabricator.dm index fe1a6440c7a..81968241cc9 100644 --- a/code/modules/vehicles/mecha/mech_fabricator.dm +++ b/code/modules/vehicles/mecha/mech_fabricator.dm @@ -142,6 +142,9 @@ sub_category += "Engineering" else sub_category += "All Cyborgs" + else if(ispath(built_item, /obj/item/borg_restart_board)) + sub_category += "All Cyborgs" //Otherwise the restart board shows in the "parts" category, which seems dumb + // Else check if this design builds a piece of exosuit equipment. else if(built_item in typesof(/obj/item/mecha_parts/mecha_equipment)) var/obj/item/mecha_parts/mecha_equipment/E = built_item