# items/recipes.ron

> What can be made from what.

<!-- Generated by `zombye-server --docs`. Do not edit: change the game and generate again. -->

**What can be made from what.** Read by the game's rules: a change here changes how the game plays, and a world remembers the content it was made with.

File: `assets/data/items/recipes.ron`

## About this file

Recipes: what a survivor can make from what it carries. Schema: zombye_sim::crafting::RecipeDef (validated on load against items.ron; unknown fields are refused). All recipes and numbers are our own.

```text
  id       lowercase letters, digits and _ (saves and tools name recipes by it)
  name     what it's called in the inventory panel and in notes
  secs     seconds it takes (Handiwork, #46, makes it 10% faster per level)
  inputs   [(item: "id", count: n)]: used up (count defaults to 1). Only whole items count: a
           part-drunk bottle won't do. Carried or held, not worn (take it off first).
  tools    [Item("id")] or [Tag("tag")] (any item with that tag in items.ron): needed, kept
  outputs  [(item: "id", count: n)]: made, into pockets and bags while they have room, the rest
           at your feet. An output can't also be an input. Empty for a recipe that only places.
  heat     true: cooking. Only made within reach of a lit campfire or a working stove (a stove
           needs its building's power). Cooked food is made fresh.
  places   Some(Campfire): also puts a lit campfire down a metre in front of you, outdoors, its
           first fuel the inputs tagged fuel (fire.ron: hours a kg). Feed it from its menu.
```


## Fields

The file is a list of `RecipeDef`, each in round brackets.

One recipe. Seconds of play; counts of whole items.

| Field | Type | What it is |
|---|---|---|
| `id` | `String` |  |
| `name` | `String` | What it's called ("Rip a T-shirt into rags"). |
| `secs` | `f32` |  |
| `inputs` | `Vec<RecipeItem>` |  |
| `tools` | `Vec<Tool>` |  |
| `outputs` | `Vec<RecipeItem>` | Made new. May be empty for a recipe that `places` something. |
| `heat` | `bool` | Cooking: only made within reach of a lit fire or a working stove (`crate::fire::heat_near`). |
| `places` | `Option<crate::fire::Placed>` | Puts something down in front of the survivor (a campfire, fed with the inputs that are fuel: `crate::fire`), as well as making the outputs. |

### `RecipeItem`

Some of one item a recipe takes or makes.

| Field | Type | What it is |
|---|---|---|
| `item` | `String` | An item id (`items.ron`). |
| `count` | `u16` |  |

### `Tool`

Something a recipe needs to hand but doesn't use up.

| Value | What it means |
|---|---|
| `Item(String)` | This item (an id in `items.ron`). |
| `Tag(String)` | Any item with this tag (`cuts`, `fire`, ...). |

### `Placed`

What a recipe can put down instead of (or as well as) items.

| Value | What it means |
|---|---|
| `Campfire` | A campfire, lit, fed with the recipe's inputs that are fuel. |

## As shipped

20 entries. Columns are the fields short enough for a table; the rest are in the file below.

