From 6f77bf1f8a533aa0865b38974c2873fe9d82e00c Mon Sep 17 00:00:00 2001 From: Toastical Date: Fri, 17 Jan 2025 20:14:40 +0200 Subject: [PATCH] Attack Chain Migration: Wirecutters (#27567) * wire cutting * change item interact signal * typo * unneeded thingy mcbob --------- Co-authored-by: Toastical Co-authored-by: Toastical --- code/game/objects/items/tools/wirecutters.dm | 26 +++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/code/game/objects/items/tools/wirecutters.dm b/code/game/objects/items/tools/wirecutters.dm index 3d6b38d653e..5f24feb644a 100644 --- a/code/game/objects/items/tools/wirecutters.dm +++ b/code/game/objects/items/tools/wirecutters.dm @@ -23,6 +23,8 @@ tool_behaviour = TOOL_WIRECUTTER var/random_color = TRUE + new_attack_chain = TRUE + /obj/item/wirecutters/New(loc, param_color = null) ..() if(random_color) @@ -31,16 +33,15 @@ belt_icon = "wirecutters_[param_color]" icon_state = "cutters_[param_color]" -/obj/item/wirecutters/attack__legacy__attackchain(mob/living/carbon/C, mob/user) - if(istype(C) && C.handcuffed && istype(C.handcuffed, /obj/item/restraints/handcuffs/cable)) - user.visible_message("[user] cuts [C]'s restraints with [src]!") - QDEL_NULL(C.handcuffed) - if(C.buckled && C.buckled.buckle_requires_restraints) - C.unbuckle() - C.update_handcuffed() - return - else - return ..() +/obj/item/wirecutters/interact_with_atom(atom/target, mob/living/user, list/modifiers) + var/mob/living/carbon/mob = target + if(istype(mob) && mob.handcuffed && istype(mob.handcuffed, /obj/item/restraints/handcuffs/cable)) + user.visible_message("[user] cuts [mob]'s restraints with [src]!") + QDEL_NULL(mob.handcuffed) + if(mob.buckled && mob.buckled.buckle_requires_restraints) + mob.unbuckle() + mob.update_handcuffed() + return ITEM_INTERACT_COMPLETE /obj/item/wirecutters/suicide_act(mob/user) user.visible_message("[user] is cutting at [user.p_their()] [is_robotic_suicide(user) ? "wiring" : "arteries"] with [src]! It looks like [user.p_theyre()] trying to commit suicide!") @@ -146,7 +147,10 @@ return OXYLOSS -/obj/item/wirecutters/power/attack_self__legacy__attackchain(mob/user) +/obj/item/wirecutters/power/activate_self(mob/user) + if(..()) + return + playsound(get_turf(user), 'sound/items/change_jaws.ogg', 50, 1) var/obj/item/crowbar/power/pryjaws = new /obj/item/crowbar/power to_chat(user, "You attach the pry jaws to [src].")