Files
CRUNCH bec388228b Migrates /obj/item/clothing to the New Attack Chain (#31421)
* the beginning of my torment

* This was a very small piece of torment

* God agghhghhhh the suffering

* pain and suffering and destruction

* Update bot_construction.dm

* Update heretic_necks.dm

* Update heretic_armor.dm

* Apply suggestions from code review

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>

* Apply suggestion from @DGamerL

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

---------

Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
2026-02-09 19:36:38 +00:00

44 lines
1.2 KiB
Plaintext

//Hardsuit toggle code
/obj/item/clothing/suit/space/hardsuit/ui_action_click()
..()
ToggleHelmet()
/obj/item/clothing/suit/space/hardsuit/proc/RemoveHelmet()
if(!helmet)
return
suit_toggled = FALSE
if(ishuman(helmet.loc))
var/mob/living/carbon/H = helmet.loc
if(helmet.on)
helmet.activate_self(H)
H.transfer_item_to(helmet, src, force = TRUE)
H.update_inv_wear_suit()
to_chat(H, SPAN_NOTICE("The helmet on the hardsuit disengages."))
playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1)
else
helmet.forceMove(src)
/obj/item/clothing/suit/space/hardsuit/proc/ToggleHelmet()
var/mob/living/carbon/human/H = src.loc
if(!helmettype)
return
if(!helmet)
return
if(!suit_toggled)
if(ishuman(src.loc))
if(H.wear_suit != src)
to_chat(H, SPAN_WARNING("You must be wearing [src] to engage the helmet!"))
return
if(H.head)
to_chat(H, SPAN_WARNING("You're already wearing something on your head!"))
return
else if(H.equip_to_slot_if_possible(helmet, ITEM_SLOT_HEAD, FALSE, FALSE))
to_chat(H, SPAN_NOTICE("You engage the helmet on the hardsuit."))
suit_toggled = TRUE
H.update_inv_wear_suit()
playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1)
else
RemoveHelmet()