Hat storage added! Currently only used for detective's candy corn.

Stripping now works for taking off suit storage as well as emptying hat storage.

Prison Management Computer now only requires armory access, not armory and captain access.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@609 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
crazyclonetheninja
2010-12-14 17:30:13 +00:00
parent d5f6b74ff6
commit 07fb210d29
10 changed files with 109 additions and 2 deletions

View File

@@ -1365,6 +1365,15 @@
..() ..()
reagents.add_reagent("nutriment", 3) reagents.add_reagent("nutriment", 3)
/obj/item/weapon/reagent_containers/food/snacks/candy_corn
name = "candy corn"
desc = "It's a handful of candy corn. Can be stored in a detective's hat."
icon_state = "candy_corn"
New()
..()
reagents.add_reagent("nutriment", 10)
bitesize = 2
/obj/item/weapon/reagent_containers/food/snacks/chips /obj/item/weapon/reagent_containers/food/snacks/chips
name = "chips" name = "chips"
desc = "Commander Riker's What-The-Crisps" desc = "Commander Riker's What-The-Crisps"

View File

@@ -34,6 +34,7 @@
var/obj/item/weapon/r_store = null var/obj/item/weapon/r_store = null
var/obj/item/weapon/l_store = null var/obj/item/weapon/l_store = null
var/obj/item/weapon/s_store = null var/obj/item/weapon/s_store = null
var/obj/item/weapon/h_store = null
var/icon/stand_icon = null var/icon/stand_icon = null
var/icon/lying_icon = null var/icon/lying_icon = null

View File

@@ -156,6 +156,7 @@
name = "head" name = "head"
icon = 'hats.dmi' icon = 'hats.dmi'
body_parts_covered = HEAD body_parts_covered = HEAD
var/list/allowed = list()
/obj/item/clothing/head/bio_hood /obj/item/clothing/head/bio_hood
name = "bio hood" name = "bio hood"
@@ -188,6 +189,7 @@
name = "hat" name = "hat"
desc = "Someone who wears this will look very smart" desc = "Someone who wears this will look very smart"
icon_state = "detective" icon_state = "detective"
allowed = list(/obj/item/weapon/reagent_containers/food/snacks/candy_corn)
/obj/item/clothing/head/powdered_wig /obj/item/clothing/head/powdered_wig
name = "powdered wig" name = "powdered wig"
@@ -601,7 +603,7 @@
item_state = "armor" item_state = "armor"
body_parts_covered = UPPER_TORSO|LOWER_TORSO body_parts_covered = UPPER_TORSO|LOWER_TORSO
flags = FPRINT | TABLEPASS | ONESIZEFITSALL flags = FPRINT | TABLEPASS | ONESIZEFITSALL
// allowed = null allowed = null
/obj/item/clothing/suit/armor/hos /obj/item/clothing/suit/armor/hos
name = "armored coat" name = "armored coat"

View File

@@ -77,6 +77,7 @@ proc/countJob(rank)
slot_r_store = 16 slot_r_store = 16
slot_s_store = 17 slot_s_store = 17
slot_in_backpack = 18 slot_in_backpack = 18
slot_h_store = 19
/mob/living/carbon/human/proc/equip_if_possible(obj/item/weapon/W, slot) // since byond doesn't seem to have pointers, this seems like the best way to do this :/ /mob/living/carbon/human/proc/equip_if_possible(obj/item/weapon/W, slot) // since byond doesn't seem to have pointers, this seems like the best way to do this :/
//warning: icky code //warning: icky code
@@ -87,6 +88,9 @@ proc/countJob(rank)
if(slot == s_store && !src.wear_suit) if(slot == s_store && !src.wear_suit)
del(W) del(W)
return return
if(slot == h_store && !src.head)
del(W)
return
switch(slot) switch(slot)
if(slot_back) if(slot_back)
if(!src.back) if(!src.back)
@@ -162,6 +166,10 @@ proc/countJob(rank)
if(B.contents.len < 7 && W.w_class <= 3) if(B.contents.len < 7 && W.w_class <= 3)
W.loc = B W.loc = B
equipped = 1 equipped = 1
if(slot_h_store)
if(!src.h_store)
src.h_store = W
equipped = 1
if(equipped) if(equipped)
W.layer = 20 W.layer = 20

