# TrapDef

> Kinbarrow modding reference — content tree `45d0fe274f851548`, version `0.2.0+main.c05ef2b`.

`traps/<id>.srd.ron` — one trap per file; stem == id (the OPEN one-file-per-entity collection, the feats/spells/magic-items precedent). A trap is the SRD "Traps" substrate: a hidden hazard a keen eye DETECTS (a Perception/Investigation check vs `detect_dc`), a deft hand DISARMS (a thieves'-tools check vs `disarm_dc`, the lock-pick precedent), and that otherwise SPRINGS its [`effect`](Self::effect) on whoever triggers it. The composing consumer is the trapped container: a chest a burglar picks without disarming springs the needle on them. The DCs and dice are the SRD's; the primitives (which skill detects, the save/attack shape) are authored. A trap that springs nothing is refused by the validator.

**Note on syntax:** these files are RON, not JSON. The shapes below are exact,
but punctuation follows RON — read a real `data/*.ron` file alongside.

## Fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `detect_dc` | `uint32` | required | The DC that detection check beats — a u32, so it is ≥ 0 by type. |
| `detect_skill` | `Skill` | required | The skill a searcher rolls to notice the trap — Perception (the passive eye) or Investigation (deducing it from tampering), per the SRD block. |
| `disarm_dc` | `uint32` | required | The DC a thieves'-tools check beats to disarm it (the lock-pick shape). |
| `effect` | `TrapEffect` | required | How the sprung trap resolves its payload (a save or an attack roll). |
| `id` | `string` | required |  |
| `name` | `string` | required |  |
| `source` | `Source` | required |  |

## Nested shapes

### Ability

The six ability scores (SRD 5.1). The engine's own `stats::Ability` is the runtime type; this is the data-layer mirror, bridged by [`Ability::engine`].

`Str`, `Dex`, `Con`, `Int`, `Wis`, `Cha`

### Damage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `dice` | `string` | required | The damage dice, an `NdM` string (e.g. "1d8"). |
| `kind` | `string` | required | A `tables/damage_kinds.srd.ron` id, boot-resolved. |

### OnSave

What a failed save spares (SRD: "half as much damage on a successful one").

`Half`, `Nothing`

### Skill

The eighteen SRD skills.

`Athletics`, `Acrobatics`, `SleightOfHand`, `Stealth`, `Arcana`, `History`, `Investigation`, `Nature`, `Religion`, `AnimalHandling`, `Insight`, `Medicine`, `Perception`, `Survival`, `Deception`, `Intimidation`, `Performance`, `Persuasion`

### Source

Every file's top-level value carries `source`.

#### Source::Srd51

SRD 5.1 — the System Reference Document, the shipped baseline.

#### Source::Original

Original content authored for this game (not from the SRD).

#### Source::Personal

A player's own transcription or third-party content in a mod tree — provenance stays honest without borrowing the base tree's markers. Never used by shipped files.

### TrapEffect

How a sprung trap resolves its payload — the SRD "Traps" section's two shapes: a SAVING THROW everyone caught rolls (a success spares per [`OnSave`]), or an ATTACK ROLL the trap makes against the victim's AC. Either carries a damage roll (reusing the damage seam) and/or an inflicted condition (a `conditions/` id) — the poison needle's poison AND poisoned. A save with neither damage nor condition, or an attack with no damage, springs nothing and is refused by the validator (the ledger-don't-fake rule, the feat/magic-item precedent).

#### TrapEffect::Save

The caught roll a saving throw of `ability` vs `dc`; a success spares per `on_save` (half the damage, or nothing). Damage and/or a condition land on a FAILURE (a success inflicts no condition, SRD).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `ability` | `Ability` | required |  |
| `condition` | `string` | optional |  |
| `damage` | `Damage` | optional |  |
| `dc` | `uint32` | required |  |
| `on_save` | `OnSave` | required |  |

#### TrapEffect::Attack

The trap makes a ranged attack (d20 + `bonus`) vs the victim's AC; a hit deals the damage and inflicts the condition, a miss does nothing. No SRD SAMPLE trap rolls an attack (the device samples all save — needle, darts, statue); this is the substrate for a mod's / the DMG's attack-roll traps.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `bonus` | `int32` | required |  |
| `condition` | `string` | optional |  |
| `damage` | `Damage` | required |  |

