# Counter action

Fields for this consumable treatment action.

**since NTM 1.0.1**

[Consumable treatments](https://movblock.mov/ntm-next/wiki/consumable-treatments.md) place this action in `actions`.

## Fields

| Field | Meaning and default | Range |
| - | - | - |
| `type` | `counter`. | |
| `counter` | `radiation`, `digamma`, `asbestos`, or `black_lung`. | |
| `operation` | `add`, `set`, or `min`. | |
| `amount` (Optional) | Operand; default 0. Add accepts a negative amount; set and min require nonnegative amounts. Lung-disease amounts are integers in `[-i32::MAX, i32::MAX]`. | finite `f64` |
| `limit_divisor` (Optional) | Uses the lung-disease maximum divided by this integer as the operand. Applies only to asbestos and black_lung; amount must be 0. Omit to use amount. | `[1, i32::MAX]` |

`add` changes the current counter and floors it at zero. `set` replaces it. `min` caps it at the operand. Lung-disease division uses integer division.

| Counter | Limits |
| - | - |
| `radiation` | `add` caps it at 2500. Unchanged while [`radiation_config`](https://movblock.mov/ntm-next/wiki/game-settings/radiation_config.md) `enable_contamination` is false |
| `digamma` | Clamped to `[0, 1000]`; 10 or more kills |
| `asbestos` | Maximum 72000; reaching it resets the counter and deals 1000 damage; unchanged while `disable_asbestos` is true |
| `black_lung` | Maximum 144000; reaching it resets the counter and deals 1000 damage; unchanged while `disable_coal` is true |

## Example:

```json
{"type": "counter", "counter": "black_lung", "operation": "min", "limit_divisor": 5}
```
