From 89b8a002bf991a0da76b0bcc19363d02aa34fd02 Mon Sep 17 00:00:00 2001 From: Bone White Date: Wed, 18 Jun 2014 11:04:33 +0100 Subject: [PATCH] Pickpocket Gloves fix They can now take/place ids without notifying, and ids enter the pickpocket's hand instead of dropping to the floor or not working. --- code/datums/uplink_item.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 67 ++++++++++++++++--- 2 files changed, 57 insertions(+), 12 deletions(-) diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index f19b2b9121b..386fad10098 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -149,7 +149,7 @@ var/list/uplink_items = list() /datum/uplink_item/jobspecific/pickpocketgloves name = "Pickpocket's Gloves" - desc = "A pair of sleek gloves to aid in pickpocketing, while wearing these you can see inside the pockets of any unsuspecting mark, loot the ID, belt, or pockets without them knowing, and pickpocketing puts the item directly into your hand." + desc = "A pair of sleek gloves to aid in pickpocketing, while wearing these you can see inside the pockets of any unsuspecting mark, loot the ID or pockets without them knowing, and pickpocketing puts the item directly into your hand." item = /obj/item/clothing/gloves/black/thief cost = 3 job = list("Assistant") diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 24b56c88d8f..1df3bfed66d 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -565,7 +565,10 @@ /mob/living/carbon/human/Topic(href, href_list) var/pickpocket = 0 + if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr)) + + // if looting pockets with gloves, do it quietly if(href_list["pockets"]) if(usr:gloves) var/obj/item/clothing/gloves/G = usr:gloves @@ -601,6 +604,47 @@ // Display a warning if the user mocks up src << "You feel your [pocket_side] pocket being fumbled with!" + + // if looting id with gloves, do it quietly - this allows pickpocket gloves to take/place id stealthily - Bone White + if(href_list["item"]) + var/itemTarget = href_list["item"] + if(itemTarget == "id") + if(usr:gloves) + var/obj/item/clothing/gloves/G = usr:gloves + pickpocket = G.pickpocket + if(pickpocket) + var/obj/item/worn_id = src.wear_id + var/obj/item/place_item = usr.get_active_hand() // Item to place in the pocket, if it's empty + + if(worn_id) + usr << "You try to remove [src]'s ID." + else if(place_item && place_item.mob_can_equip(src, slot_wear_id, 1)) + usr << "You try to place [place_item] onto [src]." + else + return + + if(do_mob(usr, src, STRIP_DELAY)) + if(worn_id) + u_equip(worn_id) + usr.put_in_hands(worn_id) + else + if(place_item) + usr.u_equip(place_item) + equip_to_slot_if_possible(place_item, slot_wear_id, 0, 1) + + // Update strip window + if(usr.machine == src && in_range(src, usr)) + show_inv(usr) + + + + else if(!pickpocket) + // Display a warning if the user mocks up + src << "You feel your ID slot being fumbled with!" + + + + if (href_list["refresh"]) if((machine)&&(in_range(src, usr))) show_inv(machine) @@ -615,17 +659,18 @@ if(ishuman(usr) && usr:gloves) var/obj/item/clothing/gloves/G = usr:gloves pickpocket = G.pickpocket - O.source = usr - O.target = src - O.item = usr.get_active_hand() - O.s_loc = usr.loc - O.t_loc = loc - O.place = href_list["item"] - O.pickpocket = pickpocket //Stealthy - requests += O - spawn( 0 ) - O.process() - return + if(!pickpocket || href_list["item"] != "id") // Stop the non-stealthy verbose strip if pickpocketing id. + O.source = usr + O.target = src + O.item = usr.get_active_hand() + O.s_loc = usr.loc + O.t_loc = loc + O.place = href_list["item"] + O.pickpocket = pickpocket //Stealthy + requests += O + spawn( 0 ) + O.process() + return if (href_list["criminal"]) if(hasHUD(usr,"security"))