Skip to content

Commit

Permalink
Compact defibs fit on labcoats and similar medical gear (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMelbert authored Nov 8, 2023
1 parent 11382be commit 91d05ae
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
20 changes: 9 additions & 11 deletions code/game/objects/items/defib.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,13 @@
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/defibrillator/attack_hand(mob/user, list/modifiers)
if(loc == user)
if(slot_flags & ITEM_SLOT_BACK)
if(user.get_item_by_slot(ITEM_SLOT_BACK) == src)
ui_action_click()
else
to_chat(user, span_warning("Put the defibrillator on your back first!"))

else if(slot_flags & ITEM_SLOT_BELT)
if(user.get_item_by_slot(ITEM_SLOT_BELT) == src)
ui_action_click()
else
to_chat(user, span_warning("Strap the defibrillator's belt on first!"))
// NON-MODULE CHANGE START
if(user.get_slot_by_item(src) & slot_flags)
ui_action_click()
else
balloon_alert(user, "equip the unit first!")
return
// NON-MODULE CHANGE END
else if(istype(loc, /obj/machinery/defibrillator_mount))
ui_action_click() //checks for this are handled in defibrillator.mount.dm
return ..()
Expand Down Expand Up @@ -283,9 +278,12 @@
nocell_state = "defibcompact-nocell"
emagged_state = "defibcompact-emagged"

/*
// NON-MODULE CHANGE
/obj/item/defibrillator/compact/item_action_slot_check(slot, mob/user)
if(slot & user.getBeltSlot())
return TRUE
*/

/obj/item/defibrillator/compact/loaded/Initialize(mapload)
. = ..()
Expand Down
22 changes: 22 additions & 0 deletions maplestation_modules/code/modules/clothing/suits/labcoat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,28 @@
/obj/item/tank/internals/emergency_oxygen,
/obj/item/tank/internals/plasmaman,
/obj/item/storage/bag/bio,
/obj/item/defibrillator/compact,
)
armor_type = /datum/armor/science_rd
species_exception = list(/datum/species/golem)

// Adding combat defib to allowed list of non-modular labcouts and co.
/obj/item/defibrillator/compact
slot_flags = ITEM_SLOT_BELT|ITEM_SLOT_SUITSTORE|ITEM_SLOT_DEX_STORAGE
worn_icon = 'icons/mob/clothing/belt.dmi'

/obj/item/clothing/suit/toggle/labcoat/Initialize(mapload)
. = ..()
allowed += /obj/item/defibrillator/compact

/obj/item/clothing/suit/hooded/wintercoat/medical/Initialize(mapload)
. = ..()
allowed += /obj/item/defibrillator/compact

/obj/item/clothing/suit/apron/surgical/Initialize(mapload)
. = ..()
allowed += /obj/item/defibrillator/compact

/datum/mod_theme/medical/New() // Maybe not necessary because the defib MOD exists
. = ..()
allowed_suit_storage += /obj/item/defibrillator/compact

0 comments on commit 91d05ae

Please sign in to comment.