/* * SeedBag */ //uncomment when this is updated to match storage update /* /obj/item/weapon/seedbag icon = 'icons/obj/hydroponics_machines.dmi' icon_state = "seedbag" name = "Seed Bag" desc = "A small satchel made for organizing seeds." var/mode = 1; //0 = pick one at a time, 1 = pick all on tile var/capacity = 500; //the number of seeds it can carry. slot_flags = SLOT_BELT w_class = 1 var/list/item_quants = list() /obj/item/weapon/seedbag/attack_self(mob/user as mob) user.machine = src interact(user) /obj/item/weapon/seedbag/verb/toggle_mode() set name = "Switch Bagging Method" set category = "Object" mode = !mode switch (mode) if(1) usr << "The bag now picks up all seeds in a tile at once." if(0) usr << "The bag now picks up one seed pouch at a time." /obj/item/seeds/attackby(var/obj/item/O as obj, var/mob/user as mob) ..() if (istype(O, /obj/item/weapon/seedbag)) var/obj/item/weapon/seedbag/S = O if (S.mode == 1) for (var/obj/item/seeds/G in locate(src.x,src.y,src.z)) if (S.contents.len < S.capacity) S.contents += G; if(S.item_quants[G.name]) S.item_quants[G.name]++ else S.item_quants[G.name] = 1 else user << "The seed bag is full." S.updateUsrDialog() return user << "You pick up all the seeds." else if (S.contents.len < S.capacity) S.contents += src; if(S.item_quants[name]) S.item_quants[name]++ else S.item_quants[name] = 1 else user << "The seed bag is full." S.updateUsrDialog() return /obj/item/weapon/seedbag/interact(mob/user as mob) var/dat = "Select an item:
" if (contents.len == 0) dat += "No seeds loaded!" else for (var/O in item_quants) if(item_quants[O] > 0) var/N = item_quants[O] dat += "[capitalize(O)]:" dat += " [N] " dat += "Vend" dat += "
" dat += "
Unload All" dat += "
" user << browse("Seedbag Supplies[dat]", "window=seedbag") onclose(user, "seedbag") return /obj/item/weapon/seedbag/Topic(href, href_list) if(..()) return usr.machine = src if ( href_list["vend"] ) var/N = href_list["vend"] if(item_quants[N] <= 0) // Sanity check, there are probably ways to press the button when it shouldn't be possible. return item_quants[N] -= 1 for(var/obj/O in contents) if(O.name == N) O.loc = get_turf(src) usr.put_in_hands(O) break else if ( href_list["unload"] ) item_quants.Cut() for(var/obj/O in contents ) O.loc = get_turf(src) src.updateUsrDialog() return /obj/item/weapon/seedbag/updateUsrDialog() var/list/nearby = range(1, src) for(var/mob/M in nearby) if ((M.client && M.machine == src)) src.attack_self(M) */