Files
CHOMPStation2/code/game/objects/items/weapons/storage/quickdraw.dm
Leshana 6756c5a483 Merge branch 'master' of https://github.com/PolarisSS13/Polaris into polaris-sync-2018-03-30
# Conflicts:
#	.travis.yml
#	code/ATMOSPHERICS/components/unary/outlet_injector.dm
#	code/__defines/_planes+layers.dm
#	code/__defines/chemistry.dm
#	code/__defines/mobs.dm
#	code/_helpers/mobs.dm
#	code/_onclick/hud/robot.dm
#	code/game/area/areas.dm
#	code/game/machinery/computer/supply.dm
#	code/game/machinery/cryopod.dm
#	code/game/machinery/doors/airlock.dm
#	code/game/objects/items/devices/communicator/UI.dm
#	code/game/objects/items/devices/communicator/messaging.dm
#	code/game/sound.dm
#	code/game/supplyshuttle.dm
#	code/game/turfs/flooring/flooring_decals.dm
#	code/modules/admin/admin.dm
#	code/modules/client/preference_setup/occupation/occupation.dm
#	code/modules/events/event_container.dm
#	code/modules/mob/dead/observer/observer.dm
#	code/modules/mob/language/language.dm
#	code/modules/mob/living/carbon/human/human.dm
#	code/modules/mob/living/carbon/human/human_powers.dm
#	code/modules/mob/living/carbon/human/life.dm
#	code/modules/mob/living/carbon/human/species/species_shapeshift.dm
#	code/modules/mob/living/living.dm
#	code/modules/mob/living/living_powers.dm
#	code/modules/mob/living/say.dm
#	code/modules/mob/living/simple_animal/animals/bear.dm
#	code/modules/mob/living/simple_animal/animals/cat.dm
#	code/modules/mob/living/simple_animal/animals/parrot.dm
#	code/modules/mob/logout.dm
#	code/modules/mob/mob_helpers.dm
#	code/modules/organs/organ.dm
#	code/modules/organs/organ_icon.dm
#	code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm
#	code/modules/reagents/reagent_containers/syringes.dm
#	code/modules/shuttles/shuttle.dm
#	html/changelogs/.all_changelog.yml
#	maps/RandomZLevels/wildwest.dm
#	maps/southern_cross/items/clothing/sc_head.dm
#	maps/southern_cross/southern_cross-1.dmm
#	vorestation.dme
2018-03-31 09:20:59 -04:00

81 lines
2.9 KiB
Plaintext

// -----------------------------
// 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"
icon = 'icons/obj/storage_vr.dmi' // VOREStation Edit
//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
)