Files
Paradise/code/game/objects/items/weapons/storage/fancy.dm
petethegoat@gmail.com 11b17c4442 Committing suomynonAyletamitlU's storage item standardisation commit: http://forums.nanotrasen.com/viewtopic.php?f=16&t=11746
Standardization of the object tree and some modified functionality.
Moved a lot of storage/*_kit and similar boxes to storage/box/* ; most of these can now be found in boxes.dm. First aid kits remain a separate item type.
Replacement Light boxes pick up lights (for example broken ones) when used on them
Moved weapon/secstorage to storage/secure
Moved plant bags, ore satchel, trash bag, and sheet snatcher to storage/bag, in bags.dm
Fixed reagent_containers and snacks to pass through attackby() so the use_to_pickup code works. This affects plant bags, trash bags, and pill bottles.
Dice packs are now pill bottles, and all pill bottles can pick up dice.
Added error handling to uplink/generate_menu() so that one mistyped string doesn't bork the whole syndie uplink menu, since strings cannot be type-checked at compile time.
Cigarette packs and crayon boxes are now storage/fancy, however they retain existing update_icon() code.
Added a comment to storage.dm so that future people know where to look for use_to_pickup and allow_quick_gather code.

Updated all maps.

I've tried to test this thoroughly but I wouldn't be surprised if there were a few lingering issues. Try not to panic if you encounter any.

Full (i think) list of changed paths:
/obj/item/weapon/storage/flashbang_kit	> /obj/item/weapon/storage/box/flashbangs
/obj/item/weapon/storage/body_bag_box	> /obj/item/weapon/storage/box/bodybags
/obj/item/weapon/storage/chemimp_kit	> /obj/item/weapon/storage/box/chemimp
/obj/item/weapon/storage/trackimp_kit	> /obj/item/weapon/storage/box/trackimp
/obj/item/weapon/storage/seccart_kit	> /obj/item/weapon/storage/box/seccarts
/obj/item/weapon/storage/handcuff_kit	> /obj/item/weapon/storage/box/handcuffs
/obj/item/weapon/cigpacket		> /obj/item/weapon/storage/fancy/cigarettes
/obj/item/weapon/storage/mousetraps	> /obj/item/weapon/storage/box/mousetraps
/obj/item/weapon/storage/PDAbox		> /obj/item/weapon/storage/box/PDAs
/obj/item/weapon/storage/id_kit		> /obj/item/weapon/storage/box/ids
/obj/item/weapon/storage/lightbox/mixed	> /obj/item/weapon/storage/box/lights/mixed
/obj/item/weapon/storage/donkpocket_kit	> /obj/item/weapon/storage/box/donkpockets
/obj/item/weapon/storage/beakerbox	> /obj/item/weapon/storage/box/beakers
/obj/item/weapon/storage/syringes	> /obj/item/weapon/storage/box/syringes
/obj/item/weapon/storage/gl_kit		> /obj/item/weapon/storage/box/rxglasses
/obj/item/weapon/storage/diskbox	> /obj/item/weapon/storage/box/disks
/obj/item/weapon/storage/stma_kit	> /obj/item/weapon/storage/box/masks
/obj/item/weapon/storage/lglo_kit	> /obj/item/weapon/storage/box/gloves
/obj/item/weapon/storage/lightbox/bulbs	> /obj/item/weapon/storage/box/lights/bulbs
/obj/item/weapon/plantbag		> /obj/item/weapon/storage/bag/plants
/obj/item/weapon/storage/satchel	> /obj/item/weapon/storage/bag/ore
/obj/item/weapon/trashbag		> /obj/item/weapon/storage/bag/trash

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5494 316c924e-a436-60f5-8080-3fe189b3f50e
2013-01-08 19:11:56 +00:00

204 lines
5.8 KiB
Plaintext

/*
* The 'fancy' path is for objects like donut boxes that show how many items are in the storage item on the sprite itself
* .. Sorry for the shitty path name, I couldnt think of a better one.
*
* WARNING: var/icon_type is used for both examine text and sprite name. Please look at the procs below and adjust your sprite names accordingly
* TODO: Cigarette boxes should be ported to this standard
*
* Contains:
* Donut Box
* Egg Box
* Candle Box
* Crayon Box
* Cigarette Box
*/
/obj/item/weapon/storage/fancy/
icon = 'icons/obj/food.dmi'
icon_state = "donutbox6"
name = "donut box"
var/icon_type = "donut"
/obj/item/weapon/storage/fancy/update_icon(var/itemremoved = 0)
var/total_contents = src.contents.len - itemremoved
src.icon_state = "[src.icon_type]box[total_contents]"
return
/obj/item/weapon/storage/fancy/examine()
set src in oview(1)
if(contents.len <= 0)
usr << "There are no [src.icon_type]s left in the box."
else if(contents.len == 1)
usr << "There is one [src.icon_type] left in the box."
else
usr << "There are [src.contents.len] [src.icon_type]s in the box."
return
/*
* Donut Box
*/
/obj/item/weapon/storage/fancy/donut_box
icon = 'icons/obj/food.dmi'
icon_state = "donutbox6"
icon_type = "donut"
name = "donut box"
storage_slots = 6
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/donut")
/obj/item/weapon/storage/fancy/donut_box/New()
..()
for(var/i=1; i <= storage_slots; i++)
new /obj/item/weapon/reagent_containers/food/snacks/donut/normal(src)
return
/*
* Egg Box
*/
/obj/item/weapon/storage/fancy/egg_box
icon = 'icons/obj/food.dmi'
icon_state = "eggbox"
icon_type = "egg"
name = "egg box"
storage_slots = 12
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/egg")
/obj/item/weapon/storage/fancy/egg_box/New()
..()
for(var/i=1; i <= storage_slots; i++)
new /obj/item/weapon/reagent_containers/food/snacks/egg(src)
return
/*
* Candle Box
*/
/obj/item/weapon/storage/fancy/candle_box
name = "Candle pack"
desc = "A pack of red candles."
icon = 'icons/obj/candle.dmi'
icon_state = "candlebox5"
icon_type = "candle"
item_state = "candlebox5"
storage_slots = 5
throwforce = 2
flags = TABLEPASS
slot_flags = SLOT_BELT
/obj/item/weapon/storage/fancy/candle_box/New()
..()
for(var/i=1; i <= storage_slots; i++)
new /obj/item/candle(src)
return
/*
* Crayon Box
*/
/obj/item/weapon/storage/fancy/crayons
name = "box of crayons"
desc = "A box of crayons for all your rune drawing needs."
icon = 'icons/obj/crayons.dmi'
icon_state = "crayonbox"
w_class = 2.0
storage_slots = 6
icon_type = "crayon"
can_hold = list(
"/obj/item/toy/crayon"
)
/obj/item/weapon/storage/fancy/crayons/New()
..()
new /obj/item/toy/crayon/red(src)
new /obj/item/toy/crayon/orange(src)
new /obj/item/toy/crayon/yellow(src)
new /obj/item/toy/crayon/green(src)
new /obj/item/toy/crayon/blue(src)
new /obj/item/toy/crayon/purple(src)
update_icon()
/obj/item/weapon/storage/fancy/crayons/update_icon()
overlays = list() //resets list
overlays += image('icons/obj/crayons.dmi',"crayonbox")
for(var/obj/item/toy/crayon/crayon in contents)
overlays += image('icons/obj/crayons.dmi',crayon.colourName)
/obj/item/weapon/storage/fancy/crayons/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/toy/crayon))
switch(W:colourName)
if("mime")
usr << "This crayon is too sad to be contained in this box."
return
if("rainbow")
usr << "This crayon is too powerful to be contained in this box."
return
..()
////////////
//CIG PACK//
////////////
/obj/item/weapon/storage/fancy/cigarettes
name = "cigarette packet"
desc = "The most popular brand of Space Cigarettes, sponsors of the Space Olympics."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cigpacket"
item_state = "cigpacket"
w_class = 1
throwforce = 2
flags = TABLEPASS
slot_flags = SLOT_BELT
storage_slots = 6
can_hold = list("/obj/item/clothing/mask/cigarette")
icon_type = "cigarette"
/obj/item/weapon/storage/fancy/cigarettes/New()
..()
flags |= NOREACT
for(var/i = 1 to storage_slots)
new /obj/item/clothing/mask/cigarette(src)
create_reagents(15 * storage_slots)//so people can inject cigarettes without opening a packet, now with being able to inject the whole one
/obj/item/weapon/storage/fancy/cigarettes/Del()
del(reagents)
..()
/obj/item/weapon/storage/fancy/cigarettes/update_icon()
icon_state = "[initial(icon_state)][contents.len]"
desc = "There are [contents.len] cig\s left!"
return
/obj/item/weapon/storage/fancy/cigarettes/remove_from_storage(obj/item/W as obj, atom/new_location)
var/obj/item/clothing/mask/cigarette/C = W
if(!istype(C)) return // what
reagents.trans_to(C, (reagents.total_volume/contents.len))
..()
/obj/item/weapon/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!istype(M, /mob))
return
if(M == user && user.zone_sel.selecting == "mouth" && contents.len > 0 && !user.wear_mask)
var/obj/item/clothing/mask/cigarette/W = new /obj/item/clothing/mask/cigarette(user)
reagents.trans_to(W, (reagents.total_volume/contents.len))
user.equip_to_slot_if_possible(W, slot_wear_mask)
reagents.maximum_volume = 15 * contents.len
contents.len--
user << "<span class='notice'>You take a cigarette out of the pack.</span>"
update_icon()
else
..()
/obj/item/weapon/storage/fancy/cigarettes/dromedaryco
name = "\improper DromedaryCo packet"
desc = "A packet of six imported DromedaryCo cancer sticks. A label on the packaging reads, \"Wouldn't a slow death make a change?\""
icon_state = "Dpacket"
item_state = "Dpacket"