This commit is contained in:
DragonTrance
2021-02-08 19:15:44 -07:00
parent 4f06193ad8
commit 187471f0af
11 changed files with 325 additions and 61 deletions
+25 -14
View File
@@ -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"
@@ -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?"
+12
View File
@@ -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))
@@ -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."
@@ -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"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

@@ -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 (
<Window
width={550}
height={380}
resizable>
{!!processing && (
<Dimmer fontSize="32px">
<Icon name="cog" spin={1} />
{' Processing...'}
</Dimmer>
)}
<Window.Content scrollable>
{!beaker && (
<NoticeBox>No Container</NoticeBox>
)}
{!!beaker && (
<BiogeneratorContent />
)}
</Window.Content>
</Window>
);
};
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 (
<Section
title={(
<Box
inline
color={biomass > 0 ? 'good' : 'bad'}>
{formatMoney(biomass)} Biomass
</Box>
)}
buttons={(
<Fragment>
Search
<Input
autoFocus
value={searchText}
onInput={(e, value) => setSearchText(value)}
mx={1} />
<Button
icon="eject"
content="Eject"
onClick={() => act('detach')} />
<Button
icon="cog"
content="Activate"
disabled={!can_process}
onClick={() => act('activate')} />
</Fragment>
)}>
<Flex>
{searchText.length === 0 && (
<Flex.Item>
<Tabs vertical>
{categories.map(category => (
<Tabs.Tab
key={category.name}
selected={category.name === selectedCategory}
onClick={() => setSelectedCategory(category.name)}>
{category.name} ({category.items?.length || 0})
</Tabs.Tab>
))}
</Tabs>
</Flex.Item>
)}
<Flex.Item grow={1} basis={0}>
{items.length === 0 && (
<NoticeBox>
{searchText.length === 0
? 'No items in this category.'
: 'No results found.'}
</NoticeBox>
)}
<Table>
<ItemList
biomass={biomass}
items={items} />
</Table>
</Flex.Item>
</Flex>
</Section>
);
};
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 => (
<Table.Row key={item.id}>
<Table.Cell>
<span
className={classes(['design32x32', item.id])}
style={{
'vertical-align': 'middle',
}} />
{' '}<b>{item.name}</b>
</Table.Cell>
<Table.Cell collapsing>
<NumberInput
value={Math.round(item.amount)}
width="35px"
minValue={1}
maxValue={10}
onChange={(e, value) => item.setAmount(value)} />
</Table.Cell>
<Table.Cell collapsing>
<Button
style={{
'text-align': 'right',
}}
fluid
content={item.cost * item.amount + ' ' + "BIO"}
disabled={item.disabled}
onmouseover={() => setHoveredItem(item)}
onmouseout={() => setHoveredItem({})}
onClick={() => act('create', {
id: item.id,
amount: item.amount,
})} />
</Table.Cell>
</Table.Row>
));
};