Migrate glass shards to the new attack chain. (#32287)

* Migrate glass shards to the new attack chain.

* Apply suggestions from CRUNCH review

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

---------

Signed-off-by: Alan <alfalfascout@users.noreply.github.com>
Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
This commit is contained in:
Alan
2026-07-24 19:30:27 +00:00
committed by GitHub
co-authored by CRUNCH
parent baf934b981
commit c31b38eff9
+20 -15
View File
@@ -19,6 +19,7 @@
var/cooldown = 0
var/icon_prefix
var/obj/item/stack/sheet/welded_type = /obj/item/stack/sheet/glass
new_attack_chain = TRUE
/obj/item/shard/suicide_act(mob/user)
to_chat(viewers(user), pick(SPAN_DANGER("[user] is slitting [user.p_their()] wrists with [src]! It looks like [user.p_theyre()] trying to commit suicide!"),
@@ -49,22 +50,26 @@
)
AddElement(/datum/element/connect_loc, loc_connections)
/obj/item/shard/afterattack__legacy__attackchain(atom/movable/AM, mob/user, proximity)
/obj/item/shard/after_attack(atom/movable/target, mob/living/carbon/human/user, proximity)
if(!proximity || !(src in user))
return
if(isturf(AM))
return
if(isstorage(AM))
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(!H.gloves && !HAS_TRAIT(H, TRAIT_PIERCEIMMUNE))
var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_hand")
if(affecting.is_robotic())
return
to_chat(H, SPAN_WARNING("[src] cuts into your hand!"))
if(affecting.receive_damage(force * 0.5))
H.UpdateDamageIcon()
return ..()
if(isturf(target))
return ..()
if(isstorage(target))
return ..()
if(!ishuman(user))
return ..()
if(user.gloves || HAS_TRAIT(user, TRAIT_PIERCEIMMUNE))
return ..()
var/obj/item/organ/external/affecting = user.get_organ("[user.hand ? "l" : "r" ]_hand")
if(affecting.is_robotic())
return ..()
to_chat(user, SPAN_DANGER("[src] cuts into your hand!"))
if(affecting.receive_damage(force * 0.5))
user.UpdateDamageIcon()
add_fingerprint(user)
return FINISH_ATTACK
/obj/item/shard/welder_act(mob/user, obj/item/I)
. = TRUE