diff --git a/code/game/machinery/defibrillator_mount.dm b/code/game/machinery/defibrillator_mount.dm index f6cc265ee6a..abb1f8a728f 100644 --- a/code/game/machinery/defibrillator_mount.dm +++ b/code/game/machinery/defibrillator_mount.dm @@ -3,16 +3,20 @@ //Not being adjacent will cause the paddles to snap back /obj/machinery/defibrillator_mount name = "defibrillator mount" - desc = "Holds and recharges defibrillators. You can grab the paddles if one is mounted." + desc = "Holds defibrillators. You can grab the paddles if one is mounted." icon = 'icons/obj/machines/defib_mount.dmi' icon_state = "defibrillator_mount" density = FALSE use_power = IDLE_POWER_USE - idle_power_usage = 1 + idle_power_usage = 0 power_channel = EQUIP req_one_access = list(ACCESS_MEDICAL, ACCESS_HEADS, ACCESS_SECURITY) //used to control clamps - var/obj/item/defibrillator/defib //this mount's defibrillator - var/clamps_locked = FALSE //if true, and a defib is loaded, it can't be removed without unlocking the clamps +/// The mount's defib + var/obj/item/defibrillator/defib +/// if true, and a defib is loaded, it can't be removed without unlocking the clamps + var/clamps_locked = FALSE +/// the type of wallframe it 'disassembles' into + var/wallframe_type = /obj/item/wallframe/defib_mount /obj/machinery/defibrillator_mount/loaded/Initialize() //loaded subtype for mapping use . = ..() @@ -32,26 +36,20 @@ else . += "Its locking clamps can be [clamps_locked ? "dis" : ""]engaged by swiping an ID with access." -/obj/machinery/defibrillator_mount/process() - if(defib && defib.cell && defib.cell.charge < defib.cell.maxcharge && is_operational()) - use_power(200) - defib.cell.give(180) //90% efficiency, slightly better than the cell charger's 87.5% - update_icon() - /obj/machinery/defibrillator_mount/update_overlays() . = ..() - + if(!defib) return - + . += "defib" - + if(defib.powered) . += (defib.safety ? "online" : "emagged") var/ratio = defib.cell.charge / defib.cell.maxcharge ratio = CEILING(ratio * 4, 1) * 25 . += "charge[ratio]" - + if(clamps_locked) . += "clamps" @@ -120,6 +118,15 @@ update_icon() return TRUE +/obj/machinery/defibrillator_mount/wrench_act(mob/living/user, obj/item/wrench/W) + if(!wallframe_type) + return ..() + new wallframe_type(get_turf(src)) + qdel(src) + W.play_tool_sound(user) + to_chat(user, "You remove [src] from the wall.") + + /obj/machinery/defibrillator_mount/AltClick(mob/living/carbon/user) if(!istype(user) || !user.canUseTopic(src, BE_CLOSE)) return @@ -138,6 +145,20 @@ defib = null update_icon() +/obj/machinery/defibrillator_mount/charging + name = "PENLITE defibrillator mount" + desc = "Holds defibrillators. You can grab the paddles if one is mounted. This PENLITE variant also allows for slow, passive recharging of the defibrillator." + icon_state = "penlite_mount" + idle_power_usage = 1 + wallframe_type = /obj/item/wallframe/defib_mount/charging + +/obj/machinery/defibrillator_mount/charging/process() + if(defib?.cell?.charge < defib.cell.maxcharge && is_operational()) + use_power(100) + defib.cell.give(80) + update_icon() + + //wallframe, for attaching the mounts easily /obj/item/wallframe/defib_mount name = "unhooked defibrillator mount" @@ -148,3 +169,10 @@ w_class = WEIGHT_CLASS_BULKY result_path = /obj/machinery/defibrillator_mount pixel_shift = -28 + +/obj/item/wallframe/defib_mount/charging + name = "unhooked PENLITE defibrillator mount" + desc = "A frame for a PENLITE defibrillator mount. Unlike the normal mount, it can passively recharge the unit inside." + icon_state = "penlite_mount" + custom_materials = list(/datum/material/iron = 300, /datum/material/glass = 100, /datum/material/silver = 50) + result_path = /obj/machinery/defibrillator_mount/charging diff --git a/code/modules/research/designs/medical_designs.dm b/code/modules/research/designs/medical_designs.dm index 92ecdbfa67b..4d568a13b18 100644 --- a/code/modules/research/designs/medical_designs.dm +++ b/code/modules/research/designs/medical_designs.dm @@ -163,14 +163,25 @@ /datum/design/defibrillator_mount name = "Defibrillator Wall Mount" - desc = "An all-in-one mounted frame for holding defibrillators, complete with ID-locked clamps and recharging cables." - id = "defibmount" + desc = "A mounted frame for holding defibrillators, providing easy security." + id = "defibmountdefault" build_type = PROTOLATHE materials = list(/datum/material/iron = 2000, /datum/material/glass = 1000) build_path = /obj/item/wallframe/defib_mount category = list("Medical Designs") departmental_flags = DEPARTMENTAL_FLAG_MEDICAL +/datum/design/defibrillator_mount_charging + name = "PENLITE Defibrillator Wall Mount" + desc = "An all-in-one mounted frame for holding defibrillators, complete with ID-locked clamps and recharging cables. The PENLITE version also allows for slow recharging of the defib's battery." + id = "defibmount" + build_type = PROTOLATHE + materials = list(/datum/material/iron = 2000, /datum/material/glass = 1000, /datum/material/silver = 500) + build_path = /obj/item/wallframe/defib_mount/charging + category = list("Medical Designs") + departmental_flags = DEPARTMENTAL_FLAG_MEDICAL + + /datum/design/defibrillator_compact name = "Compact Defibrillator" desc = "A compact defibrillator that can be worn on a belt." diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 255fde950b7..fb7c70928f6 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -57,7 +57,7 @@ display_name = "Basic Medical Equipment" description = "Basic medical tools and equipment." design_ids = list("cybernetic_liver", "cybernetic_heart", "cybernetic_lungs", "scalpel", "circular_saw", "surgicaldrill", "retractor", "cautery", "hemostat", - "surgical_drapes", "syringe", "plumbing_rcd", "beaker", "large_beaker", "xlarge_beaker", "dropper") + "surgical_drapes", "syringe", "plumbing_rcd", "beaker", "large_beaker", "xlarge_beaker", "dropper", "defibmountdefault") /////////////////////////Biotech///////////////////////// /datum/techweb_node/biotech diff --git a/icons/obj/machines/defib_mount.dmi b/icons/obj/machines/defib_mount.dmi index 3f6e3e1d173..4518bb33783 100644 Binary files a/icons/obj/machines/defib_mount.dmi and b/icons/obj/machines/defib_mount.dmi differ