mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user