From 4b3b64e5402a47ff16aa07b148b66057ebf87d4f Mon Sep 17 00:00:00 2001
From: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
Date: Wed, 12 Jun 2024 19:56:20 +0100
Subject: [PATCH] [FIX] Cyborg Zipties Will Not be Consumed When Making Wired
Rods (#25752)
* r o d
* Update handcuffs.dm
* Update handcuffs.dm
* Apply suggestions from code review
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
* Update handcuffs.dm
* Update handcuffs.dm
* Update handcuffs.dm
* Apply suggestions from code review
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
* Update handcuffs.dm
* Update code/game/objects/items/weapons/handcuffs.dm
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
---------
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
---
code/game/objects/items/stacks/rods.dm | 5 +-
code/game/objects/items/weapons/handcuffs.dm | 117 ++++++++++++-------
2 files changed, 77 insertions(+), 45 deletions(-)
diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm
index d701fdfafaf..a5543401d72 100644
--- a/code/game/objects/items/stacks/rods.dm
+++ b/code/game/objects/items/stacks/rods.dm
@@ -39,13 +39,10 @@ GLOBAL_LIST_INIT(rod_recipes, list (
usesound = 'sound/items/deconstruct.ogg'
merge_type = /obj/item/stack/rods
-
-
/obj/item/stack/rods/examine(mob/user)
. = ..()
. += "Using rods on a floor plating will install a reinforced floor. You can make reinforced glass by combining rods and normal glass sheets."
-
/obj/item/stack/rods/cyborg
energy_type = /datum/robot_storage/energy/rods
is_cyborg = TRUE
@@ -76,9 +73,11 @@ GLOBAL_LIST_INIT(rod_recipes, list (
if(get_amount() < 2)
to_chat(user, "You need at least two rods to do this!")
return
+
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
+
var/obj/item/stack/sheet/metal/new_item = new(drop_location())
if(new_item.get_amount() <= 0)
// stack was moved into another one on the pile
diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm
index 4117a949105..dc1c7b35716 100644
--- a/code/game/objects/items/weapons/handcuffs.dm
+++ b/code/game/objects/items/weapons/handcuffs.dm
@@ -4,6 +4,9 @@
icon = 'icons/obj/restraints.dmi'
var/cuffed_state = "handcuff"
+//////////////////////////////
+// MARK: HANDCUFFS
+//////////////////////////////
/obj/item/restraints/handcuffs
name = "handcuffs"
desc = "Use this to keep prisoners in line."
@@ -20,9 +23,11 @@
origin_tech = "engineering=3;combat=3"
breakouttime = 1 MINUTES
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 50, ACID = 50)
+ /// Sound made when cuffing someone.
var/cuffsound = 'sound/weapons/handcuffs.ogg'
- // Icon state for cuffed overlay on a mob
- var/trashtype = null //For disposable cuffs
+ /// Trash item generated when cuffs are broken (for disposable cuffs).
+ var/trashtype
+ /// 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(mob/living/carbon/C, mob/user)
@@ -88,6 +93,21 @@
target.update_handcuffed()
return
+//////////////////////////////
+// MARK: CUFF SKINS
+//////////////////////////////
+/obj/item/restraints/handcuffs/alien
+ icon_state = "handcuffAlien"
+
+/obj/item/restraints/handcuffs/pinkcuffs
+ name = "fluffy pink handcuffs"
+ desc = "Use this to keep prisoners in line, they are really itchy."
+ icon_state = "pinkcuffs"
+ cuffed_state = "pinkcuff"
+
+//////////////////////////////
+// MARK: SINEW CUFFS
+//////////////////////////////
/obj/item/restraints/handcuffs/sinew
name = "sinew restraints"
desc = "A pair of restraints fashioned from long strands of flesh."
@@ -98,6 +118,9 @@
breakouttime = 30 SECONDS
cuffsound = 'sound/weapons/cablecuff.ogg'
+//////////////////////////////
+// MARK: CABLE CUFFS
+//////////////////////////////
/obj/item/restraints/handcuffs/cable
name = "cable restraints"
desc = "Looks like some cables tied together. Could be used to tie something up."
@@ -152,46 +175,9 @@
color = pick(COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
return color
-/obj/item/restraints/handcuffs/alien
- icon_state = "handcuffAlien"
-
-/obj/item/restraints/handcuffs/pinkcuffs
- name = "fluffy pink handcuffs"
- desc = "Use this to keep prisoners in line, they are really itchy."
- icon_state = "pinkcuffs"
- cuffed_state = "pinkcuff"
-
-/obj/item/restraints/handcuffs/cable/attackby(obj/item/I, mob/user as mob, params)
- ..()
- if(istype(I, /obj/item/stack/rods))
- var/obj/item/stack/rods/R = I
- if(R.use(1))
- var/obj/item/wirerod/W = new /obj/item/wirerod
- if(!remove_item_from_storage(user))
- user.unEquip(src)
- user.put_in_hands(W)
- to_chat(user, "You wrap the cable restraint around the top of the rod.")
- qdel(src)
- else
- to_chat(user, "You need one rod to make a wired rod!")
- else if(istype(I, /obj/item/stack/sheet/metal))
- var/obj/item/stack/sheet/metal/M = I
- if(M.amount < 6)
- to_chat(user, "You need at least six metal sheets to make good enough weights!")
- return
- to_chat(user, "You begin to apply [I] to [src]...")
- if(do_after(user, 35 * M.toolspeed, target = src))
- var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola
- M.use(6)
- user.put_in_hands(S)
- to_chat(user, "You make some weights out of [I] and tie them to [src].")
- if(!remove_item_from_storage(user))
- user.unEquip(src)
- qdel(src)
- else if(istype(I, /obj/item/toy/crayon))
- var/obj/item/toy/crayon/C = I
- cable_color(C.colourName)
-
+//////////////////////////////
+// MARK: ZIPTIES
+//////////////////////////////
/obj/item/restraints/handcuffs/cable/zipties
name = "zipties"
desc = "Plastic, disposable zipties that can be used to restrain temporarily but are destroyed after use."
@@ -218,6 +204,9 @@
/obj/item/restraints/handcuffs/cable/zipties/used/attack()
return
+//////////////////////////////
+// MARK: TWIMSTS
+//////////////////////////////
/obj/item/restraints/handcuffs/twimsts
name = "twimsts cuffs"
desc = "Liquorice twist candy made into cable cuffs, tasty but it can't actually hold anyone."
@@ -229,3 +218,47 @@
throwforce = 0
breakouttime = 0
cuffsound = 'sound/weapons/cablecuff.ogg'
+
+//////////////////////////////
+// MARK: CRAFTING
+//////////////////////////////
+/obj/item/restraints/handcuffs/cable/attackby(obj/item/I, mob/user, params)
+ ..()
+ // Don't allow borgs to send their their ziptie module to the shadow realm.
+ if(istype(src, /obj/item/restraints/handcuffs/cable/zipties/cyborg))
+ return
+
+ if(istype(I, /obj/item/stack/rods))
+ var/obj/item/stack/rods/R = I
+ if(!R.use(1))
+ to_chat(user, "[R.amount > 1 ? "These rods" : "This rod"] somehow can't be used for crafting!")
+ return
+ if(!user.unEquip(src))
+ return
+ var/obj/item/wirerod/W = new /obj/item/wirerod(get_turf(src))
+ if(!remove_item_from_storage(user))
+ user.put_in_hands(W)
+ to_chat(user, "You wrap the cable restraint around the top of the rod.")
+ qdel(src)
+ return
+
+ if(istype(I, /obj/item/stack/sheet/metal))
+ var/obj/item/stack/sheet/metal/M = I
+ if(M.amount < 6)
+ to_chat(user, "You need at least six metal sheets to make good enough weights!")
+ return
+
+ to_chat(user, "You begin to apply [I] to [src]...")
+ if(do_after(user, 3.5 SECONDS * M.toolspeed, target = src))
+ if(!M.use(6) || !user.unEquip(src))
+ return
+ var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola(get_turf(src))
+ to_chat(user, "You make some weights out of [I] and tie them to [src].")
+ if(!remove_item_from_storage(user))
+ user.put_in_hands(S)
+ qdel(src)
+ return
+
+ if(istype(I, /obj/item/toy/crayon))
+ var/obj/item/toy/crayon/C = I
+ cable_color(C.colourName)