/* * These absorb the functionality of the plant bag, ore satchel, etc. * They use the use_to_pickup, quick_gather, and quick_empty functions * that were already defined in weapon/storage, but which had been * re-implemented in other classes. * * Contains: * Trash Bag * Mining Satchel * Plant Bag * Sheet Snatcher * Book Bag * Biowaste Bag * * -Sayu */ // Generic non-item /obj/item/storage/bag slot_flags = ITEM_SLOT_BELT w_class = WEIGHT_CLASS_BULKY /obj/item/storage/bag/ComponentInitialize() . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.allow_quick_gather = TRUE STR.allow_quick_empty = TRUE STR.display_numerical_stacking = TRUE STR.click_gather = TRUE // ----------------------------- // Trash bag // ----------------------------- /obj/item/storage/bag/trash name = "trash bag" desc = "It's the heavy-duty black polymer kind. Time to take out the trash!" icon = 'icons/obj/janitor.dmi' icon_state = "trashbag" inhand_icon_state = "trashbag" lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi' slot_flags = null ///If true, can be inserted into the janitor cart var/insertable = TRUE /obj/item/storage/bag/trash/ComponentInitialize() . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.max_w_class = WEIGHT_CLASS_SMALL STR.max_combined_w_class = 30 STR.max_items = 30 STR.set_holdable(null, list(/obj/item/disk/nuclear)) /obj/item/storage/bag/trash/suicide_act(mob/user) user.visible_message(span_suicide("[user] puts [src] over [user.p_their()] head and starts chomping at the insides! Disgusting!")) playsound(loc, 'sound/items/eatfood.ogg', 50, TRUE, -1) return (TOXLOSS) /obj/item/storage/bag/trash/update_icon_state() switch(contents.len) if(20 to INFINITY) icon_state = "[initial(icon_state)]3" if(11 to 20) icon_state = "[initial(icon_state)]2" if(1 to 11) icon_state = "[initial(icon_state)]1" else icon_state = "[initial(icon_state)]" return ..() /obj/item/storage/bag/trash/cyborg/Initialize(mapload) . = ..() ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT) /obj/item/storage/bag/trash/filled /obj/item/storage/bag/trash/filled/PopulateContents() . = ..() for(var/i in 1 to rand(1, 7)) new /obj/effect/spawner/random/trash/garbage(src) update_icon_state() /obj/item/storage/bag/trash/bluespace name = "trash bag of holding" desc = "The latest and greatest in custodial convenience, a trashbag that is capable of holding vast quantities of garbage." icon_state = "bluetrashbag" inhand_icon_state = "bluetrashbag" item_flags = NO_MAT_REDEMPTION /obj/item/storage/bag/trash/bluespace/ComponentInitialize() . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.max_combined_w_class = 60 STR.max_items = 60 /obj/item/storage/bag/trash/bluespace/cyborg insertable = FALSE // ----------------------------- // Mining Satchel // ----------------------------- /obj/item/storage/bag/ore name = "mining satchel" desc = "This little bugger can be used to store and transport ores." icon = 'icons/obj/mining.dmi' icon_state = "satchel" worn_icon_state = "satchel" slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_POCKETS w_class = WEIGHT_CLASS_NORMAL component_type = /datum/component/storage/concrete/stack var/spam_protection = FALSE //If this is TRUE, the holder won't receive any messages when they fail to pick up ore through crossing it var/mob/listeningTo /obj/item/storage/bag/ore/ComponentInitialize() . = ..() var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack) STR.allow_quick_empty = TRUE STR.set_holdable(list(/obj/item/stack/ore)) STR.max_w_class = WEIGHT_CLASS_HUGE STR.max_combined_stack_amount = 50 /obj/item/storage/bag/ore/equipped(mob/user) . = ..() if(listeningTo == user) return if(listeningTo) UnregisterSignal(listeningTo, COMSIG_MOVABLE_MOVED) RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/Pickup_ores) listeningTo = user /obj/item/storage/bag/ore/dropped() . = ..() if(listeningTo) UnregisterSignal(listeningTo, COMSIG_MOVABLE_MOVED) listeningTo = null /obj/item/storage/bag/ore/proc/Pickup_ores(mob/living/user) SIGNAL_HANDLER var/show_message = FALSE var/obj/structure/ore_box/box var/turf/tile = user.loc if (!isturf(tile)) return if (istype(user.pulling, /obj/structure/ore_box)) box = user.pulling var/datum/component/storage/STR = GetComponent(/datum/component/storage) if(STR) for(var/A in tile) if (!is_type_in_typecache(A, STR.can_hold)) continue if (box) user.transferItemToLoc(A, box) show_message = TRUE else if(SEND_SIGNAL(src, COMSIG_TRY_STORAGE_INSERT, A, user, TRUE)) show_message = TRUE else if(!spam_protection) to_chat(user, span_warning("Your [name] is full and can't hold any more!")) spam_protection = TRUE continue if(show_message) playsound(user, SFX_RUSTLE, 50, TRUE) if (box) user.visible_message(span_notice("[user] offloads the ores beneath [user.p_them()] into [box]."), \ span_notice("You offload the ores beneath you into your [box].")) else user.visible_message(span_notice("[user] scoops up the ores beneath [user.p_them()]."), \ span_notice("You scoop up the ores beneath you with your [name].")) spam_protection = FALSE /obj/item/storage/bag/ore/cyborg name = "cyborg mining satchel" /obj/item/storage/bag/ore/holding //miners, your messiah has arrived name = "mining satchel of holding" desc = "A revolution in convenience, this satchel allows for huge amounts of ore storage. It's been outfitted with anti-malfunction safety measures." icon_state = "satchel_bspace" /obj/item/storage/bag/ore/holding/ComponentInitialize() . = ..() var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack) STR.max_items = INFINITY STR.max_combined_w_class = INFINITY STR.max_combined_stack_amount = INFINITY // ----------------------------- // Plant bag // ----------------------------- /obj/item/storage/bag/plants name = "plant bag" icon = 'icons/obj/hydroponics/equipment.dmi' icon_state = "plantbag" worn_icon_state = "plantbag" resistance_flags = FLAMMABLE /obj/item/storage/bag/plants/ComponentInitialize() . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.max_w_class = WEIGHT_CLASS_NORMAL STR.max_combined_w_class = 100 STR.max_items = 100 STR.set_holdable(list( /obj/item/food/grown, /obj/item/seeds, /obj/item/grown, /obj/item/reagent_containers/honeycomb, /obj/item/graft, )) //////// /obj/item/storage/bag/plants/portaseeder name = "portable seed extractor" desc = "For the enterprising botanist on the go. Less efficient than the stationary model, it creates one seed per plant." icon_state = "portaseeder" /obj/item/storage/bag/plants/portaseeder/Initialize(mapload) . = ..() register_context() /obj/item/storage/bag/plants/portaseeder/add_context( atom/source, list/context, obj/item/held_item, mob/living/user ) context[SCREENTIP_CONTEXT_CTRL_LMB] = "Make seeds" return CONTEXTUAL_SCREENTIP_SET /obj/item/storage/bag/plants/portaseeder/examine(mob/user) . = ..() . += span_notice("Ctrl-click to activate seed extraction.") /obj/item/storage/bag/plants/portaseeder/CtrlClick(mob/user) if(user.incapacitated()) return for(var/obj/item/plant in contents) seedify(plant, 1) // ----------------------------- // Sheet Snatcher // ----------------------------- // Because it stacks stacks, this doesn't operate normally. // However, making it a storage/bag allows us to reuse existing code in some places. -Sayu /obj/item/storage/bag/sheetsnatcher name = "sheet snatcher" desc = "A patented Nanotrasen storage system designed for any kind of mineral sheet." icon = 'icons/obj/mining.dmi' icon_state = "sheetsnatcher" worn_icon_state = "satchel" var/capacity = 300; //the number of sheets it can carry. component_type = /datum/component/storage/concrete/stack /obj/item/storage/bag/sheetsnatcher/ComponentInitialize() . = ..() var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack) STR.allow_quick_empty = TRUE STR.set_holdable(list( /obj/item/stack/sheet ), list( /obj/item/stack/sheet/mineral/sandstone, /obj/item/stack/sheet/mineral/wood )) STR.max_combined_stack_amount = 300 // ----------------------------- // Sheet Snatcher (Cyborg) // ----------------------------- /obj/item/storage/bag/sheetsnatcher/borg name = "sheet snatcher 9000" desc = "" capacity = 500//Borgs get more because >specialization /obj/item/storage/bag/sheetsnatcher/borg/ComponentInitialize() . = ..() var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack) STR.max_combined_stack_amount = 500 // ----------------------------- // Book bag // ----------------------------- /obj/item/storage/bag/books name = "book bag" desc = "A bag for books." icon = 'icons/obj/library.dmi' icon_state = "bookbag" worn_icon_state = "bookbag" resistance_flags = FLAMMABLE /obj/item/storage/bag/books/ComponentInitialize() . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.max_w_class = WEIGHT_CLASS_NORMAL STR.max_combined_w_class = 21 STR.max_items = 7 STR.display_numerical_stacking = FALSE STR.set_holdable(list( /obj/item/book, /obj/item/storage/book, /obj/item/spellbook )) /* * Trays - Agouri */ /obj/item/storage/bag/tray name = "serving tray" icon = 'icons/obj/food/containers.dmi' icon_state = "tray" worn_icon_state = "tray" desc = "A metal tray to lay food on." force = 5 throwforce = 10 throw_speed = 3 throw_range = 5 flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT custom_materials = list(/datum/material/iron=3000) custom_price = PAYCHECK_ASSISTANT * 0.6 /obj/item/storage/bag/tray/ComponentInitialize() . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.max_w_class = WEIGHT_CLASS_BULKY //Plates are required bulky to keep them out of backpacks STR.set_holdable(list( /obj/item/plate, /obj/item/reagent_containers/food, /obj/item/reagent_containers/glass, /obj/item/clothing/mask/cigarette, /obj/item/storage/fancy, /obj/item/storage/box/gum, /obj/item/storage/box/matches, /obj/item/food, /obj/item/trash, /obj/item/lighter, /obj/item/rollingpaper, /obj/item/kitchen, /obj/item/organ, )) //Should cover: Bottles, Beakers, Bowls, Booze, Glasses, Food, Food Containers, Food Trash, Organs, Tobacco Products, Lighters, and Kitchen Tools. STR.insert_preposition = "on" STR.max_items = 7 /obj/item/storage/bag/tray/attack(mob/living/M, mob/living/user) . = ..() // Drop all the things. All of them. var/list/obj/item/oldContents = contents.Copy() SEND_SIGNAL(src, COMSIG_TRY_STORAGE_QUICK_EMPTY) // Make each item scatter a bit for(var/obj/item/tray_item in oldContents) do_scatter(tray_item) if(prob(50)) playsound(M, 'sound/items/trayhit1.ogg', 50, TRUE) else playsound(M, 'sound/items/trayhit2.ogg', 50, TRUE) if(ishuman(M)) if(prob(10)) M.Paralyze(40) update_appearance() /obj/item/storage/bag/tray/proc/do_scatter(obj/item/tray_item) var/delay = rand(2,4) var/datum/move_loop/loop = SSmove_manager.move_rand(tray_item, list(NORTH,SOUTH,EAST,WEST), delay, timeout = rand(1, 2) * delay, flags = MOVEMENT_LOOP_START_FAST) //This does mean scattering is tied to the tray. Not sure how better to handle it RegisterSignal(loop, COMSIG_MOVELOOP_POSTPROCESS, .proc/change_speed) /obj/item/storage/bag/tray/proc/change_speed(datum/move_loop/source) SIGNAL_HANDLER var/new_delay = rand(2, 4) var/count = source.lifetime / source.delay source.lifetime = count * new_delay source.delay = new_delay /obj/item/storage/bag/tray/update_overlays() . = ..() for(var/obj/item/I in contents) var/mutable_appearance/I_copy = new(I) I_copy.plane = FLOAT_PLANE I_copy.layer = FLOAT_LAYER . += I_copy /obj/item/storage/bag/tray/Entered(atom/movable/arrived, atom/old_loc, list/atom/old_locs) . = ..() update_appearance() /obj/item/storage/bag/tray/Exited(atom/movable/gone, direction) . = ..() update_appearance() /obj/item/storage/bag/tray/cafeteria name = "cafeteria tray" icon = 'icons/obj/food/containers.dmi' icon_state = "foodtray" desc = "A cheap metal tray to pile today's meal onto." /* * Chemistry bag */ /obj/item/storage/bag/chemistry name = "chemistry bag" icon = 'icons/obj/chemical.dmi' icon_state = "bag" worn_icon_state = "chembag" desc = "A bag for storing pills, patches, and bottles." resistance_flags = FLAMMABLE /obj/item/storage/bag/chemistry/ComponentInitialize() . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.max_combined_w_class = 200 STR.max_items = 50 STR.insert_preposition = "in" STR.set_holdable(list( /obj/item/reagent_containers/pill, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/food/drinks/waterbottle, /obj/item/reagent_containers/medigel, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/dropper, /obj/item/reagent_containers/chem_pack )) /* * Biowaste bag (mostly for virologists) */ /obj/item/storage/bag/bio name = "bio bag" icon = 'icons/obj/chemical.dmi' icon_state = "biobag" worn_icon_state = "biobag" desc = "A bag for the safe transportation and disposal of biowaste and other virulent materials." resistance_flags = FLAMMABLE /obj/item/storage/bag/bio/ComponentInitialize() . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.max_combined_w_class = 200 STR.max_items = 25 STR.insert_preposition = "in" STR.set_holdable(list( /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/dropper, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/blood, /obj/item/reagent_containers/hypospray/medipen, /obj/item/food/monkeycube, /obj/item/organ, /obj/item/bodypart, /obj/item/healthanalyzer )) /* * Science bag (mostly for xenobiologists) */ /obj/item/storage/bag/xeno name = "science bag" icon = 'icons/obj/chemical.dmi' icon_state = "xenobag" worn_icon_state = "xenobag" desc = "A bag for the storage and transport of anomalous materials." resistance_flags = FLAMMABLE /obj/item/storage/bag/xeno/ComponentInitialize() . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.max_combined_w_class = 200 STR.max_items = 25 STR.insert_preposition = "in" STR.set_holdable(list( /obj/item/slime_extract, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/dropper, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/food/deadmouse, /obj/item/food/monkeycube, /obj/item/organ, /obj/item/bodypart, /obj/item/petri_dish, /obj/item/swab )) /* * Construction bag (for engineering, holds stock parts and electronics) */ /obj/item/storage/bag/construction name = "construction bag" icon = 'icons/obj/tools.dmi' icon_state = "construction_bag" worn_icon_state = "construction_bag" desc = "A bag for storing small construction components." slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_POCKETS resistance_flags = FLAMMABLE /obj/item/storage/bag/construction/ComponentInitialize() . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.max_combined_w_class = 100 STR.max_items = 50 STR.max_w_class = WEIGHT_CLASS_SMALL STR.insert_preposition = "in" STR.set_holdable(list( /obj/item/stack/ore/bluespace_crystal, /obj/item/assembly, /obj/item/stock_parts, /obj/item/reagent_containers/glass/beaker, /obj/item/stack/cable_coil, /obj/item/circuitboard, /obj/item/electronics, /obj/item/wallframe/camera )) /obj/item/storage/bag/harpoon_quiver name = "harpoon quiver" desc = "A quiver for holding harpoons." icon_state = "quiver" inhand_icon_state = "quiver" worn_icon_state = "harpoon_quiver" /obj/item/storage/bag/harpoon_quiver/ComponentInitialize() . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.max_w_class = WEIGHT_CLASS_TINY STR.max_items = 40 STR.max_combined_w_class = 100 STR.set_holdable(list( /obj/item/ammo_casing/caseless/harpoon )) /obj/item/storage/bag/harpoon_quiver/PopulateContents() for(var/i in 1 to 40) new /obj/item/ammo_casing/caseless/harpoon(src)