/* * 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/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(mob/user) if(!..(user, 1)) return if(contents.len <= 0) to_chat(user, "There are no [src.icon_type]s left in the box.") else if(contents.len == 1) to_chat(user, "There is one [src.icon_type] left in the box.") else to_chat(user, "There are [src.contents.len] [src.icon_type]s in the box.") /* * Donut Box */ /obj/item/weapon/storage/fancy/donut_box icon = 'icons/obj/food/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/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 slot_flags = SLOT_BELT /obj/item/weapon/storage/fancy/candle_box/full/New() ..() for(var/i=1; i <= storage_slots; i++) new /obj/item/candle(src) return /obj/item/weapon/storage/fancy/candle_box/eternal name = "Eternal Candle pack" desc = "A pack of red candles made with a special wax." /obj/item/weapon/storage/fancy/candle_box/eternal/New() ..() for(var/i=1; i <= storage_slots; i++) new /obj/item/candle/eternal(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, params) if(istype(W,/obj/item/toy/crayon)) switch(W:colourName) if("mime") to_chat(usr, "This crayon is too sad to be contained in this box.") return if("rainbow") to_chat(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 = 2 throwforce = 2 slot_flags = SLOT_BELT storage_slots = 6 max_combined_w_class = 6 can_hold = list("/obj/item/clothing/mask/cigarette", "/obj/item/weapon/lighter", "/obj/item/weapon/match") cant_hold = list("/obj/item/clothing/mask/cigarette/cigar", "/obj/item/clothing/mask/cigarette/pipe", "/obj/item/weapon/lighter/zippo") icon_type = "cigarette" var/list/unlaced_cigarettes = list() // Cigarettes that haven't received reagents yet var/default_reagents = list("nicotine" = 15) // List of reagents to pre-generate for each cigarette var/cigarette_type = /obj/item/clothing/mask/cigarette /obj/item/weapon/storage/fancy/cigarettes/New() ..() flags |= NOREACT create_reagents(30 * storage_slots)//so people can inject cigarettes without opening a packet, now with being able to inject the whole one for(var/i = 1 to storage_slots) var/obj/item/clothing/mask/cigarette/C = new cigarette_type(src) unlaced_cigarettes += C for(var/R in default_reagents) reagents.add_reagent(R, default_reagents[R]) /obj/item/weapon/storage/fancy/cigarettes/Destroy() qdel(reagents) return ..() /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/proc/lace_cigarette(var/obj/item/clothing/mask/cigarette/C as obj) if(istype(C) && (C in unlaced_cigarettes)) // Only transfer reagents to each cigarette once reagents.trans_to(C, (reagents.total_volume/unlaced_cigarettes.len)) unlaced_cigarettes -= C reagents.maximum_volume = 30 * unlaced_cigarettes.len /obj/item/weapon/storage/fancy/cigarettes/remove_from_storage(obj/item/W as obj, atom/new_location) lace_cigarette(W) ..() /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(istype(M) && M == user && user.zone_sel.selecting == "mouth" && contents.len > 0 && !user.wear_mask) var/got_cig = 0 for(var/num=1, num <= contents.len, num++) var/obj/item/I = contents[num] if(istype(I, /obj/item/clothing/mask/cigarette)) var/obj/item/clothing/mask/cigarette/C = I lace_cigarette(C) user.equip_to_slot_if_possible(C, slot_wear_mask) to_chat(user, "You take \a [C.name] out of the pack.") update_icon() got_cig = 1 break if(!got_cig) to_chat(user, "There are no smokables in the pack!") else ..() /obj/item/weapon/storage/fancy/cigarettes/can_be_inserted(obj/item/W as obj, stop_messages = 0) if(istype(W, /obj/item/weapon/match)) var/obj/item/weapon/match/M = W if(M.lit == 1) if(!stop_messages) to_chat(usr, "Putting a lit [W] in [src] probably isn't a good idea.") return 0 if(istype(W, /obj/item/weapon/lighter)) var/obj/item/weapon/lighter/L = W if(L.lit == 1) if(!stop_messages) to_chat(usr, "Putting [W] in [src] while lit probably isn't a good idea.") return 0 //if we get this far, handle the insertion checks as normal .=..() /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 = "cigpacket" /obj/item/weapon/storage/fancy/cigarettes/syndicate name = "\improper Syndicate Cigarettes" desc = "A packet of six evil-looking cigarettes, A label on the packaging reads, \"Donk Co\"" icon_state = "robustpacket" item_state = "cigpacket" /obj/item/weapon/storage/fancy/cigarettes/syndicate/New() ..() var/new_name = pick("evil", "suspicious", "ominous", "donk-flavored", "robust", "sneaky") name = "[new_name] cigarette packet" /obj/item/weapon/storage/fancy/cigarettes/cigpack_syndicate name = "cigarette packet" desc = "An obscure brand of cigarettes." icon_state = "syndiepacket" item_state = "cigpacket" default_reagents = list("nicotine" = 15, "omnizine" = 15) /obj/item/weapon/storage/fancy/cigarettes/cigpack_uplift name = "\improper Uplift Smooth packet" desc = "Your favorite brand, now menthol flavored." icon_state = "upliftpacket" item_state = "cigpacket" /obj/item/weapon/storage/fancy/cigarettes/cigpack_robust name = "\improper Robust packet" desc = "Smoked by the robust." icon_state = "robustpacket" item_state = "cigpacket" /obj/item/weapon/storage/fancy/cigarettes/cigpack_robustgold name = "\improper Robust Gold packet" desc = "Smoked by the truly robust." icon_state = "robustgpacket" item_state = "cigpacket" default_reagents = list("nicotine" = 15, "gold" = 1) /obj/item/weapon/storage/fancy/cigarettes/cigpack_carp name = "\improper Carp Classic packet" desc = "Since 2313." icon_state = "carppacket" item_state = "cigpacket" /obj/item/weapon/storage/fancy/cigarettes/cigpack_midori name = "\improper Midori Tabako packet" desc = "You can't understand the runes, but the packet smells funny." icon_state = "midoripacket" item_state = "cigpacket" /obj/item/weapon/storage/fancy/cigarettes/cigpack_shadyjims name ="\improper Shady Jim's Super Slims" desc = "Is your weight slowing you down? Having trouble running away from gravitational singularities? Can't stop stuffing your mouth? Smoke Shady Jim's Super Slims and watch all that fat burn away. Guaranteed results!" icon_state = "shadyjimpacket" item_state = "cigpacket" default_reagents = list("nicotine" = 15, "lipolicide" = 7.5, "ammonia" = 2, "atrazine" = 1, "toxin" = 1.5) /obj/item/weapon/storage/fancy/cigarettes/cigpack_random name ="\improper Embellished Enigma packet" desc = "For the true connoisseur of exotic flavors." icon_state = "shadyjimpacket" item_state = "cigpacket" cigarette_type = /obj/item/clothing/mask/cigarette/random /* * Vial Box */ /obj/item/weapon/storage/fancy/vials icon = 'icons/obj/vialbox.dmi' icon_state = "vialbox6" icon_type = "vial" name = "vial storage box" storage_slots = 6 can_hold = list("/obj/item/weapon/reagent_containers/glass/beaker/vial") /obj/item/weapon/storage/fancy/vials/New() ..() for(var/i=1; i <= storage_slots; i++) new /obj/item/weapon/reagent_containers/glass/beaker/vial(src) return /obj/item/weapon/storage/lockbox/vials name = "secure vial storage box" desc = "A locked box for keeping things away from children." icon = 'icons/obj/vialbox.dmi' icon_state = "vialbox0" item_state = "syringe_kit" max_w_class = 3 can_hold = list("/obj/item/weapon/reagent_containers/glass/beaker/vial") max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item. storage_slots = 6 req_access = list(access_virology) /obj/item/weapon/storage/lockbox/vials/New() ..() update_icon() /obj/item/weapon/storage/lockbox/vials/update_icon(var/itemremoved = 0) var/total_contents = src.contents.len - itemremoved src.icon_state = "vialbox[total_contents]" src.overlays.Cut() if (!broken) overlays += image(icon, src, "led[locked]") if(locked) overlays += image(icon, src, "cover") else overlays += image(icon, src, "ledb") return /obj/item/weapon/storage/lockbox/vials/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() update_icon() ///Aquatic Starter Kit /obj/item/weapon/storage/firstaid/aquatic_kit name = "aquatic starter kit" desc = "It's a starter kit box for an aquarium." icon_state = "AquaticKit" throw_speed = 2 throw_range = 8 /obj/item/weapon/storage/firstaid/aquatic_kit/full desc = "It's a starter kit for an acquarium; includes 1 tank brush, 1 egg scoop, 1 fish net, and 1 container of fish food." /obj/item/weapon/storage/firstaid/aquatic_kit/full/New() ..() new /obj/item/weapon/egg_scoop(src) new /obj/item/weapon/fish_net(src) new /obj/item/weapon/tank_brush(src) new /obj/item/weapon/fishfood(src)