diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 3b5163c8746..5ba20045032 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -1,7 +1,8 @@ /obj/item/restraints - name = "bugged restraints" //This item existed before this pr, but had no name or such. Better warn people if it exists - desc = "Should not exist. Report me to a(n) coder/admin!" + name = "base type restraints" + desc = ABSTRACT_TYPE_DESC icon = 'icons/obj/restraints.dmi' + new_attack_chain = TRUE var/cuffed_state = "handcuff" ///How long it will take to break out of restraints var/breakouttime @@ -59,24 +60,25 @@ /// If set to TRUE, people with the TRAIT_CLUMSY won't cuff themselves when trying to cuff others. var/ignoresClumsy = FALSE -/obj/item/restraints/handcuffs/attack__legacy__attackchain(mob/living/carbon/C, mob/user) - if(!user.IsAdvancedToolUser()) - to_chat(user, SPAN_WARNING("You don't have the dexterity to do this!")) - return +/obj/item/restraints/handcuffs/interact_with_atom(atom/target, mob/living/user, list/modifiers) + if(!iscarbon(target)) + return NONE - if(!istype(C)) - return + if(!user.IsAdvancedToolUser()) + to_chat(user, SPAN_WARNING("You don't have the dexterity to use [src]!")) + return ITEM_INTERACT_COMPLETE if(flags & NODROP) to_chat(user, SPAN_WARNING("[src] is stuck to your hand!")) - return + return ITEM_INTERACT_COMPLETE if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50) && (!ignoresClumsy)) to_chat(user, SPAN_WARNING("Uh... how do those things work?!")) apply_cuffs(user, user) - return + return ITEM_INTERACT_COMPLETE - cuff(C, user) + cuff(target, user) + return ITEM_INTERACT_COMPLETE /obj/item/restraints/handcuffs/proc/cuff(mob/living/carbon/C, mob/user, remove_src = TRUE) if(!istype(C)) // Shouldn't be able to cuff anything but carbons. @@ -223,8 +225,13 @@ return TRUE return ..() -/obj/item/restraints/handcuffs/cable/zipties/used/attack__legacy__attackchain() - return +/obj/item/restraints/handcuffs/cable/zipties/used/interact_with_atom(atom/target, mob/living/user, list/modifiers) + to_chat(user, SPAN_WARNING("[src] are broken and useless!")) + return ITEM_INTERACT_COMPLETE + +/obj/item/restraints/handcuffs/cable/zipties/used/item_interaction(mob/living/user, obj/item/used, list/modifiers) + to_chat(user, SPAN_WARNING("[src] are broken and useless!")) + return ITEM_INTERACT_COMPLETE ////////////////////////////// // MARK: TWIMSTS @@ -259,10 +266,10 @@ ////////////////////////////// // MARK: CRAFTING ////////////////////////////// -/obj/item/restraints/handcuffs/cable/attackby__legacy__attackchain(obj/item/I, mob/user, params) +/obj/item/restraints/handcuffs/cable/item_interaction(mob/living/user, obj/item/used, list/modifiers) ..() - handle_attack_construction(I, user) + handle_attack_construction(used, user) /obj/item/restraints/handcuffs/cable/proc/handle_attack_construction(obj/item/I, mob/user) if(istype(I, /obj/item/stack/rods)) @@ -300,9 +307,10 @@ var/obj/item/toy/crayon/C = I cable_color(C.dye_color) -/obj/item/restraints/handcuffs/cable/zipties/cyborg/attack__legacy__attackchain(mob/living/carbon/C, mob/user) +/obj/item/restraints/handcuffs/cable/zipties/cyborg/interact_with_atom(atom/target, mob/living/user, list/modifiers) if(isrobot(user)) - cuff(C, user, FALSE) + cuff(target, user, FALSE) + return ITEM_INTERACT_COMPLETE /obj/item/restraints/handcuffs/cable/zipties/cyborg/handle_attack_construction(obj/item/I, mob/user) // Don't allow borgs to send their their ziptie module to the shadow realm. diff --git a/code/game/objects/items/weapons/legcuffs.dm b/code/game/objects/items/weapons/legcuffs.dm index 98c7a699b90..1578c3e6d07 100644 --- a/code/game/objects/items/weapons/legcuffs.dm +++ b/code/game/objects/items/weapons/legcuffs.dm @@ -1,6 +1,5 @@ /obj/item/restraints/legcuffs - name = "leg cuffs" - desc = "Use this to keep prisoners in line." + name = "base type legcuffs" gender = PLURAL icon_state = "handcuff" cuffed_state = "legcuff" @@ -9,6 +8,7 @@ slowdown = 7 breakouttime = 30 SECONDS +// MARK: Beartrap /obj/item/restraints/legcuffs/beartrap name = "bear trap" throw_speed = 1 @@ -44,49 +44,61 @@ playsound(loc, 'sound/weapons/bladeslice.ogg', 50, TRUE, -1) return BRUTELOSS -/obj/item/restraints/legcuffs/beartrap/attack_self__legacy__attackchain(mob/user) - ..() +/obj/item/restraints/legcuffs/beartrap/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE if(!ishuman(user) || user.restrained()) - return + return ITEM_INTERACT_COMPLETE if(do_after(user, 2 SECONDS, target = user)) armed = !armed update_icon(UPDATE_ICON_STATE) to_chat(user, SPAN_NOTICE("[src] is now [armed ? "armed" : "disarmed"]")) + return ITEM_INTERACT_COMPLETE -/obj/item/restraints/legcuffs/beartrap/attackby__legacy__attackchain(obj/item/I, mob/user) //Let's get explosive. - if(istype(I, /obj/item/grenade/iedcasing)) +/obj/item/restraints/legcuffs/beartrap/item_interaction(mob/living/user, obj/item/used, list/modifiers) + // Let's get explosive. + if(istype(used, /obj/item/grenade/iedcasing)) if(IED) to_chat(user, SPAN_WARNING("This beartrap already has an IED hooked up to it!")) - return + return ITEM_INTERACT_COMPLETE + if(sig) to_chat(user, SPAN_WARNING("This beartrap already has a signaler hooked up to it!")) - return + return ITEM_INTERACT_COMPLETE + user.drop_item() - I.forceMove(src) - IED = I + used.forceMove(src) + IED = used message_admins("[key_name_admin(user)] has rigged a beartrap with an IED.") log_game("[key_name(user)] has rigged a beartrap with an IED.") to_chat(user, SPAN_NOTICE("You sneak [IED] underneath the pressure plate and connect the trigger wire.")) desc = "A trap used to catch bears and other legged creatures. [SPAN_WARNING("There is an IED hooked up to it.")]" - if(istype(I, /obj/item/assembly/signaler)) + return ITEM_INTERACT_COMPLETE + + if(istype(used, /obj/item/assembly/signaler)) if(IED) to_chat(user, SPAN_WARNING("This beartrap already has an IED hooked up to it!")) - return + return ITEM_INTERACT_COMPLETE + if(sig) to_chat(user, SPAN_WARNING("This beartrap already has a signaler hooked up to it!")) - return - sig = I + return ITEM_INTERACT_COMPLETE + + sig = used if(sig.secured) to_chat(user, SPAN_WARNING("The signaler is secured.")) sig = null - return + return ITEM_INTERACT_COMPLETE + user.drop_item() - I.forceMove(src) + used.forceMove(src) to_chat(user, SPAN_NOTICE("You sneak [sig] underneath the pressure plate and connect the trigger wire.")) desc = "A trap used to catch bears and other legged creatures. [SPAN_WARNING("There is a remote signaler hooked up to it.")]" - ..() + return ITEM_INTERACT_COMPLETE + + return ..() /obj/item/restraints/legcuffs/beartrap/screwdriver_act(mob/living/user, obj/item/I) if(!IED && !sig) @@ -176,6 +188,7 @@ /obj/item/restraints/legcuffs/beartrap/energy/cyborg breakouttime = 20 // Cyborgs shouldn't have a strong restraint +// MARK: Bola /obj/item/restraints/legcuffs/bola name = "bola" desc = "A restraining device designed to be thrown at the target. Upon connecting with said target, it will wrap around their legs, making it difficult for them to move quickly." diff --git a/code/modules/antagonists/vampire/vampire_powers/umbrae_powers.dm b/code/modules/antagonists/vampire/vampire_powers/umbrae_powers.dm index 3019b583ba8..3f85e224ea9 100644 --- a/code/modules/antagonists/vampire/vampire_powers/umbrae_powers.dm +++ b/code/modules/antagonists/vampire/vampire_powers/umbrae_powers.dm @@ -88,14 +88,16 @@ to_chat(user, SPAN_USERDANGER("The snare sends a psychic backlash!")) C.EyeBlind(20 SECONDS) -/obj/item/restraints/legcuffs/beartrap/shadow_snare/attackby__legacy__attackchain(obj/item/I, mob/user) - var/obj/item/flash/flash = I +/obj/item/restraints/legcuffs/beartrap/shadow_snare/item_interaction(mob/living/user, obj/item/used, list/modifiers) + var/obj/item/flash/flash = used if(!istype(flash) || !flash.try_use_flash(user)) return ..() - user.visible_message(SPAN_DANGER("[user] points [I] at [src]!"), - SPAN_DANGER("You point [I] at [src]!")) + + user.visible_message(SPAN_DANGER("[user] points [used] at [src]!"), + SPAN_DANGER("You point [used] at [src]!")) visible_message(SPAN_NOTICE("[src] withers away.")) qdel(src) + return ITEM_INTERACT_COMPLETE /obj/item/restraints/legcuffs/beartrap/shadow_snare/process() var/turf/T = get_turf(src)