mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 09:08:30 +01:00
Hydroponics tray is now a machine that can be upgraded with bigger matter bins for more water and nutriment capacity.
Tray icons will now only update when necessary. Added cream, plant bag and mining satchel to biogenerator. Biogenerator's messages are now shown on top of the menu, instead of a separate screen. Examining the tray now tells you the name of the plant. Hydroponics trays start without nutriment, more E-Z-Nutriment added to vendor to compensate Seed vending machine's contents are now sorted.
This commit is contained in:
@@ -68,13 +68,16 @@
|
||||
user << "\red The biogenerator is already full! Activate it."
|
||||
else
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in O.contents)
|
||||
if(i >= 10)
|
||||
break
|
||||
G.loc = src
|
||||
i++
|
||||
if(i >= 10)
|
||||
user << "\blue You fill the biogenerator to its capacity."
|
||||
break
|
||||
if(i<10)
|
||||
user << "\blue You empty the plant bag into the biogenerator."
|
||||
else if(O.contents.len == 0)
|
||||
user << "\blue You empty the plant bag into the biogenerator, filling it to its capacity."
|
||||
else
|
||||
user << "\blue You fill the biogenerator to its capacity."
|
||||
|
||||
|
||||
else if(!istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
@@ -111,40 +114,42 @@
|
||||
dat += "<div class='statusDisplay'>Biogenerator is processing! Please wait...</div><BR>"
|
||||
else
|
||||
switch(menustat)
|
||||
if("menu")
|
||||
if(beaker)
|
||||
dat += "<div class='statusDisplay'>Biomass: [points] units.</div><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=activate'>Activate</A><A href='?src=\ref[src];action=detach'>Detach Container</A>"
|
||||
dat += "<h3>Food:</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
dat += "10 milk: <A href='?src=\ref[src];action=create;item=milk'>Make</A> ([20/efficiency])<BR>"
|
||||
dat += "Monkey cube: <A href='?src=\ref[src];action=create;item=meat'>Make</A> ([250/efficiency])"
|
||||
dat += "</div>"
|
||||
dat += "<h3>Nutrients:</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
dat += "E-Z-Nutrient: <A href='?src=\ref[src];action=create;item=ez'>Make</A><A href='?src=\ref[src];action=create;item=ez5'>x5</A> ([10/efficiency])<BR>"
|
||||
dat += "Left 4 Zed: <A href='?src=\ref[src];action=create;item=l4z'>Make</A><A href='?src=\ref[src];action=create;item=l4z5'>x5</A> ([20/efficiency])<BR>"
|
||||
dat += "Robust Harvest: <A href='?src=\ref[src];action=create;item=rh'>Make</A><A href='?src=\ref[src];action=create;item=rh5'>x5</A> ([25/efficiency])<BR>"
|
||||
dat += "</div>"
|
||||
dat += "<h3>Leather:</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
dat += "Wallet: <A href='?src=\ref[src];action=create;item=wallet'>Make</A> ([100/efficiency])<BR>"
|
||||
dat += "Book bag: <A href='?src=\ref[src];action=create;item=bkbag'>Make</A> ([200/efficiency])<BR>"
|
||||
dat += "Botanical gloves: <A href='?src=\ref[src];action=create;item=gloves'>Make</A> ([250/efficiency])<BR>"
|
||||
dat += "Utility belt: <A href='?src=\ref[src];action=create;item=tbelt'>Make</A> ([300/efficiency])<BR>"
|
||||
dat += "Leather Satchel: <A href='?src=\ref[src];action=create;item=satchel'>Make</A> ([400/efficiency])<BR>"
|
||||
dat += "</div>"
|
||||
else
|
||||
dat += "<div class='statusDisplay'>No beaker inside, please insert beaker.</div>"
|
||||
if("nopoints")
|
||||
dat += "<div class='statusDisplay'>You do not have biomass to create products.<BR>Please, put growns into reactor and activate it.</div>"
|
||||
dat += "<A href='?src=\ref[src];action=menu'>Return to menu</A>"
|
||||
menustat = "menu"
|
||||
if("complete")
|
||||
dat += "<div class='statusDisplay'>Operation complete.</div>"
|
||||
dat += "<A href='?src=\ref[src];action=menu'>Return to menu</A>"
|
||||
menustat = "menu"
|
||||
if("void")
|
||||
dat += "<div class='statusDisplay'>Error: No growns inside.<BR>Please, put growns into reactor.</div>"
|
||||
dat += "<A href='?src=\ref[src];action=menu'>Return to menu</A>"
|
||||
menustat = "menu"
|
||||
if(beaker)
|
||||
dat += "<div class='statusDisplay'>Biomass: [points] units.</div><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=activate'>Activate</A><A href='?src=\ref[src];action=detach'>Detach Container</A>"
|
||||
dat += "<h3>Food:</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
dat += "10 milk: <A href='?src=\ref[src];action=create;item=milk'>Make</A> ([20/efficiency])<BR>"
|
||||
dat += "10 cream: <A href='?src=\ref[src];action=create;item=cream'>Make</A> ([30/efficiency])<BR>"
|
||||
dat += "Monkey cube: <A href='?src=\ref[src];action=create;item=meat'>Make</A> ([250/efficiency])"
|
||||
dat += "</div>"
|
||||
dat += "<h3>Nutrients:</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
dat += "E-Z-Nutrient: <A href='?src=\ref[src];action=create;item=ez'>Make</A><A href='?src=\ref[src];action=create;item=ez5'>x5</A> ([10/efficiency])<BR>"
|
||||
dat += "Left 4 Zed: <A href='?src=\ref[src];action=create;item=l4z'>Make</A><A href='?src=\ref[src];action=create;item=l4z5'>x5</A> ([20/efficiency])<BR>"
|
||||
dat += "Robust Harvest: <A href='?src=\ref[src];action=create;item=rh'>Make</A><A href='?src=\ref[src];action=create;item=rh5'>x5</A> ([25/efficiency])<BR>"
|
||||
dat += "</div>"
|
||||
dat += "<h3>Leather:</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
dat += "Wallet: <A href='?src=\ref[src];action=create;item=wallet'>Make</A> ([100/efficiency])<BR>"
|
||||
dat += "Book bag: <A href='?src=\ref[src];action=create;item=bkbag'>Make</A> ([200/efficiency])<BR>"
|
||||
dat += "Plant bag: <A href='?src=\ref[src];action=create;item=ptbag'>Make</A> ([200/efficiency])<BR>"
|
||||
dat += "Mining satchel: <A href='?src=\ref[src];action=create;item=mnbag'>Make</A> ([200/efficiency])<BR>"
|
||||
dat += "Botanical gloves: <A href='?src=\ref[src];action=create;item=gloves'>Make</A> ([250/efficiency])<BR>"
|
||||
dat += "Utility belt: <A href='?src=\ref[src];action=create;item=tbelt'>Make</A> ([300/efficiency])<BR>"
|
||||
dat += "Leather Satchel: <A href='?src=\ref[src];action=create;item=satchel'>Make</A> ([400/efficiency])<BR>"
|
||||
dat += "</div>"
|
||||
else
|
||||
dat += "<div class='statusDisplay'>No beaker inside, please insert beaker.</div>"
|
||||
|
||||
var/datum/browser/popup = new(user, "biogen", name, 350, 520)
|
||||
popup.set_content(dat)
|
||||
@@ -199,6 +204,9 @@
|
||||
if("milk")
|
||||
if (check_cost(20/efficiency)) return 0
|
||||
else beaker.reagents.add_reagent("milk",10)
|
||||
if("cream")
|
||||
if (check_cost(30/efficiency)) return 0
|
||||
else beaker.reagents.add_reagent("cream",10)
|
||||
if("meat")
|
||||
if (check_cost(250/efficiency)) return 0
|
||||
else new/obj/item/weapon/reagent_containers/food/snacks/monkeycube(src.loc)
|
||||
@@ -241,6 +249,12 @@
|
||||
if("bkbag")
|
||||
if (check_cost(200/efficiency)) return 0
|
||||
else new/obj/item/weapon/storage/bag/books(src.loc)
|
||||
if("ptbag")
|
||||
if (check_cost(200/efficiency)) return 0
|
||||
else new/obj/item/weapon/storage/bag/plants(src.loc)
|
||||
if("mnbag")
|
||||
if (check_cost(200/efficiency)) return 0
|
||||
else new/obj/item/weapon/storage/bag/ore(src.loc)
|
||||
if("gloves")
|
||||
if (check_cost(250/efficiency)) return 0
|
||||
else new/obj/item/clothing/gloves/botanic_leather(src.loc)
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
/obj/machinery/hydroponics
|
||||
name = "hydroponics tray"
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon_state = "hydrotray3"
|
||||
icon_state = "hydrotray"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/waterlevel = 100 //The amount of water in the tray (max 100)
|
||||
var/maxwater = 100 //The maximum amount of water in the tray
|
||||
var/nutrilevel = 10 //The amount of nutrient in the tray (max 10)
|
||||
var/maxnutri = 10 //The maximum nutrient of water in the tray
|
||||
var/pestlevel = 0 //The amount of pests in the tray (max 10)
|
||||
var/weedlevel = 0 //The amount of weeds in the tray (max 10)
|
||||
var/yieldmod = 1 //Modifier to yield
|
||||
@@ -24,6 +26,29 @@
|
||||
|
||||
pixel_y=8
|
||||
|
||||
/obj/machinery/hydroponics/constructable
|
||||
name = "hydroponics tray"
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon_state = "hydrotray3"
|
||||
|
||||
/obj/machinery/hydroponics/constructable/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/hydroponics(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/hydroponics/constructable/RefreshParts()
|
||||
var tmp_capacity = 0
|
||||
for (var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
tmp_capacity += M.rating
|
||||
maxwater = tmp_capacity * 50 // Up to 300
|
||||
maxnutri = tmp_capacity * 5 // Up to 30
|
||||
waterlevel = maxwater
|
||||
nutrilevel = 3
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/proc/FindConnected()
|
||||
|
||||
@@ -45,7 +70,6 @@
|
||||
return connected
|
||||
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/bullet_act(var/obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
|
||||
if(!planted)
|
||||
..()
|
||||
@@ -65,6 +89,8 @@
|
||||
|
||||
obj/machinery/hydroponics/process()
|
||||
|
||||
var/needs_update = 0 // Checks if the icon needs updating so we don't redraw empty trays every time
|
||||
|
||||
if(myseed && (myseed.loc != src))
|
||||
myseed.loc = src
|
||||
|
||||
@@ -73,6 +99,7 @@ obj/machinery/hydroponics/process()
|
||||
if(planted && !dead)
|
||||
// Advance age
|
||||
age++
|
||||
needs_update = 1
|
||||
|
||||
//Nutrients//////////////////////////////////////////////////////////////
|
||||
// Nutrients deplete slowly
|
||||
@@ -169,7 +196,9 @@ obj/machinery/hydroponics/process()
|
||||
weedinvasion()
|
||||
else
|
||||
weedinvasion() // Weed invasion into empty tray
|
||||
update_icon()
|
||||
needs_update = 1
|
||||
if (needs_update)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
@@ -189,6 +218,7 @@ obj/machinery/hydroponics/update_icon()
|
||||
|
||||
icon_state = "hoses-[n]"
|
||||
|
||||
UpdateDescription()
|
||||
|
||||
if(planted)
|
||||
if(dead)
|
||||
@@ -223,6 +253,15 @@ obj/machinery/hydroponics/update_icon()
|
||||
|
||||
return
|
||||
|
||||
obj/machinery/hydroponics/proc/UpdateDescription()
|
||||
desc = null
|
||||
if (planted)
|
||||
desc = "[src] has \blue [myseed.plantname] \black planted."
|
||||
if (dead)
|
||||
desc += " It's dead."
|
||||
else if (harvest)
|
||||
desc += " It's ready to harvest."
|
||||
|
||||
obj/machinery/hydroponics/proc/weedinvasion() // If a weed growth is sufficient, this happens.
|
||||
dead = 0
|
||||
var/oldPlantName
|
||||
@@ -259,7 +298,6 @@ obj/machinery/hydroponics/proc/weedinvasion() // If a weed growth is sufficient,
|
||||
visible_message("\blue [oldPlantName] overtaken by [myseed.plantname].")
|
||||
|
||||
|
||||
|
||||
obj/machinery/hydroponics/proc/mutate(var/lifemut=2, var/endmut=5, var/productmut=1, var/yieldmut=2, var/potmut=25) // Mutates the current seed
|
||||
if(!planted)
|
||||
return
|
||||
@@ -301,7 +339,6 @@ obj/machinery/hydroponics/proc/mutatespecie() // Mutagent produced a new plant!
|
||||
visible_message("\red[oldPlantName] suddenly mutated into \blue [myseed.plantname]!")
|
||||
|
||||
|
||||
|
||||
obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent instead. Mind you, this pretty much destroys the old plant
|
||||
if( weedlevel > 5 )
|
||||
if(myseed)
|
||||
@@ -324,7 +361,6 @@ obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent in
|
||||
usr << "The few weeds in [src] seem to react, but only for a moment..."
|
||||
|
||||
|
||||
|
||||
obj/machinery/hydroponics/proc/plantdies() // OH NOES!!!!! I put this all in one function to make things easier
|
||||
health = 0
|
||||
harvest = 0
|
||||
@@ -334,7 +370,6 @@ obj/machinery/hydroponics/proc/plantdies() // OH NOES!!!!! I put this all in one
|
||||
dead = 1
|
||||
|
||||
|
||||
|
||||
obj/machinery/hydroponics/proc/mutatepest()
|
||||
if(pestlevel > 5)
|
||||
visible_message("The pests seem to behave oddly...")
|
||||
@@ -345,17 +380,20 @@ obj/machinery/hydroponics/proc/mutatepest()
|
||||
usr << "The pests seem to behave oddly, but quickly settle down..."
|
||||
|
||||
|
||||
|
||||
obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
|
||||
//Called when mob user "attacks" it with object O
|
||||
if(istype(O, /obj/item/nutrient))
|
||||
var/obj/item/nutrient/myNut = O
|
||||
user.u_equip(O)
|
||||
if (yieldmod == myNut.yieldmod && mutmod == myNut.mutmod)
|
||||
user << "You add the nutriment solution to [src]."
|
||||
else
|
||||
nutrilevel = 0
|
||||
yieldmod = myNut.yieldmod
|
||||
mutmod = myNut.mutmod
|
||||
user << "You replace the nutrient solution in [src]."
|
||||
adjustNutri(10)
|
||||
yieldmod = myNut.yieldmod
|
||||
mutmod = myNut.mutmod
|
||||
user << "You replace the nutrient solution in [src]."
|
||||
del(O)
|
||||
update_icon()
|
||||
|
||||
@@ -610,16 +648,16 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
user << "-Weed level: <span class='notice'> [weedlevel]/10</span>"
|
||||
user << "-Pest level: <span class='notice'> [pestlevel]/10</span>"
|
||||
user << "-Toxicity level: <span class='notice'> [toxic]/100</span>"
|
||||
user << "-Water level: <span class='notice'> [waterlevel]/100</span>"
|
||||
user << "-Nutrition level: <span class='notice'> [nutrilevel]/10</span>"
|
||||
user << "-Water level: <span class='notice'> [waterlevel]/[maxwater]</span>"
|
||||
user << "-Nutrition level: <span class='notice'> [nutrilevel]/[maxnutri]</span>"
|
||||
user << ""
|
||||
else
|
||||
user << "<B>No plant found.</B>"
|
||||
user << "-Weed level: <span class='notice'> [weedlevel]/10</span>"
|
||||
user << "-Pest level: <span class='notice'> [pestlevel]/10</span>"
|
||||
user << "-Toxicity level: <span class='notice'> [toxic]/100</span>"
|
||||
user << "-Water level: <span class='notice'> [waterlevel]/100</span>"
|
||||
user << "-Nutrition level: <span class='notice'> [nutrilevel]/10</span>"
|
||||
user << "-Water level: <span class='notice'> [waterlevel]/[maxwater]</span>"
|
||||
user << "-Nutrition level: <span class='notice'> [nutrilevel]/[maxnutri]</span>"
|
||||
user << ""
|
||||
|
||||
else if(istype(O, /obj/item/weapon/minihoe))
|
||||
@@ -675,7 +713,6 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
else if(istype(O, /obj/item/weapon/screwdriver))
|
||||
|
||||
if(anchored)
|
||||
|
||||
if(anchored==2)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
anchored = 1
|
||||
@@ -695,6 +732,16 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
user << "You clear up [src]!"
|
||||
del(src)
|
||||
|
||||
else if(istype(O, /obj/item/weapon/crowbar))
|
||||
if(anchored==2)
|
||||
user << "Unscrew the hoses first!"
|
||||
return
|
||||
|
||||
if(istype(src, /obj/machinery/hydroponics/soil))
|
||||
return
|
||||
panel_open = 1
|
||||
default_deconstruction_crowbar(O)
|
||||
panel_open = 0
|
||||
|
||||
return
|
||||
|
||||
@@ -719,8 +766,8 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
user << "The plant looks unhealthy."
|
||||
else
|
||||
user << "[src] is empty."
|
||||
user << "Water: [waterlevel]/100"
|
||||
user << "Nutrient: [nutrilevel]/10"
|
||||
user << "Water: [waterlevel]/[maxwater]"
|
||||
user << "Nutrient: [nutrilevel]/[maxnutri]"
|
||||
if(weedlevel >= 5) // Visual aid for those blind
|
||||
user << "[src] is filled with weeds!"
|
||||
if(pestlevel >= 5) // Visual aid for those blind
|
||||
@@ -931,12 +978,12 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
/obj/machinery/hydroponics/proc/adjustNutri(var/adjustamt)
|
||||
nutrilevel += adjustamt
|
||||
nutrilevel = max(nutrilevel, 0)
|
||||
nutrilevel = min(nutrilevel, 10)
|
||||
nutrilevel = min(nutrilevel, maxnutri)
|
||||
|
||||
/obj/machinery/hydroponics/proc/adjustWater(var/adjustamt)
|
||||
waterlevel += adjustamt
|
||||
waterlevel = max(waterlevel, 0)
|
||||
waterlevel = min(waterlevel, 100)
|
||||
waterlevel = min(waterlevel, maxwater)
|
||||
if(adjustamt>0)
|
||||
adjustToxic(-round(adjustamt/4))//Toxicity dilutation code. The more water you put in, the lesser the toxin concentration.
|
||||
|
||||
@@ -1002,6 +1049,9 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
|
||||
update_icon() // Same as normal but with the overlays removed - Cheridan.
|
||||
overlays.Cut()
|
||||
|
||||
UpdateDescription()
|
||||
|
||||
if(planted)
|
||||
if(dead)
|
||||
overlays += image('icons/obj/hydroponics.dmi', icon_state="[myseed.species]-dead")
|
||||
|
||||
@@ -1292,7 +1292,7 @@ datum/design/biogenerator
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/biogenerator
|
||||
/*
|
||||
|
||||
datum/design/hydroponics
|
||||
name = "Hydroponics Tray Board"
|
||||
desc = "The circuit board for a hydroponics tray."
|
||||
@@ -1301,7 +1301,7 @@ datum/design/hydroponics
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/hydroponics
|
||||
*/
|
||||
|
||||
datum/design/microwave
|
||||
name = "Microwave Board"
|
||||
desc = "The circuit board for a microwave."
|
||||
|
||||
Reference in New Issue
Block a user