Add chat notification for shoes & glove protection when mousetraps triggered (#70428)

* Being protected by Shoes or Gloves against a mousetrap will now give you a message in chat telling you such, removing a surprise for those caught off-guard by it.

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
Tim
2022-10-12 02:10:38 -05:00
committed by GitHub
parent e5b2dec70e
commit a2db4ab3fc
+13 -9
View File
@@ -114,23 +114,27 @@
update_appearance()
var/obj/item/bodypart/affecting = null
if(ishuman(target))
var/mob/living/carbon/human/H = target
if(HAS_TRAIT(H, TRAIT_PIERCEIMMUNE))
var/mob/living/carbon/human/victim = target
if(HAS_TRAIT(victim, TRAIT_PIERCEIMMUNE))
playsound(src, 'sound/effects/snap.ogg', 50, TRUE)
pulse(FALSE)
return FALSE
switch(type)
if("feet")
if(!H.shoes)
affecting = H.get_bodypart(pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG))
H.Paralyze(60)
if(!victim.shoes)
affecting = victim.get_bodypart(pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG))
victim.Paralyze(60)
else
to_chat(victim, span_notice("Your [victim.shoes] protects you from [src]."))
if(BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND)
if(!H.gloves)
affecting = H.get_bodypart(type)
H.Stun(60)
if(!victim.gloves)
affecting = victim.get_bodypart(type)
victim.Stun(60)
else
to_chat(victim, span_notice("Your [victim.gloves] protects you from [src]."))
if(affecting)
if(affecting.receive_damage(1, 0))
H.update_damage_overlays()
victim.update_damage_overlays()
else if(ismouse(target))
var/mob/living/simple_animal/mouse/M = target
visible_message(span_boldannounce("SPLAT!"))