From 33e3df815717df367edde60f6cce230f4dc5c464 Mon Sep 17 00:00:00 2001 From: Trilbyspaceclone <30435998+Trilbyspaceclone@users.noreply.github.com> Date: Thu, 25 Apr 2019 20:46:39 -0400 Subject: [PATCH] What in the hell? --- .../components/storage/concrete/pockets.dm | 133 +++++++++++------- 1 file changed, 85 insertions(+), 48 deletions(-) diff --git a/code/datums/components/storage/concrete/pockets.dm b/code/datums/components/storage/concrete/pockets.dm index f049a12ffb..e0a23b0209 100644 --- a/code/datums/components/storage/concrete/pockets.dm +++ b/code/datums/components/storage/concrete/pockets.dm @@ -1,52 +1,89 @@ +/datum/component/storage/concrete/pockets + max_items = 2 + max_w_class = WEIGHT_CLASS_SMALL + max_combined_w_class = 50 + rustle_sound = FALSE -/////////// -//COLLARS// -/////////// - -/obj/item/clothing/neck/petcollar - name = "pet collar" - desc = "It's for pets. Though you probably could wear it yourself, you'd doubtless be the subject of ridicule." - icon_state = "petcollar" - item_color = "petcollar" - pocket_storage_component_path = /datum/component/storage/concrete/pockets/small/collar - var/tagname = null - -/obj/item/clothing/neck/petcollar/attack_self(mob/user) - tagname = copytext(sanitize(input(user, "Would you like to change the name on the tag?", "Name your new pet", "Spot") as null|text),1,MAX_NAME_LEN) - name = "[initial(name)] - [tagname]" - - -/obj/item/clothing/neck/petcollar/locked - name = "locked collar" - desc = "A collar that has a small lock on it to keep it from being removed." - pocket_storage_component_path = /datum/component/storage/concrete/pockets/small/collar/locked - var/lock = FALSE - -/obj/item/clothing/neck/petcollar/locked/attackby(obj/item/key/collar, mob/user, params) - if(lock != FALSE) - to_chat(user, "With a click the collar unlocks!") - lock = FALSE - item_flags = NONE - else - to_chat(user, "With a click the collar locks!") - lock = TRUE - item_flags = NODROP - return - -/obj/item/clothing/neck/petcollar/locked/attack_hand(mob/user) - if(loc == user && user.get_item_by_slot(SLOT_NECK) && lock != FALSE) - to_chat(user, "The collar is locked! You'll need unlock the collar before you can take it off!") - return - ..() - -/obj/item/key/collar - name = "Collar Key" - desc = "A key for a tiny lock on a collar or bag." - -/obj/item/clothing/neck/petcollar/Initialize() +/datum/component/storage/concrete/pockets/handle_item_insertion(obj/item/I, prevent_warning, mob/user) . = ..() - new /obj/item/reagent_containers/food/snacks/cookie(src) + if(. && silent && !prevent_warning) + if(quickdraw) + to_chat(user, "You discreetly slip [I] into [parent]. Alt-click [parent] to remove it.") + else + to_chat(user, "You discreetly slip [I] into [parent].") -/obj/item/clothing/neck/petcollar/locked/Initialize() +/datum/component/storage/concrete/pockets + max_w_class = WEIGHT_CLASS_NORMAL + +/datum/component/storage/concrete/pockets/small + max_items = 1 + attack_hand_interact = FALSE + +/datum/component/storage/concrete/pockets/small/collar + max_items = 1 + +/datum/component/storage/concrete/pockets/small/collar/Initialize() . = ..() - new /obj/item/key/collar(src) + can_hold = typecacheof(list( + /obj/item/reagent_containers/food/snacks/cookie, + /obj/item/reagent_containers/food/snacks/sugarcookie)) + +/datum/component/storage/concrete/pockets/small/collar/locked/Initialize() + . = ..() + can_hold = typecacheof(list( + /obj/item/reagent_containers/food/snacks/cookie, + /obj/item/reagent_containers/food/snacks/sugarcookie, + /obj/item/key/collar)) + +/datum/component/storage/concrete/pockets/tiny + max_items = 1 + max_w_class = WEIGHT_CLASS_TINY + attack_hand_interact = FALSE + +/datum/component/storage/concrete/pockets/small/detective + attack_hand_interact = TRUE // so the detectives would discover pockets in their hats + +/datum/component/storage/concrete/pockets/shoes + attack_hand_interact = FALSE + quickdraw = TRUE + silent = TRUE + +/datum/component/storage/concrete/pockets/shoes/Initialize() + . = ..() + cant_hold = typecacheof(list(/obj/item/screwdriver/power)) + can_hold = typecacheof(list( + /obj/item/kitchen/knife, /obj/item/switchblade, /obj/item/pen, + /obj/item/scalpel, /obj/item/reagent_containers/syringe, /obj/item/dnainjector, + /obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/dropper, + /obj/item/implanter, /obj/item/screwdriver, /obj/item/weldingtool/mini, + /obj/item/firing_pin + )) + +/datum/component/storage/concrete/pockets/shoes/clown/Initialize() + . = ..() + cant_hold = typecacheof(list(/obj/item/screwdriver/power)) + can_hold = typecacheof(list( + /obj/item/kitchen/knife, /obj/item/switchblade, /obj/item/pen, + /obj/item/scalpel, /obj/item/reagent_containers/syringe, /obj/item/dnainjector, + /obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/dropper, + /obj/item/implanter, /obj/item/screwdriver, /obj/item/weldingtool/mini, + /obj/item/firing_pin, /obj/item/bikehorn)) + +/datum/component/storage/concrete/pockets/pocketprotector + max_items = 3 + max_w_class = WEIGHT_CLASS_TINY + var/atom/original_parent + +/datum/component/storage/concrete/pockets/pocketprotector/Initialize() + original_parent = parent + . = ..() + can_hold = typecacheof(list( //Same items as a PDA + /obj/item/pen, + /obj/item/toy/crayon, + /obj/item/lipstick, + /obj/item/flashlight/pen, + /obj/item/clothing/mask/cigarette)) + +/datum/component/storage/concrete/pockets/pocketprotector/real_location() + // if the component is reparented to a jumpsuit, the items still go in the protector + return original_parent