View File

@@ -11,6 +11,7 @@
#define ui_storage1 "SOUTH-1,4" #define ui_storage1 "SOUTH-1,4"
#define ui_storage2 "SOUTH-1,5" #define ui_storage2 "SOUTH-1,5"
#define ui_sstore1 "SOUTH+1,4" #define ui_sstore1 "SOUTH+1,4"
#define ui_hstore1 "SOUTH+1,5"
#define ui_resist "EAST+1,SOUTH-1" #define ui_resist "EAST+1,SOUTH-1"
#define ui_gloves "SOUTH,5" #define ui_gloves "SOUTH,5"
#define ui_glasses "SOUTH,7" #define ui_glasses "SOUTH,7"
@@ -58,6 +59,7 @@ obj/hud/New(var/type = 0)
if(mymob:ears) mymob:ears:screen_loc = ui_ears if(mymob:ears) mymob:ears:screen_loc = ui_ears
if(mymob:s_store) mymob:s_store:screen_loc = ui_sstore1 if(mymob:s_store) mymob:s_store:screen_loc = ui_sstore1
if(mymob:glasses) mymob:glasses:screen_loc = ui_glasses if(mymob:glasses) mymob:glasses:screen_loc = ui_glasses
if(mymob:h_store) mymob:h_store:screen_loc = ui_hstore1
else else
if(istype(mymob, /mob/living/carbon/human)) if(istype(mymob, /mob/living/carbon/human))
if(mymob:shoes) mymob:shoes:screen_loc = null if(mymob:shoes) mymob:shoes:screen_loc = null
@@ -65,6 +67,7 @@ obj/hud/New(var/type = 0)
if(mymob:ears) mymob:ears:screen_loc = null if(mymob:ears) mymob:ears:screen_loc = null
if(mymob:s_store) mymob:s_store:screen_loc = null if(mymob:s_store) mymob:s_store:screen_loc = null
if(mymob:glasses) mymob:glasses:screen_loc = null if(mymob:glasses) mymob:glasses:screen_loc = null
if(mymob:h_store) mymob:h_store:screen_loc = null
/obj/hud/var/show_otherinventory = 1 /obj/hud/var/show_otherinventory = 1

View File

@@ -349,6 +349,7 @@
src.equip_if_possible(new /obj/item/clothing/suit/det_suit(src), slot_wear_suit) src.equip_if_possible(new /obj/item/clothing/suit/det_suit(src), slot_wear_suit)
src.equip_if_possible(new /obj/item/device/detective_scanner(src), slot_in_backpack) src.equip_if_possible(new /obj/item/device/detective_scanner(src), slot_in_backpack)
src.equip_if_possible(new /obj/item/weapon/zippo(src), slot_l_store) src.equip_if_possible(new /obj/item/weapon/zippo(src), slot_l_store)
src.equip_if_possible(new /obj/item/weapon/reagent_containers/food/snacks/candy_corn(src), slot_h_store)
if ("Medical Doctor") if ("Medical Doctor")
src.equip_if_possible(new /obj/item/device/radio/headset/headset_med (src), slot_ears) // -- TLE src.equip_if_possible(new /obj/item/device/radio/headset/headset_med (src), slot_ears) // -- TLE

View File

@@ -2,7 +2,7 @@
name = "Prisoner Management" name = "Prisoner Management"
icon = 'computer.dmi' icon = 'computer.dmi'
icon_state = "explosive" icon_state = "explosive"
req_access = list(access_captain, access_armory) req_access = list(access_armory)
var/id = 0.0 var/id = 0.0
var/temp = null var/temp = null

View File

@@ -214,6 +214,14 @@
using.layer = 19 using.layer = 19
src.other += using src.other += using
using = new src.h_type( src )
using.name = "hat storage"
using.icon = ui_style
using.icon_state = "hair"
using.screen_loc = ui_hstore1
using.layer = 19
src.other += using
using = new src.h_type( src ) using = new src.h_type( src )
using.name = "resist" using.name = "resist"
using.icon = ui_style using.icon = ui_style

