Really what we need is to eventually split the recipes out into a number of “steps” (kinda similar to the construction system), each of which can either be turn or time based (since some things like cooking don’t care how skilled you are, they aren’t going to cook faster). In addition we should hopefully allow for you to walk away from some time-based things (like cooking), possibly with penalties if you wait too long (burned your squirrel meat?), while we could also allow for skill modifiers on the turn-based ones. Each step could then also require given tools, and we could have a tool modifier be applied either to the time or number of turns that a given step takes.
The end result would probably look something like this:
{
"id": "blueberry_pie", //What is the recipe id
"suffix": "from_scratch", //Used to differentiate between certain things (i.e. acid bomb from batteries or from hardcore acid), possible could require
//ingredients with a certain suffix in the steps below
"difficulty": 3,
"recipe": {
"step": {
"cost": ["turns": 1000], //100 turns per 6 seconds at average speed
"ingredients": [
["blueberry": 5], //We need five blueberries regardless
[["flour": 1, "butter": 2, "water_clean": 1], ["pie_crust": 1]] //And either make a pie crust or use a pre-made one
],
"tools": [
["CUTTING": 1, "cost": 1], //Beyond having a basic knife having a sharper one doesn't really help
["CONTAINER": 1, "cost": 1] //Need a pie tin of some kind
]
"skills": [
["cooking": 10, "cap": 50] // Every point in cooking beyond the difficulty gives you a 10% decrease, up to 50%
]
},
"step": {
"cost": ["time": 300], //1 time unit = 6 seconds
"tools": [
["COOKING": 1,, "cost": 1, "mod": 5, "cap": 90], //Having a better oven reduces the time needed by 5% for each level above 1,
//but won't reduce it below 90%
["CONTAINER": 1, "cost": 1] //Need a pie tin of some kind
],
"can_leave": true, //We can walk away while this is cooking
"penalties": ["BURN" : 1] //Leave it cooking for too long and it will output a burnt result
}
"result": {
"id": "blueberry_pie"
//We could also put things like number of charges, whether it's in a container and whether or not it is an active item here
}
//"can_disassemble": false, //Normally we can't disassemble a pie, but this is a magic example pie so we'll do this instead
// Probably by default have this just attempt to do the above steps in reverse order
"disassembly": {
"use_assembly": true, //We still want the above steps in reverse order, so we need this to keep those around
"step": {
"count": 2, // But let's replace the second step (the cooking) with something else
"cost": ["time": 50],
"tools": [
["FREEZING": 1, "cost": 1, "mod": 10, "cap": 60], //This is how thermodynamics works right?
["CONTAINER": 1, "cost": 1]
]
}
"step": {
"count": .5, //And let's add an extra step at the end (lower counts are later in the disassembly process!)
"cost": ["turns": 0], // Could probably just have it assume this, putting it here for reference purposes
"tools": ["COOKING": -1, "cost": 1], //Magically charge up whatever cooking thing we are using here
}
}
}
}
Ideally we could also set up some shortcut types, so you could do something like this:
{
"id": "blueberry_pie",
"suffix": "from_scratch",
"difficulty": 3,
"use_template": {
"id": "pie", //Use the pie template
"values": [1000, 300] //The values needed for the template, in this case the various preparation and baking times
"ingredients": ["blueberry": 5] //The ingredients the template needs, in this case the type of filling
}
And then everything else could be pulled from the designated template, meaning you could define the basic pie recipe in one place and greatly shorten the size of a list of pie recipes. (Probably could do something similar with normal item definitions too, and allow for a bunch of identical pies that still had different id’s, different flavor text, and possibly different nutrition, but that had the exact same bashing/resistance/etc. properties without all that unnecessary duplication in the item definition files.)