diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 09825a746ca..881cce7ec25 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -49,7 +49,7 @@ else to_chat(user, SPAN_DANGER("You need to have a firm grip on [C] before you can put \the [src] on!")) -/obj/item/handcuffs/proc/place_handcuffs(var/mob/living/carbon/target, var/mob/user) +/obj/item/handcuffs/proc/place_handcuffs(var/mob/living/carbon/target, var/mob/user, var/instant) playsound(src.loc, cuff_sound, 30, 1, -2) var/mob/living/carbon/human/H = target @@ -57,35 +57,44 @@ return FALSE if (!H.has_organ_for_slot(slot_handcuffed)) - to_chat(user, SPAN_DANGER("\The [H] needs at least two wrists before you can cuff them together!")) + if(user) + to_chat(user, SPAN_DANGER("\The [H] needs at least two wrists before you can cuff them together!")) return FALSE if(istype(H.gloves,/obj/item/clothing/gloves/rig) && !elastic) // Can't cuff someone who's in a deployed hardsuit. - to_chat(user, SPAN_DANGER("\The [src] won't fit around \the [H.gloves]!")) + if(user) + to_chat(user, SPAN_DANGER("\The [src] won't fit around \the [H.gloves]!")) return FALSE - user.visible_message(SPAN_DANGER("\The [user] is attempting to put [cuff_type] on \the [H]!")) + if(user) + user.visible_message(SPAN_DANGER("\The [user] is attempting to put [cuff_type] on \the [H]!")) - if(!do_mob(user, target, 30)) - return + if(!instant) + if(!do_mob(user, target, 30)) + return - H.attack_log += text("\[[time_stamp()]\] Has been handcuffed (attempt) by [user.name] ([user.ckey])") - user.attack_log += text("\[[time_stamp()]\] Attempted to handcuff [H.name] ([H.ckey])") - msg_admin_attack("[key_name_admin(user)] attempted to handcuff [key_name_admin(H)] (JMP)",ckey=key_name(user),ckey_target=key_name(H)) + if(user) + H.attack_log += text("\[[time_stamp()]\] Has been handcuffed (attempt) by [user.name] ([user.ckey])") + user.attack_log += text("\[[time_stamp()]\] Attempted to handcuff [H.name] ([H.ckey])") + msg_admin_attack("[key_name_admin(user)] attempted to handcuff [key_name_admin(H)] (JMP)",ckey=key_name(user),ckey_target=key_name(H)) feedback_add_details("handcuffs","H") - user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) - user.do_attack_animation(H) + if(user) + user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) + user.do_attack_animation(H) + user.visible_message(SPAN_DANGER("\The [user] has put [cuff_type] on \the [H]!")) - user.visible_message(SPAN_DANGER("\The [user] has put [cuff_type] on \the [H]!")) target.drop_r_hand() target.drop_l_hand() + // Apply cuffs. var/obj/item/handcuffs/cuffs = src if(dispenser) cuffs = new(target) - else + else if(user) user.drop_from_inventory(cuffs,target) + else + cuffs.forceMove(target) target.handcuffed = cuffs target.update_inv_handcuffed() return TRUE @@ -130,6 +139,7 @@ breakouttime = 300 //Deciseconds = 30s cuff_sound = 'sound/weapons/cablecuff.ogg' cuff_type = "cable restraints" + var/can_be_cut = TRUE elastic = TRUE build_from_parts = TRUE worn_overlay = "end" @@ -153,6 +163,11 @@ /obj/item/handcuffs/cable/green color = COLOR_GREEN +/obj/item/handcuffs/cable/green/vines + name = "vine bindings" + desc = "A set of handcuffs made out of vines. How devilish!" + can_be_cut = FALSE + /obj/item/handcuffs/cable/pink color = COLOR_PINK @@ -176,10 +191,10 @@ if (R.use(1)) var/obj/item/material/wirerod/W = new(get_turf(user)) user.put_in_hands(W) - to_chat(user, SPAN_NOTICE("You wrap the cable restraint around the top of the rod.")) + to_chat(user, SPAN_NOTICE("You wrap \the [src] around the top of the rod.")) qdel(src) update_icon(user) - else if(I.iswirecutter()) + else if(can_be_cut && I.iswirecutter()) user.visible_message("[user] cuts the [src].", SPAN_NOTICE("You cut the [src].")) playsound(src.loc, 'sound/items/wirecutter.ogg', 50, 1) new/obj/item/stack/cable_coil(get_turf(src), 15, color) diff --git a/code/modules/spell_system/spells/spell_list/others/generic/entangle.dm b/code/modules/spell_system/spells/spell_list/others/generic/entangle.dm index 4634c59ec75..6d84a3cae5b 100644 --- a/code/modules/spell_system/spells/spell_list/others/generic/entangle.dm +++ b/code/modules/spell_system/spells/spell_list/others/generic/entangle.dm @@ -28,24 +28,27 @@ seed.name = "heirlooms" seed.seed_name = "heirloom" seed.display_name = "vines" - seed.chems = list(/datum/reagent/nutriment = list(1,20)) + seed.chems = list(/datum/reagent/nutriment = list(1, 20)) /spell/targeted/entangle/cast(var/list/targets) for(var/mob/M in targets) var/turf/T = get_turf(M) - var/obj/effect/plant/single/P = new(T,seed) - P.can_buckle = 1 + var/obj/effect/plant/single/P = new(T, seed) + P.can_buckle = TRUE P.health = P.max_health P.mature_time = 0 P.process() P.buckle_mob(M) M.set_dir(pick(cardinal)) - M.visible_message("[P] appear from the floor, spinning around \the [M] tightly!") + + var/obj/item/handcuffs/cable/green/vines/V = new /obj/item/handcuffs/cable/green/vines(get_turf(M)) + V.place_handcuffs(M, instant = TRUE) + M.visible_message(SPAN_DANGER("[P] appear from the floor, spinning tightly around \the [M]!")) /spell/targeted/entangle/empower_spell() if(!..()) - return 0 + return FALSE max_targets++ diff --git a/code/modules/spell_system/spells/spell_list/targeted_spells.dm b/code/modules/spell_system/spells/spell_list/targeted_spells.dm index 76a7f061388..004d24280cc 100644 --- a/code/modules/spell_system/spells/spell_list/targeted_spells.dm +++ b/code/modules/spell_system/spells/spell_list/targeted_spells.dm @@ -55,13 +55,11 @@ Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are exp for(var/mob/living/M in starting_targets) if(!(spell_flags & INCLUDEUSER) && M == user) continue - if(compatible_mobs && compatible_mobs.len) - if(!is_type_in_list(M, compatible_mobs)) continue - if(compatible_mobs && compatible_mobs.len && !is_type_in_list(M, compatible_mobs)) + if(length(compatible_mobs) && !is_type_in_list(M, compatible_mobs)) continue possible_targets += M - if(possible_targets.len) + if(length(possible_targets)) if(spell_flags & SELECTABLE) //if we are allowed to choose. see setup.dm for details var/mob/temp_target = input(user, "Choose the target for the spell.", "Targeting") as null|mob in possible_targets if(temp_target) @@ -83,13 +81,14 @@ Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are exp for(var/mob/living/target in starting_targets) if(!(spell_flags & INCLUDEUSER) && target == user) continue - if(compatible_mobs && !is_type_in_list(target, compatible_mobs)) + if(length(compatible_mobs) && !is_type_in_list(target, compatible_mobs)) continue possible_targets += target if(spell_flags & SELECTABLE) - for(var/i = 1; i<=max_targets, i++) - if(!possible_targets.len) + for(var/i = 1; i <= max_targets, i++) + if(!length(possible_targets)) + to_chat(user, SPAN_WARNING("There are no targets in range!")) break var/mob/M = input(user, "Choose the target for the spell.", "Targeting") as null|mob in possible_targets if(!M) @@ -100,8 +99,8 @@ Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are exp targets += M possible_targets -= M else - for(var/i=1,i<=max_targets,i++) - if(!possible_targets.len) + for(var/i = 1,i <= max_targets, i++) + if(!length(possible_targets)) break if(target_ignore_prev) var/target = pick(possible_targets) @@ -113,7 +112,7 @@ Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are exp if(!(spell_flags & INCLUDEUSER) && (user in targets)) targets -= user - if(compatible_mobs && compatible_mobs.len) + if(length(compatible_mobs)) for(var/mob/living/target in targets) //filters out all the non-compatible mobs if(!is_type_in_list(target, compatible_mobs)) targets -= target diff --git a/html/changelogs/geeves-entangle_fix.yml b/html/changelogs/geeves-entangle_fix.yml new file mode 100644 index 00000000000..e911665abc9 --- /dev/null +++ b/html/changelogs/geeves-entangle_fix.yml @@ -0,0 +1,7 @@ +author: Geeves + +delete-after: True + +changes: + - bugfix: "Fixed upgraded entangle not allowing you to select targets." + - rscadd: "Added vine binding handcuffs that prevent the user from just unbuckling out of the entangle spell." \ No newline at end of file