Improvements to the recent clothing menu toggle hardsuit helmet feature.

This commit is contained in:
Ghommie
2020-07-03 01:08:28 +02:00
parent 54b4672f13
commit 92c846fdbf
2 changed files with 23 additions and 15 deletions
+13 -7
View File
@@ -164,7 +164,7 @@
RemoveHelmet()
..()
/obj/item/clothing/suit/space/hardsuit/proc/RemoveHelmet()
/obj/item/clothing/suit/space/hardsuit/proc/RemoveHelmet(message = TRUE)
if(!helmet)
return
suittoggled = FALSE
@@ -174,16 +174,18 @@
helmet.attack_self(H)
H.transferItemToLoc(helmet, src, TRUE)
H.update_inv_wear_suit()
to_chat(H, "<span class='notice'>The helmet on the hardsuit disengages.</span>")
if(message)
to_chat(H, "<span class='notice'>The helmet on the hardsuit disengages.</span>")
playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1)
else
helmet.forceMove(src)
return TRUE
/obj/item/clothing/suit/space/hardsuit/dropped(mob/user)
..()
RemoveHelmet()
/obj/item/clothing/suit/space/hardsuit/proc/ToggleHelmet()
/obj/item/clothing/suit/space/hardsuit/proc/ToggleHelmet(message = TRUE)
var/mob/living/carbon/human/H = loc
if(!helmettype)
return
@@ -192,15 +194,19 @@
if(!suittoggled)
if(ishuman(src.loc))
if(H.wear_suit != src)
to_chat(H, "<span class='warning'>You must be wearing [src] to engage the helmet!</span>")
if(message)
to_chat(H, "<span class='warning'>You must be wearing [src] to engage the helmet!</span>")
return
if(H.head)
to_chat(H, "<span class='warning'>You're already wearing something on your head!</span>")
if(message)
to_chat(H, "<span class='warning'>You're already wearing something on your head!</span>")
return
else if(H.equip_to_slot_if_possible(helmet,SLOT_HEAD,0,0,1))
to_chat(H, "<span class='notice'>You engage the helmet on the hardsuit.</span>")
if(message)
to_chat(H, "<span class='notice'>You engage the helmet on the hardsuit.</span>")
suittoggled = TRUE
H.update_inv_wear_suit()
playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1)
return TRUE
else
RemoveHelmet()
return RemoveHelmet(message)