Skip to content

Commit

Permalink
[MIRROR] Fake handcuffs no longer apply click cooldown on resist (#2159)
Browse files Browse the repository at this point in the history
* Fake handcuffs no longer apply click cooldown on resist (#82828)

## About The Pull Request

Fake handcuffs/zipties do not apply a click cooldown upon resisting.

I'm not super happy with the solution to this (adding another item-level
var) but I told myself I'd fix this, and wasn't about to give up after
my handcuff-level solution didn't work.

Which calls into question -- Why does the breakout proc use item
typecasting over the restraint type? Is this necessary for anything to
function? I was too afraid to change it and accidentally break something
else.
## Why It's Good For The Game

Closes #82711.

Makes fake handcuffs a properly harmless joke item.
## Changelog
:cl: Rhials
fix: Fake handcuffs/Zipties no longer block clicks for a few seconds
after being resisted out of.
/:cl:

* Fake handcuffs no longer apply click cooldown on resist

---------

Co-authored-by: Rhials <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Apr 24, 2024
1 parent 1264fdb commit 2c3f7a3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@
var/current_skin
///// List of options to reskin.
var/list/unique_reskin
/// Do we apply a click cooldown when resisting this object if it is restraining them?
var/resist_cooldown = CLICK_CD_BREAKOUT

/obj/item/Initialize(mapload)
if(attack_verb_continuous)
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/handcuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
desc = "Fake handcuffs meant for gag purposes."
breakouttime = 1 SECONDS
restraint_strength = HANDCUFFS_TYPE_WEAK
resist_cooldown = CLICK_CD_SLOW

/**
* # Cable restraints
Expand Down Expand Up @@ -356,6 +357,7 @@
name = "fake zipties"
desc = "Fake zipties meant for gag purposes."
breakouttime = 1 SECONDS
resist_cooldown = CLICK_CD_SLOW

/obj/item/restraints/handcuffs/cable/zipties/fake/used
desc = "A pair of broken fake zipties."
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,15 @@
var/obj/item/restraints/cuffs = src.get_item_by_slot(ITEM_SLOT_HANDCUFFED)
buckle_cd = cuffs.breakouttime

visible_message(span_warning("[src] attempts to unbuckle [p_them()]self!"),
visible_message(span_warning("[src] attempts to unbuckle [p_them()]self!"),
span_notice("You attempt to unbuckle yourself... \
(This will take around [DisplayTimeText(buckle_cd)] and you must stay still.)"))

if(!do_after(src, buckle_cd, target = src, timed_action_flags = IGNORE_HELD_ITEM, hidden = TRUE))
if(buckled)
to_chat(src, span_warning("You fail to unbuckle yourself!"))
return

if(QDELETED(src) || isnull(buckled))
return

Expand All @@ -283,8 +283,8 @@
type = 2
if(I)
if(type == 1)
changeNext_move(CLICK_CD_BREAKOUT)
last_special = world.time + CLICK_CD_BREAKOUT
changeNext_move(I.resist_cooldown)
last_special = world.time + I.resist_cooldown
if(type == 2)
changeNext_move(CLICK_CD_RANGE)
last_special = world.time + CLICK_CD_RANGE
Expand Down

0 comments on commit 2c3f7a3

Please sign in to comment.