diff --git a/code/game/objects/items/storage/belt.dm b/code/game/objects/items/storage/belt.dm index 5f6c0c50..bf66362d 100644 --- a/code/game/objects/items/storage/belt.dm +++ b/code/game/objects/items/storage/belt.dm @@ -878,29 +878,40 @@ obj/item/storage/belt/slut/ComponentInitialize() /obj/item/storage/belt/sabre/rapier/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(attack_type == PROJECTILE_ATTACK) - final_block_chance = 0 //To thin to block bullets + final_block_chance = 0 //Too thin to block bullets return ..() /obj/item/storage/belt/botany - name = "botany belt" - desc = "A belt used to hold most janitorial supplies." - icon_state = "grenadebeltold" //reusing the old grenade belt sprite, can't go wrong. - item_state = "grenadebeltold" + name = "botanical belt" + desc = "A belt made for holding hydroponics supplies." + icon_state = "botanybelt" + item_state = "botanybelt" + content_overlays = TRUE + +/obj/item/storage/belt/botany/New() + if(prob(1)) + new/obj/item/storage/belt/botany/fancy(loc) + qdel(src) /obj/item/storage/belt/botany/ComponentInitialize() . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) - STR.max_items = 8 + STR.max_items = 6 STR.max_w_class = WEIGHT_CLASS_NORMAL STR.can_hold = typecacheof(list( - /obj/item/reagent_containers/glass/beaker, - /obj/item/reagent_containers/glass/bottle, - /obj/item/reagent_containers/syringe, - /obj/item/reagent_containers/spray, - /obj/item/disk/plantgene, + /obj/item/reagent_containers/spray/plantbgone, + /obj/item/plant_analyzer, /obj/item/seeds, - /obj/item/shovel/spade, + /obj/item/reagent_containers/glass/bottle, + /obj/item/reagent_containers/glass/beaker, /obj/item/cultivator, + /obj/item/reagent_containers/spray/pestspray, /obj/item/hatchet, - /obj/item/plant_analyzer - )) + /obj/item/shovel/spade, + /obj/item/gun/energy/floragun + )) + +/obj/item/storage/belt/botany/fancy //I like citadel's botany belt but I also wanna keep the default + desc = "A belt made for holding hydroponics supplies. Oddly enough, it's not green." + icon_state = "botanybelt_extra" + item_state = "botanybelt_extra" \ No newline at end of file diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm index e4c6ca9d..77be5c29 100644 --- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm +++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm @@ -396,6 +396,16 @@ list_reagents = list(/datum/reagent/consumable/orangejuice = 100) foodtype = FRUIT| BREAKFAST +/obj/item/reagent_containers/food/drinks/bottle/bio_carton + name = "small carton box" + desc = "A small biodegradable carton box made from plant biomatter." + icon_state = "eco_box" + item_state = "carton" + lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi' + volume = 50 + isGlass = FALSE + /obj/item/reagent_containers/food/drinks/bottle/cream name = "milk cream" desc = "It's cream. Made from milk. What else did you think you'd find in there?" diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 9c594260..a3ff3884 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -651,6 +651,18 @@ myseed.adjust_yield(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 0.02)) adjustPests(-rand(1,2)) + // Enduro Grow sacrifices potency + yield for endurance + if(S.has_reagent(/datum/reagent/plantnutriment/endurogrow, 1)) + myseed.adjust_potency(-round(S.get_reagent_amount(/datum/reagent/plantnutriment/endurogrow) * 0.1)) + myseed.adjust_yield(-round(S.get_reagent_amount(/datum/reagent/plantnutriment/endurogrow) * 0.075)) + myseed.adjust_endurance(round(S.get_reagent_amount(/datum/reagent/plantnutriment/endurogrow) * 0.35)) + + // Liquid Earthquake increases production speed but increases weeds + if(S.has_reagent(/datum/reagent/plantnutriment/liquidearthquake, 1)) + myseed.adjust_weed_rate(round(S.get_reagent_amount(/datum/reagent/plantnutriment/liquidearthquake) * 0.1)) + myseed.adjust_weed_chance(round(S.get_reagent_amount(/datum/reagent/plantnutriment/liquidearthquake) * 0.3)) + myseed.adjust_production(round(S.get_reagent_amount(/datum/reagent/plantnutriment/liquidearthquake) * 0.075)) + // Nutriment Compost, effectively if(S.has_reagent(/datum/reagent/consumable/nutriment, 1)) adjustHealth(round(S.get_reagent_amount(/datum/reagent/consumable/nutriment) * 0.5)) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 69934a44..fe62eef1 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -1606,16 +1606,21 @@ tox_prob = 15 pH = 1 +/datum/reagent/plantnutriment/endurogrow + name = "Enduro Grow" + description = "A specialized nutriment, which decreases product quantity and potency, but strengthens the plants endurance." + color = "#a06fa7" // RBG: 160, 111, 167 + tox_prob = 15 - - - +/datum/reagent/plantnutriment/liquidearthquake + name = "Liquid Earthquake" + description = "A specialized nutriment, which increases the plant's production speed, as well as its susceptibility to weeds." + color = "#912e00" // RBG: 145, 46, 0 + tox_prob = 25 // GOON OTHERS - - /datum/reagent/oil name = "Oil" description = "Burns in a small smoky fire, mostly used to get Ash." diff --git a/code/modules/research/designs/biogenerator_designs.dm b/code/modules/research/designs/biogenerator_designs.dm index 20242c91..a08aa6fc 100644 --- a/code/modules/research/designs/biogenerator_designs.dm +++ b/code/modules/research/designs/biogenerator_designs.dm @@ -2,8 +2,11 @@ ///////Biogenerator Designs /////// /////////////////////////////////// +//Please be wary to not add inorganic items to the results such as generic glass bottles and metal. +//as they kind of defeat the design of this feature. + /datum/design/milk - name = "10 Milk" + name = "10u Milk" id = "milk" build_type = BIOGENERATOR materials = list(MAT_BIOMASS = 20) @@ -11,29 +14,13 @@ category = list("initial","Food") /datum/design/cream - name = "10 Cream" + name = "10u Cream" id = "cream" build_type = BIOGENERATOR materials = list(MAT_BIOMASS = 30) make_reagents = list(/datum/reagent/consumable/cream = 10) category = list("initial","Food") -/datum/design/milk_carton - name = "Milk Carton" - id = "milk_carton" - build_type = BIOGENERATOR - materials = list(MAT_BIOMASS = 100) - build_path = /obj/item/reagent_containers/food/condiment/milk - category = list("initial","Food") - -/datum/design/cream_carton - name = "Cream Carton" - id = "cream_carton" - build_type = BIOGENERATOR - materials = list(MAT_BIOMASS = 300) - build_path = /obj/item/reagent_containers/food/drinks/bottle/cream - category = list("initial","Food") - /datum/design/black_pepper name = "10u Black Pepper" id = "black_pepper" @@ -42,13 +29,12 @@ make_reagents = list(/datum/reagent/consumable/blackpepper = 10) category = list("initial","Food") -/datum/design/pepper_mill - name = "Pepper Mill" - id = "pepper_mill" +/datum/design/enzyme + name = "10u Universal Enzyme" + id = "enzyme" build_type = BIOGENERATOR - materials = list(MAT_BIOMASS = 50) - build_path = /obj/item/reagent_containers/food/condiment/peppermill - make_reagents = list() + materials = list(MAT_BIOMASS = 30) + make_reagents = list(/datum/reagent/consumable/enzyme = 10) category = list("initial","Food") /datum/design/monkey_cube @@ -68,52 +54,92 @@ category = list("initial", "Food") /datum/design/ez_nut - name = "E-Z Nutrient" + name = "10u E-Z Nutrient" id = "ez_nut" build_type = BIOGENERATOR - materials = list(MAT_BIOMASS = 10) - build_path = /obj/item/reagent_containers/glass/bottle/nutrient/ez + materials = list(MAT_BIOMASS = 2) + make_reagents = list(/datum/reagent/plantnutriment/eznutriment = 10) category = list("initial","Botany Chemicals") /datum/design/l4z_nut - name = "Left 4 Zed" + name = "10u Left 4 Zed" id = "l4z_nut" build_type = BIOGENERATOR - materials = list(MAT_BIOMASS = 20) - build_path = /obj/item/reagent_containers/glass/bottle/nutrient/l4z + materials = list(MAT_BIOMASS = 4) + make_reagents = list(/datum/reagent/plantnutriment/left4zednutriment = 10) category = list("initial","Botany Chemicals") /datum/design/rh_nut - name = "Robust Harvest" + name = "10u Robust Harvest" id = "rh_nut" build_type = BIOGENERATOR + materials = list(MAT_BIOMASS = 5) + make_reagents = list(/datum/reagent/plantnutriment/robustharvestnutriment = 10) + category = list("initial","Botany Chemicals") + +/datum/design/end_gro + name = "30u Enduro Grow" + id = "end_gro" + build_type = BIOGENERATOR + materials = list(MAT_BIOMASS = 30) + make_reagents = list(/datum/reagent/plantnutriment/endurogrow = 30) + category = list("initial","Botany Chemicals") + +/datum/design/liq_earth + name = "30u Liquid Earthquake" + id = "liq_earth" + build_type = BIOGENERATOR + materials = list(MAT_BIOMASS = 30) + make_reagents = list(/datum/reagent/plantnutriment/liquidearthquake = 30) + category = list("initial","Botany Chemicals") + +/datum/design/ammonia + name = "10u Ammonia" + id = "ammonia_biogen" + build_type = BIOGENERATOR materials = list(MAT_BIOMASS = 25) - build_path = /obj/item/reagent_containers/glass/bottle/nutrient/rh + make_reagents = list(/datum/reagent/ammonia = 10) + category = list("initial","Botany Chemicals") + +/datum/design/saltpetre + name = "10u Saltpetre" + id = "saltpetre_biogen" + build_type = BIOGENERATOR + materials = list(MAT_BIOMASS = 75) + make_reagents = list(/datum/reagent/saltpetre = 10) + category = list("initial","Botany Chemicals") + +/datum/design/mutagen //This is here because I'd like it if botany wouldn't rely on chemical dispensers to make fancy things + name = "5u Unstable Mutagen" + id = "fabricated_mutagen" + build_type = BIOGENERATOR + materials = list(MAT_BIOMASS = 80) + make_reagents = list(/datum/reagent/toxin/mutagen = 5) //suffer category = list("initial","Botany Chemicals") /datum/design/weed_killer name = "Weed Killer" id = "weed_killer" build_type = BIOGENERATOR - materials = list(MAT_BIOMASS = 50) - build_path = /obj/item/reagent_containers/glass/bottle/killer/weedkiller + materials = list(MAT_BIOMASS = 10) + make_reagents = list(/datum/reagent/toxin/plantbgone/weedkiller = 10) category = list("initial","Botany Chemicals") /datum/design/pest_spray name = "Pest Killer" id = "pest_spray" build_type = BIOGENERATOR - materials = list(MAT_BIOMASS = 50) - build_path = /obj/item/reagent_containers/glass/bottle/killer/pestkiller + materials = list(MAT_BIOMASS = 10) + make_reagents = list(/datum/reagent/toxin/pestkiller = 10) category = list("initial","Botany Chemicals") -/datum/design/botany_bottle - name = "Empty Bottle" - id = "botany_bottle" +/datum/design/empty_carton + name = "Small Empty Carton Box" + id = "empty_carton" build_type = BIOGENERATOR - materials = list(MAT_BIOMASS = 5) - build_path = /obj/item/reagent_containers/glass/bottle/nutrient/empty - category = list("initial", "Botany Chemicals") + materials = list(MAT_BIOMASS = 15) + build_path = /obj/item/reagent_containers/food/drinks/bottle/bio_carton + category = list("initial", "Organic Materials") /datum/design/cloth name = "Roll of Cloth" @@ -163,6 +189,14 @@ build_path = /obj/item/storage/belt/janitor category = list("initial","Organic Materials") +/datum/design/plantbelt + name = "Botanical Belt" + id = "plantbelt" + build_type = BIOGENERATOR + materials = list(MAT_BIOMASS = 300) + build_path = /obj/item/storage/belt/botany + category = list("initial","Organic Materials") + /datum/design/s_holster name = "Shoulder Holster" id = "s_holster" diff --git a/icons/mob/inhands/equipment/belt_lefthand.dmi b/icons/mob/inhands/equipment/belt_lefthand.dmi index beac5672..a694348b 100644 Binary files a/icons/mob/inhands/equipment/belt_lefthand.dmi and b/icons/mob/inhands/equipment/belt_lefthand.dmi differ diff --git a/icons/mob/inhands/equipment/belt_righthand.dmi b/icons/mob/inhands/equipment/belt_righthand.dmi index da31cc97..b5f71184 100644 Binary files a/icons/mob/inhands/equipment/belt_righthand.dmi and b/icons/mob/inhands/equipment/belt_righthand.dmi differ diff --git a/icons/obj/clothing/belt_overlays.dmi b/icons/obj/clothing/belt_overlays.dmi index 717937c0..1267c8af 100644 Binary files a/icons/obj/clothing/belt_overlays.dmi and b/icons/obj/clothing/belt_overlays.dmi differ diff --git a/icons/obj/clothing/belts.dmi b/icons/obj/clothing/belts.dmi index 8d8cd646..d7131e13 100644 Binary files a/icons/obj/clothing/belts.dmi and b/icons/obj/clothing/belts.dmi differ diff --git a/icons/obj/drinks.dmi b/icons/obj/drinks.dmi index 36bbef1c..5507bca9 100644 Binary files a/icons/obj/drinks.dmi and b/icons/obj/drinks.dmi differ diff --git a/tgui-next/packages/tgui/interfaces/biogenerator.js b/tgui-next/packages/tgui/interfaces/biogenerator.js new file mode 100644 index 00000000..ee109206 --- /dev/null +++ b/tgui-next/packages/tgui/interfaces/biogenerator.js @@ -0,0 +1,192 @@ +import { classes } from 'common/react'; +import { createSearch } from 'common/string'; +import { Fragment } from 'inferno'; +import { useBackend, useLocalState } from '../backend'; +import { Box, Button, Dimmer, Flex, Icon, Input, NoticeBox, NumberInput, Section, Table, Tabs } from '../components'; +import { formatMoney } from '../format'; +import { Window } from '../layouts'; + +const MAX_SEARCH_RESULTS = 25; + +export const Biogenerator = (props, context) => { + 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 { + biomass, + can_process, + categories = [], + } = 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 && 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 && 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)} /> + + +