From 42615fcc466eb54b55e287da5fe93430c2b56591 Mon Sep 17 00:00:00 2001 From: Tayyyyyyy Date: Tue, 23 May 2017 16:31:06 -0700 Subject: [PATCH] Allow dislodging of headpocket via strip panel --- code/modules/mob/living/carbon/human/human.dm | 21 +++++++++++++++++++ .../modules/surgery/organs/subtypes/skrell.dm | 10 +++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 1c012655cdc..16293212601 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -531,6 +531,17 @@ dat += "Head:[(head && !(head.flags&ABSTRACT)) ? head : "Empty"]" + var/obj/item/organ/internal/headpocket/C = get_int_organ(/obj/item/organ/internal/headpocket) + if(C) + if(slot_wear_mask in obscured) + dat += " ↳Headpocket:Obscured" + else + var/list/items = C.get_contents() + if(items.len) + dat += " ↳Headpocket:Dislodge Items" + else + dat += " ↳Headpocket:Empty" + if(slot_wear_mask in obscured) dat += "Mask:Obscured" else @@ -826,6 +837,16 @@ var/obj/item/clothing/under/U = w_uniform U.set_sensors(usr) + if(href_list["dislodge_headpocket"]) + usr.visible_message("[usr] is trying to remove something from [src]'s head!", + "You start to dislodge whatever's inside [src]'s headpocket!") + if(do_mob(usr, src, POCKET_STRIP_DELAY)) + usr.visible_message("[usr] has dislodged something from [src]'s head!", + "You have dislodged everything from [src]'s headpocket!") + var/obj/item/organ/internal/headpocket/C = get_int_organ(/obj/item/organ/internal/headpocket) + C.empty_contents() + add_logs(usr, src, "stripped", addition="of headpocket items", print_attack_log=isLivingSSD(src)) + if(href_list["strip_accessory"]) if(istype(w_uniform, /obj/item/clothing/under)) var/obj/item/clothing/under/U = w_uniform diff --git a/code/modules/surgery/organs/subtypes/skrell.dm b/code/modules/surgery/organs/subtypes/skrell.dm index d5978badaf1..586136ba0d0 100644 --- a/code/modules/surgery/organs/subtypes/skrell.dm +++ b/code/modules/surgery/organs/subtypes/skrell.dm @@ -30,7 +30,7 @@ if(pocket.contents.len && (owner.stunned || !findtextEx(head.h_style, "Tentacles"))) owner.visible_message("Something falls from [owner]'s head!", "Something falls from your head!") - pocket.empty_object_contents(0, get_turf(owner)) + empty_contents() /obj/item/organ/internal/headpocket/ui_action_click() if(!loc) @@ -38,8 +38,14 @@ pocket.MouseDrop(owner) /obj/item/organ/internal/headpocket/on_owner_death() - pocket.empty_object_contents(0, get_turf(owner)) + empty_contents() /obj/item/organ/internal/headpocket/remove() pocket.empty_object_contents(0, get_turf(owner)) . = ..() + +/obj/item/organ/internal/headpocket/proc/empty_contents() + pocket.empty_object_contents(0, get_turf(owner)) + +/obj/item/organ/internal/headpocket/proc/get_contents() + return pocket.contents