From f9b23a10292ed40a324220ec175f155f6d264c47 Mon Sep 17 00:00:00 2001 From: Contrabang <91113370+Contrabang@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:44:28 -0400 Subject: [PATCH] Fixes pickpocket gloves (#25074) * yes this is really how it works * dies of death * undo --- code/datums/elements/strippable.dm | 41 ++++++++++--------- .../mob/living/carbon/carbon_stripping.dm | 20 +++++---- .../living/carbon/human/human_stripping.dm | 6 --- 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/code/datums/elements/strippable.dm b/code/datums/elements/strippable.dm index 487ebbe2d79..668f723fe60 100644 --- a/code/datums/elements/strippable.dm +++ b/code/datums/elements/strippable.dm @@ -71,14 +71,15 @@ /// Start the equipping process. This is the proc you should yield in. /// Returns TRUE/FALSE depending on if it is allowed. /datum/strippable_item/proc/start_equip(atom/source, obj/item/equipping, mob/user) - source.visible_message( - "[user] tries to put [equipping] on [source].", - "[user] tries to put [equipping] on you.", - ) - if(ishuman(source)) - var/mob/living/carbon/human/victim_human = source - if(!victim_human.has_vision()) - to_chat(victim_human, "You feel someone trying to put something on you.") + if(!in_thief_mode(user)) + source.visible_message( + "[user] tries to put [equipping] on [source].", + "[user] tries to put [equipping] on you.", + ) + if(ishuman(source)) + var/mob/living/carbon/human/victim_human = source + if(!victim_human.has_vision()) + to_chat(victim_human, "You feel someone trying to put something on you.") if(!do_mob(user, source, equipping.put_on_delay)) return FALSE @@ -118,20 +119,20 @@ if(isnull(item)) return FALSE - source.visible_message( - "[user] tries to remove [source]'s [item.name].", - "[user] tries to remove your [item.name].", - "You hear rustling." - ) - to_chat(user, "You try to remove [source]'s [item.name]...") add_attack_logs(user, source, "Attempting stripping of [item]") item.add_fingerprint(user) - if(ishuman(source)) - var/mob/living/carbon/human/victim_human = source - if(!victim_human.has_vision()) - to_chat(source, "You feel someone fumble with your belongings.") + if(!in_thief_mode(user)) + source.visible_message( + "[user] tries to remove [source]'s [item.name].", + "[user] tries to remove your [item.name].", + "You hear rustling." + ) + if(ishuman(source)) + var/mob/living/carbon/human/victim_human = source + if(!victim_human.has_vision()) + to_chat(source, "You feel someone fumble with your belongings.") return start_unequip_mob(get_item(source), source, user) @@ -168,7 +169,7 @@ /datum/strippable_item/proc/should_show(atom/source, mob/user) return TRUE -/// Returns whether or not this item should show. +/// Returns whether the user is in "thief mode" where stripping/equipping is silent and stealing from pockets moves stuff to your hands /datum/strippable_item/proc/in_thief_mode(mob/user) if(!ishuman(user)) return FALSE @@ -242,6 +243,8 @@ return FALSE INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(finish_unequip_mob), item, source, user) + if(in_thief_mode(user)) + INVOKE_ASYNC(user, TYPE_PROC_REF(/mob, put_in_hands), item) /// Returns the delay of equipping this item to a mob /datum/strippable_item/mob_item_slot/proc/get_equip_delay(obj/item/equipping) diff --git a/code/modules/mob/living/carbon/carbon_stripping.dm b/code/modules/mob/living/carbon/carbon_stripping.dm index 61cd804d1fa..e29abf475da 100644 --- a/code/modules/mob/living/carbon/carbon_stripping.dm +++ b/code/modules/mob/living/carbon/carbon_stripping.dm @@ -42,11 +42,13 @@ var/obj/item/organ/internal/headpocket/pocket = H.get_int_organ(/obj/item/organ/internal/headpocket) if(!pocket.held_item) return - user.visible_message("[user] is trying to remove something from [source]'s head!", - "You start to dislodge whatever's inside [source]'s headpocket!") + if(!in_thief_mode(user)) + user.visible_message("[user] is trying to remove something from [source]'s head!", + "You start to dislodge whatever's inside [source]'s headpocket!") if(do_mob(user, source, POCKET_STRIP_DELAY)) - user.visible_message("[user] has dislodged something from [source]'s head!", - "You have dislodged everything from [source]'s headpocket!") + if(!in_thief_mode(user)) + user.visible_message("[user] has dislodged something from [source]'s head!", + "You have dislodged everything from [source]'s headpocket!") pocket.empty_contents() add_attack_logs(user, source, "Stripped of headpocket items", isLivingSSD(source) ? null : ATKLOG_ALL) return @@ -61,8 +63,9 @@ to_chat(user, "You lack the ability to manipulate the lock.") return - muzzle.visible_message("[user] tries to [muzzle.locked ? "unlock" : "lock"] [source]'s [muzzle.name].", \ - "[user] tries to [muzzle.locked ? "unlock" : "lock"] [source]'s [muzzle.name].") + if(!in_thief_mode(user)) + muzzle.visible_message("[user] tries to [muzzle.locked ? "unlock" : "lock"] [source]'s [muzzle.name].", \ + "[user] tries to [muzzle.locked ? "unlock" : "lock"] [source]'s [muzzle.name].") if(!do_mob(user, source, POCKET_STRIP_DELAY)) return @@ -74,8 +77,9 @@ if(!success) return - muzzle.visible_message("[user] [muzzle.locked ? "locks" : "unlocks"] [source]'s [muzzle.name].", \ - "[user] [muzzle.locked ? "locks" : "unlocks"] [source]'s [muzzle.name].") + if(!in_thief_mode(user)) + muzzle.visible_message("[user] [muzzle.locked ? "locks" : "unlocks"] [source]'s [muzzle.name].", \ + "[user] [muzzle.locked ? "locks" : "unlocks"] [source]'s [muzzle.name].") /datum/strippable_item/mob_item_slot/handcuffs diff --git a/code/modules/mob/living/carbon/human/human_stripping.dm b/code/modules/mob/living/carbon/human/human_stripping.dm index 4de1424ae72..1e159ce42c6 100644 --- a/code/modules/mob/living/carbon/human/human_stripping.dm +++ b/code/modules/mob/living/carbon/human/human_stripping.dm @@ -166,12 +166,6 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( /datum/strippable_item/mob_item_slot/pocket/proc/warn_owner(atom/owner) to_chat(owner, "You feel your [pocket_side] pocket being fumbled with!") -/datum/strippable_item/mob_item_slot/pocket/finish_unequip(atom/source, mob/user) - var/obj/item/item = get_item(source) - . = ..() - if(in_thief_mode(user)) - INVOKE_ASYNC(user, TYPE_PROC_REF(/mob, put_in_hands), item) - /datum/strippable_item/mob_item_slot/pocket/left key = STRIPPABLE_ITEM_LPOCKET item_slot = SLOT_HUD_LEFT_STORE