ports pockets (from Animus Green) and adds them to some clothing.

This PR ports pockets (from Animus Green) and adds them to some clothing.

 Shoes that support storing items now use pockets system.
 Some hats have 1 small pocket.
 Detective's hat spawns with a flask in it.
 Clown's mask has a single tiny top-secret pocket. Honk!

This PR also includes two or three path fixes. It also fixes internal storages (pockets, storage implant) having less "max depth" than external ones.
This commit is contained in:
Core0verload
2016-07-14 19:36:26 +12:00
committed by oranges
parent 90340ca794
commit e666d2e76b
20 changed files with 178 additions and 72 deletions
@@ -1,39 +1,79 @@
/obj/item/weapon/storage/internal
storage_slots = 2
max_w_class = 2
max_combined_w_class = 4
max_combined_w_class = 50 // Limited by slots, not combined weight class
w_class = 4
var/priority = 1
/*obj/item/weapon/storage/internal/pocket/New()
/obj/item/weapon/storage/internal/ClickAccessible(mob/user, depth=1)
if(loc)
return loc.ClickAccessible(user, depth)
/obj/item/weapon/storage/internal/Adjacent(A)
if(loc)
return loc.Adjacent(A)
/obj/item/weapon/storage/internal/pocket
var/priority = TRUE
// TRUE if opens when clicked, like a backpack.
// FALSE if opens only when dragged on mob's icon (hidden pocket)
var/quickdraw = FALSE
// TRUE if you can quickdraw items from it with alt-click.
/obj/item/weapon/storage/internal/pocket/New()
..()
if(loc) name = loc.name
if(loc)
name = loc.name
/obj/item/weapon/storage/internal/pocket/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
. = ..()
if(. && silent && !prevent_warning)
if(quickdraw)
user << "<span class='notice'>You discreetly slip [W] into [src]. Alt-click [src] to remove it.</span>"
else
user << "<span class='notice'>You discreetly slip [W] into [src]."
/obj/item/weapon/storage/internal/pocket/big
max_w_class = 3
max_combined_w_class = 6
/obj/item/weapon/storage/internal/pocket/small
storage_slots = 1
max_combined_w_class = 2
priority = 0
priority = FALSE
/obj/item/weapon/storage/internal/pocket/tiny
storage_slots = 1
max_w_class = 1
max_combined_w_class = 1
priority = 0
priority = FALSE
/obj/item/weapon/storage/internal/pocket/shoes
can_hold = list(
/obj/item/weapon/kitchen/knife, /obj/item/weapon/switchblade, /obj/item/weapon/pen,
/obj/item/weapon/scalpel, /obj/item/weapon/reagent_containers/syringe, /obj/item/weapon/dnainjector,
/obj/item/weapon/reagent_containers/hypospray/medipen, /obj/item/weapon/reagent_containers/dropper,
/obj/item/weapon/implanter, /obj/item/weapon/screwdriver, /obj/item/weapon/weldingtool/mini,
/obj/item/device/firing_pin
)
//can hold both regular pens and energy daggers. made for your every-day tactical librarians/murderers.
priority = FALSE
quickdraw = TRUE
silent = TRUE
/obj/item/weapon/storage/internal/pocket/shoes/clown
can_hold = list(
/obj/item/weapon/kitchen/knife, /obj/item/weapon/switchblade, /obj/item/weapon/pen,
/obj/item/weapon/scalpel, /obj/item/weapon/reagent_containers/syringe, /obj/item/weapon/dnainjector,
/obj/item/weapon/reagent_containers/hypospray/medipen, /obj/item/weapon/reagent_containers/dropper,
/obj/item/weapon/implanter, /obj/item/weapon/screwdriver, /obj/item/weapon/weldingtool/mini,
/obj/item/device/firing_pin, /obj/item/weapon/bikehorn)
/obj/item/weapon/storage/internal/pocket/small/detective
priority = 1
priority = TRUE // so the detectives would discover pockets in their hats
/obj/item/weapon/storage/internal/pocket/small/detective/New()
..()
new /obj/item/weapon/reagent_containers/food/drinks/flask/det(src)
proc/isstorage(var/atom/A)
/*
/proc/isstorage(var/atom/A)
if(istype(A, /obj/item/weapon/storage))
return 1
@@ -36,8 +36,9 @@
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return
if(over_object == M && Adjacent(M)) // this must come before the screen objects only block
orient2hud(M) // dunno why it wasn't before
// this must come before the screen objects only block, dunno why it wasn't before
if(over_object == M && (src.ClickAccessible(M, depth=STORAGE_VIEW_DEPTH) || Adjacent(M)))
orient2hud(M)
if(M.s_active)
M.s_active.close(M)
show_to(M)
@@ -205,7 +206,7 @@
number = 1
//This proc determins the size of the inventory to be displayed. Please touch it only if you know what you're doing.
//This proc determines the size of the inventory to be displayed. Please touch it only if you know what you're doing.
/obj/item/weapon/storage/proc/orient2hud(mob/user)
var/adjusted_contents = contents.len