/**********************Ore box**************************/ /obj/structure/ore_box icon = 'icons/obj/mining.dmi' icon_state = "orebox" name = "ore box" desc = "A heavy wooden box, which can be filled with a lot of ores." density = TRUE pressure_resistance = 5 * ONE_ATMOSPHERE /obj/structure/ore_box/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/stack/ore)) if(!user.drop_item()) return W.forceMove(src) else if(isstorage(W)) var/obj/item/storage/S = W S.hide_from(usr) for(var/obj/item/stack/ore/O in S.contents) S.remove_from_storage(O, src) //This will move the item to this item's contents to_chat(user, "You empty the satchel into the box.") else return ..() /obj/structure/ore_box/crowbar_act(mob/living/user, obj/item/I) . = TRUE if(!I.use_tool(src, user, 5 SECONDS, volume = I.tool_volume)) return user.visible_message("[user] pries [src] apart.", "You pry apart [src].", "You hear splitting wood.") deconstruct(TRUE, user) /obj/structure/ore_box/attack_hand(mob/user) if(Adjacent(user)) show_contents(user) /obj/structure/ore_box/attack_robot(mob/user) if(Adjacent(user)) show_contents(user) /obj/structure/ore_box/proc/show_contents(mob/user) var/dat = "The contents of the ore box reveal...
" var/list/assembled = list() for(var/obj/item/stack/ore/O in src) assembled[O.type] += O.amount for(var/type in assembled) var/obj/item/stack/ore/O = type dat += "[initial(O.name)] - [assembled[type]]
" dat += "

Empty box" var/datum/browser/popup = new(user, "orebox", name, 400, 400) popup.set_content(dat) popup.open(0) /obj/structure/ore_box/Topic(href, href_list) if(..()) return usr.set_machine(src) add_fingerprint(usr) if(href_list["removeall"]) dump_box_contents() to_chat(usr, "You empty the box.") updateUsrDialog() /obj/structure/ore_box/deconstruct(disassembled = TRUE, mob/user) var/obj/item/stack/sheet/wood/W = new (loc, 4) if(user) W.add_fingerprint(user) dump_box_contents() qdel(src) /obj/structure/ore_box/proc/dump_box_contents() for(var/obj/item/stack/ore/O in src) if(QDELETED(O)) continue if(QDELETED(src)) break O.forceMove(loc) CHECK_TICK /obj/structure/ore_box/examine(mob/user) . = ..() if(Adjacent(user)) . += "You can Alt-Shift-Click to empty the ore box." /obj/structure/ore_box/onTransitZ() return /obj/structure/ore_box/AltShiftClick(mob/user) if(!Adjacent(user) || !ishuman(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) to_chat(user, "You cannot interact with the ore box.") return add_fingerprint(user) if(length(contents) < 1) to_chat(user, "The ore box is empty.") return dump_box_contents() to_chat(user, "You empty the ore box.")