View File

@@ -628,6 +628,15 @@
else if (W == src.glasses) else if (W == src.glasses)
src.glasses = null src.glasses = null
else if (W == src.head) else if (W == src.head)
W = src.h_store
if (W)
u_equip(W)
if (src.client)
src.client.screen -= W
if (W)
W.loc = src.loc
W.dropped(src)
W.layer = initial(W.layer)
src.head = null src.head = null
else if (W == src.ears) else if (W == src.ears)
src.ears = null src.ears = null
@@ -649,6 +658,8 @@
src.l_store = null src.l_store = null
else if (W == src.s_store) else if (W == src.s_store)
src.s_store = null src.s_store = null
else if (W == src.h_store)
src.h_store = null
else if (W == src.back) else if (W == src.back)
src.back = null src.back = null
else if (W == src.handcuffed) else if (W == src.handcuffed)
@@ -658,6 +669,7 @@
else if (W == src.l_hand) else if (W == src.l_hand)
src.l_hand = null src.l_hand = null
update_clothing() update_clothing()
/mob/living/carbon/human/db_click(text, t1) /mob/living/carbon/human/db_click(text, t1)
@@ -838,6 +850,23 @@
src.u_equip(W) src.u_equip(W)
src.s_store = W src.s_store = W
if("hat storage")
if (src.h_store)
if (emptyHand)
src.h_store.DblClick()
return
var/confirm
if (src.head)
for(var/i=1, i<=src.head.allowed.len, i++)
// world << "[src.head.allowed[i]] and [W.type]"
if (findtext("[W.type]","[src.head.allowed[i]]"))
confirm = 1
break
if (!confirm) return
else
src.u_equip(W)
src.h_store = W
update_clothing() update_clothing()
return return
@@ -1218,6 +1247,9 @@
if (src.r_store) if (src.r_store)
src.r_store.screen_loc = ui_storage2 src.r_store.screen_loc = ui_storage2
if (src.h_store)
src.h_store.screen_loc = ui_hstore1
if (src.back) if (src.back)
var/t1 = src.back.icon_state var/t1 = src.back.icon_state
src.overlays += image("icon" = 'back.dmi', "icon_state" = text("[][]", t1, (!( src.lying ) ? null : "2")), "layer" = MOB_LAYER) src.overlays += image("icon" = 'back.dmi', "icon_state" = text("[][]", t1, (!( src.lying ) ? null : "2")), "layer" = MOB_LAYER)
@@ -1922,6 +1954,10 @@
message = text("\red <B>[] is trying to unhandcuff []!</B>", src.source, src.target) message = text("\red <B>[] is trying to unhandcuff []!</B>", src.source, src.target)
if("uniform") if("uniform")
message = text("\red <B>[] is trying to take off \a [] from []'s body!</B>", src.source, src.target.w_uniform, src.target) message = text("\red <B>[] is trying to take off \a [] from []'s body!</B>", src.source, src.target.w_uniform, src.target)
if("s_store")
message = text("\red <B>[] is trying to take off \a [] from []'s suit!</B>", src.source, src.target.s_store, src.target)
if("h_store")
message = text("\red <B>[] is trying to empty []'s hat!</B>", src.source, src.target)
if("pockets") if("pockets")
for(var/obj/item/weapon/mousetrap/MT in list(src.target.l_store, src.target.r_store)) for(var/obj/item/weapon/mousetrap/MT in list(src.target.l_store, src.target.r_store))
if(MT.armed) if(MT.armed)
@@ -2056,6 +2092,32 @@
src.item.layer = 20 src.item.layer = 20
src.target.belt = src.item src.target.belt = src.item
src.item.loc = src.target src.item.loc = src.target
if("s_store")
if (src.target.s_store)
var/obj/item/W = src.target.s_store
src.target.u_equip(W)
if (src.target.client)
src.target.client.screen -= W
if (W)
W.loc = src.target.loc
W.dropped(src.target)
W.layer = initial(W.layer)
W.add_fingerprint(src.source)
else
if (istype(src.item, /obj) && src.target.wear_suit)
var/confirm
for(var/i=1, i<=src.target.wear_suit.allowed.len, i++)
// world << "[src.target.wear_suit.allowed[i]] and [W.type]"
if (findtext("[src.item.type]","[src.target.wear_suit.allowed[i]]") || istype(src.item, /obj/item/device/pda) || istype(src.item, /obj/item/weapon/pen))
confirm = 1
break
if (!confirm) return
else
src.source.drop_item()
src.loc = src.target
src.item.layer = 20
src.target.s_store = src.item
src.item.loc = src.target
if("head") if("head")
if (src.target.head) if (src.target.head)
var/obj/item/W = src.target.head var/obj/item/W = src.target.head
@@ -2262,6 +2324,17 @@
src.item.layer = 20 src.item.layer = 20
src.target.back = src.item src.target.back = src.item
src.item.loc = src.target src.item.loc = src.target
if("h_store")
if (src.target.h_store)
var/obj/item/W = src.target.h_store
src.target.u_equip(W)
if (src.target.client)
src.target.client.screen -= W
if (W)
W.loc = src.target.loc
W.dropped(src.target)
W.layer = initial(W.layer)
W.add_fingerprint(src.source)
if("handcuff") if("handcuff")
if (src.target.handcuffed) if (src.target.handcuffed)
var/obj/item/W = src.target.handcuffed var/obj/item/W = src.target.handcuffed
@@ -2465,9 +2538,11 @@
<BR><B>(Exo)Suit:</B> <A href='?src=\ref[src];item=suit'>[(src.wear_suit ? src.wear_suit : "Nothing")]</A> <BR><B>(Exo)Suit:</B> <A href='?src=\ref[src];item=suit'>[(src.wear_suit ? src.wear_suit : "Nothing")]</A>
<BR><B>Back:</B> <A href='?src=\ref[src];item=back'>[(src.back ? src.back : "Nothing")]</A> [((istype(src.wear_mask, /obj/item/clothing/mask) && istype(src.back, /obj/item/weapon/tank) && !( src.internal )) ? text(" <A href='?src=\ref[];item=internal'>Set Internal</A>", src) : "")] <BR><B>Back:</B> <A href='?src=\ref[src];item=back'>[(src.back ? src.back : "Nothing")]</A> [((istype(src.wear_mask, /obj/item/clothing/mask) && istype(src.back, /obj/item/weapon/tank) && !( src.internal )) ? text(" <A href='?src=\ref[];item=internal'>Set Internal</A>", src) : "")]
<BR><B>ID:</B> <A href='?src=\ref[src];item=id'>[(src.wear_id ? src.wear_id : "Nothing")]</A> <BR><B>ID:</B> <A href='?src=\ref[src];item=id'>[(src.wear_id ? src.wear_id : "Nothing")]</A>
<BR><B>Suit Storage:</B> <A href='?src=\ref[src];item=s_store'>[(src.s_store ? src.s_store : "Nothing")]</A>
<BR>[(src.handcuffed ? text("<A href='?src=\ref[src];item=handcuff'>Handcuffed</A>") : text("<A href='?src=\ref[src];item=handcuff'>Not Handcuffed</A>"))] <BR>[(src.handcuffed ? text("<A href='?src=\ref[src];item=handcuff'>Handcuffed</A>") : text("<A href='?src=\ref[src];item=handcuff'>Not Handcuffed</A>"))]
<BR>[(src.internal ? text("<A href='?src=\ref[src];item=internal'>Remove Internal</A>") : "")] <BR>[(src.internal ? text("<A href='?src=\ref[src];item=internal'>Remove Internal</A>") : "")]
<BR><A href='?src=\ref[src];item=pockets'>Empty Pockets</A> <BR><A href='?src=\ref[src];item=pockets'>Empty Pockets</A>
<BR><A href='?src=\ref[src];item=h_store'>Empty Hat</A>
<BR><A href='?src=\ref[user];mach_close=mob[src.name]'>Close</A> <BR><A href='?src=\ref[user];mach_close=mob[src.name]'>Close</A>
<BR>"} <BR>"}
user << browse(dat, text("window=mob[src.name];size=340x480")) user << browse(dat, text("window=mob[src.name];size=340x480"))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB