Skip to content

Commit

Permalink
Pouches.
Browse files Browse the repository at this point in the history
  • Loading branch information
LudwigVonChesterfield committed Jul 23, 2019
1 parent 3258a9d commit eac1efc
Show file tree
Hide file tree
Showing 12 changed files with 317 additions and 3 deletions.
5 changes: 3 additions & 2 deletions code/game/objects/items/weapons/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@
item_state = "medical"
can_hold = list(
"/obj/item/device/healthanalyzer",
"/obj/item/device/plant_analyzer",
"/obj/item/device/robotanalyzer",
"/obj/item/weapon/dnainjector",
"/obj/item/weapon/reagent_containers/dropper",
"/obj/item/weapon/reagent_containers/glass/beaker",
"/obj/item/weapon/reagent_containers/glass/bottle",
"/obj/item/weapon/reagent_containers/pill",
"/obj/item/weapon/reagent_containers/syringe",
"/obj/item/weapon/reagent_containers/glass/dispenser",
"/obj/item/weapon/lighter/zippo",
"/obj/item/weapon/lighter",
"/obj/item/weapon/storage/fancy/cigarettes",
"/obj/item/weapon/storage/pill_bottle",
"/obj/item/stack/medical",
Expand Down
268 changes: 268 additions & 0 deletions code/game/objects/items/weapons/storage/pouches.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
/obj/item/weapon/storage/pouch
name = "pouch"
desc = "Can hold various things."
icon = 'icons/obj/pouches.dmi'
icon_state = "pouch"
item_state = "pouch"

w_class = ITEM_SIZE_SMALL
slot_flags = SLOT_POCKET|SLOT_BELT //Pouches can be worn on belt
storage_slots = 1
max_w_class = ITEM_SIZE_SMALL
max_storage_space = base_storage_capacity(ITEM_SIZE_NORMAL)
attack_verb = list("pouched")

var/sliding_behavior = FALSE

/obj/item/weapon/storage/pouch/verb/toggle_slide()
set name = "Toggle Slide"
set desc = "Toggle the behavior of last item in [src] \"sliding\" into your hand."
set category = "Object"

sliding_behavior = !sliding_behavior
to_chat(usr, "<span class='notice'>Items will now [sliding_behavior ? "" : "not"] slide out of [src].</span>")

/obj/item/weapon/storage/pouch/attack_hand(mob/living/carbon/human/user)
if(sliding_behavior && contents.len && (src in user))
var/obj/item/I = contents[contents.len]
if(istype(I))
hide_from(usr)
var/turf/T = get_turf(user)
remove_from_storage(I, T)
usr.put_in_hands(I)
add_fingerprint(user)
else
..()

/obj/item/weapon/storage/pouch/small_generic
name = "small generic pouch"
desc = "Can hold anything in it, but only about once."
icon_state = "small_generic"
item_state = "small_generic"
storage_slots = null //Uses generic capacity
max_storage_space = ITEM_SIZE_TINY * 3
max_w_class = ITEM_SIZE_SMALL

/obj/item/weapon/storage/pouch/medium_generic
name = "medium generic pouch"
desc = "Can hold anything in it, but only about twice."
icon_state = "medium_generic"
item_state = "medium_generic"
storage_slots = null //Uses generic capacity
max_storage_space = ITEM_SIZE_TINY * 5
max_w_class = ITEM_SIZE_NORMAL

/obj/item/weapon/storage/pouch/large_generic
name = "large generic pouch"
desc = "A mini satchel. Can hold a fair bit, but it won't fit in your pocket"
icon_state = "large_generic"
item_state = "large_generic"
w_class = ITEM_SIZE_NORMAL
slot_flags = SLOT_BELT|SLOT_DENYPOCKET
storage_slots = null //Uses generic capacity
max_storage_space = ITEM_SIZE_TINY * 10
max_w_class = ITEM_SIZE_NORMAL

/obj/item/weapon/storage/pouch/medical_supply
name = "medical supply pouch"
desc = "Can hold medical equipment. But only about three pieces of it."
icon_state = "medical_supply"
item_state = "medical_supply"

storage_slots = 3
max_w_class = ITEM_SIZE_NORMAL

can_hold = list(
"/obj/item/device/healthanalyzer",
"/obj/item/device/plant_analyzer",
"/obj/item/device/robotanalyzer",
"/obj/item/weapon/dnainjector",
"/obj/item/weapon/reagent_containers/dropper",
"/obj/item/weapon/reagent_containers/glass/beaker",
"/obj/item/weapon/reagent_containers/glass/bottle",
"/obj/item/weapon/reagent_containers/pill",
"/obj/item/weapon/reagent_containers/syringe",
"/obj/item/weapon/lighter",
"/obj/item/weapon/storage/fancy/cigarettes",
"/obj/item/weapon/storage/pill_bottle",
"/obj/item/stack/medical",
"/obj/item/device/flashlight/pen",
"/obj/item/clothing/mask/surgical",
"/obj/item/clothing/gloves/latex",
"/obj/item/weapon/reagent_containers/hypospray",
"/obj/item/clothing/glasses/hud/health",
"/obj/item/device/sensor_device",
"/obj/item/device/mass_spectrometer",
"/obj/item/device/reagent_scanner"
)

/obj/item/weapon/storage/pouch/engineering_tools
name = "engineering tools pouch"
desc = "Can hold small engineering tools. But only about three pieces of them."
icon_state = "engineering_tool"
item_state = "engineering_tool"

storage_slots = 3
max_w_class = ITEM_SIZE_SMALL

can_hold = list(
"/obj/item/weapon/crowbar",
"/obj/item/weapon/screwdriver",
"/obj/item/weapon/weldingtool",
"/obj/item/weapon/wirecutters",
"/obj/item/weapon/wrench",
"/obj/item/device/multitool",
"/obj/item/device/flashlight",
"/obj/item/stack/cable_coil",
"/obj/item/device/t_scanner",
"/obj/item/device/analyzer",
"/obj/item/device/plant_analyzer",
"/obj/item/device/robotanalyzer",
"/obj/item/taperoll/engineering",
"/obj/item/device/radio/headset",
"/obj/item/weapon/minihoe",
"/obj/item/weapon/hatchet",
"/obj/item/weapon/extinguisher/mini",
"/obj/item/weapon/hand_labeler",
"/obj/item/clothing/gloves",
"/obj/item/clothing/glasses",
"/obj/item/weapon/lighter",
"/obj/item/weapon/storage/fancy/cigarettes",
)

/obj/item/weapon/storage/pouch/engineering_supply
name = "engineering supply pouch"
desc = "Can hold engineering equipment. But only about two pieces of it."
icon_state = "engineering_supply"
item_state = "engineering_supply"

storage_slots = 2
w_class = ITEM_SIZE_NORMAL
max_w_class = ITEM_SIZE_NORMAL

can_hold = list(
"/obj/item/weapon/circuitboard",
"/obj/item/stack/rods",
"/obj/item/stack/sheet",
"/obj/item/weapon/stock_parts",
"/obj/item/device/flashlight",
"/obj/item/weapon/reagent_containers/food/snacks/glowstick",
"/obj/item/stack/cable_coil",
"/obj/item/taperoll/engineering"
)

/obj/item/weapon/storage/pouch/ammo
name = "ammo pouch"
desc = "Can hold ammo boxes and bullets."
// desc = "Can hold ammo magazines and bullets, not the boxes though."
icon_state = "ammo"
item_state = "ammo"

storage_slots = 3
w_class = ITEM_SIZE_NORMAL
max_w_class = ITEM_SIZE_NORMAL

can_hold = list(
"/obj/item/ammo_box",
"/obj/item/ammo_casing"
)

/obj/item/weapon/storage/pouch/flare
name = "flares pouch"
desc = "Can hold about five flares in. In fact, anything cylindrical and small... Makes you think."
icon_state = "flare"
item_state = "flare"

storage_slots = 5
w_class = ITEM_SIZE_NORMAL
max_w_class = ITEM_SIZE_NORMAL

can_hold = list(
"/obj/item/device/flashlight/flare",
"/obj/item/weapon/reagent_containers/food/snacks/glowstick",
"/obj/item/weapon/reagent_containers/syringe",
"/obj/item/weapon/reagent_containers/glass/beaker/vial",
"/obj/item/weapon/reagent_containers/hypospray/autoinjector",
"/obj/item/weapon/pen",
"/obj/item/weapon/storage/pill_bottle"
)

/obj/item/weapon/storage/pouch/flare/update_icon()
..()
overlays.Cut()
if(contents.len)
overlays += image('icons/obj/pouches.dmi', "flare_[contents.len]")

/obj/item/weapon/storage/pouch/flare/vial
name = "vial pouch"
desc = "Can hold about five vials. Rebranding!"

/obj/item/weapon/storage/pouch/pistol_holster
name = "pistol holster"
desc = "Can hold a handgun in."
icon_state = "pistol_holster"
item_state = "pistol_holster"

storage_slots = 1
w_class = ITEM_SIZE_NORMAL
max_w_class = ITEM_SIZE_NORMAL

/*
can_hold = list(
/obj/item/weapon/gun/projectile/clarissa,
/obj/item/weapon/gun/projectile/colt,
/obj/item/weapon/gun/projectile/deagle,
/obj/item/weapon/gun/projectile/giskard,
/obj/item/weapon/gun/projectile/gyropistol,
/obj/item/weapon/gun/projectile/handmade_pistol,
/obj/item/weapon/gun/projectile/lamia,
/obj/item/weapon/gun/projectile/mk58,
/obj/item/weapon/gun/projectile/olivaw,
/obj/item/weapon/gun/projectile/silenced,
/obj/item/weapon/gun/energy/gun,
/obj/item/weapon/gun/energy/chameleon,
/obj/item/weapon/gun/energy/captain,
/obj/item/weapon/gun/energy/stunrevolver,
/obj/item/weapon/gun/projectile/revolver,
/obj/item/weapon/gun/projectile/automatic/IH_machinepistol,
/obj/item/weapon/gun/projectile/IH_sidearm,
/obj/item/weapon/gun/projectile/shotgun/doublebarrel/sawn, //short enough to fit in
/obj/item/weapon/gun/launcher/syringe
)
*/

sliding_behavior = TRUE

/obj/item/weapon/storage/pouch/pistol_holster/can_be_inserted(obj/item/W, stop_messages = FALSE)
. = ..()
if(. && istype(W, /obj/item/weapon/gun))
var/obj/item/weapon/gun/G = W
return G.isHandgun()

/obj/item/weapon/storage/pouch/pistol_holster/update_icon()
..()
overlays.Cut()
if(contents.len)
overlays += image('icons/obj/pouches.dmi', "pistol_layer")

/obj/item/weapon/storage/pouch/baton_holster
name = "baton sheath"
desc = "Can hold a baton, or indeed most weapon shafts."
icon_state = "baton_holster"
item_state = "baton_holster"

storage_slots = 1
max_w_class = ITEM_SIZE_LARGE

can_hold = list(
"/obj/item/weapon/melee",
"/obj/item/weapon/crowbar"
)

sliding_behavior = TRUE

/obj/item/weapon/storage/pouch/baton_holster/update_icon()
..()
overlays.Cut()
if(contents.len)
overlays += image('icons/obj/pouches.dmi', "baton_layer")
23 changes: 23 additions & 0 deletions code/game/objects/random/pouches.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/obj/random/pouch
name = "random pouch"
icon = 'icons/obj/pouches.dmi'
icon_state = "large_generic"

/obj/random/pouch/item_to_spawn()
return pickweight(list(
/obj/item/weapon/storage/pouch/small_generic = 10,
/obj/item/weapon/storage/pouch/medium_generic = 5,
/obj/item/weapon/storage/pouch/large_generic = 1,
/obj/item/weapon/storage/pouch/medical_supply = 3,
/obj/item/weapon/storage/pouch/engineering_supply = 3,
/obj/item/weapon/storage/pouch/engineering_tools = 5,
/obj/item/weapon/storage/pouch/flare = 7,
/obj/item/weapon/storage/pouch/ammo = 3,
/obj/item/weapon/storage/pouch/pistol_holster = 3,
/obj/item/weapon/storage/pouch/baton_holster = 3
))

/obj/random/pouch/low_chance
name = "low chance random pouch"
icon_state = "small_generic"
spawn_nothing_percentage = 80
3 changes: 2 additions & 1 deletion code/game/objects/random/random_misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@

prob(30);/obj/item/weapon/storage/box/ids,\
prob(20);/obj/item/weapon/storage/box/handcuffs,\
prob(10);/obj/item/weapon/storage/box/contraband\
prob(10);/obj/item/weapon/storage/box/contraband,\
prob(10);/obj/random/pouch
)

