mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
@@ -214,8 +214,8 @@
|
|||||||
desc = "A plant nutrients vendor"
|
desc = "A plant nutrients vendor"
|
||||||
icon_state = "nutri"
|
icon_state = "nutri"
|
||||||
icon_deny = "nutri-deny"
|
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_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"
|
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_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_hidden = "/obj/item/weapon/reagent_containers/glass/bottle/ammonia;/obj/item/weapon/reagent_containers/glass/bottle/diethylamine"
|
||||||
product_hideamt = "10;5"
|
product_hideamt = "10;5"
|
||||||
|
|||||||
@@ -38,6 +38,118 @@
|
|||||||
if(0)
|
if(0)
|
||||||
usr << "The bag now picks up one plant at a time."
|
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 = "<TT><b>Select an item:</b><br>"
|
||||||
|
|
||||||
|
if (contents.len == 0)
|
||||||
|
dat += "<font color = 'red'>No seeds loaded!</font>"
|
||||||
|
else
|
||||||
|
for (var/O in item_quants)
|
||||||
|
if(item_quants[O] > 0)
|
||||||
|
var/N = item_quants[O]
|
||||||
|
dat += "<FONT color = 'blue'><B>[capitalize(O)]</B>:"
|
||||||
|
dat += " [N] </font>"
|
||||||
|
dat += "<a href='byond://?src=\ref[src];vend=[O]'>Vend</A>"
|
||||||
|
dat += "<br>"
|
||||||
|
|
||||||
|
dat += "<br><a href='byond://?src=\ref[src];unload=1'>Unload All</A>"
|
||||||
|
dat += "</TT>"
|
||||||
|
user << browse("<HEAD><TITLE>Seedbag Supplies</TITLE></HEAD><TT>[dat]</TT>", "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
|
* Sunflower
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
new /obj/item/clothing/suit/apron(src)
|
new /obj/item/clothing/suit/apron(src)
|
||||||
if(2)
|
if(2)
|
||||||
new /obj/item/clothing/suit/apron/overalls(src)
|
new /obj/item/clothing/suit/apron/overalls(src)
|
||||||
|
new /obj/item/weapon/seedbag(src)
|
||||||
new /obj/item/weapon/plantbag(src)
|
new /obj/item/weapon/plantbag(src)
|
||||||
new /obj/item/clothing/under/rank/hydroponics(src)
|
new /obj/item/clothing/under/rank/hydroponics(src)
|
||||||
new /obj/item/device/analyzer/plant_analyzer(src)
|
new /obj/item/device/analyzer/plant_analyzer(src)
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 138 KiB |
Reference in New Issue
Block a user