diff --git a/code/defines/obj/vending.dm b/code/defines/obj/vending.dm index ac89893bef..efd1d0b5bd 100755 --- a/code/defines/obj/vending.dm +++ b/code/defines/obj/vending.dm @@ -214,8 +214,8 @@ desc = "A plant nutrients vendor" icon_state = "nutri" icon_deny = "nutri-deny" - product_paths = "/obj/item/nutrient/ez;/obj/item/nutrient/l4z;/obj/item/nutrient/rh;/obj/item/weapon/pestspray;/obj/item/weapon/reagent_containers/syringe;/obj/item/weapon/plantbag" - product_amounts = "35;25;15;20;5;5" + product_paths = "/obj/item/nutrient/ez;/obj/item/nutrient/l4z;/obj/item/nutrient/rh;/obj/item/weapon/pestspray;/obj/item/weapon/reagent_containers/syringe;/obj/item/weapon/plantbag;/obj/item/weapon/seedbag" + product_amounts = "35;25;15;20;5;5;5" product_slogans = "Aren't you glad you don't have to fertilize the natural way?;Now with 50% less stink!;Plants are people too!" product_hidden = "/obj/item/weapon/reagent_containers/glass/bottle/ammonia;/obj/item/weapon/reagent_containers/glass/bottle/diethylamine" product_hideamt = "10;5" diff --git a/code/game/objects/items/weapons/hydroponics.dm b/code/game/objects/items/weapons/hydroponics.dm index 9ebb60804f..9274453e96 100644 --- a/code/game/objects/items/weapons/hydroponics.dm +++ b/code/game/objects/items/weapons/hydroponics.dm @@ -38,6 +38,118 @@ if(0) usr << "The bag now picks up one plant at a time." +/* + * SeedBag + */ + +/obj/item/weapon/seedbag + icon = 'icons/obj/hydroponics.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. + flags = FPRINT | TABLEPASS + 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 << "\blue The seed bag is full." + S.updateUsrDialog() + return + user << "\blue 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 << "\blue The seed bag is full." + S.updateUsrDialog() + return + +/obj/item/weapon/seedbag/proc/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) /* * Sunflower diff --git a/code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm b/code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm index f96c0bdce3..b9c963ab0f 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm @@ -17,6 +17,7 @@ new /obj/item/clothing/suit/apron(src) if(2) new /obj/item/clothing/suit/apron/overalls(src) + new /obj/item/weapon/seedbag(src) new /obj/item/weapon/plantbag(src) new /obj/item/clothing/under/rank/hydroponics(src) new /obj/item/device/analyzer/plant_analyzer(src) diff --git a/icons/obj/hydroponics.dmi b/icons/obj/hydroponics.dmi index e45d28d3c2..03a8c72bc0 100644 Binary files a/icons/obj/hydroponics.dmi and b/icons/obj/hydroponics.dmi differ