mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-02 05:23:01 +00:00
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
84 lines
2.4 KiB
Plaintext
84 lines
2.4 KiB
Plaintext
|
|
/**********************Ore box**************************/
|
|
|
|
/obj/structure/ore_box
|
|
icon = 'icons/obj/mining.dmi'
|
|
icon_state = "orebox"
|
|
name = "Ore Box"
|
|
desc = "It's heavy"
|
|
density = 1
|
|
|
|
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
if (istype(W, /obj/item/weapon/ore))
|
|
src.contents += W;
|
|
if (istype(W, /obj/item/weapon/storage))
|
|
var/obj/item/weapon/storage/S = W
|
|
S.hide_from(usr)
|
|
for(var/obj/item/weapon/ore/O in S.contents)
|
|
S.remove_from_storage(O, src) //This will move the item to this item's contents
|
|
user << "\blue You empty the satchel into the box."
|
|
return
|
|
|
|
/obj/structure/ore_box/attack_hand(obj, mob/user as mob)
|
|
var/amt_gold = 0
|
|
var/amt_silver = 0
|
|
var/amt_diamond = 0
|
|
var/amt_glass = 0
|
|
var/amt_iron = 0
|
|
var/amt_plasma = 0
|
|
var/amt_uranium = 0
|
|
var/amt_clown = 0
|
|
|
|
for (var/obj/item/weapon/ore/C in contents)
|
|
if (istype(C,/obj/item/weapon/ore/diamond))
|
|
amt_diamond++;
|
|
if (istype(C,/obj/item/weapon/ore/glass))
|
|
amt_glass++;
|
|
if (istype(C,/obj/item/weapon/ore/plasma))
|
|
amt_plasma++;
|
|
if (istype(C,/obj/item/weapon/ore/iron))
|
|
amt_iron++;
|
|
if (istype(C,/obj/item/weapon/ore/silver))
|
|
amt_silver++;
|
|
if (istype(C,/obj/item/weapon/ore/gold))
|
|
amt_gold++;
|
|
if (istype(C,/obj/item/weapon/ore/uranium))
|
|
amt_uranium++;
|
|
if (istype(C,/obj/item/weapon/ore/clown))
|
|
amt_clown++;
|
|
|
|
var/dat = text("<b>The contents of the ore box reveal...</b><br>")
|
|
if (amt_gold)
|
|
dat += text("Gold ore: [amt_gold]<br>")
|
|
if (amt_silver)
|
|
dat += text("Silver ore: [amt_silver]<br>")
|
|
if (amt_iron)
|
|
dat += text("Metal ore: [amt_iron]<br>")
|
|
if (amt_glass)
|
|
dat += text("Sand: [amt_glass]<br>")
|
|
if (amt_diamond)
|
|
dat += text("Diamond ore: [amt_diamond]<br>")
|
|
if (amt_plasma)
|
|
dat += text("Plasma ore: [amt_plasma]<br>")
|
|
if (amt_uranium)
|
|
dat += text("Uranium ore: [amt_uranium]<br>")
|
|
if (amt_clown)
|
|
dat += text("Bananium ore: [amt_clown]<br>")
|
|
|
|
dat += text("<br><br><A href='?src=\ref[src];removeall=1'>Empty box</A>")
|
|
user << browse("[dat]", "window=orebox")
|
|
return
|
|
|
|
/obj/structure/ore_box/Topic(href, href_list)
|
|
if(..())
|
|
return
|
|
usr.set_machine(src)
|
|
src.add_fingerprint(usr)
|
|
if(href_list["removeall"])
|
|
for (var/obj/item/weapon/ore/O in contents)
|
|
contents -= O
|
|
O.loc = src.loc
|
|
usr << "\blue You empty the box"
|
|
src.updateUsrDialog()
|
|
return
|