From 590847bdf742b1e53f05ea700d48ec0676cdcf43 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 22 Nov 2022 07:57:13 +0300 Subject: [PATCH] Biogenerator tweaks, leather makes more belts and clothing (#71175) ## About The Pull Request ### Revamped the biogenerator UI: https://user-images.githubusercontent.com/3625094/200973283-b703f21b-c747-493e-98d9-043eef86d410.mp4 ### Changed biogenerator icon to use layers and see the biomass level: https://user-images.githubusercontent.com/3625094/201396065-caeaa412-6676-46f6-875e-efa2dca34985.mp4 ### Biogenerator rebalance: - Now you don't need the beaker to print solid products. - Biogenerator now accepts all food, not just plants. - Biogenerator now treats all nutriment subtypes as nutriments, so vitamins and proteins also turn into biomass. - Biomass now has the same units as other reagents (you get 5 biomass from 5 nutrient with tier 1 parts). - Doubled the cost of all items and reagents. (biomass generation reduced by 10 and prices - by 5) - Chemicals output amounts are now in units and you can select how much you want to output exactly. It will not let you specify more than the size of container or above 50 units with one button click. - Reduced the amount of stored items and introduced a limit to the biomass, both tied to the matter bin tier. ### Recipes changes: Made biogenerator more dumb by moving the clothing out from the biogenerator designs, and extending leather recipes instead. The biogenerator is a grinder/recycler style machine so it doesn't make sense that it outputs clothing. Also you need to make leather to craft the toolbelt, while you can't do the same to craft job-specific belts. Now you can print leather in biogenerator and craft the leather clothing by using the leather in-hand. And the rice hat is now crafted from bamboo, instead of biogenerator. Also added paper to the biogenerator recipes as it makes stuff from cellulose and barely anyone knows that you can craft paper from 1 log and 50 water. And paper is needed in large quantities to craft some items, like paper frames. And it doesn't output a pack of rolling paper. It's dumb now. It prints the rolling paper sheets instead. ## Why It's Good For The Game Biogenerator had terrible UX and backend logic. I didn't improve much on BE though, but now it should be less frustrating to use. Also I hate how biogenerator is superior to all other means of obtaining its products. It doesn't make sense to grow and grind wheat, for instance, when you can just throw shit into biogenerator and get the flour fast. And the costs are ridiculous - you can get a couple of bottles of fertilizers just from one medium potato. It honestly begs for more nerfing, at least to make the nutriment - chemicals exchange rate 1:1. The reason for the biomass cap is because people use it as a sink for veggies and generate infinite biomass. Maybe the limit will make them care more about the part upgrade and offload some of the veggies to the fridge for the Cook. Also it was weird that biogenerator could tailor some things, while others have to be crafted in-hand. Now you can print leather and craft all types of belts and leather clothing. ## Changelog :cl: refactor: biogenerator UI revamped qol: biogenerator no longer requires beaker for materials, monkey cubes and nori balance: biogenerator accepts all food, not just plants balance: biogenerator treats all nutriment subtypes as nutriments (vitamins, protein, etc.) balance: biogenerator product prices doubled balance: biogenerator biomass storage is limited depending on the level of matter bins balance: cowboy boots recipe moved from crafting to leather recipes balance: leather clothing & belt recipes moved from biogenerator to leather recipes balance: rice hat recipe moved from biogenerator to bamboo recipes balance: biogenerator now outputs rolling paper sheets instead of a pack add: biogenerator can now print paper imageadd: biogenerator icons now use overlays, have emissive layer and indicate the biomass volume /:cl: --- .../__DEFINES/research/research_categories.dm | 6 +- code/datums/components/crafting/tailoring.dm | 7 - .../objects/items/stacks/sheets/leather.dm | 24 +- .../items/stacks/sheets/sheet_types.dm | 159 ++++++------ code/modules/hydroponics/biogenerator.dm | 200 +++++++-------- .../research/designs/biogenerator_designs.dm | 228 ++++++++---------- icons/obj/machines/biogenerator.dmi | Bin 2151 -> 1639 bytes tgui/packages/tgui/interfaces/Biogenerator.js | 189 --------------- .../packages/tgui/interfaces/Biogenerator.tsx | 225 +++++++++++++++++ 9 files changed, 523 insertions(+), 515 deletions(-) delete mode 100644 tgui/packages/tgui/interfaces/Biogenerator.js create mode 100644 tgui/packages/tgui/interfaces/Biogenerator.tsx diff --git a/code/__DEFINES/research/research_categories.dm b/code/__DEFINES/research/research_categories.dm index 137aceae867..a5ec0dd29ce 100644 --- a/code/__DEFINES/research/research_categories.dm +++ b/code/__DEFINES/research/research_categories.dm @@ -183,9 +183,9 @@ #define RND_CATEGORY_LIMBS_OTHER "Other Limbs" /// Biogenerator Categories -#define RND_CATEGORY_FOOD "Food" -#define RND_CATEGORY_BOTANY_CHEMICALS "Botany Chemicals" -#define RND_CATEGORY_ORGANIC_MATERIALS "Organic Materials" +#define RND_CATEGORY_BIO_FOOD "Food" +#define RND_CATEGORY_BIO_CHEMICALS "Chemicals" +#define RND_CATEGORY_BIO_MATERIALS "Materials" // Meta categories #define RND_CATEGORY_INITIAL "initial" diff --git a/code/datums/components/crafting/tailoring.dm b/code/datums/components/crafting/tailoring.dm index 0b1a8fdc16a..a40fa7e40ce 100644 --- a/code/datums/components/crafting/tailoring.dm +++ b/code/datums/components/crafting/tailoring.dm @@ -130,13 +130,6 @@ reqs = list(/obj/item/bedsheet = 1) category = CAT_CLOTHING -/datum/crafting_recipe/cowboyboots - name = "Cowboy Boots" - result = /obj/item/clothing/shoes/cowboy - reqs = list(/obj/item/stack/sheet/leather = 2) - time = 4.5 SECONDS - category = CAT_CLOTHING - /datum/crafting_recipe/lizardboots name = "Lizard Skin Boots" result = /obj/effect/spawner/random/clothing/lizardboots diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm index 7edec0aedbc..24b7d26c613 100644 --- a/code/game/objects/items/stacks/sheets/leather.dm +++ b/code/game/objects/items/stacks/sheets/leather.dm @@ -188,22 +188,30 @@ GLOBAL_LIST_INIT(xeno_recipes, list ( \ GLOBAL_LIST_INIT(leather_recipes, list ( \ new/datum/stack_recipe("wallet", /obj/item/storage/wallet, 1), \ new/datum/stack_recipe("muzzle", /obj/item/clothing/mask/muzzle, 2), \ - new/datum/stack_recipe("botany gloves", /obj/item/clothing/gloves/botanic_leather, 3), \ - new/datum/stack_recipe("toolbelt", /obj/item/storage/belt/utility, 4), \ - new/datum/stack_recipe("leather satchel", /obj/item/storage/backpack/satchel/leather, 5), \ - new/datum/stack_recipe("bandolier", /obj/item/storage/belt/bandolier, 5), \ - new/datum/stack_recipe("leather jacket", /obj/item/clothing/suit/jacket/leather, 7), \ - new/datum/stack_recipe("leather shoes", /obj/item/clothing/shoes/laceup, 2), \ - new/datum/stack_recipe("biker jacket", /obj/item/clothing/suit/jacket/leather/biker, 7), \ new/datum/stack_recipe("saddle", /obj/item/saddle, 5), \ + new/datum/stack_recipe("leather shoes", /obj/item/clothing/shoes/laceup, 2), \ + new/datum/stack_recipe("cowboy boots", /obj/item/clothing/shoes/cowboy, 2), \ + new/datum/stack_recipe("botany gloves", /obj/item/clothing/gloves/botanic_leather, 3), \ + new/datum/stack_recipe("leather satchel", /obj/item/storage/backpack/satchel/leather, 5), \ new/datum/stack_recipe("sheriff vest", /obj/item/clothing/accessory/vest_sheriff, 4), \ + new/datum/stack_recipe("leather jacket", /obj/item/clothing/suit/jacket/leather, 7), \ + new/datum/stack_recipe("biker jacket", /obj/item/clothing/suit/jacket/leather/biker, 7), \ + new/datum/stack_recipe_list("belts", list( \ + new/datum/stack_recipe("tool belt", /obj/item/storage/belt/utility, 4), \ + new/datum/stack_recipe("botanical belt", /obj/item/storage/belt/plant, 2), \ + new/datum/stack_recipe("janitorial belt", /obj/item/storage/belt/janitor, 2), \ + new/datum/stack_recipe("medical belt", /obj/item/storage/belt/medical, 2), \ + new/datum/stack_recipe("security belt", /obj/item/storage/belt/security, 2), \ + new/datum/stack_recipe("shoulder holster", /obj/item/storage/belt/holster, 3), \ + new/datum/stack_recipe("bandolier", /obj/item/storage/belt/bandolier, 5), \ + )), new/datum/stack_recipe_list("cowboy hats", list( \ new/datum/stack_recipe("sheriff hat", /obj/item/clothing/head/cowboy/brown, 2), \ new/datum/stack_recipe("desperado hat", /obj/item/clothing/head/cowboy/black, 2), \ new/datum/stack_recipe("ten-gallon hat", /obj/item/clothing/head/cowboy/white, 2), \ new/datum/stack_recipe("deputy hat", /obj/item/clothing/head/cowboy/red, 2), \ new/datum/stack_recipe("drifter hat", /obj/item/clothing/head/cowboy/grey, 2), \ - )), + )), )) /obj/item/stack/sheet/leather/get_main_recipes() diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 1d22d1f924a..841986f828d 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -65,46 +65,46 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ )), null, \ new/datum/stack_recipe("rack parts", /obj/item/rack_parts), \ - new/datum/stack_recipe("closet", /obj/structure/closet, 2, time = 15, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("closet", /obj/structure/closet, 2, time = 1.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ null, \ - new/datum/stack_recipe("unfinished canister frame", /obj/structure/canister_frame/machine/unfinished_canister_frame, 5, time = 8, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("unfinished canister frame", /obj/structure/canister_frame/machine/unfinished_canister_frame, 5, time = 0.8 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ null, \ new/datum/stack_recipe("floor tile", /obj/item/stack/tile/iron/base, 1, 4, 20), \ new/datum/stack_recipe("iron rod", /obj/item/stack/rods, 1, 2, 60), \ null, \ - new/datum/stack_recipe("wall girders (anchored)", /obj/structure/girder, 2, time = 40, one_per_turf = TRUE, on_solid_ground = TRUE, trait_booster = TRAIT_QUICK_BUILD, trait_modifier = 0.75), \ + new/datum/stack_recipe("wall girders (anchored)", /obj/structure/girder, 2, time = 4 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, trait_booster = TRAIT_QUICK_BUILD, trait_modifier = 0.75), \ null, \ - new/datum/stack_recipe("tram wall girders (anchored)", /obj/structure/girder/tram, 2, time = 40, one_per_turf = TRUE, on_solid_ground = FALSE, on_tram = TRUE, trait_booster = TRAIT_QUICK_BUILD, trait_modifier = 0.75), \ + new/datum/stack_recipe("tram wall girders (anchored)", /obj/structure/girder/tram, 2, time = 4 SECONDS, one_per_turf = TRUE, on_solid_ground = FALSE, on_tram = TRUE, trait_booster = TRAIT_QUICK_BUILD, trait_modifier = 0.75), \ null, \ - new/datum/stack_recipe("computer frame", /obj/structure/frame/computer, 5, time = 25, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("modular console", /obj/machinery/modular_computer/console, 10, time = 25, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("machine frame", /obj/structure/frame/machine, 5, time = 25, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("computer frame", /obj/structure/frame/computer, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("modular console", /obj/machinery/modular_computer/console, 10, time = 2.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("machine frame", /obj/structure/frame/machine, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ null, \ new /datum/stack_recipe_list("airlock assemblies", list( \ - new /datum/stack_recipe("standard airlock assembly", /obj/structure/door_assembly, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("public airlock assembly", /obj/structure/door_assembly/door_assembly_public, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("command airlock assembly", /obj/structure/door_assembly/door_assembly_com, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("security airlock assembly", /obj/structure/door_assembly/door_assembly_sec, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("engineering airlock assembly", /obj/structure/door_assembly/door_assembly_eng, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("mining airlock assembly", /obj/structure/door_assembly/door_assembly_min, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("atmospherics airlock assembly", /obj/structure/door_assembly/door_assembly_atmo, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("research airlock assembly", /obj/structure/door_assembly/door_assembly_research, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("freezer airlock assembly", /obj/structure/door_assembly/door_assembly_fre, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("science airlock assembly", /obj/structure/door_assembly/door_assembly_science, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("medical airlock assembly", /obj/structure/door_assembly/door_assembly_med, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("hydroponics airlock assembly", /obj/structure/door_assembly/door_assembly_hydro, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("virology airlock assembly", /obj/structure/door_assembly/door_assembly_viro, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("maintenance airlock assembly", /obj/structure/door_assembly/door_assembly_mai, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("external airlock assembly", /obj/structure/door_assembly/door_assembly_ext, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("external maintenance airlock assembly", /obj/structure/door_assembly/door_assembly_extmai, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("airtight hatch assembly", /obj/structure/door_assembly/door_assembly_hatch, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ - new /datum/stack_recipe("maintenance hatch assembly", /obj/structure/door_assembly/door_assembly_mhatch, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("standard airlock assembly", /obj/structure/door_assembly, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("public airlock assembly", /obj/structure/door_assembly/door_assembly_public, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("command airlock assembly", /obj/structure/door_assembly/door_assembly_com, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("security airlock assembly", /obj/structure/door_assembly/door_assembly_sec, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("engineering airlock assembly", /obj/structure/door_assembly/door_assembly_eng, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("mining airlock assembly", /obj/structure/door_assembly/door_assembly_min, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("atmospherics airlock assembly", /obj/structure/door_assembly/door_assembly_atmo, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("research airlock assembly", /obj/structure/door_assembly/door_assembly_research, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("freezer airlock assembly", /obj/structure/door_assembly/door_assembly_fre, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("science airlock assembly", /obj/structure/door_assembly/door_assembly_science, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("medical airlock assembly", /obj/structure/door_assembly/door_assembly_med, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("hydroponics airlock assembly", /obj/structure/door_assembly/door_assembly_hydro, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("virology airlock assembly", /obj/structure/door_assembly/door_assembly_viro, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("maintenance airlock assembly", /obj/structure/door_assembly/door_assembly_mai, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("external airlock assembly", /obj/structure/door_assembly/door_assembly_ext, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("external maintenance airlock assembly", /obj/structure/door_assembly/door_assembly_extmai, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("airtight hatch assembly", /obj/structure/door_assembly/door_assembly_hatch, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ + new /datum/stack_recipe("maintenance hatch assembly", /obj/structure/door_assembly/door_assembly_mhatch, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), \ )), \ null, \ - new/datum/stack_recipe("firelock frame", /obj/structure/firelock_frame, 3, time = 50, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("turret frame", /obj/machinery/porta_turret_construct, 5, time = 25, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("meatspike frame", /obj/structure/kitchenspike_frame, 5, time = 25, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("reflector frame", /obj/structure/reflector, 5, time = 25, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("firelock frame", /obj/structure/firelock_frame, 3, time = 5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("turret frame", /obj/machinery/porta_turret_construct, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("meatspike frame", /obj/structure/kitchenspike_frame, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("reflector frame", /obj/structure/reflector, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ null, \ new/datum/stack_recipe("grenade casing", /obj/item/grenade/chem_grenade), \ new/datum/stack_recipe("light fixture frame", /obj/item/wallframe/light_fixture, 2), \ @@ -120,8 +120,8 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ new/datum/stack_recipe("filing cabinet", /obj/structure/filingcabinet, 2, time = 10 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ new/datum/stack_recipe("desk bell", /obj/structure/desk_bell, 2, time = 3 SECONDS), \ new/datum/stack_recipe("floodlight frame", /obj/structure/floodlight_frame, 5, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("voting box", /obj/structure/votebox, 15, time = 50), \ - new/datum/stack_recipe("pestle", /obj/item/pestle, 1, time = 50), \ + new/datum/stack_recipe("voting box", /obj/structure/votebox, 15, time = 5 SECONDS), \ + new/datum/stack_recipe("pestle", /obj/item/pestle, 1, time = 5 SECONDS), \ new/datum/stack_recipe("hygienebot assembly", /obj/item/bot_assembly/hygienebot, 2, time = 5 SECONDS), \ new/datum/stack_recipe("shower frame", /obj/structure/showerframe, 2, time= 2 SECONDS) )) @@ -240,13 +240,13 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ * Plasteel */ GLOBAL_LIST_INIT(plasteel_recipes, list ( \ - new/datum/stack_recipe("AI core", /obj/structure/ai_core, 4, time = 50, one_per_turf = TRUE), - new/datum/stack_recipe("bomb assembly", /obj/machinery/syndicatebomb/empty, 10, time = 50), + new/datum/stack_recipe("AI core", /obj/structure/ai_core, 4, time = 5 SECONDS, one_per_turf = TRUE), + new/datum/stack_recipe("bomb assembly", /obj/machinery/syndicatebomb/empty, 10, time = 5 SECONDS), new/datum/stack_recipe("Large Gas Tank", /obj/structure/tank_frame, 4, time=1 SECONDS, one_per_turf=TRUE), null, new /datum/stack_recipe_list("airlock assemblies", list( \ - new/datum/stack_recipe("high security airlock assembly", /obj/structure/door_assembly/door_assembly_highsecurity, 4, time = 50, one_per_turf = 1, on_solid_ground = 1), - new/datum/stack_recipe("vault door assembly", /obj/structure/door_assembly/door_assembly_vault, 6, time = 50, one_per_turf = 1, on_solid_ground = 1), + new/datum/stack_recipe("high security airlock assembly", /obj/structure/door_assembly/door_assembly_highsecurity, 4, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), + new/datum/stack_recipe("vault door assembly", /obj/structure/door_assembly/door_assembly_vault, 6, time = 5 SECONDS, one_per_turf = 1, on_solid_ground = 1), )), \ )) @@ -285,36 +285,36 @@ GLOBAL_LIST_INIT(plasteel_recipes, list ( \ GLOBAL_LIST_INIT(wood_recipes, list ( \ new/datum/stack_recipe("wooden sandals", /obj/item/clothing/shoes/sandal, 1), \ new/datum/stack_recipe("wood floor tile", /obj/item/stack/tile/wood, 1, 4, 20), \ - new/datum/stack_recipe("wood table frame", /obj/structure/table_frame/wood, 2, time = 10), \ - new/datum/stack_recipe("rolling pin", /obj/item/kitchen/rollingpin, 2, time = 30), \ - new/datum/stack_recipe("wooden chair", /obj/structure/chair/wood/, 3, time = 10, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("winged wooden chair", /obj/structure/chair/wood/wings, 3, time = 10, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("wooden barricade", /obj/structure/barricade/wooden, 5, time = 50, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("wooden door", /obj/structure/mineral_door/wood, 10, time = 20, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("wood table frame", /obj/structure/table_frame/wood, 2, time = 1 SECONDS), \ + new/datum/stack_recipe("rolling pin", /obj/item/kitchen/rollingpin, 2, time = 3 SECONDS), \ + new/datum/stack_recipe("wooden chair", /obj/structure/chair/wood/, 3, time = 1 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("winged wooden chair", /obj/structure/chair/wood/wings, 3, time = 1 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("wooden barricade", /obj/structure/barricade/wooden, 5, time = 5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("wooden door", /obj/structure/mineral_door/wood, 10, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ new/datum/stack_recipe("wooden stairs frame", /obj/structure/stairs_frame/wood, 10, time = 5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("coffin", /obj/structure/closet/crate/coffin, 5, time = 15, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("book case", /obj/structure/bookcase, 4, time = 15, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("drying rack", /obj/machinery/smartfridge/drying_rack, 10, time = 15, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("wooden barrel", /obj/structure/fermenting_barrel, 8, time = 50, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("dog bed", /obj/structure/bed/dogbed, 10, time = 10, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("dresser", /obj/structure/dresser, 10, time = 15, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("picture frame", /obj/item/wallframe/picture, 1, time = 10),\ - new/datum/stack_recipe("painting frame", /obj/item/wallframe/painting, 1, time = 10),\ + new/datum/stack_recipe("coffin", /obj/structure/closet/crate/coffin, 5, time = 1.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("book case", /obj/structure/bookcase, 4, time = 1.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("drying rack", /obj/machinery/smartfridge/drying_rack, 10, time = 1.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("wooden barrel", /obj/structure/fermenting_barrel, 8, time = 5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("dog bed", /obj/structure/bed/dogbed, 10, time = 1 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("dresser", /obj/structure/dresser, 10, time = 1.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("picture frame", /obj/item/wallframe/picture, 1, time = 1 SECONDS),\ + new/datum/stack_recipe("painting frame", /obj/item/wallframe/painting, 1, time = 1 SECONDS),\ new/datum/stack_recipe("display case chassis", /obj/structure/displaycase_chassis, 5, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("wooden buckler", /obj/item/shield/riot/buckler, 20, time = 40), \ - new/datum/stack_recipe("apiary", /obj/structure/beebox, 40, time = 50),\ + new/datum/stack_recipe("wooden buckler", /obj/item/shield/riot/buckler, 20, time = 4 SECONDS), \ + new/datum/stack_recipe("apiary", /obj/structure/beebox, 40, time = 5 SECONDS),\ new/datum/stack_recipe("tiki mask", /obj/item/clothing/mask/gas/tiki_mask, 2), \ - new/datum/stack_recipe("honey frame", /obj/item/honey_frame, 5, time = 10),\ - new/datum/stack_recipe("wooden bucket", /obj/item/reagent_containers/cup/bucket/wooden, 3, time = 10),\ - new/datum/stack_recipe("rake", /obj/item/cultivator/rake, 5, time = 10),\ - new/datum/stack_recipe("ore box", /obj/structure/ore_box, 4, time = 50, one_per_turf = TRUE, on_solid_ground = TRUE),\ - new/datum/stack_recipe("wooden crate", /obj/structure/closet/crate/wooden, 6, time = 50, one_per_turf = TRUE, on_solid_ground = TRUE),\ - new/datum/stack_recipe("baseball bat", /obj/item/melee/baseball_bat, 5, time = 15),\ - new/datum/stack_recipe("loom", /obj/structure/loom, 10, time = 15, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("honey frame", /obj/item/honey_frame, 5, time = 1 SECONDS),\ + new/datum/stack_recipe("wooden bucket", /obj/item/reagent_containers/cup/bucket/wooden, 3, time = 1 SECONDS),\ + new/datum/stack_recipe("rake", /obj/item/cultivator/rake, 5, time = 1 SECONDS),\ + new/datum/stack_recipe("ore box", /obj/structure/ore_box, 4, time = 5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE),\ + new/datum/stack_recipe("wooden crate", /obj/structure/closet/crate/wooden, 6, time = 5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE),\ + new/datum/stack_recipe("baseball bat", /obj/item/melee/baseball_bat, 5, time = 1.5 SECONDS),\ + new/datum/stack_recipe("loom", /obj/structure/loom, 10, time = 1.5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ new/datum/stack_recipe("mortar", /obj/item/reagent_containers/cup/mortar, 3), \ - new/datum/stack_recipe("firebrand", /obj/item/match/firebrand, 2, time = 100), \ - new/datum/stack_recipe("bonfire", /obj/structure/bonfire, 10, time = 60, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("easel", /obj/structure/easel, 5, time = 10, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("firebrand", /obj/item/match/firebrand, 2, time = 10 SECONDS), \ + new/datum/stack_recipe("bonfire", /obj/structure/bonfire, 10, time = 6 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("easel", /obj/structure/easel, 5, time = 1 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ null, \ new/datum/stack_recipe_list("pews", list( new /datum/stack_recipe("pew (middle)", /obj/structure/chair/pew, 3, one_per_turf = TRUE, on_solid_ground = TRUE), @@ -354,18 +354,19 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \ */ GLOBAL_LIST_INIT(bamboo_recipes, list ( \ - new/datum/stack_recipe("punji sticks trap", /obj/structure/punji_sticks, 5, time = 30, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("bamboo spear", /obj/item/spear/bamboospear, 25, time = 90), \ - new/datum/stack_recipe("blow gun", /obj/item/gun/syringe/blowgun, 10, time = 70), \ - new/datum/stack_recipe("crude syringe", /obj/item/reagent_containers/syringe/crude, 5, time = 10), \ + new/datum/stack_recipe("punji sticks trap", /obj/structure/punji_sticks, 5, time = 3 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("bamboo spear", /obj/item/spear/bamboospear, 25, time = 9 SECONDS), \ + new/datum/stack_recipe("blow gun", /obj/item/gun/syringe/blowgun, 10, time = 7 SECONDS), \ + new/datum/stack_recipe("crude syringe", /obj/item/reagent_containers/syringe/crude, 5, time = 1 SECONDS), \ + new/datum/stack_recipe("rice hat", /obj/item/clothing/head/costume/rice_hat, 10, time = 7 SECONDS), \ null, \ - new/datum/stack_recipe("bamboo stool", /obj/structure/chair/stool/bamboo, 2, time = 10, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("bamboo stool", /obj/structure/chair/stool/bamboo, 2, time = 1 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ new/datum/stack_recipe("bamboo mat piece", /obj/item/stack/tile/bamboo, 1, 4, 20), \ null, \ new/datum/stack_recipe_list("bamboo benches", list( - new /datum/stack_recipe("bamboo bench (middle)", /obj/structure/chair/sofa/bamboo, 3, time = 10, one_per_turf = TRUE, on_solid_ground = TRUE), - new /datum/stack_recipe("bamboo bench (left)", /obj/structure/chair/sofa/bamboo/left, 3, time = 10, one_per_turf = TRUE, on_solid_ground = TRUE), - new /datum/stack_recipe("bamboo bench (right)", /obj/structure/chair/sofa/bamboo/right, 3, time = 10, one_per_turf = TRUE, on_solid_ground = TRUE) + new /datum/stack_recipe("bamboo bench (middle)", /obj/structure/chair/sofa/bamboo, 3, time = 1 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), + new /datum/stack_recipe("bamboo bench (left)", /obj/structure/chair/sofa/bamboo/left, 3, time = 1 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), + new /datum/stack_recipe("bamboo bench (right)", /obj/structure/chair/sofa/bamboo/right, 3, time = 1 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE) )), \ )) @@ -458,10 +459,10 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \ amount = 5 GLOBAL_LIST_INIT(durathread_recipes, list ( \ - new/datum/stack_recipe("durathread jumpsuit", /obj/item/clothing/under/misc/durathread, 4, time = 40), - new/datum/stack_recipe("durathread beret", /obj/item/clothing/head/beret/durathread, 2, time = 40), \ - new/datum/stack_recipe("durathread beanie", /obj/item/clothing/head/beanie/durathread, 2, time = 40), \ - new/datum/stack_recipe("durathread bandana", /obj/item/clothing/mask/bandana/durathread, 1, time = 25), \ + new/datum/stack_recipe("durathread jumpsuit", /obj/item/clothing/under/misc/durathread, 4, time = 4 SECONDS), + new/datum/stack_recipe("durathread beret", /obj/item/clothing/head/beret/durathread, 2, time = 4 SECONDS), \ + new/datum/stack_recipe("durathread beanie", /obj/item/clothing/head/beanie/durathread, 2, time = 4 SECONDS), \ + new/datum/stack_recipe("durathread bandana", /obj/item/clothing/mask/bandana/durathread, 1, time = 2.5 SECONDS), \ )) /obj/item/stack/sheet/durathread @@ -619,12 +620,12 @@ GLOBAL_LIST_INIT(cardboard_recipes, list ( \ */ GLOBAL_LIST_INIT(bronze_recipes, list ( \ - new/datum/stack_recipe("wall gear", /obj/structure/girder/bronze, 2, time = 20, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("wall gear", /obj/structure/girder/bronze, 2, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ null, new/datum/stack_recipe("directional bronze window", /obj/structure/window/bronze/unanchored, time = 0, on_solid_ground = TRUE, window_checks = TRUE), \ new/datum/stack_recipe("fulltile bronze window", /obj/structure/window/bronze/fulltile/unanchored, 2, time = 0, on_solid_ground = TRUE, window_checks = TRUE), \ - new/datum/stack_recipe("pinion airlock assembly", /obj/structure/door_assembly/door_assembly_bronze, 4, time = 50, one_per_turf = TRUE, on_solid_ground = TRUE), \ - new/datum/stack_recipe("bronze pinion airlock assembly", /obj/structure/door_assembly/door_assembly_bronze/seethru, 4, time = 50, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("pinion airlock assembly", /obj/structure/door_assembly/door_assembly_bronze, 4, time = 5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ + new/datum/stack_recipe("bronze pinion airlock assembly", /obj/structure/door_assembly/door_assembly_bronze/seethru, 4, time = 5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE), \ new/datum/stack_recipe("bronze floor tile", /obj/item/stack/tile/bronze, 1, 4, 20), \ new/datum/stack_recipe("bronze hat", /obj/item/clothing/head/costume/bronze), \ new/datum/stack_recipe("bronze suit", /obj/item/clothing/suit/costume/bronze), \ @@ -715,7 +716,7 @@ GLOBAL_LIST_INIT(bronze_recipes, list ( \ GLOBAL_LIST_INIT(plastic_recipes, list( new /datum/stack_recipe("plastic floor tile", /obj/item/stack/tile/plastic, 1, 4, 20), \ new /datum/stack_recipe("folding plastic chair", /obj/structure/chair/plastic, 2), \ - new /datum/stack_recipe("plastic flaps", /obj/structure/plasticflaps, 5, one_per_turf = TRUE, on_solid_ground = TRUE, time = 40), \ + new /datum/stack_recipe("plastic flaps", /obj/structure/plasticflaps, 5, one_per_turf = TRUE, on_solid_ground = TRUE, time = 4 SECONDS), \ new /datum/stack_recipe("water bottle", /obj/item/reagent_containers/cup/glass/waterbottle/empty), \ new /datum/stack_recipe("large water bottle", /obj/item/reagent_containers/cup/glass/waterbottle/large/empty, 3), \ new /datum/stack_recipe("colo cups", /obj/item/reagent_containers/cup/glass/colocup, 1), \ @@ -745,8 +746,8 @@ GLOBAL_LIST_INIT(plastic_recipes, list( . += GLOB.plastic_recipes GLOBAL_LIST_INIT(paperframe_recipes, list( -new /datum/stack_recipe("paper frame separator", /obj/structure/window/paperframe, 2, one_per_turf = TRUE, on_solid_ground = TRUE, time = 10), \ -new /datum/stack_recipe("paper frame door", /obj/structure/mineral_door/paperframe, 3, one_per_turf = TRUE, on_solid_ground = TRUE, time = 10 ))) +new /datum/stack_recipe("paper frame separator", /obj/structure/window/paperframe, 2, one_per_turf = TRUE, on_solid_ground = TRUE, time = 1 SECONDS), \ +new /datum/stack_recipe("paper frame door", /obj/structure/mineral_door/paperframe, 3, one_per_turf = TRUE, on_solid_ground = TRUE, time = 1 SECONDS ))) /obj/item/stack/sheet/paperframes name = "paper frames" diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm index 3f3152a5ef9..6939bcd351c 100644 --- a/code/modules/hydroponics/biogenerator.dm +++ b/code/modules/hydroponics/biogenerator.dm @@ -2,26 +2,32 @@ name = "biogenerator" desc = "Converts plants into biomass, which can be used to construct useful items." icon = 'icons/obj/machines/biogenerator.dmi' - icon_state = "biogen-empty" + icon_state = "biogenerator" density = TRUE circuit = /obj/item/circuitboard/machine/biogenerator + light_power = 1 + light_range = MINIMUM_USEFUL_LIGHT_RANGE var/processing = FALSE var/obj/item/reagent_containers/cup/beaker = null - var/points = 0 + var/biomass = 0 var/efficiency = 0 var/productivity = 0 - var/max_items = 40 + var/max_items = 20 + var/max_biomass = 500 + var/max_output = 50 var/datum/techweb/stored_research - var/list/show_categories = list(RND_CATEGORY_FOOD, RND_CATEGORY_BOTANY_CHEMICALS, RND_CATEGORY_ORGANIC_MATERIALS) - /// Currently selected category in the UI + var/list/show_categories = list(RND_CATEGORY_BIO_FOOD, RND_CATEGORY_BIO_CHEMICALS, RND_CATEGORY_BIO_MATERIALS) var/selected_cat + var/datum/looping_sound/generator/soundloop /obj/machinery/biogenerator/Initialize(mapload) . = ..() stored_research = new /datum/techweb/specialized/autounlocking/biogenerator + soundloop = new(src, processing) /obj/machinery/biogenerator/Destroy() QDEL_NULL(beaker) + QDEL_NULL(soundloop) return ..() /obj/machinery/biogenerator/contents_explosion(severity, target) @@ -47,43 +53,58 @@ . = ..() var/E = 0 var/P = 0 - var/max_storage = 40 + var/I = 10 + var/V = 0 for(var/obj/item/stock_parts/matter_bin/B in component_parts) - P += B.rating - max_storage = 40 * B.rating + I += 10 * B.rating + V += 500 * B.rating for(var/obj/item/stock_parts/manipulator/M in component_parts) + P += M.rating E += M.rating efficiency = E productivity = P - max_items = max_storage + max_items = I + max_biomass = V + update_appearance() /obj/machinery/biogenerator/examine(mob/user) . = ..() if(in_range(user, src) || isobserver(user)) - . += span_notice("The status display reads: Productivity at [productivity*100]%.
Matter consumption reduced by [(efficiency*25)-25]%.
Machine can hold up to [max_items] pieces of produce.") + . += span_notice("The status display reads: Productivity at [productivity*100]%.
Matter consumption reduced by [(efficiency*25)-25]%.
Machine can hold up to [max_items] pieces of produce.
And up to [max_biomass] units of biomass.") -/obj/machinery/biogenerator/update_icon_state() +/obj/machinery/biogenerator/update_appearance() + . = ..() + if((machine_stat & (NOPOWER|BROKEN)) || panel_open) + luminosity = 0 + return + luminosity = 1 + ROUND_UP(2 * biomass / max_biomass) + (processing & 1) + +/obj/machinery/biogenerator/update_overlays() + . = ..() if(panel_open) - icon_state = "biogen-empty-o" - return ..() - if(!beaker) - icon_state = "biogen-empty" - return ..() - if(!processing) - icon_state = "biogen-stand" - return ..() - icon_state = "biogen-work" - return ..() + . += mutable_appearance(icon, "[icon_state]_o_panel", alpha = alpha) + if(beaker) + . += mutable_appearance(icon, "[icon_state]_o_container", alpha = alpha) + if(biomass > 0) + var/biomass_level = min(ROUND_UP(7 * biomass / max_biomass), 7) + . += mutable_appearance(icon, "[icon_state]_o_biomass_[biomass_level]", alpha = alpha) + . += emissive_appearance(icon, "[icon_state]_o_biomass_[biomass_level]", src, alpha = alpha) + if(machine_stat & (NOPOWER|BROKEN)) + return + if(processing) + . += mutable_appearance(icon, "[icon_state]_o_process", alpha = alpha) + . += emissive_appearance(icon, "[icon_state]_o_process", src, alpha = alpha) + . += mutable_appearance(icon, "[icon_state]_o_screen", alpha = alpha) + . += emissive_appearance(icon, "[icon_state]_o_screen", src, alpha = alpha) /obj/machinery/biogenerator/attackby(obj/item/O, mob/living/user, params) if(user.combat_mode) return ..() - if(processing) - to_chat(user, span_warning("The biogenerator is currently processing.")) - return - - if(default_deconstruction_screwdriver(user, "biogen-empty-o", "biogen-empty", O)) + if(default_deconstruction_screwdriver(user, icon_state, icon_state, O)) + if(processing) + processing = FALSE + soundloop.stop() if(beaker) var/obj/item/reagent_containers/cup/B = beaker B.forceMove(drop_location()) @@ -91,7 +112,12 @@ update_appearance() return + var/turf/drop_location = drop_location() if(default_deconstruction_crowbar(O)) + if(biomass > 0) + drop_location.visible_message(span_warning("The biomass spills!")) + playsound(drop_location, 'sound/effects/slosh.ogg', 25, vary = TRUE) + new /obj/effect/decal/cleanable/greenglow(drop_location) return if(istype(O, /obj/item/reagent_containers/cup)) @@ -99,33 +125,32 @@ to_chat(user, span_warning("Close the maintenance panel first.")) else insert_beaker(user, O) - return TRUE - else if(istype(O, /obj/item/storage/bag/plants)) - var/obj/item/storage/bag/plants/PB = O + else if(istype(O, /obj/item/storage/bag)) + var/obj/item/storage/bag/bag = O var/i = 0 - for(var/obj/item/food/grown/G in contents) + for(var/obj/item/food/item in contents) i++ if(i >= max_items) to_chat(user, span_warning("The biogenerator is already full! Activate it.")) else - for(var/obj/item/food/grown/G in PB.contents) + for(var/obj/item/food/item in bag.contents) if(i >= max_items) break - if(PB.atom_storage.attempt_remove(G, src)) + if(bag.atom_storage.attempt_remove(item, src)) i++ - if(i= max_items) + to_chat(user, span_info("You fill the biogenerator from the bag to its capacity.")) else - to_chat(user, span_info("You fill the biogenerator to its capacity.")) + to_chat(user, span_info("You fill the biogenerator from the bag.")) return TRUE //no afterattack - else if(istype(O, /obj/item/food/grown)) + else if(istype(O, /obj/item/food)) var/i = 0 - for(var/obj/item/food/grown/G in contents) + for(var/obj/item/food/item in contents) i++ if(i >= max_items) to_chat(user, span_warning("The biogenerator is full! Activate it.")) @@ -154,7 +179,7 @@ eject_beaker(user) /** - * activate: Activates biomass processing and converts all inserted grown products into biomass + * activate: Activates biomass processing and converts all inserted food products into biomass * * Arguments: * * user The mob starting the biomass processing @@ -167,74 +192,55 @@ if(processing) to_chat(user, span_warning("The biogenerator is in the process of working.")) return - var/processing_time = 0 - for(var/obj/item/food/grown/I in contents) - processing_time += 5 - if(I.reagents.get_reagent_amount(/datum/reagent/consumable/nutriment) < 0.1) - points += 1 * productivity - else - points += I.reagents.get_reagent_amount(/datum/reagent/consumable/nutriment) * 10 * productivity - qdel(I) - if(processing_time) + if(biomass >= max_biomass) + say("Warning: The biomass storage is full!") + return + if(locate(/obj/item/food) in contents) processing = TRUE + soundloop.start() update_appearance() - playsound(loc, 'sound/machines/blender.ogg', 50, TRUE) - use_power(processing_time * active_power_usage * 0.1) // .1 needed here to convert time (in deciseconds) to seconds such that watts * seconds = joules - sleep(processing_time + 15 / productivity) + for(var/obj/item/food/object in contents) + var/nutriments = 0 + for(var/nutriment in typesof(/datum/reagent/consumable/nutriment)) + nutriments += object.reagents.get_reagent_amount(nutriment) + qdel(object) + var/potential_biomass = max(1, nutriments) * productivity + while(processing && potential_biomass > 0) + use_power(active_power_usage * (1 SECONDS)) // Seconds needed here to convert time (in deciseconds) to seconds such that watts * seconds = joules + potential_biomass -= 1 + biomass += 1 + stoplag(2 / productivity) + update_appearance(UPDATE_ICON) processing = FALSE + soundloop.stop() update_appearance() -/obj/machinery/biogenerator/proc/check_cost(list/materials, multiplier = 1, remove_points = TRUE) +/obj/machinery/biogenerator/proc/use_biomass(list/materials, amount = 1, remove_biomass = TRUE) if(materials.len != 1 || materials[1] != GET_MATERIAL_REF(/datum/material/biomass)) return FALSE - if (materials[GET_MATERIAL_REF(/datum/material/biomass)]*multiplier/efficiency > points) + if (ROUND_UP(materials[GET_MATERIAL_REF(/datum/material/biomass)]*amount/efficiency) > biomass) return FALSE else - if(remove_points) - points -= materials[GET_MATERIAL_REF(/datum/material/biomass)]*multiplier/efficiency + if(remove_biomass) + biomass -= ROUND_UP(materials[GET_MATERIAL_REF(/datum/material/biomass)]*amount/efficiency) update_appearance() return TRUE -/obj/machinery/biogenerator/proc/check_container_volume(list/reagents, multiplier = 1) - var/sum_reagents = 0 - for(var/R in reagents) - sum_reagents += reagents[R] - sum_reagents *= multiplier - - if(beaker.reagents.total_volume + sum_reagents > beaker.reagents.maximum_volume) - return FALSE - - return TRUE - /obj/machinery/biogenerator/proc/create_product(datum/design/D, amount) - if(!beaker || !loc) - return FALSE - - if(ispath(D.build_path, /obj/item/stack)) - if(!check_container_volume(D.make_reagents, amount)) + if(D.make_reagents.len > 0) + if(!beaker) return FALSE - if(!check_cost(D.materials, amount)) + if(beaker.reagents.maximum_volume - beaker.reagents.total_volume < amount) + say("Warning: Attached container does not have enough free capacity!") + return FALSE + if(!use_biomass(D.materials, amount)) + return FALSE + beaker.reagents.add_reagent(D.make_reagents[1], amount) + if(D.build_path) + if(!use_biomass(D.materials, amount)) return FALSE - new D.build_path(drop_location(), amount) - for(var/R in D.make_reagents) - beaker.reagents.add_reagent(R, D.make_reagents[R]*amount) - else - var/i = amount - while(i > 0) - if(!check_container_volume(D.make_reagents)) - say("Warning: Attached container does not have enough free capacity!") - return . - if(!check_cost(D.materials)) - return . - if(D.build_path) - new D.build_path(loc) - for(var/R in D.make_reagents) - beaker.reagents.add_reagent(R, D.make_reagents[R]) - . = 1 - --i - update_appearance() - return . + return TRUE /* * Insert a new beaker into the biogenerator, replacing/swapping our current beaker if there is one. @@ -301,9 +307,12 @@ /obj/machinery/biogenerator/ui_data(mob/user) var/list/data = list() data["beaker"] = beaker ? TRUE : FALSE - data["biomass"] = points + data["biomass"] = biomass + data["max_biomass"] = max_biomass data["processing"] = processing - if(locate(/obj/item/food/grown) in contents) + data["max_output"] = max_output + data["efficiency"] = efficiency + if((locate(/obj/item/food) in contents) && biomass < max_biomass) data["can_process"] = TRUE else data["can_process"] = FALSE @@ -335,6 +344,7 @@ cat["items"] += list(list( "id" = D.id, "name" = D.name, + "is_reagent" = D.make_reagents.len > 0, "cost" = D.materials[GET_MATERIAL_REF(/datum/material/biomass)]/efficiency, )) data["categories"] += list(cat) @@ -355,7 +365,6 @@ return TRUE if("create") var/amount = text2num(params["amount"]) - amount = clamp(amount, 1, 10) if(!amount) return var/id = params["id"] @@ -363,6 +372,7 @@ stack_trace("ID did not map to a researched datum [id]") return var/datum/design/D = SSresearch.techweb_design_by_id(id) + amount = clamp(amount, 1, (D.make_reagents.len > 0 && beaker ? beaker.reagents.maximum_volume - beaker.reagents.total_volume : max_output)) if(D && !istype(D, /datum/design/error_design)) create_product(D, amount) else diff --git a/code/modules/research/designs/biogenerator_designs.dm b/code/modules/research/designs/biogenerator_designs.dm index f4fbe183ec4..a6902e32f61 100644 --- a/code/modules/research/designs/biogenerator_designs.dm +++ b/code/modules/research/designs/biogenerator_designs.dm @@ -3,225 +3,185 @@ /////////////////////////////////// /datum/design/milk - name = "10u Milk" + name = "Milk" id = "milk" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 20) - make_reagents = list(/datum/reagent/consumable/milk = 10) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_FOOD) + materials = list(/datum/material/biomass= 0.4) + make_reagents = list(/datum/reagent/consumable/milk = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_FOOD) /datum/design/soymilk - name = "10u Soy Milk" + name = "Soy Milk" id = "soymilk" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 20) - make_reagents = list(/datum/reagent/consumable/soymilk = 10) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_FOOD) + materials = list(/datum/material/biomass= 0.4) + make_reagents = list(/datum/reagent/consumable/soymilk = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_FOOD) /datum/design/ethanol - name = "10u Ethanol" + name = "Ethanol" id = "ethanol" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 30) - make_reagents = list(/datum/reagent/consumable/ethanol = 10) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_FOOD) + materials = list(/datum/material/biomass= 0.6) + make_reagents = list(/datum/reagent/consumable/ethanol = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_FOOD) /datum/design/cream - name = "10u Cream" + name = "Cream" id = "cream" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 30) - make_reagents = list(/datum/reagent/consumable/cream = 10) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_FOOD) + materials = list(/datum/material/biomass= 0.6) + make_reagents = list(/datum/reagent/consumable/cream = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_FOOD) /datum/design/black_pepper - name = "10u Black Pepper" + name = "Black Pepper" id = "black_pepper" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 25) - make_reagents = list(/datum/reagent/consumable/blackpepper = 10) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_FOOD) + materials = list(/datum/material/biomass= 0.6) + make_reagents = list(/datum/reagent/consumable/blackpepper = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_FOOD) /datum/design/enzyme - name = "10u Universal Enzyme" + name = "Universal Enzyme" id = "enzyme" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 30) - make_reagents = list(/datum/reagent/consumable/enzyme = 10) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_FOOD) + materials = list(/datum/material/biomass= 0.6) + make_reagents = list(/datum/reagent/consumable/enzyme = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_FOOD) /datum/design/flour - name = "10u Flour" + name = "Flour" id = "flour_sack" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 30) - make_reagents = list(/datum/reagent/consumable/flour = 10) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_FOOD) + materials = list(/datum/material/biomass= 0.6) + make_reagents = list(/datum/reagent/consumable/flour = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_FOOD) /datum/design/sugar - name = "10u Sugar" + name = "Sugar" id = "sugar" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 30) - make_reagents = list(/datum/reagent/consumable/sugar = 10) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_FOOD) + materials = list(/datum/material/biomass= 0.6) + make_reagents = list(/datum/reagent/consumable/sugar = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_FOOD) /datum/design/monkey_cube name = "Monkey Cube" id = "mcube" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 250) + materials = list(/datum/material/biomass= 50) build_path = /obj/item/food/monkeycube - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_FOOD) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_FOOD) /datum/design/seaweed_sheet name = "Seaweed sheet" id = "seaweedsheet" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 30) + materials = list(/datum/material/biomass= 3) build_path = /obj/item/food/seaweedsheet - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_FOOD) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_FOOD) /datum/design/ez_nut //easy nut :) - name = "25u E-Z Nutrient" + name = "E-Z Nutrient" id = "ez_nut" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 10) - make_reagents = list(/datum/reagent/plantnutriment/eznutriment = 25) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BOTANY_CHEMICALS) + materials = list(/datum/material/biomass= 0.1) + make_reagents = list(/datum/reagent/plantnutriment/eznutriment = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_CHEMICALS) /datum/design/l4z_nut - name = "25u Left 4 Zed" + name = "Left 4 Zed" id = "l4z_nut" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 20) - make_reagents = list(/datum/reagent/plantnutriment/left4zednutriment = 25) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BOTANY_CHEMICALS) + materials = list(/datum/material/biomass= 0.1) + make_reagents = list(/datum/reagent/plantnutriment/left4zednutriment = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_CHEMICALS) /datum/design/rh_nut - name = "25u Robust Harvest" + name = "Robust Harvest" id = "rh_nut" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 25) - make_reagents = list(/datum/reagent/plantnutriment/robustharvestnutriment = 25) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BOTANY_CHEMICALS) + materials = list(/datum/material/biomass= 0.2) + make_reagents = list(/datum/reagent/plantnutriment/robustharvestnutriment = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_CHEMICALS) /datum/design/end_gro - name = "25u Enduro Grow" + name = "Enduro Grow" id = "end_gro" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 30) - make_reagents = list(/datum/reagent/plantnutriment/endurogrow = 25) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BOTANY_CHEMICALS) + materials = list(/datum/material/biomass= 0.3) + make_reagents = list(/datum/reagent/plantnutriment/endurogrow = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_CHEMICALS) /datum/design/liq_earth - name = "25u Liquid Earthquake" + name = "Liquid Earthquake" id = "liq_earth" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 30) - make_reagents = list(/datum/reagent/plantnutriment/liquidearthquake = 25) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BOTANY_CHEMICALS) + materials = list(/datum/material/biomass= 0.3) + make_reagents = list(/datum/reagent/plantnutriment/liquidearthquake = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_CHEMICALS) /datum/design/weed_killer - name = "25u Weed Killer" + name = "Weed Killer" id = "weed_killer" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 50) - make_reagents = list(/datum/reagent/toxin/plantbgone/weedkiller = 25) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BOTANY_CHEMICALS) + materials = list(/datum/material/biomass= 0.2) + make_reagents = list(/datum/reagent/toxin/plantbgone/weedkiller = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_CHEMICALS) /datum/design/pest_spray - name = "25u Pest Killer" + name = "Pest Killer" id = "pest_spray" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 50) - make_reagents = list(/datum/reagent/toxin/pestkiller = 25) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BOTANY_CHEMICALS) + materials = list(/datum/material/biomass= 0.4) + make_reagents = list(/datum/reagent/toxin/pestkiller = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_CHEMICALS) /datum/design/org_pest_spray - name = "25u Organic Pest Killer" + name = "Organic Pest Killer" id = "org_pest_spray" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 80) - make_reagents = list(/datum/reagent/toxin/pestkiller/organic = 25) - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BOTANY_CHEMICALS) - -/datum/design/cloth - name = "Roll of Cloth" - id = "cloth" - build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 50) - build_path = /obj/item/stack/sheet/cloth - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_ORGANIC_MATERIALS) - -/datum/design/cardboard - name = "Sheet of Cardboard" - id = "cardboard" - build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 25) - build_path = /obj/item/stack/sheet/cardboard - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_ORGANIC_MATERIALS) - -/datum/design/rolling_paper_pack - name = "Rolling Paper Pack" - id = "rolling_paper_pack" - build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 50) - build_path = /obj/item/storage/fancy/rollingpapers - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_ORGANIC_MATERIALS) + materials = list(/datum/material/biomass= 0.6) + make_reagents = list(/datum/reagent/toxin/pestkiller/organic = 1) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_CHEMICALS) /datum/design/leather name = "Sheet of Leather" id = "leather" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 150) + materials = list(/datum/material/biomass= 30) build_path = /obj/item/stack/sheet/leather - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_ORGANIC_MATERIALS) + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_MATERIALS) -/datum/design/secbelt - name = "Security Belt" - id = "secbelt" +/datum/design/cloth + name = "Sheet of Cloth" + id = "cloth" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 300) - build_path = /obj/item/storage/belt/security - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_ORGANIC_MATERIALS) + materials = list(/datum/material/biomass= 10) + build_path = /obj/item/stack/sheet/cloth + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_MATERIALS) -/datum/design/medbelt - name = "Medical Belt" - id = "medbel" +/datum/design/cardboard + name = "Sheet of Cardboard" + id = "cardboard" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 300) - build_path = /obj/item/storage/belt/medical - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_ORGANIC_MATERIALS) + materials = list(/datum/material/biomass= 5) + build_path = /obj/item/stack/sheet/cardboard + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_MATERIALS) -/datum/design/janibelt - name = "Janitorial Belt" - id = "janibelt" +/datum/design/paper + name = "Sheet of Paper" + id = "paper" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 300) - build_path = /obj/item/storage/belt/janitor - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_ORGANIC_MATERIALS) + materials = list(/datum/material/biomass= 2) + build_path = /obj/item/paper + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_MATERIALS) -/datum/design/plantbelt - name = "Botanical Belt" - id = "plantbelt" +/datum/design/rolling_paper + name = "Sheet of Rolling Paper" + id = "rollingpaper" build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 300) - build_path = /obj/item/storage/belt/plant - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_ORGANIC_MATERIALS) - -/datum/design/s_holster - name = "Shoulder Holster" - id = "s_holster" - build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 400) - build_path = /obj/item/storage/belt/holster - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_ORGANIC_MATERIALS) - -/datum/design/rice_hat - name = "Rice Hat" - id = "rice_hat" - build_type = BIOGENERATOR - materials = list(/datum/material/biomass= 300) - build_path = /obj/item/clothing/head/costume/rice_hat - category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_ORGANIC_MATERIALS) + materials = list(/datum/material/biomass= 1) + build_path = /obj/item/rollingpaper + category = list(RND_CATEGORY_INITIAL, RND_CATEGORY_BIO_MATERIALS) diff --git a/icons/obj/machines/biogenerator.dmi b/icons/obj/machines/biogenerator.dmi index 7989d6f355f5deefc4cbf411e27cb1f16ac61a2b..76f6324ca5025000e4094aeb74464abb73bca489 100644 GIT binary patch delta 1483 zcmYjRdpy$%6#vac#%wY6sazydl*gS*W!_}fC1sv%lOi^;VJ(mG8zq@)mODx=MSb$v z(6~ubOG%;>HY24xT0Xedm1p=}?)`jj_xy3r`JTt;d(I!{D9{QGlPn)^Pb6Xk0ssKy zUV{4}0D!HyFkmfw#Y71Mi7Q|`-z1u#y2VCcUmt>?vT2Ai0U?CV*0#8{HUx8X^Fl*I z2(UcJI83|5ipYo!V^TG>Q0sKG&}g)-t}ZdyAAM|tr~iI{kMcOUm;cgSNgctTGXN0? z3oA=YYpe6^J&Zr0);UOH2m(3)06K2eIjUxlLLR^X@#;W2Qq^2tB9VA~e|lndH0B|1 zU%>gJ{P+rJOCkm`-NWOL#ZehdDm?}O5(-7#O^9YIwCa~#iQHFJMl){q4TNlFO|{R< znYuJvKFNojT7kqNp!i-R`LZniVVWDW)T8#xIUFP^>Of7G&T`fP3HiD-qZR=n)` zeHKe2>`{sN>DrzEVx)wo&5-SLtNJOHWo`97@BpRiWC}cEscREWqokndISHGb@Ze2l zF%D8H-Dq4O>vD>gQR~EpWXin@*>JR!e=FkwWuk9CKDj)C4vzP|Nt_X9P_}Z-Aoert zJQmfAK4+=~0LqxX?k>cH!pS%4hx?CXBwvG#wI{utH^|(+|-JHIzr<@_!+s${9-j84uKGD*X}!SKcw5$9L4 zT;xA48QxXSw3rx4&)KJ#x)M9TNHQxvr!tb4*R-Q;-kk&=xp`CI8rl*bt$tu~NYq(9 z$~LNkiA#j3xJbX-B9W-P#r?iAF^B@%MuOzL0RJLggt($C)D)}iw?2wWp1XO#{=y zUD68-Eohv(E~D2~*mjXMu$GBwe~I5qP5?=MO?(X&98}Y6GpKSx{@Zwn^5-5fii8Oe z3=rUPTyyKsN-g~F9AOC_T5gCteJYJ`+uzyta2=W5X<^3Q-tG<0(`MKS&7NoHyV-^` z^$)N=*cdusp~lck*wuxa-s+P}H@i6`S;NM>vr^h646DDsmByh|8b3XK z-*(F2$t@V2mHKWze8lL8L+aEx9XTCmKqZ}9KPZ0snLfDuq5q_#aI*0&dA#rAsD-bF>ODc-hncL3mPQXp!1 z_iAoumQW>9jn08W7z3N6<$AyT+{-CNbyJ#+OCQ@k4FLl)rep z*{4Hl+P!iMOLDaznlNa;OK{_uq#`%dga=L0J79z4Eo)Za)~YzWUM>h?MGWfrPH_jB z_!xubseA>jLwwwzc{icY-euA#joaIKH6{rRH+_vpV5F-5_O0r*uJZ0 zq66GUM^ZRme^x1D`0HKl)(X^rIZ1xj0z>dMVL&|$Z?S>b+T?sNv|qe zKLYP4U9I{bTh4wx9pCJ4VV*V(THK_x=J|(&9(Bx1$fJaEjj?R0HLa8}1@g3OQs%W)H$s3?Dg<=uW~(-{x<-Cr8EEl delta 1980 zcma)7eK^y58~-6>c(xoYb)K!`>SaPmLQgj4EiVtXEfuoLBlRQ{G5p%kl#sOK$*Rm@Av-R-|PFi@9VyCV`qzkEqnuzi@etLHg-nc zAyWh00H8i;&Yy5~bu|n$2IBPf{(%J240SE_xm<2emSI2qx<))HfDE{P`p-#t!%U_e zj`xU&3qOB4HvV)>Gyu>F$w9H_FGv^2v2%+bxBFRd=XLYR)dy|+?1f`i5Z~Y86>$Dq zPMwoI$^MPK@20}Bn{78Ko5&Ux_5>G)Ku3q#k}^_Ow*8i;57*k!(gpxJ2Yfu- zD73=qLM3(3>-&!IT>oc*(B4yJ*(PiCrh*GvLL;TzJsEo^Z(LaOJFj#}t=^X41LVE* z(+umDJ{k75wo!)mi*s*aM_A&b&3bNUrWw>b*Axx;Mv#jo` z`O(*z^q}9XoZ`>0F{w?Q91QZ68_RA!X=)1DA#Na6O+>!PVsnCg)8XK~UsL!^gXFW* zV)3D0+l^%;&jbGsK3a7@rt*5(fN?~k^hkXL<*hFQ{N>*E=M9WTdEh_Kl{fx;PvdG! zlh~lzI`aCde4P!@{xj>7doa~`m86UA?}-PsCe*UdP#D1WOI^Lk(O4xD2TX+&#$ z=yyz<&-nnMK2EJ;zi1Q(aO>;;xZ>hNWegA~Y;~=`WL67`e2{T)Y zDS*6eIltvHb&SvOx`+HOpFB)C+7rmFW$I9BL{V-BsUV~v9^I=gTbedAMH~!y3h5^u zJZRi*R!x2_nYpj`(1t3HpIu&TZuX0GO}Ni}851bvE==`od;?Ax;7qSJDwfuCpL~?n z6|Vyx5{`Il{jH~bs3ih3s6`U`-BOBs-h~i9Av3&h!EN|F+{g4L9CtKZRu1zy&&Z>G z(^LTmQuhqhNYcX~0^SRnE^GNIprI+cO5pj&Vv3R;(>sL>;PZINP&^4vZ!QsF;{&f0 z9e+7&R?Jj=pA$d;os^G$4@kGUu%~r&w#=pA`lH-RiG(5}61&qrDa^6LLUlHnnuskF zXM@1qRUjbaQLjWfu@Ipi`~ioxHJ{fgvLIyIQAm2XFGx^oq%ClOC#sZw@q}kh&$f3J?TACnU#{Tu>D)WT3j%$`s*x$ zlqEkmt5}!B7_%%pia6r3l~tyYTX3j?~*Mkh>n3D9ytv_k!; z)u<4HF!iniHGQ68vMeo?XeZ;ViE4a2+m){yG%3j7p}7jRyCglEnbSL-i{we&m4WCS z99%nD$%mi>{S}(ogro=wHq>34m-BQBEm1RmP%lW>1)U1@S{8zY{6(!BtMK@WiyrHO z62J+V;j1u02~0Q_;ne6U-OH}pU%SF}R>OkDc&D$rzlq-^U~a*3XC2b{ib>ni@Y!1n z%BZ}AM)coF*QGa|eetQ|XVUoL@waCoJDIO@F%OUKP#`vg9d(9IonUHI%zIF&Fkb#L zu3iJS&ucfj?j+2jGZi%MXb*alR`f+6MQ4hUm(iIMx*iM~8$}V0(abmXDdj-eralhS zBy$?+VVo(_r!fw*U5}KG^3j>8NTv4rPlXIt7cK@#aShz zO-1ZgXk{tWOQgC+3Vk;*a`O`UYCoaN@VjNK{@0mHjZ@joYm8isWy5spFW|Q?YjlD? z6?u@wyj)G;=9h=VM$v6YJ5Mf&F0)Ft&sIq;zB zO@}CHX>vHuDl*dsdn0m1 znQd8H`=M1dq0M65NnE(Ziy?vL5LPy3l8@}%0kQ5m3K31(j@R8pR@IDd zv7k&w!wYXa=IJ%8;i1^?kkzvP4JDCSabiN!d*ajo;WL5^(>OK$*=>civ>h(X`jhHn z*eN@>wCs8a8{7?I{_9<{N%n0Sj|n$9-g7Cjo^w(h9r+li!nBK { - const { data } = useBackend(context); - const { beaker, processing } = data; - return ( - - {!!processing && ( - - - {' Processing...'} - - )} - - {!beaker && No Container} - {!!beaker && } - - - ); -}; - -export const BiogeneratorContent = (props, context) => { - const { act, data } = useBackend(context); - const { - beakerCurrentVolume, - beakerMaxVolume, - biomass, - can_process, - categories = [], - reagent_color, - } = data; - const [searchText, setSearchText] = useLocalState(context, 'searchText', ''); - const [selectedCategory, setSelectedCategory] = useLocalState( - context, - 'category', - categories[0]?.name - ); - const testSearch = createSearch(searchText, (item) => { - return item.name; - }); - const items = - (searchText.length > 0 && - // Flatten all categories and apply search to it - categories - .flatMap((category) => category.items || []) - .filter(testSearch) - .filter((item, i) => i < MAX_SEARCH_RESULTS)) || - // Select a category and show all items in it - categories.find((category) => category.name === selectedCategory)?.items || - // If none of that results in a list, return an empty list - []; - return ( -
0 ? 'good' : 'bad'}> - {formatMoney(biomass)} Biomass - - } - buttons={ - <> - Search - setSearchText(value)} - mx={1} - /> -
- ); -}; - -const ItemList = (props, context) => { - const { act } = useBackend(context); - const [hoveredItem, setHoveredItem] = useLocalState( - context, - 'hoveredItem', - {} - ); - const hoveredCost = hoveredItem.cost || 0; - // Append extra hover data to items - const items = props.items.map((item) => { - const [amount, setAmount] = useLocalState(context, 'amount' + item.name, 1); - const notSameItem = hoveredItem.name !== item.name; - const notEnoughHovered = - props.biomass - hoveredCost * hoveredItem.amount < item.cost * amount; - const disabledDueToHovered = notSameItem && notEnoughHovered; - const disabled = props.biomass < item.cost * amount || disabledDueToHovered; - return { - ...item, - disabled, - amount, - setAmount, - }; - }); - return items.map((item) => ( - - - {' '} - {item.name} - - - item.setAmount(value)} - /> - - -