diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index 9faa513c9ec..48593c7b21c 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -134,7 +134,8 @@ /obj/item/weapon/crowbar, /obj/item/device/flashlight, /obj/item/weapon/cell/device, - /obj/item/weapon/extinguisher/mini + /obj/item/weapon/extinguisher/mini, + /obj/item/weapon/storage/quickdraw/syringe_case ) /obj/item/weapon/storage/belt/medical/emt diff --git a/code/game/objects/items/weapons/storage/quickdraw.dm b/code/game/objects/items/weapons/storage/quickdraw.dm new file mode 100644 index 00000000000..86d7c76ca2d --- /dev/null +++ b/code/game/objects/items/weapons/storage/quickdraw.dm @@ -0,0 +1,80 @@ +// ----------------------------- +// Quickdraw storage +// ----------------------------- +//These items are pouches and cases made to be kept in belts or pockets to quickly draw objects from +//Largely inspired by the vest pouches on Colonial Marines + +/obj/item/weapon/storage/quickdraw + name = "quickdraw" + desc = "This object should not appear" + + //Quickmode + //When set to 0, this storage will operate as a regular storage, and clicking on it while equipped will open it as a storage + //When set to 1, a click while it is equipped will instead move the first item inside it to your hand + var/quickmode = 0 + +/obj/item/weapon/storage/quickdraw/attack_hand(mob/user as mob) + if(src.loc == user) //If they aren't holding us, we do nothing special + if(ishuman(user)) + var/mob/living/carbon/human/H = user + if(quickmode) + var/first_item = contents[1] + if(first_item && !H.get_active_hand()) //Do we have anything to give you? + H.put_in_hands(first_item) + return + + if(H.l_store == src && !H.get_active_hand()) //overrides + src.open(user) + return + if(H.r_store == src && !H.get_active_hand()) + src.open(user) + return + ..() //Nothing special happened, go call the other proc + + +/obj/item/weapon/storage/quickdraw/verb/toggle_quickdraw() + set name = "Switch Quickdraw Mode" + set category = "Object" + + quickmode = !quickmode + switch (quickmode) + if(1) + to_chat(usr, "[src] now draws the first object inside.") + if(0) + to_chat(usr, "[src] now opens as a container.") + +/obj/item/weapon/storage/quickdraw/AltClick(mob/user) + ..() + if(src.loc == user) //Are they carrying us? + toggle_quickdraw() + + +// If we start adding more of these, we'll need to make them their own folder. 'til then, this one should be fine. + +// ----------------------------- +// Syringe case +// ----------------------------- + +/obj/item/weapon/storage/quickdraw/syringe_case + name = "syringe case" + desc = "A small case for safely carrying sharps around." + icon_state = "syringe_case" + + w_class = ITEMSIZE_SMALL + max_w_class = ITEMSIZE_TINY + max_storage_space = ITEMSIZE_TINY * 6 //Capable of holding six syringes + + //Can hold syringes and autoinjectors, but also pills if you really wanted. Syringe-shaped objects like pens and cigarettes also fit, but why would you do that? + can_hold = list(/obj/item/weapon/reagent_containers/syringe, /obj/item/weapon/reagent_containers/hypospray/autoinjector, + /obj/item/weapon/reagent_containers/pill, /obj/item/weapon/pen, /obj/item/device/flashlight/pen, /obj/item/clothing/mask/smokable/cigarette) + + quickmode = 1 //Starts in quickdraw mode + //Preloaded for your convenience! + starts_with = list( + /obj/item/weapon/reagent_containers/syringe, + /obj/item/weapon/reagent_containers/syringe, + /obj/item/weapon/reagent_containers/syringe, + /obj/item/weapon/reagent_containers/syringe, + /obj/item/weapon/reagent_containers/syringe, + /obj/item/weapon/reagent_containers/syringe + ) \ No newline at end of file diff --git a/icons/obj/storage.dmi b/icons/obj/storage.dmi index 677903284cd..91658df513f 100644 Binary files a/icons/obj/storage.dmi and b/icons/obj/storage.dmi differ diff --git a/polaris.dme b/polaris.dme index 08797dc0633..1906f467bfd 100644 --- a/polaris.dme +++ b/polaris.dme @@ -1016,6 +1016,7 @@ #include "code\game\objects\items\weapons\storage\laundry_basket.dm" #include "code\game\objects\items\weapons\storage\lockbox.dm" #include "code\game\objects\items\weapons\storage\misc.dm" +#include "code\game\objects\items\weapons\storage\quickdraw.dm" #include "code\game\objects\items\weapons\storage\secure.dm" #include "code\game\objects\items\weapons\storage\storage.dm" #include "code\game\objects\items\weapons\storage\toolbox.dm"