| `id` | `name` | `heat` | `inputs` | `outputs` | `secs` | `tools` |
|---|---|---|---|---|---|---|
| "rip_t_shirt" | "Rip a T-shirt into rags" | false | [(count: 1, item: "t_shirt")] | [(count: 3, item: "rag")] | 3 | [] |
| "rip_jumper" | "Rip a jumper into rags" | false | [(count: 1, item: "jumper")] | [(count: 4, item: "rag")] | 4 | [] |
| "rip_hoodie" | "Rip a hoodie into rags" | false | [(count: 1, item: "hoodie")] | [(count: 5, item: "rag")] | 5 | [] |
| "cut_jeans" | "Cut jeans into rags" | false | [(count: 1, item: "jeans")] | [(count: 4, item: "rag")] | 6 | [Tag("cuts")] |
| "rip_bed_sheet" | "Tear a bed sheet into rags" | false | [(count: 1, item: "bed_sheet")] | [(count: 6, item: "rag")] | 5 | [] |
| "rip_towel" | "Rip a towel into rags" | false | [(count: 1, item: "towel")] | [(count: 4, item: "rag")] | 4 | [] |
| "wash_rags" | "Wash rags in clean water" | false | [(count: 3, item: "rag"), (count: 1, ite… | [(count: 3, item: "clean_rag"), (count: … | 12 | [] |
| "build_campfire" | "Build a campfire" | false | [(count: 2, item: "firewood")] | [] | 15 | [Tag("fire")] |
| "build_campfire_planks" | "Build a campfire from planks" | false | [(count: 2, item: "wooden_plank")] | [] | 15 | [Tag("fire")] |
| "saw_firewood" | "Saw a plank into firewood" | false | [(count: 1, item: "wooden_plank")] | [(count: 1, item: "firewood")] | 10 | [Tag("saws")] |
| "cook_chicken" | "Cook the chicken" | true | [(count: 1, item: "raw_chicken")] | [(count: 1, item: "cooked_chicken")] | 20 | [Tag("cookware")] |
| "cook_sausages" | "Cook the sausages" | true | [(count: 1, item: "sausages")] | [(count: 1, item: "cooked_sausages")] | 15 | [Tag("cookware")] |
| "scramble_eggs" | "Scramble some eggs" | true | [(count: 2, item: "egg")] | [(count: 1, item: "scrambled_eggs")] | 8 | [Tag("cookware")] |
| "boil_pasta" | "Boil pasta" | true | [(count: 1, item: "dry_pasta"), (count: … | [(count: 1, item: "cooked_pasta"), (coun… | 25 | [Tag("pot")] |
| "boil_rice" | "Boil rice" | true | [(count: 1, item: "dry_rice"), (count: 1… | [(count: 1, item: "cooked_rice"), (count… | 25 | [Tag("pot")] |
| "heat_soup" | "Heat a tin of soup" | true | [(count: 1, item: "tinned_soup")] | [(count: 1, item: "hot_soup")] | 10 | [Tag("opens_tins"), Tag("cookware")] |
| "heat_beans" | "Heat a tin of beans" | true | [(count: 1, item: "tinned_beans")] | [(count: 1, item: "hot_beans")] | 10 | [Tag("opens_tins"), Tag("cookware")] |
| "open_nails" | "Open a box of nails" | false | [(count: 1, item: "nails")] | [(count: 50, item: "nail")] | 1 | [] |
| "saw_log_planks" | "Saw a log into planks" | false | [(count: 1, item: "log")] | [(count: 3, item: "wooden_plank")] | 30 | [Tag("saws")] |
| "split_log" | "Split a log into firewood" | false | [(count: 1, item: "log")] | [(count: 4, item: "firewood")] | 20 | [Tag("chops")] |

## The file

<details>
<summary>The whole file as shipped</summary>

```ron
// Recipes: what a survivor can make from what it carries. Schema: zombye_sim::crafting::RecipeDef
// (validated on load against items.ron; unknown fields are refused). All recipes and numbers are
// our own.
//
//   id       lowercase letters, digits and _ (saves and tools name recipes by it)
//   name     what it's called in the inventory panel and in notes
//   secs     seconds it takes (Handiwork, #46, makes it 10% faster per level)
//   inputs   [(item: "id", count: n)]: used up (count defaults to 1). Only whole items count: a
//            part-drunk bottle won't do. Carried or held, not worn (take it off first).
//   tools    [Item("id")] or [Tag("tag")] (any item with that tag in items.ron): needed, kept
//   outputs  [(item: "id", count: n)]: made, into pockets and bags while they have room, the rest
//            at your feet. An output can't also be an input. Empty for a recipe that only places.
//   heat     true: cooking. Only made within reach of a lit campfire or a working stove (a stove
//            needs its building's power). Cooked food is made fresh.
//   places   Some(Campfire): also puts a lit campfire down a metre in front of you, outdoors, its
//            first fuel the inputs tagged fuel (fire.ron: hours a kg). Feed it from its menu.
[
    // ---- Rags from cloth ------------------------------------------------------------------------
    (id: "rip_t_shirt", name: "Rip a T-shirt into rags", secs: 3.0,
        inputs: [(item: "t_shirt")], outputs: [(item: "rag", count: 3)]),
    (id: "rip_jumper", name: "Rip a jumper into rags", secs: 4.0,
        inputs: [(item: "jumper")], outputs: [(item: "rag", count: 4)]),
    (id: "rip_hoodie", name: "Rip a hoodie into rags", secs: 5.0,
        inputs: [(item: "hoodie")], outputs: [(item: "rag", count: 5)]),
    // Denim won't tear by hand: cut it.
    (id: "cut_jeans", name: "Cut jeans into rags", secs: 6.0,
        inputs: [(item: "jeans")], tools: [Tag("cuts")], outputs: [(item: "rag", count: 4)]),
    (id: "rip_bed_sheet", name: "Tear a bed sheet into rags", secs: 5.0,
        inputs: [(item: "bed_sheet")], outputs: [(item: "rag", count: 6)]),
    (id: "rip_towel", name: "Rip a towel into rags", secs: 4.0,
        inputs: [(item: "towel")], outputs: [(item: "rag", count: 4)]),

    // ---- Dressings ------------------------------------------------------------------------------
    // A rag dresses a wound dirty (it may fester); washed in clean water it goes on clean, like gauze.
    (id: "wash_rags", name: "Wash rags in clean water", secs: 12.0,
        inputs: [(item: "rag", count: 3), (item: "water_bottle")], outputs: [(item: "clean_rag", count: 3), (item: "empty_bottle")]),

    // ---- Fire ---------------------------------------------------------------------------------
    (id: "build_campfire", name: "Build a campfire", secs: 15.0,
        inputs: [(item: "firewood", count: 2)], tools: [Tag("fire")], places: Some(Campfire)),
    (id: "build_campfire_planks", name: "Build a campfire from planks", secs: 15.0,
        inputs: [(item: "wooden_plank", count: 2)], tools: [Tag("fire")], places: Some(Campfire)),
    // Breaking a plank up with a saw or an axe: firewood stacks and packs better than planks.
    (id: "saw_firewood", name: "Saw a plank into firewood", secs: 10.0,
        inputs: [(item: "wooden_plank")], tools: [Tag("saws")], outputs: [(item: "firewood")]),

    // ---- Cooking (over a lit campfire or a working stove) --------------------------------------
    (id: "cook_chicken", name: "Cook the chicken", secs: 20.0, heat: true,
        inputs: [(item: "raw_chicken")], tools: [Tag("cookware")], outputs: [(item: "cooked_chicken")]),
    (id: "cook_sausages", name: "Cook the sausages", secs: 15.0, heat: true,
        inputs: [(item: "sausages")], tools: [Tag("cookware")], outputs: [(item: "cooked_sausages")]),
    (id: "scramble_eggs", name: "Scramble some eggs", secs: 8.0, heat: true,
        inputs: [(item: "egg", count: 2)], tools: [Tag("cookware")], outputs: [(item: "scrambled_eggs")]),
    (id: "boil_pasta", name: "Boil pasta", secs: 25.0, heat: true,
        inputs: [(item: "dry_pasta"), (item: "water_bottle")], tools: [Tag("pot")], outputs: [(item: "cooked_pasta"), (item: "empty_bottle")]),
    (id: "boil_rice", name: "Boil rice", secs: 25.0, heat: true,
        inputs: [(item: "dry_rice"), (item: "water_bottle")], tools: [Tag("pot")], outputs: [(item: "cooked_rice"), (item: "empty_bottle")]),
    (id: "heat_soup", name: "Heat a tin of soup", secs: 10.0, heat: true,
        inputs: [(item: "tinned_soup")], tools: [Tag("opens_tins"), Tag("cookware")], outputs: [(item: "hot_soup")]),
    (id: "heat_beans", name: "Heat a tin of beans", secs: 10.0, heat: true,
        inputs: [(item: "tinned_beans")], tools: [Tag("opens_tins"), Tag("cookware")], outputs: [(item: "hot_beans")]),

    // ---- Building (build.ron uses these) --------------------------------------------------------
    (id: "open_nails", name: "Open a box of nails", secs: 1.0,
        inputs: [(item: "nails")], outputs: [(item: "nail", count: 50)]),
    // ---- Wood ----------------------------------------------------------------------------------
    // Logs come from trees felled with an axe (zombye_sim::trees). Planks board up windows and doors.
    (id: "saw_log_planks", name: "Saw a log into planks", secs: 30.0,
        inputs: [(item: "log")], tools: [Tag("saws")], outputs: [(item: "wooden_plank", count: 3)]),
    // Split with a hatchet or an axe where it lies: firewood for a campfire, four to a log.
    (id: "split_log", name: "Split a log into firewood", secs: 20.0,
        inputs: [(item: "log")], tools: [Tag("chops")], outputs: [(item: "firewood", count: 4)]),
]
```

</details>