mobile defibrillator mount (#83000)

## About The Pull Request


![image](https://github.com/tgstation/tgstation/assets/70376633/e8650bc6-e915-499c-8a63-eba0a70b4a96)

![image](https://github.com/tgstation/tgstation/assets/70376633/14a95345-e436-43c7-b4a7-de2502fc59cc)


5 iron and 1 sheet of silver and 15 cable to craft

its a defib mount but mobile, thats basically it

## Why It's Good For The Game

good for maps where there are no good spots to place wall defib mounts
or if you cant or dont want to take off your backpack (maybe using a
modsuit?) and theres no defib mount nearby


## Changelog
🆑
add: mobile defibrillator mount
/🆑
This commit is contained in:
jimmyl
2024-05-16 19:31:06 +02:00
committed by GitHub
parent 5a3d67a44e
commit d93d19c7d1
4 changed files with 58 additions and 12 deletions
@@ -47,3 +47,15 @@
tool_behaviors = list(TOOL_SCREWDRIVER)
category = CAT_FURNITURE
time = 5 SECONDS
/datum/crafting_recipe/defib_mobile
name = "Mobile Defibrillator Mount"
reqs = list(
/obj/item/stack/sheet/mineral/silver = 1,
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/cable_coil = 15,
)
result = /obj/machinery/defibrillator_mount/mobile
tool_behaviors = list(TOOL_SCREWDRIVER)
category = CAT_FURNITURE
time = 7 SECONDS
+44 -12
View File
@@ -51,25 +51,23 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/defibrillator_mount, 28)
/obj/machinery/defibrillator_mount/update_overlays()
. = ..()
if(!defib)
if(isnull(defib))
return
. += "defib"
var/mutable_appearance/defib_overlay = mutable_appearance(icon, "defib", layer = layer+0.01, offset_spokesman = src)
if(defib.powered)
var/obj/item/stock_parts/cell/C = get_cell()
. += (defib.safety ? "online" : "emagged")
var/ratio = C.charge / C.maxcharge
ratio = CEILING(ratio * 4, 1) * 25
. += "charge[ratio]"
var/obj/item/stock_parts/cell/cell = defib.cell
var/mutable_appearance/safety = mutable_appearance(icon, defib.safety ? "online" : "emagged", offset_spokesman = src)
var/mutable_appearance/charge_overlay = mutable_appearance(icon, "charge[CEILING((cell.charge / cell.maxcharge) * 4, 1) * 25]", offset_spokesman = src)
defib_overlay.overlays += list(safety, charge_overlay)
if(clamps_locked)
. += "clamps"
var/mutable_appearance/clamps = mutable_appearance(icon, "clamps", offset_spokesman = src)
defib_overlay.overlays += clamps
/obj/machinery/defibrillator_mount/get_cell()
if(defib)
return defib.get_cell()
. += defib_overlay
//defib interaction
/obj/machinery/defibrillator_mount/attack_hand(mob/living/user, list/modifiers)
@@ -220,3 +218,37 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/defibrillator_mount, 28)
icon_state = "penlite_mount"
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 3, /datum/material/glass = SMALL_MATERIAL_AMOUNT, /datum/material/silver = SMALL_MATERIAL_AMOUNT * 0.5)
result_path = /obj/machinery/defibrillator_mount/charging
//mobile defib
/obj/machinery/defibrillator_mount/mobile
name = "mobile defibrillator mount"
icon_state = "mobile"
anchored = FALSE
density = TRUE
/obj/machinery/defibrillator_mount/mobile/Initialize(mapload)
. = ..()
AddElement(/datum/element/noisy_movement)
/obj/machinery/defibrillator_mount/mobile/wrench_act_secondary(mob/living/user, obj/item/tool)
if(user.combat_mode)
return ..()
if(defib)
to_chat(user, span_warning("The mount can't be deconstructed while a defibrillator unit is loaded!"))
..()
return TRUE
balloon_alert(user, "deconstructing...")
tool.play_tool_sound(src)
if(tool.use_tool(src, user, 5 SECONDS))
playsound(loc, 'sound/items/deconstruct.ogg', 50, vary = TRUE)
deconstruct()
return TRUE
/obj/machinery/defibrillator_mount/mobile/on_deconstruction(disassembled)
if(disassembled)
new /obj/item/stack/sheet/iron(drop_location(), 5)
new /obj/item/stack/sheet/mineral/silver(drop_location(), 1)
new /obj/item/stack/cable_coil(drop_location(), 15)
else
new /obj/item/stack/sheet/iron(drop_location(), 5)
+2
View File
@@ -368,6 +368,7 @@
if(!req_defib)
return
RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(check_range))
RegisterSignal(defib.loc, COMSIG_MOVABLE_MOVED, PROC_REF(check_range))
/obj/item/shockpaddles/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
@@ -434,6 +435,7 @@
. = ..()
if(user)
UnregisterSignal(user, COMSIG_MOVABLE_MOVED)
UnregisterSignal(defib.loc, COMSIG_MOVABLE_MOVED)
if(req_defib)
if(user)
to_chat(user, span_notice("The paddles snap back into the main unit."))
Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 1.3 KiB