mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-15 03:52:43 +00:00
- Moved update_icon() calls from storage/fancy to all storage items, whenever an item is added or removed from the storage item. Also renamed updateIcon() to update_icon(), since that's the obj-wide proc. - Part of fixing issue u - Removed crayon and crayonbox snowflake code - Removed bible snowflake code - Made the click-drag to move to l_hand or r_hand thing something that works on all storage items. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4484 316c924e-a436-60f5-8080-3fe189b3f50e
97 lines
2.3 KiB
Plaintext
97 lines
2.3 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
|
|
*
|
|
* Contains:
|
|
* Donut Box
|
|
* Egg Box
|
|
* Candle 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
|