# Atmospheric chemistry

Gas reactions in the atmospheres of celestial bodies.

Every 20 ticks, each landable body with an atmosphere applies every row in table order, each at most once. A row reacts when the atmosphere holds every input gas at $64 \times$ its `amount` mB or more; it then removes $64 \times$ each input `amount` and adds $64 \times$ the output `amount`. Only gaseous fluids are exchanged. Recipe viewers list the rows as Atmospheric Chemistry.

## Fields

| Field | Meaning and default | Range |
| - | - | - |
| `type` | Selects the `hbmspace:atmosphere` recipe format. | |
| `name` (Optional) | Internal lookup name; defaults to the last segment of the recipe resource path. | |
| `order` (Optional) | Sort position within the recipe table; lower values first, default 2147483647. | `i32` |
| `input_fluids` | At least one input gas. | |
| `input_fluids.type` | Registered fluid ID. | |
| `input_fluids.amount` | Amount in mB; use $[1, \mathrm{tank\ capacity}]$ for transfers because machine code casts to int. | `i64` |
| `input_fluids.pressure` (Optional) | Pressure level; default 0. | `i32` |
| `output_fluids` | Exactly one output gas. | |
| `output_fluids.type` | Registered fluid ID. | |
| `output_fluids.amount` | Amount in mB; use $[1, \mathrm{tank\ capacity}]$ for transfers because machine code casts to int. | `i64` |
| `output_fluids.pressure` (Optional) | Pressure level; default 0. | `i32` |

A row without inputs or with another number of outputs fails to load. `duration`, `power`, item fields and fluid `pressure` are ignored.

## Example

Source path: `data/hbmspace/recipe/atmosphere/atmo.lithcarbonate.json`

```json
{
  "type": "hbmspace:atmosphere",
  "input_fluids": [
    {
      "type": "hbmspace:lithydro",
      "amount": 16000
    },
    {
      "type": "hbmspace:dunaair",
      "amount": 256000
    }
  ],
  "order": 0,
  "output_fluids": [
    {
      "type": "hbmspace:lithcarbonate",
      "amount": 32000
    }
  ]
}
```
