Refactors defib code into a component (#19987)

* Start to datumize the defib.

* Wire everything else up

* connect some loose wires from testing

* More changes from testing

* More cleanups and documentation

* Revert CMO defib to have a 10% heart-attack chance

* Review, clean up giant if statement

* other review things

* sirryan review

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* change signals to direct proc calls

* rename variable

* Fix bad argument

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
Luc
2023-01-16 20:19:03 -06:00
committed by GitHub
co-authored by Ryan
parent 16604112c7
commit 8b91d8b48e
7 changed files with 501 additions and 358 deletions
@@ -1020,7 +1020,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
SetLockdown(0)
if(module)
module.emag_act()
module.emag_act(user)
module.module_type = "Malf" // For the cool factor
update_module_icon()
module.rebuild_modules() // This will add the emagged items to the borgs inventory.
@@ -331,15 +331,15 @@
special_rechargables = list(/obj/item/reagent_containers/spray/cyborg_facid, /obj/item/extinguisher/mini)
// Disable safeties on the borg's defib.
/obj/item/robot_module/medical/emag_act()
/obj/item/robot_module/medical/emag_act(mob/user)
. = ..()
for(var/obj/item/borg_defib/F in modules)
F.safety = FALSE
F.emag_act()
// Enable safeties on the borg's defib.
/obj/item/robot_module/medical/unemag()
for(var/obj/item/borg_defib/F in modules)
F.safety = TRUE
F.emag_act()
return ..()
// Fluorosulphuric acid spray bottle.