# ECO food
## Idea
The basic ingredients for drinks and food are easily acquired in certain machines like booze dispenser and bio generator.
However there are alternative ways to acquire them in a more natural way in the game. These ways require more effort, so there is no point to:
- Grow wheat or sugarcane when you get flour and sugar from biogen
- Ferment drinks when you get all basic drinks from booze dispenser
- Juice plants when you get many variants of juice from soda dispenser
- Milk animals when you get milk from biogen
- Grow livestock when you get monkey cubes
The goal is to implement a solution that would reward these ways of acquiring reagents without punishing the dispenser/biogen only workflows.
This will also provide an additional layer of depth to the cook/barman/botanist professions for more experienced players.
## Solution
- Make food and drinks that use natural ingredients better (or just special) than ones made of machine ingredients
### Consumable purity
- Consumable reagents could use purity stat to determine the quality of the reagent.
- Machine reagents have the default purity: 0.5, and natural ones span from 0 to 1
- You could make an ingredient that is worse than a machine one in some way
- Natural reagents have variable purity that is determined by external factors:
- Grown ingredients get purity from their seed stats - e.g. lifespan and endurance
- This also makes botany care more about these two, usually neglected, stats if the aim is to get the best food ingredient
- Milk, meat and eggs can use a more simple logic:
- The synthetic biogen milk has 0.5 purity, and milk from animal has 1 purity
- Meat from synthetic monkey has 0.5 purity, and all other types of meat have 1 purity
- Purity should be preserved when reagents undergo reactions or used in cooking/drink recipes
- Similar to medicines, purity will determine the effect of the food reagents on player:
- Dish nutriment amount scales with purity
- Dish mood buff strength/duration scale with purity (only when the food type matches player species diet)
- Drink mood buff strength/duration scales with purity
- Apply purity to the resulting food/drink, making natural variant (when all reagents are 100% pure) twice better compared to the 0.5 purity variant (the current, default values)
### Instability effects
Consumables from grown food may also gain some random effects if the seed instability was high. So even a pure reagent may lead to harm or something interesting.
## Actual Implementation
### Consumables purity
- Effects
- Adjusts duration of the mood buff from food consumption
- Adjusts nutrition values of consumed reagents
- Base values
- Synthetic food from biogen has 0.3 purity (including monkey meat)
- Note: Can be purified to 0.5 using mass spectrometer machine
- Map spawn and default consumables have 0.5 purity
- Domestic animals yield organic eggs and meats with 1 purity
- Grown food consumables get purity from the seed stats (at the moment of harvest, specific for every harvested fruit) - usually around 0.65 purity by default:
- 50% - base purity of grown food
- Lifespan adds up to 25% at 100 Lifespan
- Endurance adds up to 25% at 100 Endurance
- Instability adds/reduces up to 25% at 100 Instability
- Also applicable to sub-products of grown food like meatwheat and egg-plants
### Recipe complexity
- Effects
- Increases the strength of mood buff from crafted food consumption. Simulates **exquisitness** of the meal - the more effort is put into your food - the more happy you are when you eat it.
- Applied to crafted food only. The mood buff ignores map-/admin-spawned food, regardless of its complexity. They're factory-made donk pokets and donuts. Soulless.
- Values
- Spans from 0 to ~5
- Reflects the number of steps/ingredients/rare ingredients needed to make the meal
- Hard-coded for every food object or their parent types:
- Complexity 1:
- Fried/Boiled egg
- Cheese
- Onion rings
- Tator tot
- Steak
- ... other things that require one step of ingredient or reagent processing
- Complexity 2:
- Pastry base
- Plain cake/pie
- Bread
- Raw pizza
- Simple pasta
- Simple salads
- Simple soups
- ... other things that require a couple steps of processing or a couple of grown ingredients
- Complexity 3:
- Burgers
- Sandwitches
- Pizza
- Cakes/Pies
- Stuffed breads
- Pastas
- Average salads
- Average soups
- ... other things that require Complexity 2 item plus something simple
- Complexity 4+:
- Other things that are harder to make
### Mood buff from food consumption
- The previous positive mood buff system is replaced with a procedural one
- New buff
- Buff duration (ingredient quality):
- 0-100% according to the average purity of reagents.
- Synthetic food gives shorter buffs, organic - longer.
- Buff strength (food quality/exquisiteness):
- Affects buff mood change value (and maybe some extra buffs later)
- Base value is determined by the complexity of the recipe, only when the food is hand crafted
- Spans from 0 (grown fruits, map-spawn food) to ~5 (most time-consuming recipes)
- Preferrences of the eater adjust the base value as follows:
- -4 when the food is toxic for the species
- -2 when species dislike the food type
- +2 when species like the food type
- Accumulative, you can get +4 if the food has 2 food types that you like
### Procedural nutrition values
- The food reagents will **STOP** being applied to hand-crafted food and will be used only for map-spawned food
- Crafted food will get reagents only from its ingredients without getting any extra out of nowhere
- So crafting, most of the times, affects only the effect of the mood buff, but not the nutrition values
- Nutrition value may change, hovewer, if the crafting recipe has reagent conversion logic (see below)
### Reagent conversion logic
- Some recipes may cause consumable reagents to change into other reagents
- This will be defined like:
- This recipe can turn all milk into nutriments, or all nutriments into sulfuric acid
- Will be applied only to selected recipes, where this is required
# TODO for later or someone else
- [ ] Complexity for slap-crafted food (custom burgers, sushi, pizza, etc.)
- [ ] Add reagent conversion method (convert nutriments to misc. reagents instead of custom amount)
- [ ] Consider rare clothes (e.g. durathread) as an exquisite meal for moths
- [ ] Biogen should consider `nutriment_factor` and purity
- [ ] Lock Mothic and Lizard recipes behind species
- [ ] More custom and interesting food buffs tied to certain dishes
- [ ] Lavaland cooking makes you storm or fire proof, etc.
- [ ] Make progressive learning system for cooking recipes
- [ ] You start with only 1 and 2 complexity food in every category and have to cook them to unlock 3-5 complexity within the category
- [ ] Eco food for Bar stuff
- [ ] Make juices get`nutriment_factor` from `/datum/reagents/proc/get_average_nutriment_factor()` - blocked by issue with reagent manipulation resetting consumable data on transferring
- [ ] Make all this shit work for soups