Skip to content

Commit 7beb443

Browse files
[BugFix] Fix legcuffs not working at all (Monkestation#783)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> <!-- Note: PRs including balance changes authored by anyone other than maintainers and official devs will not be considered. --> ## About The Pull Request Fixes being unable to cuff the legs of people, that simple. For some reason it broke a while back and nobody noticed besides a few people (such as me) so I fixed it. You can now target a leg with a rope/chains and tie thier legs to slow them down once again. ## Why It's Good For The Game Fixing broken features is good because the feature is no longer broken. ## Pre-Merge Checklist <!-- Don't bother filling these in while creating your Pull Request, just click the checkboxes after the Pull Request is opened and you are redirected to the page. --> - [x] You tested this on a local server. - [x] This code did not runtime during testing. - [x] You documented all of your changes. <!-- Neither the compiler nor workflow checks are perfect at detecting runtimes and errors. It is important to test your code/feature/fix locally. -->
1 parent 0e695ed commit 7beb443

File tree

6 files changed

+44
-42
lines changed

6 files changed

+44
-42
lines changed

code/__DEFINES/movespeed_modification.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
#define MOVESPEED_ID_DAMAGE_SLOWDOWN "DAMAGE"
8181
#define MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING "FLYING"
8282
#define MOVESPEED_ID_LENTURI "LENTURI_SLOWDOWN"
83-
#define MOVESPEED_ID_NET_SLOWDOWN "NET"
83+
#define MOVESPEED_ID_LEGCUFF_SLOWDOWN "LEGCUFF"
8484

8585
#define MOVESPEED_ID_LIVING_SLOWDOWN_STATUS "LSS"
8686

code/datums/status_effects/rogue/debuff.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,13 @@
343343
/datum/status_effect/debuff/netted/on_apply()
344344
. = ..()
345345
var/mob/living/carbon/C = owner
346-
C.add_movespeed_modifier(MOVESPEED_ID_NET_SLOWDOWN, multiplicative_slowdown = 3)
346+
C.add_movespeed_modifier(MOVESPEED_ID_LEGCUFF_SLOWDOWN, multiplicative_slowdown = 3)
347347

348348
/datum/status_effect/debuff/netted/on_remove()
349349
. = ..()
350350
if(iscarbon(owner))
351351
var/mob/living/carbon/C = owner
352-
C.remove_movespeed_modifier(MOVESPEED_ID_NET_SLOWDOWN)
352+
C.remove_movespeed_modifier(MOVESPEED_ID_LEGCUFF_SLOWDOWN)
353353
// Already handled in uncuff()
354354
/*
355355
C.legcuffed = null

code/game/objects/items/rogueitems/ropechainbola.dm

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
gender = PLURAL
66
icon = 'icons/roguetown/items/misc.dmi'
77
icon_state = "rope"
8-
slot_flags = ITEM_SLOT_HIP|ITEM_SLOT_WRISTS
8+
slot_flags = ITEM_SLOT_HIP|ITEM_SLOT_WRISTS|ITEM_SLOT_NECK
99
throwforce = 5
1010
w_class = WEIGHT_CLASS_SMALL
1111
throw_speed = 1
1212
throw_range = 3
1313
breakouttime = 5 SECONDS
1414
slipouttime = 1 MINUTES
15-
var/cuffsound = 'sound/blank.ogg'
1615
possible_item_intents = list(/datum/intent/tie)
1716
firefuel = 5 MINUTES
1817
drop_sound = 'sound/foley/dropsound/cloth_drop.ogg'
18+
var/legcuff_multiplicative_slowdown = 3
1919

2020
/datum/intent/tie
2121
name = "tie"
@@ -37,6 +37,7 @@
3737
if(M.legcuffed == src)
3838
M.legcuffed = null
3939
M.update_inv_legcuffed()
40+
M.remove_movespeed_modifier(MOVESPEED_ID_LEGCUFF_SLOWDOWN, TRUE)
4041
return ..()
4142

4243
/obj/item/rope/attack(mob/living/carbon/C, mob/living/user)
@@ -47,43 +48,38 @@
4748
if(!istype(C))
4849
return
4950

50-
if(user.aimheight > 4)
51+
if(user.aimheight >= 5)
5152
if(!C.handcuffed)
5253
if(C.get_num_arms(FALSE))
53-
C.visible_message("<span class='warning'>[user] is trying to tie [C]'s arms with [src.name]!</span>", \
54-
"<span class='userdanger'>[user] is trying to tie my arms with [src.name]!</span>")
55-
56-
playsound(loc, cuffsound, 100, TRUE, -2)
54+
C.visible_message(span_warning("[user] is trying to tie [C]'s arms with [src.name]!"), \
55+
span_danger("[user] is trying to tie my arms with [src.name]!"))
5756
if(do_after(user, 6 SECONDS * (C.surrendering ? 0.5 : 1), C) && C.get_num_arms(FALSE))
58-
apply_cuffs(C, user)
59-
C.visible_message("<span class='warning'>[user] ties [C] with [src.name].</span>", \
60-
"<span class='danger'>[user] ties me up with [src.name].</span>")
57+
apply_cuffs(C, user, leg = FALSE)
58+
C.visible_message(span_warning("[user] ties [C]' arms with [src.name]."), \
59+
span_danger("[user] ties my arms up with [src.name]."))
6160
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
6261
user.mind?.adjust_experience(/datum/skill/craft/traps, C.STAINT, FALSE)
6362
log_combat(user, C, "handcuffed")
6463
else
65-
to_chat(user, "<span class='warning'>I fail to tie up [C]!</span>")
64+
to_chat(user, span_warning("I fail to tie up [C]'s arms!</span>"))
6665
else
67-
to_chat(user, "<span class='warning'>[C] has no arms to tie up.</span>")
68-
69-
if(user.aimheight <= 4)
66+
to_chat(user, span_warning("[C] is missing two or one arms."))
67+
else
7068
if(!C.legcuffed)
71-
if(C.get_num_legs(TRUE) == 2)
72-
C.visible_message("<span class='warning'>[user] is trying to tie [C]'s legs with [src.name]!</span>", \
73-
"<span class='userdanger'>[user] is trying to tie my legs with [src.name]!</span>")
74-
75-
playsound(loc, cuffsound, 30, TRUE, -2)
76-
if(do_after(user, 6 SECONDS, C) && (C.get_num_legs(FALSE) < 2))
77-
apply_cuffs(C, user)
78-
C.visible_message("<span class='warning'>[user] ties [C]'s legs with [src.name].</span>", \
79-
"<span class='danger'>[user] ties my legs with [src.name].</span>")
69+
if(C.get_num_legs(FALSE))
70+
C.visible_message(span_warning("[user] is trying to tie [C]'s legs with [src.name]!"), \
71+
span_danger("[user] is trying to tie my legs with [src.name]!"))
72+
if(do_after(user, 6 SECONDS * (C.surrendering ? 0.5 : 1), C) && C.get_num_legs(FALSE))
73+
apply_cuffs(C, user, leg = TRUE)
74+
C.visible_message(span_warning("[user] ties [C]' legs with [src.name]."), \
75+
span_danger("[user] ties my legs up with [src.name]."))
8076
SSblackbox.record_feedback("tally", "legcuffs", 1, type)
8177
user.mind?.adjust_experience(/datum/skill/craft/traps, C.STAINT, FALSE)
82-
log_combat(user, C, "legcuffed", TRUE)
78+
log_combat(user, C, "legcuffed")
8379
else
84-
to_chat(user, "<span class='warning'>I fail to tie up [C]!</span>")
80+
to_chat(user, span_warning("I fail to tie up [C]'s legs!</span>"))
8581
else
86-
to_chat(user, "<span class='warning'>[C] is missing two or one legs.</span>")
82+
to_chat(user, span_warning("[C] is missing two or one legs."))
8783

8884
/obj/item/rope/proc/apply_cuffs(mob/living/carbon/target, mob/user, leg = FALSE)
8985
if(!leg)
@@ -112,17 +108,11 @@
112108
cuffs.forceMove(target)
113109
target.legcuffed = cuffs
114110

111+
target.add_movespeed_modifier(MOVESPEED_ID_LEGCUFF_SLOWDOWN, multiplicative_slowdown = legcuff_multiplicative_slowdown)
112+
115113
target.update_inv_legcuffed()
116114
return
117115

118-
119-
/datum/intent/whip
120-
name = "strike"
121-
blade_class = BCLASS_BLUNT
122-
attack_verb = list("whips", "strikes", "smacks")
123-
penfactor = 40
124-
chargetime = 5
125-
126116
/obj/item/rope/chain
127117
name = "chain"
128118
desc = "Metal chains designed to interlock and apply the harshest confinement on the villainous."
@@ -136,14 +126,20 @@
136126
throw_range = 3
137127
breakouttime = 1 MINUTES
138128
slipouttime = 5 MINUTES
139-
cuffsound = 'sound/blank.ogg'
140129
possible_item_intents = list(/datum/intent/tie, /datum/intent/whip)
141130
firefuel = null
142131
drop_sound = 'sound/foley/dropsound/chain_drop.ogg'
143132

144-
/obj/item/net
145-
name = "net"
146-
desc = ""
133+
/datum/intent/whip
134+
name = "strike"
135+
blade_class = BCLASS_BLUNT
136+
attack_verb = list("whips", "strikes", "smacks")
137+
penfactor = 40
138+
chargetime = 5
139+
140+
/obj/item/rope/net
141+
name = "rope net"
142+
desc = "A rope mesh of designed to slow a person down."
147143
icon = 'icons/roguetown/items/misc.dmi'
148144
icon_state = "net"
149145
slot_flags = ITEM_SLOT_HIP|ITEM_SLOT_WRISTS
@@ -173,7 +169,7 @@
173169
C.update_inv_legcuffed()
174170
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
175171
to_chat(C, "<span class='danger'>\The [src] entraps you!</span>")
176-
C.Knockdown(knockdown)
172+
//C.Knockdown(knockdown)
177173
C.apply_status_effect(/datum/status_effect/debuff/netted)
178174
playsound(src, 'sound/blank.ogg', 50, TRUE)
179175

@@ -183,6 +179,7 @@
183179
var/mob/living/carbon/M = loc
184180
if(M.legcuffed == src)
185181
M.legcuffed = null
182+
M.remove_movespeed_modifier(MOVESPEED_ID_LEGCUFF_SLOWDOWN, TRUE)
186183
M.update_inv_legcuffed()
187184
if(M.has_status_effect(/datum/status_effect/debuff/netted))
188185
M.remove_status_effect(/datum/status_effect/debuff/netted)

code/modules/mob/living/carbon/carbon.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@
413413
if (legcuffed)
414414
var/obj/item/W = legcuffed
415415
legcuffed = null
416+
remove_movespeed_modifier(MOVESPEED_ID_LEGCUFF_SLOWDOWN, TRUE)
416417
update_inv_legcuffed()
417418
if (client)
418419
client.screen -= W
@@ -454,6 +455,7 @@
454455
legcuffed.forceMove(drop_location())
455456
legcuffed.dropped()
456457
legcuffed = null
458+
remove_movespeed_modifier(MOVESPEED_ID_LEGCUFF_SLOWDOWN, TRUE)
457459
update_inv_legcuffed()
458460
return TRUE
459461

code/modules/mob/living/carbon/inventory.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
update_handcuffed()
127127
else if(I == legcuffed)
128128
legcuffed = null
129+
remove_movespeed_modifier(MOVESPEED_ID_LEGCUFF_SLOWDOWN, TRUE)
129130
if(!QDELETED(src))
130131
update_inv_legcuffed()
131132

code/modules/surgery/bodyparts/bodypart_dismemberment.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
C.legcuffed.forceMove(C.drop_location()) //At this point bodypart is still in nullspace
276276
C.legcuffed.dropped(C)
277277
C.legcuffed = null
278+
C.remove_movespeed_modifier(MOVESPEED_ID_LEGCUFF_SLOWDOWN, TRUE)
278279
C.update_inv_legcuffed()
279280
if(C.shoes && (C.get_num_legs(FALSE) < 1))
280281
C.dropItemToGround(C.shoes, force = TRUE)
@@ -289,6 +290,7 @@
289290
C.legcuffed.forceMove(C.drop_location())
290291
C.legcuffed.dropped(C)
291292
C.legcuffed = null
293+
C.remove_movespeed_modifier(MOVESPEED_ID_LEGCUFF_SLOWDOWN, TRUE)
292294
C.update_inv_legcuffed()
293295
if(C.shoes && (C.get_num_legs(FALSE) < 1))
294296
C.dropItemToGround(C.shoes, force = TRUE)

0 commit comments

Comments
 (0)