/obj/random/misc/smokes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
new /obj/item/device/lightreplacer(src)
new /obj/item/weapon/storage/bag/trash(src)
new /obj/item/clothing/shoes/galoshes(src)
new /obj/item/weapon/storage/pouch/small_generic(src) // Because I feel like poor janitor gets it bad.

/*
* Lawyer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
new /obj/item/device/multitool(src)
new /obj/item/device/flash(src)
new /obj/item/taperoll/engineering(src)
new /obj/item/weapon/storage/pouch/engineering_supply(src)

/obj/structure/closet/secure_closet/engineering_electrical
name = "Electrical Supplies"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
new /obj/item/weapon/reagent_containers/hypospray/cmo(src)
new /obj/item/clothing/suit/surgicalapron(src)
new /obj/item/airbag(src)
new /obj/item/weapon/storage/pouch/medical_supply(src)

/obj/structure/closet/secure_closet/animal
name = "Animal Control"
Expand All @@ -146,6 +147,7 @@
/obj/structure/closet/secure_closet/chemical/PopulateContents()
for (var/i in 1 to 2)
new /obj/item/weapon/storage/box/pillbottles(src)
new /obj/item/weapon/storage/pouch/flare/vial(src)

/obj/structure/closet/secure_closet/medical_wall
name = "First Aid Closet"
Expand Down
Loading

0 comments on commit eac1efc

Please sign in to comment.