From 71a1b9ace320018e51d33cf940b0f3b969380dd8 Mon Sep 17 00:00:00 2001 From: Giacomand Date: Mon, 24 Jun 2013 20:38:06 +0100 Subject: [PATCH 1/2] * Re-added reverse pickpocketing. Resolves #792. * Increased the time to empty pockets. * Split pockets into the left and right pocket slots. * You can tell if a pocket is empty or full from the strip menu. --- code/modules/mob/living/carbon/human/human.dm | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 1c0f5343112..d5b834287b6 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -377,7 +377,8 @@ if(legcuffed) dat += "
Legcuffed" if(w_uniform) - dat += "
Empty Pockets" + dat += "

Left [l_store ? "" : "Empty"] Pocket" + dat += " - Right [r_store ? "" : "Empty"] Pocket" dat += {"
@@ -481,15 +482,38 @@ //strip panel if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr)) if(href_list["pockets"]) + + var/pocket_side = href_list["pockets"] + var/pocket_id = (pocket_side == "right" ? slot_r_store : slot_l_store) + var/obj/item/pocket_item = (pocket_id == slot_r_store ? src.r_store : src.l_store) + var/obj/item/place_item = usr.get_active_hand() // Item to place in the pocket, if it's empty + //visible_message("[usr] tries to empty [src]'s pockets.", \ "[usr] tries to empty [src]'s pockets.") // Pickpocketing! - usr << "You try to empty [src]'s pockets." - if(do_mob(usr, src, STRIP_DELAY * 0.5)) - u_equip(r_store) - u_equip(l_store) + if(pocket_item) + usr << "You try to empty [src]'s [pocket_side] pocket." + else if(place_item && place_item.mob_can_equip(src, pocket_id, 1)) + usr << "You try to place [place_item] into [src]'s [pocket_side] pocket." + else + return + + if(do_mob(usr, src, STRIP_DELAY)) + if(pocket_item) + u_equip(pocket_item) + else + if(place_item) + usr.u_equip(place_item) + equip_to_slot_if_possible(place_item, pocket_id, 0, 1) + + // Update strip window + if(usr.machine == src && in_range(src, usr)) + show_inv(usr) + + + else // Display a warning if the user mocks up - src << "You feel your pockets being fumbled with!" + src << "You feel your [pocket_side] pocket being fumbled with!" if(href_list["criminal"]) if(istype(usr, /mob/living/carbon/human)) From 537ede1e02a2a27250333e5de9e6ff974d33a511 Mon Sep 17 00:00:00 2001 From: Giacomand Date: Mon, 24 Jun 2013 20:50:22 +0100 Subject: [PATCH 2/2] * Cleaned up the interface a bit. * Made the window name be the pointer of the mob, instead of the name, to prevent multiple windows opening when the mob changes name while being stripped. --- .../mob/living/carbon/alien/humanoid/humanoid.dm | 8 ++++---- code/modules/mob/living/carbon/carbon.dm | 6 +++--- code/modules/mob/living/carbon/human/human.dm | 10 +++++----- code/modules/mob/mob.dm | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 41f1d2ce0a4..69f01f03d96 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -398,10 +398,10 @@ In all, this is a lot like the monkey code. /N dat += {"
-
Close +
Close "} - user << browse(dat, "window=mob[name];size=325x500") - onclose(user, "mob[name]") + user << browse(dat, "window=mob\ref[src];size=325x500") + onclose(user, "mob\ref[src]") /mob/living/carbon/alien/humanoid/Topic(href, href_list) @@ -413,4 +413,4 @@ In all, this is a lot like the monkey code. /N "[usr] tries to empty [src]'s pouches.") if(do_mob(usr, src, STRIP_DELAY * 0.5)) u_equip(r_store) - u_equip(l_store) + u_equip(l_store) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 75216157702..0cca5b54265 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -495,10 +495,10 @@ dat += {"
-
Close +
Close "} - user << browse(dat, "window=mob[name];size=325x500") - onclose(user, "mob[name]") + user << browse(dat, "window=mob\ref[src];size=325x500") + onclose(user, "mob\ref[src]") /mob/living/carbon/Topic(href, href_list) ..() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index d5b834287b6..241b2822514 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -377,16 +377,16 @@ if(legcuffed) dat += "
Legcuffed" if(w_uniform) - dat += "

Left [l_store ? "" : "Empty"] Pocket" - dat += " - Right [r_store ? "" : "Empty"] Pocket" + dat += "

Left Pocket ([l_store ? "Full" : "Empty"])" + dat += " - Right Pocket ([r_store ? "Full" : "Empty"])" dat += {"
-
Close +
Close "} - user << browse(dat, "window=mob[name];size=340x480") - onclose(user, "mob[name]") + user << browse(dat, "window=mob\ref[src];size=340x480") + onclose(user, "mob\ref[src]") // called when something steps onto a human diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 05f6d4ad9fa..25db03a46ab 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -238,10 +238,10 @@ var/list/slot_equipment_priority = list( \

Left Hand: [l_hand ? l_hand : "Nothing"]
Right Hand: [r_hand ? r_hand : "Nothing"] -
Close +
Close "} - user << browse(dat, "window=mob[name];size=325x500") - onclose(user, "mob[name]") + user << browse(dat, "window=mob\ref[src];size=325x500") + onclose(user, "mob\ref[src]") /mob/verb/mode()