@alpaca-software/40kdc-data 0.4.7 → 0.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"generated.js","sourceRoot":"","sources":["../src/generated.ts"],"names":[],"mappings":"AAAA,gHAAgH","sourcesContent":["/* Generated from crates/wh40kdc/schemas/bundled.schema.json by 'npm run codegen:types'. DO NOT EDIT BY HAND. */\n\n/**\n * Kebab-case identifier\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"entity-id\".\n */\nexport type EntityId = string;\n/**\n * Game edition, e.g. '10th' or '11'\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"edition\".\n */\nexport type Edition = string;\n/**\n * Dataslate version: a quarterly tag (e.g. '2025-q3') or a named kebab-case slug for non-quarterly slates (e.g. 'pre-launch-provisional')\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"dataslate-version\".\n */\nexport type DataslateVersion = string;\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"keyword\".\n */\nexport type Keyword = string;\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"keyword-list\".\n */\nexport type KeywordList = Keyword[];\n/**\n * A stat that can be a fixed number or a dice expression\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"stat-value\".\n */\nexport type StatValue = number | string;\n/**\n * GitHub handle or '40kdc-community'\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"contributor-ref\".\n */\nexport type ContributorRef = string;\n/**\n * The five official game phases. Unchanged between 10th and 11th edition — 11e reorders Pile In timing within the Fight phase but adds no top-level phase.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"phase\".\n */\nexport type Phase = \"command\" | \"movement\" | \"shooting\" | \"charge\" | \"fight\";\n/**\n * @minItems 1\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"phase-list\".\n */\nexport type PhaseList = [Phase, ...Phase[]];\n/**\n * Type of game element that is the source of an enrichment entry\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"source-type\".\n */\nexport type SourceType = \"ability\" | \"stratagem\" | \"enhancement\" | \"detachment-rule\" | \"faction-rule\";\n/**\n * Which player's turn this applies during\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"player-turn\".\n */\nexport type PlayerTurn = \"your-turn\" | \"opponent-turn\" | \"either\";\n/**\n * 11e battle size, which sets the army's points limit and detachment-point budget: 'incursion' = 1000 pts / 2 detachment points; 'strike-force' = 2000 pts / 3 detachment points.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"battle-size\".\n */\nexport type BattleSize = \"incursion\" | \"strike-force\";\n/**\n * One of the five confirmed 11e launch Force Dispositions. Shared by force-disposition entities and the mission-matchup matrix.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"force-disposition-id\".\n */\nexport type ForceDispositionId =\n | \"take-and-hold\"\n | \"disruption\"\n | \"purge-the-foe\"\n | \"priority-assets\"\n | \"reconnaissance\";\n/**\n * A terrain piece's 2D footprint in local inches (y-down): an axis-aligned rectangle with its min corner at the local origin, a right triangle with the right angle at the local origin and legs along +x/+y, or an explicit polygon (>= 3 points). The placement resolver re-centers the footprint on its polygon area centroid, so the local-origin convention does not affect where the piece lands — only its shape matters.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"footprint\".\n */\nexport type Footprint =\n | {\n type: \"rectangle\";\n width: number;\n height: number;\n }\n | {\n type: \"right-triangle\";\n width: number;\n height: number;\n }\n | {\n type: \"polygon\";\n /**\n * @minItems 3\n */\n points: [Vec2, Vec2, Vec2, ...Vec2[]];\n };\n/**\n * An 11e terrain-area keyword. Confirmed launch set; extend as further keywords publish on dataslate.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"terrain-area-keyword\".\n */\nexport type TerrainAreaKeyword = \"obscuring\" | \"hidden\" | \"plunging-fire\";\n/**\n * A zone footprint, expressed as an axis-aligned rectangle or an explicit polygon. Vertices/extent are relative to the owning element's position.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"zone-shape\".\n */\nexport type ZoneShape =\n | {\n type: \"rectangle\";\n width: number;\n height: number;\n }\n | {\n type: \"polygon\";\n /**\n * @minItems 3\n */\n points: [Vec2, Vec2, Vec2, ...Vec2[]];\n };\n/**\n * Which player a zone or territory belongs to.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"side\".\n */\nexport type Side = \"attacker\" | \"defender\";\n/**\n * Eligibility predicate for which units may perform the action.\n */\nexport type AbilityCondition = SimpleCondition | CompoundCondition;\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"condition-node\".\n */\nexport type ConditionNode = SimpleCondition | CompoundCondition;\n/**\n * Predicate for when the action is considered complete.\n */\nexport type AbilityCondition1 = SimpleCondition | CompoundCondition;\n/**\n * Effect applied when the action completes (e.g. terrain-area-tag, objective-tag, or unit-tag to mark transient state).\n */\nexport type AbilityEffect =\n | SingleEffect\n | ChoiceEffect\n | SequenceEffect\n | DiceGatedEffect\n | ConditionalEffect\n | DicePoolAllocationEffect;\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"effect-node\".\n */\nexport type EffectNode =\n | SingleEffect\n | ChoiceEffect\n | SequenceEffect\n | DiceGatedEffect\n | ConditionalEffect\n | DicePoolAllocationEffect;\nexport type AbilityCondition2 = SimpleCondition | CompoundCondition;\nexport type AbilityEffect1 =\n | SingleEffect\n | ChoiceEffect\n | SequenceEffect\n | DiceGatedEffect\n | ConditionalEffect\n | DicePoolAllocationEffect;\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"condition\".\n */\nexport type AbilityCondition3 = SimpleCondition | CompoundCondition;\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"effect\".\n */\nexport type AbilityEffect2 =\n | SingleEffect\n | ChoiceEffect\n | SequenceEffect\n | DiceGatedEffect\n | ConditionalEffect\n | DicePoolAllocationEffect;\n\n/**\n * Auto-generated by tools/src/bundle-schemas.ts. Single self-contained schema for Rust codegen — do not edit by hand.\n */\nexport interface KdcBundledSchemas {\n [k: string]: unknown;\n}\n/**\n * A 2D point in board inches. Origin at a board corner; JSON uses y-down (downstream renderers may flip to y-up).\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"vec2\".\n */\nexport interface Vec2 {\n x: number;\n y: number;\n}\n/**\n * A model's base. 'round' carries 'diameter'; 'oval' carries 'width'+'length'. 'flying-base' (with 'size': small/large), 'hull', and 'unique' are categories the GW base-size guide gives without standard millimetre dimensions; entries carrying such a category, or any millimetre value not taken from an authoritative source, set 'draft': true to mark them for later hand-authoring.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"base-size\".\n */\nexport interface BaseSize {\n shape: \"round\" | \"oval\" | \"flying-base\" | \"hull\" | \"unique\";\n diameter?: number;\n width?: number;\n length?: number;\n /**\n * Flying-base size class, when 'shape' is 'flying-base'.\n */\n size?: \"small\" | \"large\";\n /**\n * True when the entry is provisional/guessed (e.g. a category without authoritative dimensions) and should be revisited.\n */\n draft?: boolean;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"game-version-ref\".\n */\nexport interface GameVersionReference {\n edition: Edition;\n dataslate: DataslateVersion;\n [k: string]: unknown;\n}\n/**\n * A deployment map: per-side deployment zones, objective positions, and (11e) per-side territory polygons. Pattern geometry carries forward unchanged from 10th edition; downstream tooling (e.g. bevy-deploy-helper) consumes this as the canonical encoding.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"deployment-pattern\".\n */\nexport interface DeploymentPattern {\n id: EntityId;\n name: string;\n /**\n * Mission pack or source the pattern originates from (e.g. 'leviathan').\n */\n source?: string;\n description?: string;\n /**\n * Per-side deployment zones.\n *\n * @minItems 1\n */\n zones: [\n {\n player: Side;\n name?: string;\n shape: ZoneShape;\n position: Vec2;\n /**\n * Hex render color for the zone overlay.\n */\n color?: string;\n },\n ...{\n player: Side;\n name?: string;\n shape: ZoneShape;\n position: Vec2;\n /**\n * Hex render color for the zone overlay.\n */\n color?: string;\n }[]\n ];\n /**\n * 11e per-side territory polygons, mirroring the deployment-zone shape (e.g. the band between a deployment zone and the midline). Empty until authored.\n */\n territories?: {\n player: Side;\n shape: ZoneShape;\n position: Vec2;\n }[];\n /**\n * Objective-marker positions on the board.\n */\n objectives?: Vec2[];\n /**\n * Ids of recommended terrain-layout entities (resolved once terrain-layout data is authored).\n */\n recommended_terrain_layout_ids?: EntityId[];\n game_version: GameVersionReference;\n}\n/**\n * A detachment option within a faction, providing a detachment rule, enhancements, and stratagems.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"detachment\".\n */\nexport interface Detachment {\n id: EntityId;\n name: string;\n faction_id: EntityId;\n detachment_rule_id?: EntityId | null;\n /**\n * 11e: the detachment-point cost (1–3) charged against the army's detachment-point budget. null when not yet assigned.\n */\n detachment_points?: number | null;\n /**\n * 11e: ids of the Force Disposition entities this detachment grants. Empty until assigned.\n */\n force_dispositions?: EntityId[];\n enhancement_ids?: EntityId[];\n stratagem_ids?: EntityId[];\n restrictions?: {\n required_keywords?: KeywordList;\n excluded_keywords?: KeywordList;\n notes?: string;\n } | null;\n game_version: GameVersionReference;\n}\n/**\n * A purchasable upgrade for a character unit, provided by a detachment.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"enhancement\".\n */\nexport interface Enhancement {\n id: EntityId;\n name: string;\n detachment_id: EntityId;\n cost: number;\n /**\n * True when the cost is carried over provisionally (e.g. seeded from a prior edition during migration) and not yet confirmed against the current dataslate.\n */\n points_provisional?: boolean;\n /**\n * 11e: when true, this enhancement applies to up to `max_targets` non-character units while counting as a single Enhancement choice.\n */\n upgrade_tag?: boolean;\n /**\n * Number of units this enhancement may be applied to. Only meaningful when `upgrade_tag` is true; defaults to 1.\n */\n max_targets?: number;\n keyword_restrictions?: KeywordList;\n exclusion_keywords?: KeywordList | null;\n ability_id?: EntityId | null;\n is_unique?: boolean;\n game_version: GameVersionReference;\n}\n/**\n * A playable faction or sub-faction.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"faction\".\n */\nexport interface Faction {\n id: EntityId;\n name: string;\n parent_faction_id?: EntityId | null;\n game_version: GameVersionReference;\n keywords?: KeywordList;\n aliases?: string[];\n /**\n * Reference to the faction-wide ability (e.g., Oath of Moment)\n */\n faction_rule_id?: EntityId | null;\n}\n/**\n * A 11e strategic-intent tag granted by detachments. Players compare dispositions at game start to determine the shared mission; asymmetric primary objectives result.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"force-disposition\".\n */\nexport interface ForceDisposition {\n /**\n * One of the five confirmed launch Force Dispositions.\n */\n id: \"take-and-hold\" | \"disruption\" | \"purge-the-foe\" | \"priority-assets\" | \"reconnaissance\";\n name: string;\n /**\n * Community-authored description of the disposition's effect (original prose only — no reproduced rules text).\n */\n text?: string;\n game_version: GameVersionReference;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"game-version\".\n */\nexport interface GameVersion {\n edition: Edition;\n dataslate: DataslateVersion;\n effective_date: string;\n label?: string;\n supersedes?: DataslateVersion | null;\n}\n/**\n * Defines which character units can attach to which bodyguard units.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"leader-attachment\".\n */\nexport interface LeaderAttachment {\n leader_id: EntityId;\n /**\n * @minItems 1\n */\n eligible_bodyguard_ids: [EntityId, ...EntityId[]];\n game_version: GameVersionReference;\n}\n/**\n * One cell of the 11e Force Disposition matrix: given the player's own Force Disposition and their opponent's, the mission that player plays. Mirrors a single row on a physical Force Disposition card. The (disposition, opponent_disposition) pair is the conceptual key; compound uniqueness across entries is a data convention, not enforced by this schema.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"mission-matchup\".\n */\nexport interface MissionMatchup {\n id: EntityId;\n /**\n * The player's own Force Disposition.\n */\n disposition: \"take-and-hold\" | \"disruption\" | \"purge-the-foe\" | \"priority-assets\" | \"reconnaissance\";\n /**\n * The opponent's Force Disposition.\n */\n opponent_disposition: \"take-and-hold\" | \"disruption\" | \"purge-the-foe\" | \"priority-assets\" | \"reconnaissance\";\n /**\n * Kebab-case identifier\n */\n mission_id: string;\n game_version: GameVersionReference;\n}\n/**\n * An 11e primary mission (the objective a player scores). Which mission a player plays is selected by the Force Disposition matchup matrix (see mission-matchup), keyed on the player's own disposition and their opponent's. Victory points are capped per game and per battle round.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"mission\".\n */\nexport interface Mission {\n id: EntityId;\n name: string;\n /**\n * Mission pack or source the mission originates from.\n */\n source?: string;\n /**\n * Community-authored mission/objective summary (original prose only — no reproduced rules text).\n */\n description?: string;\n /**\n * Maximum primary VP scorable across the whole game. 11e default is 45.\n */\n vp_per_game_cap?: number;\n /**\n * Maximum primary VP scorable in a single battle round. 11e default is 15.\n */\n vp_per_round_cap?: number;\n /**\n * Ids of the deployment-pattern entities (maps) this mission can be played on. Empty until the per-mission maps are confirmed.\n */\n deployment_pattern_ids?: EntityId[];\n game_version: GameVersionReference;\n}\n/**\n * When a VP award is evaluated. A bare `phase` is the legacy shorthand for 'during this phase'; richer triggers add `timing` (the moment within a phase/turn/game), `player_turn`, and a `battle_round` window. A card's section headers map onto these: 'ANY BATTLE ROUND' omits `battle_round`; 'SECOND BATTLE ROUND ONWARDS' is { min: 2 }; 'END OF THE BATTLE' is timing: end-of-battle.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"scoring-trigger\".\n */\nexport interface ScoringTrigger {\n /**\n * The five official game phases. Unchanged between 10th and 11th edition — 11e reorders Pile In timing within the Fight phase but adds no top-level phase.\n */\n phase?: \"command\" | \"movement\" | \"shooting\" | \"charge\" | \"fight\";\n /**\n * The moment the award is checked. 'End of your turn' = end-of-turn; 'End of your Command phase' = end-of-phase with phase: command; 'End of the battle' = end-of-battle.\n */\n timing?: \"start-of-turn\" | \"end-of-turn\" | \"start-of-phase\" | \"end-of-phase\" | \"end-of-battle\";\n player_turn?: PlayerTurn;\n /**\n * Battle-round window in which the trigger is active. Absent means any battle round (1-5). 'Second battle round onwards' is { min: 2 }.\n */\n battle_round?: {\n min?: number;\n max?: number;\n };\n}\n/**\n * A draw-time predicate over an army list (not runtime board state, so deliberately NOT the Ability DSL condition). Used to gate when_drawn operations such as redraws. Example: a card that is void unless the opponent fields a large unit (10e 'Cull the Horde' redrew when the opponent had no unit of 14+ models) is { subject: 'opponent', quantifier: 'none', unit_filter: { model_count_min: 14 } } with operation 'redraw'.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"army-composition-predicate\".\n */\nexport interface ArmyCompositionPredicate {\n /**\n * Whose army list the predicate inspects.\n */\n subject: \"self\" | \"opponent\";\n /**\n * Whether the army must contain ('any') or lack ('none') a unit matching unit_filter for the predicate to hold.\n */\n quantifier: \"any\" | \"none\";\n /**\n * Criteria a unit in the army must satisfy to match. All present criteria must hold (logical AND).\n */\n unit_filter: {\n model_count_min?: number;\n model_count_max?: number;\n wounds_min?: number;\n keywords?: KeywordList;\n };\n}\n/**\n * An 11e mission card. The deck-level rule (draw 2 per turn, keep unscored cards) is separate and not modelled here. This is the per-card shape: an optional on-draw deck operation, an optional player action, and zero or more VP-award blocks. Primary mission cards reuse this shape via card_type. Mechanic blocks reference the Ability DSL; prose is community-authored (no reproduced rules text).\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"secondary-card\".\n */\nexport interface SecondaryCard {\n id: EntityId;\n name: string;\n /**\n * Whether this is a secondary card or a primary mission card (which reuses this shape).\n */\n card_type?: \"secondary\" | \"primary\";\n /**\n * Finer classification within the deck (e.g. a category or tactical/fixed split). Free-form — not enum-locked until 11e categories are confirmed.\n */\n subtype?: string;\n /**\n * Optional deck operation performed when this card is drawn (e.g. redraw, swap). Distinct from combat effects — deck operations have no combat target, so they are not modelled via the Ability DSL effect language. If `condition` is present, the operation fires only when the predicate holds.\n */\n when_drawn?: {\n /**\n * The deck manipulation this card triggers on draw.\n */\n operation: \"reshuffle\" | \"replace\" | \"redraw\" | \"draw-extra\" | \"swap\";\n /**\n * Other cards this operation references, by id.\n */\n card_ids?: EntityId[];\n condition?: ArmyCompositionPredicate1;\n /**\n * Battle-round window in which the draw operation is eligible (e.g. { max: 1 } means 'only when drawn in the first battle round'). Absent means the operation fires regardless of round.\n */\n battle_round?: {\n min?: number;\n max?: number;\n };\n };\n /**\n * Optional player actions the card enables. Most cards have a single action; a few (e.g. Observe Enemy, with separate Baited-removal and Spotted actions) have two distinct actions on the same card.\n *\n * @minItems 1\n */\n actions?: [\n {\n /**\n * Optional kebab-case identifier used to reference this action from `action-completed` conditions in `awards[].when`.\n */\n action_id?: string;\n /**\n * The five official game phases. Unchanged between 10th and 11th edition — 11e reorders Pile In timing within the Fight phase but adds no top-level phase.\n */\n starts?: \"command\" | \"movement\" | \"shooting\" | \"charge\" | \"fight\";\n player_turn?: PlayerTurn;\n units?: AbilityCondition;\n /**\n * Maximum number of times the action may be performed (per turn unless `use_limit_scope` says otherwise).\n */\n use_limit?: number;\n /**\n * Whether `use_limit` is enforced per turn or once per game (e.g. Recover the Relics / Find and Deny 'Overwhelming Force' is once per game).\n */\n use_limit_scope?: \"per-turn\" | \"per-game\";\n completes?: AbilityCondition1;\n effect?: AbilityEffect;\n },\n ...{\n /**\n * Optional kebab-case identifier used to reference this action from `action-completed` conditions in `awards[].when`.\n */\n action_id?: string;\n /**\n * The five official game phases. Unchanged between 10th and 11th edition — 11e reorders Pile In timing within the Fight phase but adds no top-level phase.\n */\n starts?: \"command\" | \"movement\" | \"shooting\" | \"charge\" | \"fight\";\n player_turn?: PlayerTurn;\n units?: AbilityCondition;\n /**\n * Maximum number of times the action may be performed (per turn unless `use_limit_scope` says otherwise).\n */\n use_limit?: number;\n /**\n * Whether `use_limit` is enforced per turn or once per game (e.g. Recover the Relics / Find and Deny 'Overwhelming Force' is once per game).\n */\n use_limit_scope?: \"per-turn\" | \"per-game\";\n completes?: AbilityCondition1;\n effect?: AbilityEffect;\n }[]\n ];\n /**\n * VP-award blocks: each scores when `trigger` fires and the optional `when` condition holds. An award scores either a flat `vp` or a count-scaled `vp_per` (VP per instance of the thing named by `per`). Awards accrue independently and sum; a card's '+ ... CUMULATIVE' rows are modelled as separate awards flagged `cumulative` for faithful round-trip. Awards sharing the same `exclusive_group` value within a card resolve as the highest-scoring single award fires (the card's literal 'OR' rows between tier breakpoints, e.g. Record-Breaking Mission's 3-Fronts vs 4-Fronts).\n *\n * @minItems 1\n */\n awards?: [\n (\n | {\n [k: string]: unknown;\n }\n | {\n [k: string]: unknown;\n }\n ),\n ...(\n | {\n [k: string]: unknown;\n }\n | {\n [k: string]: unknown;\n }\n )[]\n ];\n /**\n * Community-authored card description (original prose only — no reproduced rules text).\n */\n text?: string;\n game_version: GameVersionReference;\n}\n/**\n * Draw-time army-composition predicate gating the operation (e.g. redraw when the opponent lacks a qualifying unit).\n */\nexport interface ArmyCompositionPredicate1 {\n /**\n * Whose army list the predicate inspects.\n */\n subject: \"self\" | \"opponent\";\n /**\n * Whether the army must contain ('any') or lack ('none') a unit matching unit_filter for the predicate to hold.\n */\n quantifier: \"any\" | \"none\";\n /**\n * Criteria a unit in the army must satisfy to match. All present criteria must hold (logical AND).\n */\n unit_filter: {\n model_count_min?: number;\n model_count_max?: number;\n wounds_min?: number;\n keywords?: KeywordList;\n };\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"simple-condition\".\n */\nexport interface SimpleCondition {\n type:\n | \"phase-is\"\n | \"timing-is\"\n | \"player-turn-is\"\n | \"unit-below-starting-strength\"\n | \"unit-below-half-strength\"\n | \"unit-has-keyword\"\n | \"unit-within-range-of\"\n | \"model-is-leader\"\n | \"target-has-keyword\"\n | \"charged-this-turn\"\n | \"advanced-this-turn\"\n | \"remained-stationary\"\n | \"is-battle-shocked\"\n | \"has-lost-wounds\"\n | \"opponent-unit-within-range\"\n | \"within-range-of-objective\"\n | \"attack-is-type\"\n | \"has-fought-this-phase\"\n | \"destroyed-by-attack-type\"\n | \"controls-objective\"\n | \"is-attached\"\n | \"terrain-area-control\"\n | \"engagement-state\"\n | \"territory-control\"\n | \"fights-first\"\n | \"disposition-matches\"\n | \"units-destroyed\"\n | \"units-destroyed-comparison\"\n | \"objective-majority\"\n | \"action-completed\"\n | \"objective-has-tag\"\n | \"unit-has-tag\"\n | \"terrain-has-tag\"\n | \"new-objective-controlled\"\n | \"engagement-fronts\"\n | \"destroyed-while-on-objective\"\n | \"destroyed-in-tagged-terrain\";\n parameters?: {\n [k: string]: unknown;\n };\n negated?: boolean;\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"compound-condition\".\n */\nexport interface CompoundCondition {\n operator: \"and\" | \"or\" | \"not\";\n /**\n * @minItems 1\n */\n operands: [ConditionNode, ...ConditionNode[]];\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"single-effect\".\n */\nexport interface SingleEffect {\n type:\n | \"stat-modifier\"\n | \"roll-modifier\"\n | \"re-roll\"\n | \"mortal-wounds\"\n | \"feel-no-pain\"\n | \"invulnerable-save\"\n | \"ward\"\n | \"keyword-grant\"\n | \"movement-modifier\"\n | \"deep-strike\"\n | \"fallback-and-act\"\n | \"fight-first\"\n | \"fight-last\"\n | \"shoot-on-death\"\n | \"fight-on-death\"\n | \"objective-control-modifier\"\n | \"leadership-modifier\"\n | \"damage-reduction\"\n | \"attack-restriction\"\n | \"ability-grant\"\n | \"cp-gain\"\n | \"cp-refund\"\n | \"model-destruction\"\n | \"resurrection\"\n | \"resource-gain\"\n | \"resource-spend\"\n | \"charge-roll-modifier\"\n | \"terrain-area-tag\"\n | \"objective-tag\"\n | \"unit-tag\"\n | \"bs-modifier\"\n | \"engagement-passthrough\";\n target:\n | \"self\"\n | \"bearer\"\n | \"unit\"\n | \"attached-unit\"\n | \"attacker\"\n | \"defender\"\n | \"friendly-within-aura\"\n | \"enemy-within-aura\"\n | \"all-friendly\"\n | \"all-enemy\";\n modifier?: {\n [k: string]: unknown;\n };\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"choice-effect\".\n */\nexport interface ChoiceEffect {\n type: \"choice\";\n /**\n * @minItems 2\n */\n options: [EffectNode, EffectNode, ...EffectNode[]];\n choice_label?: string;\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"sequence-effect\".\n */\nexport interface SequenceEffect {\n type: \"sequence\";\n /**\n * @minItems 1\n */\n steps: [EffectNode, ...EffectNode[]];\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"dice-gated-effect\".\n */\nexport interface DiceGatedEffect {\n type: \"dice-gated\";\n /**\n * Dice expression, e.g. 'D6', '2D6'\n */\n dice: string;\n /**\n * Fixed threshold or model characteristic to compare against\n */\n threshold: number | (\"leadership\" | \"toughness\" | \"save\");\n comparison?: \"gte\" | \"lte\" | \"gt\" | \"lt\" | \"eq\";\n on_success?: EffectNode | null;\n on_fail?: EffectNode | null;\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"conditional-effect\".\n */\nexport interface ConditionalEffect {\n type: \"conditional\";\n condition: AbilityCondition2;\n effect: EffectNode;\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"dice-pool-allocation-effect\".\n */\nexport interface DicePoolAllocationEffect {\n type: \"dice-pool-allocation\";\n pool: {\n count: number;\n die: string;\n [k: string]: unknown;\n };\n max_activations: number;\n /**\n * @minItems 1\n */\n options: [\n {\n name: string;\n requirement: {\n type: \"pair\" | \"triple\" | \"single\" | \"run\";\n min_value: number;\n [k: string]: unknown;\n };\n effect: EffectNode;\n [k: string]: unknown;\n },\n ...{\n name: string;\n requirement: {\n type: \"pair\" | \"triple\" | \"single\" | \"run\";\n min_value: number;\n [k: string]: unknown;\n };\n effect: EffectNode;\n [k: string]: unknown;\n }[]\n ];\n [k: string]: unknown;\n}\n/**\n * A CP-costed ability usable during specific game phases.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"stratagem\".\n */\nexport interface Stratagem {\n id: EntityId;\n name: string;\n /**\n * Whether this is a universal core stratagem or tied to a specific detachment\n */\n category: \"core\" | \"detachment\";\n /**\n * GW-printed stratagem category from the card\n */\n type: \"battle-tactic\" | \"strategic-ploy\" | \"epic-deed\" | \"wargear\";\n /**\n * Null for core stratagems\n */\n detachment_id?: EntityId | null;\n cp_cost: number;\n phases: PhaseList;\n player_turn: PlayerTurn;\n timing: \"once-per-phase\" | \"once-per-turn\" | \"once-per-battle\" | \"unlimited\";\n target_restrictions?: {\n required_keywords?: KeywordList;\n excluded_keywords?: KeywordList;\n notes?: string;\n } | null;\n ability_id?: EntityId | null;\n game_version: GameVersionReference;\n}\n/**\n * One terrain piece placed on the board. Geometry comes from a catalog `template` or an inline `footprint` (if both are present, `footprint` is authoritative and `template` is provenance).\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"piece\".\n */\nexport interface Piece {\n /**\n * Kebab-case identifier\n */\n id?: string;\n name?: string;\n /**\n * An `area` is a gameplay terrain zone (the 11e 'terrain area'); a `feature` is physical scenery (walls, containers, pipes) placed on an area.\n */\n piece_type?: \"area\" | \"feature\";\n /**\n * Kebab-case identifier\n */\n template?: string;\n /**\n * Inline geometry, standing in for or overriding a template footprint. Authoritative when present.\n */\n footprint?:\n | {\n type: \"rectangle\";\n width: number;\n height: number;\n }\n | {\n type: \"right-triangle\";\n width: number;\n height: number;\n }\n | {\n type: \"polygon\";\n /**\n * @minItems 3\n */\n points: [Vec2, Vec2, Vec2, ...Vec2[]];\n };\n position: Vec21;\n /**\n * Clockwise rotation about the centroid in the y-down board frame. Absent or 0 means the template's natural orientation.\n */\n rotation_degrees?: number;\n /**\n * Reflection applied in the centroid-local frame before rotation: `horizontal` negates local x (left-right flip), `vertical` negates local y.\n */\n mirror?: \"none\" | \"horizontal\" | \"vertical\";\n /**\n * Kebab-case identifier\n */\n parent_area_id?: string;\n /**\n * Ruin floor this piece occupies (0 = ground level).\n */\n floor?: number;\n /**\n * Height of the piece in inches; overrides the template default. Gates Plunging Fire (a piece 3\" or taller confers +1 BS on ground-level targets).\n */\n height_inches?: number;\n /**\n * Terrain-area keywords this piece's area carries; overrides the template default.\n */\n terrain_area_keywords?: TerrainAreaKeyword[];\n /**\n * Pieces sharing a `link_group` value are linked terrain — treated as a single terrain feature (and, where an objective sits among them, a single objective).\n */\n link_group?: string;\n /**\n * Designates this terrain area — or, when `link_group`'d, the union of linked areas (one objective for the set) — as carrying an objective of the given 11e role: `home` (inside a deployment zone), `center` (board middle), or `expansion` (no-man's-land). Implies `is_objective`.\n */\n objective_role?: \"home\" | \"expansion\" | \"center\";\n /**\n * Whether this piece carries an objective marker.\n */\n is_objective?: boolean;\n /**\n * Objective-marker metadata. Only meaningful when `is_objective` is true.\n */\n objective?: {\n position?: Vec22;\n /**\n * Range from the marker within which models contribute to control.\n */\n control_range_inches?: number;\n };\n /**\n * Measurement keystones: the author-selected dimension lines a reference card prints so a player can place this piece with a tape measure (board edge → a feature of the placed piece). Only the selection is stored — the distance is always DERIVED from the resolved geometry by the shared keystone resolver (pinned by the conformance corpus), so a keystone can never disagree with the layout. Vertex indices follow the resolver's pinned vertex order; re-authoring a template's footprint invalidates them, so review keystones when geometry changes.\n */\n keystones?: {\n /**\n * The board edge the measurement runs from, in the y-down board frame (left/right pin x against board width; top/bottom pin y against board height).\n */\n edge: \"left\" | \"right\" | \"top\" | \"bottom\";\n /**\n * Which feature of the placed piece the measurement reaches: a footprint vertex (by resolver vertex order) or an axis-aligned bounding face of the placed footprint.\n */\n ref:\n | {\n kind: \"vertex\";\n index: number;\n }\n | {\n kind: \"face\";\n side: \"min-x\" | \"max-x\" | \"min-y\" | \"max-y\";\n };\n }[];\n}\n/**\n * A 2D point in board inches. Origin at a board corner; JSON uses y-down (downstream renderers may flip to y-up).\n */\nexport interface Vec21 {\n x: number;\n y: number;\n}\n/**\n * A 2D point in board inches. Origin at a board corner; JSON uses y-down (downstream renderers may flip to y-up).\n */\nexport interface Vec22 {\n x: number;\n y: number;\n}\n/**\n * A recommended arrangement of terrain pieces on the board, independent of the deployment map (a deployment-pattern references the layouts it recommends via recommended_terrain_layout_ids). Each piece draws its geometry from a catalog `template` (a terrain-template entity) or an inline `footprint`; geometry is the source of truth. Placement is template-centroid-anchored: `position` is the piece's centroid, which is invariant under rotation and mirror, so orientation and location are decoupled. Resolved board-space vertices are derived by the shared terrain resolver (pinned by the conformance corpus), never stored here. No layout data is authored yet beyond migrated examples.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"terrain-layout\".\n */\nexport interface TerrainLayout {\n id: EntityId;\n name: string;\n /**\n * Mission pack or source the layout originates from.\n */\n source?: string;\n description?: string;\n /**\n * Kebab-case identifier\n */\n mission_matchup_id?: string;\n /**\n * The card's trailing variant number within its mission matchup (1–3 at launch, since three layouts share each pairing). No hard maximum, to avoid a breaking change if more variants ship.\n */\n variant?: number;\n /**\n * Kebab-case identifier\n */\n deployment_pattern_id?: string;\n /**\n * Terrain pieces composing the layout. May be empty while a layout is registered by name ahead of its confirmed geometry.\n */\n pieces?: Piece[];\n game_version: GameVersionReference;\n}\n/**\n * A feature placed on an area template, positioned in the area's centroid-local frame (y-down inches). When the area is placed, rotated, or mirrored, its composed features are carried along.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"composed-feature\".\n */\nexport interface ComposedFeature {\n /**\n * Kebab-case identifier\n */\n id?: string;\n /**\n * Kebab-case identifier\n */\n template: string;\n position: Vec23;\n /**\n * Clockwise rotation of the feature about its own centroid, within the area-local frame.\n */\n rotation_degrees?: number;\n mirror?: \"none\" | \"horizontal\" | \"vertical\";\n /**\n * Ruin floor this feature occupies (0 = ground level).\n */\n floor?: number;\n}\n/**\n * A 2D point in board inches. Origin at a board corner; JSON uses y-down (downstream renderers may flip to y-up).\n */\nexport interface Vec23 {\n x: number;\n y: number;\n}\n/**\n * A reusable terrain piece in the standard catalog: a gameplay area (the 11e terrain-area templates) or a scenery feature (walls, containers, pipes, floor segments). Footprints are authored in natural local inches; the terrain resolver derives each footprint's polygon area centroid and re-centers on it, so a layout piece that instances a template places its centroid via the layout's `position`. An `area` template may carry an embedded `features` list — scenery placed in the area's centroid-local frame — making the template a reusable composition (e.g. a ruin with its walls). Placing such a template places all of its features, transformed by the area's own placement.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"terrain-template\".\n */\nexport interface TerrainTemplate {\n id: EntityId;\n name: string;\n /**\n * `area` = a gameplay terrain zone; `feature` = physical scenery placed on an area.\n */\n kind: \"area\" | \"feature\";\n /**\n * Catalog or mission pack the template originates from.\n */\n source?: string;\n footprint: Footprint;\n /**\n * Default height in inches for pieces instancing this template. Gates Plunging Fire (>= 3\").\n */\n default_height_inches?: number;\n /**\n * Whether the template blocks line of sight / movement by default.\n */\n default_blocking?: boolean;\n /**\n * Whether models may be placed on the ground footprint. `false` marks an elevated-only piece (a platform reachable only on its `upper_floor`, e.g. a gantry/catwalk) or a solid obstacle with no valid placement (e.g. a generator). Meaningful for `kind: \"feature\"`.\n */\n ground_accessible?: boolean;\n /**\n * An elevated platform carried by this feature (e.g. a ruin's second storey). Its footprint is authored in the SAME local frame as `footprint` and re-centered on the GROUND footprint's polygon area centroid, so the two floors stay registered when the piece is placed, rotated, or mirrored. Non-resolved metadata: the terrain resolver does not emit it; authoring/visualization tools render it as an overlay. Meaningful for `kind: \"feature\"`.\n */\n upper_floor?: {\n footprint: Footprint;\n /**\n * Ruin floor this platform occupies (1 = first floor above ground).\n */\n floor?: number;\n };\n /**\n * Terrain-area keywords areas of this template carry by default. Meaningful for `kind: \"area\"`.\n */\n default_terrain_area_keywords?: TerrainAreaKeyword[];\n /**\n * Composed scenery features, in the area's centroid-local frame. Only meaningful for `kind: \"area\"`.\n */\n features?: ComposedFeature[];\n game_version: GameVersionReference;\n}\n/**\n * Describes the internal model-type breakdown of a unit.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"unit-composition\".\n */\nexport interface UnitComposition {\n unit_id: EntityId;\n /**\n * @minItems 1\n */\n models: [\n {\n name: string;\n profile_name?: string | null;\n min: number;\n max: number;\n default_weapon_ids?: EntityId[];\n is_leader_model?: boolean;\n base_size_mm?: BaseSize1;\n },\n ...{\n name: string;\n profile_name?: string | null;\n min: number;\n max: number;\n default_weapon_ids?: EntityId[];\n is_leader_model?: boolean;\n base_size_mm?: BaseSize1;\n }[]\n ];\n game_version: GameVersionReference;\n}\n/**\n * This model's base. Absent when no base could be resolved for the model.\n */\nexport interface BaseSize1 {\n shape: \"round\" | \"oval\" | \"flying-base\" | \"hull\" | \"unique\";\n diameter?: number;\n width?: number;\n length?: number;\n /**\n * Flying-base size class, when 'shape' is 'flying-base'.\n */\n size?: \"small\" | \"large\";\n /**\n * True when the entry is provisional/guessed (e.g. a category without authoritative dimensions) and should be revisited.\n */\n draft?: boolean;\n}\n/**\n * A unit datasheet entry with stat profiles and point costs.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"unit\".\n */\nexport interface Unit {\n id: EntityId;\n name: string;\n faction_id: EntityId;\n /**\n * Battlefield role from the datasheet header. Unit types (Infantry, Vehicle, etc.) belong in keywords.\n */\n role?: \"character\" | \"battleline\" | \"dedicated-transport\" | \"fortification\" | \"allied\" | \"epic-hero\";\n /**\n * Character attachment role (11e). 'support' implies the unit is only legal when attached to a host unit (cannot be taken solo); 'leader' is valid as a standalone list entry. null/absent for non-attaching units.\n */\n attachment_role?: (\"leader\" | \"support\") | null;\n /**\n * @minItems 1\n */\n profiles: [\n {\n /**\n * Profile name (e.g., 'Wounded' for degrading)\n */\n name?: string;\n M: StatValue;\n T: number;\n W: number;\n Sv: number;\n invuln_sv?: number | null;\n Ld: number;\n OC: number;\n [k: string]: unknown;\n },\n ...{\n /**\n * Profile name (e.g., 'Wounded' for degrading)\n */\n name?: string;\n M: StatValue;\n T: number;\n W: number;\n Sv: number;\n invuln_sv?: number | null;\n Ld: number;\n OC: number;\n [k: string]: unknown;\n }[]\n ];\n points?: {\n models: number;\n cost: number;\n [k: string]: unknown;\n }[];\n /**\n * True when point costs are carried over provisionally (e.g. seeded from a prior edition during migration) and not yet confirmed against the current dataslate.\n */\n points_provisional?: boolean;\n keywords?: KeywordList;\n faction_keywords?: KeywordList;\n /**\n * The unit's representative base (the most-numerous model's base). Mixed-model units carry the full per-model breakdown in unit-composition; this top-level value is a convenience for consumers that need a single base.\n */\n base_size_mm?: BaseSize | null;\n model_count?: {\n min: number;\n max: number;\n [k: string]: unknown;\n };\n weapon_ids?: EntityId[];\n ability_ids?: EntityId[];\n transport_capacity?: {\n capacity: number;\n keyword_restrictions?: KeywordList | null;\n exclusion_keywords?: KeywordList | null;\n } | null;\n game_version: GameVersionReference;\n is_legend?: boolean;\n}\n/**\n * A wargear option available to models within a unit: a weapon/wargear swap, a pure add-on, or a choice between alternatives. Models start with the unit's base loadout; an option modifies that loadout for the number of models its `model_constraint` permits.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"wargear-option\".\n */\nexport interface WargearOption {\n id: EntityId;\n unit_id: EntityId;\n model_constraint?: {\n model_name?: string;\n per_n_models?: number;\n max_count?: number;\n /**\n * When true, every model in the unit may take the option ('Any number of models can each ...'). Mutually exclusive in spirit with `per_n_models`.\n */\n any_number?: boolean;\n } | null;\n /**\n * Weapon or wargear IDs removed from the model. Omit for a pure add-on (the option only equips new wargear).\n *\n * @minItems 1\n */\n replaces?: [EntityId, ...EntityId[]];\n /**\n * Weapon or wargear IDs added to the model — all of them. Exactly one of `replacement` / `replacement_choice` is present.\n *\n * @minItems 1\n */\n replacement?: [EntityId, ...EntityId[]];\n /**\n * A choice of replacements ('one of the following'): pick exactly one inner group; each group's IDs are all added together. Exactly one of `replacement` / `replacement_choice` is present.\n *\n * @minItems 2\n */\n replacement_choice?: [[EntityId, ...EntityId[]], [EntityId, ...EntityId[]], ...[EntityId, ...EntityId[]][]];\n is_free?: boolean;\n additional_cost?: number | null;\n game_version: GameVersionReference;\n}\n/**\n * A non-weapon item a model may carry — an icon, attachment, or other piece of equipment with no weapon profile. Weapons live in weapon.schema.json; this entity exists so wargear-option swaps and add-ons can reference equipment that is not a weapon.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"wargear\".\n */\nexport interface Wargear {\n id: EntityId;\n name: string;\n category?: string | null;\n game_version: GameVersionReference;\n}\n/**\n * Catalog entry for a weapon keyword (Lethal Hits, Sustained Hits N, Anti-X N+, etc.). Each weapon profile references entries here via {keyword_id, parameters?} instead of carrying free-text strings. The optional `effect` describes the keyword's game mechanic in the Ability DSL; null when the behaviour is faction-specific flavour not yet modelled.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"weapon-keyword\".\n */\nexport interface WeaponKeyword {\n id: EntityId;\n name: string;\n /**\n * Parameter keys that must be supplied at each reference site, in the order they would appear in a printed datasheet (e.g. Anti-INFANTRY 4+ → ['target_keyword', 'threshold']).\n *\n * @maxItems 3\n */\n required_parameters:\n | []\n | [\"value\" | \"target_keyword\" | \"threshold\"]\n | [\"value\" | \"target_keyword\" | \"threshold\", \"value\" | \"target_keyword\" | \"threshold\"]\n | [\n \"value\" | \"target_keyword\" | \"threshold\",\n \"value\" | \"target_keyword\" | \"threshold\",\n \"value\" | \"target_keyword\" | \"threshold\"\n ];\n /**\n * Mechanical effect of this keyword. Null when the behaviour is faction-specific flavour not yet expressible in the DSL — engines treat such references as no-op buffs and may surface them as 'cannot auto-apply'.\n */\n effect: AbilityEffect1 | null;\n game_version: GameVersionReference;\n}\n/**\n * A weapon entry with one or more stat profiles (e.g., standard and overcharge modes).\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"weapon\".\n */\nexport interface Weapon {\n id: EntityId;\n name: string;\n type: \"ranged\" | \"melee\";\n /**\n * @minItems 1\n */\n profiles: [\n {\n name: string;\n range?: number | \"Melee\";\n stats: {\n A: StatValue;\n BS?: number | null;\n WS?: number | null;\n S: StatValue;\n AP: number;\n D: StatValue;\n [k: string]: unknown;\n };\n /**\n * References into the weapon-keyword catalog. Each entry names the catalog id and supplies parameter values (e.g. `Sustained Hits 1` → `{keyword_id: 'sustained-hits', parameters: {value: 1}}`).\n */\n keywords?: {\n keyword_id: EntityId;\n /**\n * Reference-site parameters conforming to the catalog entry's required_parameters. Only the three documented keys are accepted; any other key is invalid.\n */\n parameters?: {\n value?: StatValue;\n target_keyword?: string;\n threshold?: number;\n };\n }[];\n },\n ...{\n name: string;\n range?: number | \"Melee\";\n stats: {\n A: StatValue;\n BS?: number | null;\n WS?: number | null;\n S: StatValue;\n AP: number;\n D: StatValue;\n [k: string]: unknown;\n };\n /**\n * References into the weapon-keyword catalog. Each entry names the catalog id and supplies parameter values (e.g. `Sustained Hits 1` → `{keyword_id: 'sustained-hits', parameters: {value: 1}}`).\n */\n keywords?: {\n keyword_id: EntityId;\n /**\n * Reference-site parameters conforming to the catalog entry's required_parameters. Only the three documented keys are accepted; any other key is invalid.\n */\n parameters?: {\n value?: StatValue;\n target_keyword?: string;\n threshold?: number;\n };\n }[];\n }[]\n ];\n game_version: GameVersionReference;\n}\n/**\n * Community-authored structured representation of what a game ability does. NOT GW text.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"ability\".\n */\nexport interface AbilityDSLEntry {\n ability_id: EntityId;\n name: string;\n authored_by: ContributorRef;\n game_version: GameVersionReference;\n version?: DataslateVersion;\n supersedes?: DataslateVersion | null;\n unit_ids?: EntityId[];\n /**\n * For faction-type abilities, the faction this rule belongs to\n */\n faction_id?: EntityId | null;\n /**\n * For detachment/enhancement/stratagem-type abilities, the associated detachment\n */\n detachment_id?: EntityId | null;\n ability_type?: \"core\" | \"faction\" | \"detachment\" | \"unit\" | \"enhancement\" | \"stratagem\";\n /**\n * How this ability interacts with the game flow — not a runtime predicate\n */\n behavior?: \"passive\" | \"activated\" | \"reactive\" | \"aura\";\n effect: AbilityEffect1;\n scope: AbilityScope;\n interactions?: {\n ability_ref: EntityId;\n type: \"conflicts-with\" | \"combos-with\" | \"superseded-by\" | \"requires\" | \"replaces\";\n notes?: string;\n [k: string]: unknown;\n }[];\n disputed?: boolean;\n dispute_notes?: string;\n community_notes?: string;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"scope\".\n */\nexport interface AbilityScope {\n range:\n | \"self\"\n | \"unit\"\n | \"attached\"\n | \"aura-6\"\n | \"aura-9\"\n | \"aura-12\"\n | \"aura-custom\"\n | \"engagement-range\"\n | \"any-visible\"\n | \"any-on-battlefield\"\n | \"terrain-within-range\";\n duration: \"phase\" | \"turn\" | \"battle-round\" | \"battle\" | \"until-next-command-phase\" | \"one-use\" | \"permanent\";\n range_inches?: number;\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"interaction-flag\".\n */\nexport interface InteractionFlag {\n ability_a: EntityId;\n ability_b: EntityId;\n interaction_type: \"conflicts\" | \"combos\" | \"sequencing-dependent\" | \"stacks\" | \"does-not-stack\" | \"replaces\";\n resolution?: string;\n faq_reference?: string;\n disputed?: boolean;\n game_version: GameVersionReference;\n authored_by?: ContributorRef;\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"phase-mapping\".\n */\nexport interface PhaseMapping {\n source_id: EntityId;\n source_type: SourceType;\n phases: PhaseList;\n game_version: GameVersionReference;\n authored_by?: ContributorRef;\n [k: string]: unknown;\n}\n/**\n * A faction's resource system (Miracle Dice, Pain tokens, Blessings dice pool, etc.).\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"resource-pool\".\n */\nexport interface ResourcePool {\n id: EntityId;\n name: string;\n faction_id: EntityId;\n pool_type: \"token\" | \"dice-pool\" | \"counter\";\n generation?: {\n condition: AbilityCondition2;\n amount: StatValue;\n [k: string]: unknown;\n }[];\n max_size?: number | null;\n game_version: GameVersionReference;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"timing-flag\".\n */\nexport interface TimingFlag {\n source_id: EntityId;\n source_type: SourceType;\n timing:\n | \"start-of-phase\"\n | \"end-of-phase\"\n | \"before-hit-roll\"\n | \"after-hit-roll\"\n | \"before-wound-roll\"\n | \"after-wound-roll\"\n | \"before-save-roll\"\n | \"after-save-roll\"\n | \"before-damage-roll\"\n | \"after-damage-roll\"\n | \"before-charge-roll\"\n | \"after-charge-roll\"\n | \"before-advance-roll\"\n | \"after-advance-roll\"\n | \"before-battle-shock\"\n | \"after-battle-shock\"\n | \"on-unit-selected\"\n | \"on-unit-destroyed\"\n | \"on-model-destroyed\"\n | \"on-damage-allocated\";\n game_version: GameVersionReference;\n authored_by?: ContributorRef;\n [k: string]: unknown;\n}\n"]}
1
+ {"version":3,"file":"generated.js","sourceRoot":"","sources":["../src/generated.ts"],"names":[],"mappings":"AAAA,gHAAgH","sourcesContent":["/* Generated from crates/wh40kdc/schemas/bundled.schema.json by 'npm run codegen:types'. DO NOT EDIT BY HAND. */\n\n/**\n * Kebab-case identifier\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"entity-id\".\n */\nexport type EntityId = string;\n/**\n * Game edition, e.g. '10th' or '11'\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"edition\".\n */\nexport type Edition = string;\n/**\n * Dataslate version: a quarterly tag (e.g. '2025-q3') or a named kebab-case slug for non-quarterly slates (e.g. 'pre-launch-provisional')\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"dataslate-version\".\n */\nexport type DataslateVersion = string;\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"keyword\".\n */\nexport type Keyword = string;\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"keyword-list\".\n */\nexport type KeywordList = Keyword[];\n/**\n * A stat that can be a fixed number or a dice expression\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"stat-value\".\n */\nexport type StatValue = number | string;\n/**\n * GitHub handle or '40kdc-community'\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"contributor-ref\".\n */\nexport type ContributorRef = string;\n/**\n * The five official game phases. Unchanged between 10th and 11th edition — 11e reorders Pile In timing within the Fight phase but adds no top-level phase.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"phase\".\n */\nexport type Phase = \"command\" | \"movement\" | \"shooting\" | \"charge\" | \"fight\";\n/**\n * @minItems 1\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"phase-list\".\n */\nexport type PhaseList = [Phase, ...Phase[]];\n/**\n * Type of game element that is the source of an enrichment entry\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"source-type\".\n */\nexport type SourceType = \"ability\" | \"stratagem\" | \"enhancement\" | \"detachment-rule\" | \"faction-rule\";\n/**\n * Which player's turn this applies during\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"player-turn\".\n */\nexport type PlayerTurn = \"your-turn\" | \"opponent-turn\" | \"either\";\n/**\n * 11e battle size, which sets the army's points limit and detachment-point budget: 'incursion' = 1000 pts / 2 detachment points; 'strike-force' = 2000 pts / 3 detachment points.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"battle-size\".\n */\nexport type BattleSize = \"incursion\" | \"strike-force\";\n/**\n * One of the five confirmed 11e launch Force Dispositions. Shared by force-disposition entities and the mission-matchup matrix.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"force-disposition-id\".\n */\nexport type ForceDispositionId =\n | \"take-and-hold\"\n | \"disruption\"\n | \"purge-the-foe\"\n | \"priority-assets\"\n | \"reconnaissance\";\n/**\n * A terrain piece's 2D footprint in local inches (y-down): an axis-aligned rectangle with its min corner at the local origin, a right triangle with the right angle at the local origin and legs along +x/+y, or an explicit polygon (>= 3 points). The placement resolver re-centers the footprint on its polygon area centroid, so the local-origin convention does not affect where the piece lands — only its shape matters.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"footprint\".\n */\nexport type Footprint =\n | {\n type: \"rectangle\";\n width: number;\n height: number;\n }\n | {\n type: \"right-triangle\";\n width: number;\n height: number;\n }\n | {\n type: \"polygon\";\n /**\n * @minItems 3\n */\n points: [Vec2, Vec2, Vec2, ...Vec2[]];\n };\n/**\n * An 11e terrain-area keyword. Confirmed launch set; extend as further keywords publish on dataslate.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"terrain-area-keyword\".\n */\nexport type TerrainAreaKeyword = \"obscuring\" | \"hidden\" | \"plunging-fire\";\n/**\n * A zone footprint, expressed as an axis-aligned rectangle or an explicit polygon. Vertices/extent are relative to the owning element's position.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"zone-shape\".\n */\nexport type ZoneShape =\n | {\n type: \"rectangle\";\n width: number;\n height: number;\n }\n | {\n type: \"polygon\";\n /**\n * @minItems 3\n */\n points: [Vec2, Vec2, Vec2, ...Vec2[]];\n };\n/**\n * Which player a zone or territory belongs to.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"side\".\n */\nexport type Side = \"attacker\" | \"defender\";\n/**\n * Eligibility predicate for which units may perform the action.\n */\nexport type AbilityCondition = SimpleCondition | CompoundCondition;\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"condition-node\".\n */\nexport type ConditionNode = SimpleCondition | CompoundCondition;\n/**\n * Predicate for when the action is considered complete.\n */\nexport type AbilityCondition1 = SimpleCondition | CompoundCondition;\n/**\n * Effect applied when the action completes (e.g. terrain-area-tag, objective-tag, or unit-tag to mark transient state).\n */\nexport type AbilityEffect =\n | SingleEffect\n | ChoiceEffect\n | SequenceEffect\n | DiceGatedEffect\n | ConditionalEffect\n | DicePoolAllocationEffect;\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"effect-node\".\n */\nexport type EffectNode =\n | SingleEffect\n | ChoiceEffect\n | SequenceEffect\n | DiceGatedEffect\n | ConditionalEffect\n | DicePoolAllocationEffect;\nexport type AbilityCondition2 = SimpleCondition | CompoundCondition;\n/**\n * Predicate that BLOCKS starting the action while it holds (Sensor Sweep: a unit cannot start this action if there is only one operation marker on the battlefield).\n */\nexport type AbilityCondition3 = SimpleCondition | CompoundCondition;\nexport type AbilityEffect1 =\n | SingleEffect\n | ChoiceEffect\n | SequenceEffect\n | DiceGatedEffect\n | ConditionalEffect\n | DicePoolAllocationEffect;\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"condition\".\n */\nexport type AbilityCondition4 = SimpleCondition | CompoundCondition;\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"effect\".\n */\nexport type AbilityEffect2 =\n | SingleEffect\n | ChoiceEffect\n | SequenceEffect\n | DiceGatedEffect\n | ConditionalEffect\n | DicePoolAllocationEffect;\n\n/**\n * Auto-generated by tools/src/bundle-schemas.ts. Single self-contained schema for Rust codegen — do not edit by hand.\n */\nexport interface KdcBundledSchemas {\n [k: string]: unknown;\n}\n/**\n * A 2D point in board inches. Origin at a board corner; JSON uses y-down (downstream renderers may flip to y-up).\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"vec2\".\n */\nexport interface Vec2 {\n x: number;\n y: number;\n}\n/**\n * A model's base. 'round' carries 'diameter'; 'oval' carries 'width'+'length'. 'flying-base' (with 'size': small/large), 'hull', and 'unique' are categories the GW base-size guide gives without standard millimetre dimensions; entries carrying such a category, or any millimetre value not taken from an authoritative source, set 'draft': true to mark them for later hand-authoring.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"base-size\".\n */\nexport interface BaseSize {\n shape: \"round\" | \"oval\" | \"flying-base\" | \"hull\" | \"unique\";\n diameter?: number;\n width?: number;\n length?: number;\n /**\n * Flying-base size class, when 'shape' is 'flying-base'.\n */\n size?: \"small\" | \"large\";\n /**\n * True when the entry is provisional/guessed (e.g. a category without authoritative dimensions) and should be revisited.\n */\n draft?: boolean;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"game-version-ref\".\n */\nexport interface GameVersionReference {\n edition: Edition;\n dataslate: DataslateVersion;\n [k: string]: unknown;\n}\n/**\n * A deployment map: per-side deployment zones, objective positions, and (11e) per-side territory polygons. Pattern geometry carries forward unchanged from 10th edition; downstream tooling (e.g. bevy-deploy-helper) consumes this as the canonical encoding.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"deployment-pattern\".\n */\nexport interface DeploymentPattern {\n id: EntityId;\n name: string;\n /**\n * Mission pack or source the pattern originates from (e.g. 'leviathan').\n */\n source?: string;\n description?: string;\n /**\n * Per-side deployment zones.\n *\n * @minItems 1\n */\n zones: [\n {\n player: Side;\n name?: string;\n shape: ZoneShape;\n position: Vec2;\n /**\n * Hex render color for the zone overlay.\n */\n color?: string;\n },\n ...{\n player: Side;\n name?: string;\n shape: ZoneShape;\n position: Vec2;\n /**\n * Hex render color for the zone overlay.\n */\n color?: string;\n }[]\n ];\n /**\n * 11e per-side territory polygons, mirroring the deployment-zone shape (e.g. the band between a deployment zone and the midline). Empty until authored.\n */\n territories?: {\n player: Side;\n shape: ZoneShape;\n position: Vec2;\n }[];\n /**\n * Objective-marker positions on the board.\n */\n objectives?: Vec2[];\n /**\n * Ids of recommended terrain-layout entities (resolved once terrain-layout data is authored).\n */\n recommended_terrain_layout_ids?: EntityId[];\n game_version: GameVersionReference;\n}\n/**\n * A detachment option within a faction, providing a detachment rule, enhancements, and stratagems.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"detachment\".\n */\nexport interface Detachment {\n id: EntityId;\n name: string;\n faction_id: EntityId;\n detachment_rule_id?: EntityId | null;\n /**\n * 11e: the detachment-point cost (1–3) charged against the army's detachment-point budget. null when not yet assigned.\n */\n detachment_points?: number | null;\n /**\n * 11e: ids of the Force Disposition entities this detachment grants. Empty until assigned.\n */\n force_dispositions?: EntityId[];\n enhancement_ids?: EntityId[];\n stratagem_ids?: EntityId[];\n restrictions?: {\n required_keywords?: KeywordList;\n excluded_keywords?: KeywordList;\n notes?: string;\n } | null;\n game_version: GameVersionReference;\n}\n/**\n * A purchasable upgrade for a character unit, provided by a detachment.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"enhancement\".\n */\nexport interface Enhancement {\n id: EntityId;\n name: string;\n detachment_id: EntityId;\n cost: number;\n /**\n * True when the cost is carried over provisionally (e.g. seeded from a prior edition during migration) and not yet confirmed against the current dataslate.\n */\n points_provisional?: boolean;\n /**\n * 11e: when true, this enhancement applies to up to `max_targets` non-character units while counting as a single Enhancement choice.\n */\n upgrade_tag?: boolean;\n /**\n * Number of units this enhancement may be applied to. Only meaningful when `upgrade_tag` is true; defaults to 1.\n */\n max_targets?: number;\n keyword_restrictions?: KeywordList;\n exclusion_keywords?: KeywordList | null;\n ability_id?: EntityId | null;\n is_unique?: boolean;\n game_version: GameVersionReference;\n}\n/**\n * A playable faction or sub-faction.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"faction\".\n */\nexport interface Faction {\n id: EntityId;\n name: string;\n parent_faction_id?: EntityId | null;\n game_version: GameVersionReference;\n keywords?: KeywordList;\n aliases?: string[];\n /**\n * Reference to the faction-wide ability (e.g., Oath of Moment)\n */\n faction_rule_id?: EntityId | null;\n}\n/**\n * A 11e strategic-intent tag granted by detachments. Players compare dispositions at game start to determine the shared mission; asymmetric primary objectives result.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"force-disposition\".\n */\nexport interface ForceDisposition {\n /**\n * One of the five confirmed launch Force Dispositions.\n */\n id: \"take-and-hold\" | \"disruption\" | \"purge-the-foe\" | \"priority-assets\" | \"reconnaissance\";\n name: string;\n /**\n * Community-authored description of the disposition's effect (original prose only — no reproduced rules text).\n */\n text?: string;\n game_version: GameVersionReference;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"game-version\".\n */\nexport interface GameVersion {\n edition: Edition;\n dataslate: DataslateVersion;\n effective_date: string;\n label?: string;\n supersedes?: DataslateVersion | null;\n}\n/**\n * Defines which character units can attach to which bodyguard units.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"leader-attachment\".\n */\nexport interface LeaderAttachment {\n leader_id: EntityId;\n /**\n * @minItems 1\n */\n eligible_bodyguard_ids: [EntityId, ...EntityId[]];\n game_version: GameVersionReference;\n}\n/**\n * One cell of the 11e Force Disposition matrix: given the player's own Force Disposition and their opponent's, the mission that player plays. Mirrors a single row on a physical Force Disposition card. The (disposition, opponent_disposition) pair is the conceptual key; compound uniqueness across entries is a data convention, not enforced by this schema.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"mission-matchup\".\n */\nexport interface MissionMatchup {\n id: EntityId;\n /**\n * The player's own Force Disposition.\n */\n disposition: \"take-and-hold\" | \"disruption\" | \"purge-the-foe\" | \"priority-assets\" | \"reconnaissance\";\n /**\n * The opponent's Force Disposition.\n */\n opponent_disposition: \"take-and-hold\" | \"disruption\" | \"purge-the-foe\" | \"priority-assets\" | \"reconnaissance\";\n /**\n * Kebab-case identifier\n */\n mission_id: string;\n game_version: GameVersionReference;\n}\n/**\n * An 11e primary mission (the objective a player scores). Which mission a player plays is selected by the Force Disposition matchup matrix (see mission-matchup), keyed on the player's own disposition and their opponent's. Victory points are capped per game and per battle round.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"mission\".\n */\nexport interface Mission {\n id: EntityId;\n name: string;\n /**\n * Mission pack or source the mission originates from.\n */\n source?: string;\n /**\n * Community-authored mission/objective summary (original prose only — no reproduced rules text).\n */\n description?: string;\n /**\n * Maximum primary VP scorable across the whole game. 11e default is 45.\n */\n vp_per_game_cap?: number;\n /**\n * Maximum primary VP scorable in a single battle round. 11e default is 15.\n */\n vp_per_round_cap?: number;\n /**\n * Ids of the deployment-pattern entities (maps) this mission can be played on. Empty until the per-mission maps are confirmed.\n */\n deployment_pattern_ids?: EntityId[];\n game_version: GameVersionReference;\n}\n/**\n * When a VP award is evaluated. A bare `phase` is the legacy shorthand for 'during this phase'; richer triggers add `timing` (the moment within a phase/turn/game), `player_turn`, and a `battle_round` window. A card's section headers map onto these: 'ANY BATTLE ROUND' omits `battle_round`; 'SECOND BATTLE ROUND ONWARDS' is { min: 2 }; 'END OF THE BATTLE' is timing: end-of-battle.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"scoring-trigger\".\n */\nexport interface ScoringTrigger {\n /**\n * The five official game phases. Unchanged between 10th and 11th edition — 11e reorders Pile In timing within the Fight phase but adds no top-level phase.\n */\n phase?: \"command\" | \"movement\" | \"shooting\" | \"charge\" | \"fight\";\n /**\n * The moment the award is checked. 'End of your turn' = end-of-turn; 'End of your Command phase' = end-of-phase with phase: command; 'End of the battle' = end-of-battle.\n */\n timing?: \"start-of-turn\" | \"end-of-turn\" | \"start-of-phase\" | \"end-of-phase\" | \"end-of-battle\";\n player_turn?: PlayerTurn;\n /**\n * Battle-round window in which the trigger is active. Absent means any battle round (1-5). 'Second battle round onwards' is { min: 2 }.\n */\n battle_round?: {\n min?: number;\n max?: number;\n };\n}\n/**\n * A draw-time predicate over an army list (not runtime board state, so deliberately NOT the Ability DSL condition). Used to gate when_drawn operations such as redraws. Example: a card that is void unless the opponent fields a large unit (10e 'Cull the Horde' redrew when the opponent had no unit of 14+ models) is { subject: 'opponent', quantifier: 'none', unit_filter: { model_count_min: 14 } } with operation 'redraw'.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"army-composition-predicate\".\n */\nexport interface ArmyCompositionPredicate {\n /**\n * Whose army list the predicate inspects.\n */\n subject: \"self\" | \"opponent\";\n /**\n * Whether the army must contain ('any') or lack ('none') a unit matching unit_filter for the predicate to hold.\n */\n quantifier: \"any\" | \"none\";\n /**\n * Criteria a unit in the army must satisfy to match. All present criteria must hold (logical AND).\n */\n unit_filter: {\n model_count_min?: number;\n model_count_max?: number;\n wounds_min?: number;\n keywords?: KeywordList;\n };\n}\n/**\n * An 11e mission card. The deck-level rule (draw 2 per turn, keep unscored cards) is separate and not modelled here. This is the per-card shape: an optional on-draw deck operation, an optional player action, and zero or more VP-award blocks. Primary mission cards reuse this shape via card_type. Mechanic blocks reference the Ability DSL; prose is community-authored (no reproduced rules text).\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"secondary-card\".\n */\nexport interface SecondaryCard {\n id: EntityId;\n name: string;\n /**\n * Whether this is a secondary card or a primary mission card (which reuses this shape).\n */\n card_type?: \"secondary\" | \"primary\";\n /**\n * Finer classification within the deck (e.g. a category or tactical/fixed split). Free-form — not enum-locked until 11e categories are confirmed.\n */\n subtype?: string;\n /**\n * Optional deck operation performed when this card is drawn (e.g. redraw, swap). Distinct from combat effects — deck operations have no combat target, so they are not modelled via the Ability DSL effect language. If `condition` is present, the operation fires only when the predicate holds.\n */\n when_drawn?: {\n /**\n * The deck manipulation this card triggers on draw.\n */\n operation: \"reshuffle\" | \"replace\" | \"redraw\" | \"draw-extra\" | \"swap\";\n /**\n * Other cards this operation references, by id.\n */\n card_ids?: EntityId[];\n condition?: ArmyCompositionPredicate1;\n /**\n * Battle-round window in which the draw operation is eligible (e.g. { max: 1 } means 'only when drawn in the first battle round'). Absent means the operation fires regardless of round.\n */\n battle_round?: {\n min?: number;\n max?: number;\n };\n };\n /**\n * Optional player actions the card enables. Most cards have a single action; a few (e.g. Observe Enemy, with separate Baited-removal and Spotted actions) have two distinct actions on the same card.\n *\n * @minItems 1\n */\n actions?: [\n {\n /**\n * Optional kebab-case identifier used to reference this action from `action-completed` conditions in `awards[].when`.\n */\n action_id?: string;\n /**\n * The five official game phases. Unchanged between 10th and 11th edition — 11e reorders Pile In timing within the Fight phase but adds no top-level phase.\n */\n starts?: \"command\" | \"movement\" | \"shooting\" | \"charge\" | \"fight\";\n /**\n * Non-phase moment the action happens, for card rules that are not started in a phase (Locate and Deny's start-of-battle marker placement, Punishment's start-of-turn condemnation, Consecrate's end-of-turn objective selection). Mutually informative with `starts` — a card action uses one or the other.\n */\n timing?: \"start-of-battle\" | \"start-of-turn\" | \"end-of-turn\";\n /**\n * Battle-round window in which the action can be started. Absent means any battle round. 'From the second battle round onwards' (Triangulate, Extract Intelligence) is { min: 2 }.\n */\n battle_round?: {\n min?: number;\n max?: number;\n };\n player_turn?: PlayerTurn;\n units?: AbilityCondition;\n /**\n * Maximum number of times the action may be performed (per turn unless `use_limit_scope` says otherwise).\n */\n use_limit?: number;\n /**\n * Whether `use_limit` is enforced per turn or once per game (e.g. Recover the Relics / Find and Deny 'Overwhelming Force' is once per game).\n */\n use_limit_scope?: \"per-turn\" | \"per-game\";\n completes?: AbilityCondition1;\n effect?: AbilityEffect;\n restrictions?: AbilityCondition3;\n },\n ...{\n /**\n * Optional kebab-case identifier used to reference this action from `action-completed` conditions in `awards[].when`.\n */\n action_id?: string;\n /**\n * The five official game phases. Unchanged between 10th and 11th edition — 11e reorders Pile In timing within the Fight phase but adds no top-level phase.\n */\n starts?: \"command\" | \"movement\" | \"shooting\" | \"charge\" | \"fight\";\n /**\n * Non-phase moment the action happens, for card rules that are not started in a phase (Locate and Deny's start-of-battle marker placement, Punishment's start-of-turn condemnation, Consecrate's end-of-turn objective selection). Mutually informative with `starts` — a card action uses one or the other.\n */\n timing?: \"start-of-battle\" | \"start-of-turn\" | \"end-of-turn\";\n /**\n * Battle-round window in which the action can be started. Absent means any battle round. 'From the second battle round onwards' (Triangulate, Extract Intelligence) is { min: 2 }.\n */\n battle_round?: {\n min?: number;\n max?: number;\n };\n player_turn?: PlayerTurn;\n units?: AbilityCondition;\n /**\n * Maximum number of times the action may be performed (per turn unless `use_limit_scope` says otherwise).\n */\n use_limit?: number;\n /**\n * Whether `use_limit` is enforced per turn or once per game (e.g. Recover the Relics / Find and Deny 'Overwhelming Force' is once per game).\n */\n use_limit_scope?: \"per-turn\" | \"per-game\";\n completes?: AbilityCondition1;\n effect?: AbilityEffect;\n restrictions?: AbilityCondition3;\n }[]\n ];\n /**\n * VP-award blocks: each scores when `trigger` fires and the optional `when` condition holds. An award scores either a flat `vp` or a count-scaled `vp_per` (VP per instance of the thing named by `per`). Awards accrue independently and sum; a card's '+ ... CUMULATIVE' rows are modelled as separate awards flagged `cumulative` for faithful round-trip. Awards sharing the same `exclusive_group` value within a card resolve as the highest-scoring single award fires (the card's literal 'OR' rows between tier breakpoints, e.g. Record-Breaking Mission's 3-Fronts vs 4-Fronts).\n *\n * @minItems 1\n */\n awards?: [\n (\n | {\n [k: string]: unknown;\n }\n | {\n [k: string]: unknown;\n }\n ),\n ...(\n | {\n [k: string]: unknown;\n }\n | {\n [k: string]: unknown;\n }\n )[]\n ];\n /**\n * Community-authored card description (original prose only — no reproduced rules text).\n */\n text?: string;\n game_version: GameVersionReference;\n}\n/**\n * Draw-time army-composition predicate gating the operation (e.g. redraw when the opponent lacks a qualifying unit).\n */\nexport interface ArmyCompositionPredicate1 {\n /**\n * Whose army list the predicate inspects.\n */\n subject: \"self\" | \"opponent\";\n /**\n * Whether the army must contain ('any') or lack ('none') a unit matching unit_filter for the predicate to hold.\n */\n quantifier: \"any\" | \"none\";\n /**\n * Criteria a unit in the army must satisfy to match. All present criteria must hold (logical AND).\n */\n unit_filter: {\n model_count_min?: number;\n model_count_max?: number;\n wounds_min?: number;\n keywords?: KeywordList;\n };\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"simple-condition\".\n */\nexport interface SimpleCondition {\n type:\n | \"phase-is\"\n | \"timing-is\"\n | \"player-turn-is\"\n | \"unit-below-starting-strength\"\n | \"unit-below-half-strength\"\n | \"unit-has-keyword\"\n | \"unit-within-range-of\"\n | \"model-is-leader\"\n | \"target-has-keyword\"\n | \"charged-this-turn\"\n | \"advanced-this-turn\"\n | \"remained-stationary\"\n | \"is-battle-shocked\"\n | \"has-lost-wounds\"\n | \"opponent-unit-within-range\"\n | \"within-range-of-objective\"\n | \"attack-is-type\"\n | \"has-fought-this-phase\"\n | \"destroyed-by-attack-type\"\n | \"controls-objective\"\n | \"is-attached\"\n | \"terrain-area-control\"\n | \"engagement-state\"\n | \"territory-control\"\n | \"fights-first\"\n | \"disposition-matches\"\n | \"units-destroyed\"\n | \"units-destroyed-comparison\"\n | \"objective-majority\"\n | \"action-completed\"\n | \"objective-has-tag\"\n | \"unit-has-tag\"\n | \"terrain-has-tag\"\n | \"new-objective-controlled\"\n | \"engagement-fronts\"\n | \"destroyed-while-on-objective\"\n | \"destroyed-in-tagged-terrain\"\n | \"operation-markers\";\n parameters?: {\n [k: string]: unknown;\n };\n negated?: boolean;\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"compound-condition\".\n */\nexport interface CompoundCondition {\n operator: \"and\" | \"or\" | \"not\";\n /**\n * @minItems 1\n */\n operands: [ConditionNode, ...ConditionNode[]];\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"single-effect\".\n */\nexport interface SingleEffect {\n type:\n | \"stat-modifier\"\n | \"roll-modifier\"\n | \"re-roll\"\n | \"mortal-wounds\"\n | \"feel-no-pain\"\n | \"invulnerable-save\"\n | \"ward\"\n | \"keyword-grant\"\n | \"movement-modifier\"\n | \"deep-strike\"\n | \"fallback-and-act\"\n | \"fight-first\"\n | \"fight-last\"\n | \"shoot-on-death\"\n | \"fight-on-death\"\n | \"objective-control-modifier\"\n | \"leadership-modifier\"\n | \"damage-reduction\"\n | \"attack-restriction\"\n | \"ability-grant\"\n | \"cp-gain\"\n | \"cp-refund\"\n | \"model-destruction\"\n | \"resurrection\"\n | \"resource-gain\"\n | \"resource-spend\"\n | \"charge-roll-modifier\"\n | \"terrain-area-tag\"\n | \"objective-tag\"\n | \"unit-tag\"\n | \"bs-modifier\"\n | \"engagement-passthrough\";\n target:\n | \"self\"\n | \"bearer\"\n | \"unit\"\n | \"attached-unit\"\n | \"attacker\"\n | \"defender\"\n | \"friendly-within-aura\"\n | \"enemy-within-aura\"\n | \"all-friendly\"\n | \"all-enemy\";\n modifier?: {\n [k: string]: unknown;\n };\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"choice-effect\".\n */\nexport interface ChoiceEffect {\n type: \"choice\";\n /**\n * @minItems 2\n */\n options: [EffectNode, EffectNode, ...EffectNode[]];\n choice_label?: string;\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"sequence-effect\".\n */\nexport interface SequenceEffect {\n type: \"sequence\";\n /**\n * @minItems 1\n */\n steps: [EffectNode, ...EffectNode[]];\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"dice-gated-effect\".\n */\nexport interface DiceGatedEffect {\n type: \"dice-gated\";\n /**\n * Dice expression, e.g. 'D6', '2D6'\n */\n dice: string;\n /**\n * Fixed threshold or model characteristic to compare against\n */\n threshold: number | (\"leadership\" | \"toughness\" | \"save\");\n comparison?: \"gte\" | \"lte\" | \"gt\" | \"lt\" | \"eq\";\n on_success?: EffectNode | null;\n on_fail?: EffectNode | null;\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"conditional-effect\".\n */\nexport interface ConditionalEffect {\n type: \"conditional\";\n condition: AbilityCondition2;\n effect: EffectNode;\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"dice-pool-allocation-effect\".\n */\nexport interface DicePoolAllocationEffect {\n type: \"dice-pool-allocation\";\n pool: {\n count: number;\n die: string;\n [k: string]: unknown;\n };\n max_activations: number;\n /**\n * @minItems 1\n */\n options: [\n {\n name: string;\n requirement: {\n type: \"pair\" | \"triple\" | \"single\" | \"run\";\n min_value: number;\n [k: string]: unknown;\n };\n effect: EffectNode;\n [k: string]: unknown;\n },\n ...{\n name: string;\n requirement: {\n type: \"pair\" | \"triple\" | \"single\" | \"run\";\n min_value: number;\n [k: string]: unknown;\n };\n effect: EffectNode;\n [k: string]: unknown;\n }[]\n ];\n [k: string]: unknown;\n}\n/**\n * A CP-costed ability usable during specific game phases.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"stratagem\".\n */\nexport interface Stratagem {\n id: EntityId;\n name: string;\n /**\n * Whether this is a universal core stratagem or tied to a specific detachment\n */\n category: \"core\" | \"detachment\";\n /**\n * GW-printed stratagem category from the card\n */\n type: \"battle-tactic\" | \"strategic-ploy\" | \"epic-deed\" | \"wargear\";\n /**\n * Null for core stratagems\n */\n detachment_id?: EntityId | null;\n cp_cost: number;\n phases: PhaseList;\n player_turn: PlayerTurn;\n timing: \"once-per-phase\" | \"once-per-turn\" | \"once-per-battle\" | \"unlimited\";\n target_restrictions?: {\n required_keywords?: KeywordList;\n excluded_keywords?: KeywordList;\n notes?: string;\n } | null;\n ability_id?: EntityId | null;\n game_version: GameVersionReference;\n}\n/**\n * One terrain piece placed on the board. Geometry comes from a catalog `template` or an inline `footprint` (if both are present, `footprint` is authoritative and `template` is provenance).\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"piece\".\n */\nexport interface Piece {\n /**\n * Kebab-case identifier\n */\n id?: string;\n name?: string;\n /**\n * An `area` is a gameplay terrain zone (the 11e 'terrain area'); a `feature` is physical scenery (walls, containers, pipes) placed on an area.\n */\n piece_type?: \"area\" | \"feature\";\n /**\n * Kebab-case identifier\n */\n template?: string;\n /**\n * Inline geometry, standing in for or overriding a template footprint. Authoritative when present.\n */\n footprint?:\n | {\n type: \"rectangle\";\n width: number;\n height: number;\n }\n | {\n type: \"right-triangle\";\n width: number;\n height: number;\n }\n | {\n type: \"polygon\";\n /**\n * @minItems 3\n */\n points: [Vec2, Vec2, Vec2, ...Vec2[]];\n };\n position: Vec21;\n /**\n * Clockwise rotation about the centroid in the y-down board frame. Absent or 0 means the template's natural orientation.\n */\n rotation_degrees?: number;\n /**\n * Reflection applied in the centroid-local frame before rotation: `horizontal` negates local x (left-right flip), `vertical` negates local y.\n */\n mirror?: \"none\" | \"horizontal\" | \"vertical\";\n /**\n * Kebab-case identifier\n */\n parent_area_id?: string;\n /**\n * Ruin floor this piece occupies (0 = ground level).\n */\n floor?: number;\n /**\n * Height of the piece in inches; overrides the template default. Gates Plunging Fire (a piece 3\" or taller confers +1 BS on ground-level targets).\n */\n height_inches?: number;\n /**\n * Terrain-area keywords this piece's area carries; overrides the template default.\n */\n terrain_area_keywords?: TerrainAreaKeyword[];\n /**\n * Pieces sharing a `link_group` value are linked terrain — treated as a single terrain feature (and, where an objective sits among them, a single objective).\n */\n link_group?: string;\n /**\n * Designates this terrain area — or, when `link_group`'d, the union of linked areas (one objective for the set) — as carrying an objective of the given 11e role: `home` (inside a deployment zone), `center` (board middle), or `expansion` (no-man's-land). Implies `is_objective`.\n */\n objective_role?: \"home\" | \"expansion\" | \"center\";\n /**\n * Whether this piece carries an objective marker.\n */\n is_objective?: boolean;\n /**\n * Objective-marker metadata. Only meaningful when `is_objective` is true.\n */\n objective?: {\n position?: Vec22;\n /**\n * Range from the marker within which models contribute to control.\n */\n control_range_inches?: number;\n };\n /**\n * Measurement keystones: the author-selected dimension lines a reference card prints so a player can place this piece with a tape measure (board edge → a feature of the placed piece). Only the selection is stored — the distance is always DERIVED from the resolved geometry by the shared keystone resolver (pinned by the conformance corpus), so a keystone can never disagree with the layout. Vertex indices follow the resolver's pinned vertex order; re-authoring a template's footprint invalidates them, so review keystones when geometry changes.\n */\n keystones?: {\n /**\n * The board edge the measurement runs from, in the y-down board frame (left/right pin x against board width; top/bottom pin y against board height).\n */\n edge: \"left\" | \"right\" | \"top\" | \"bottom\";\n /**\n * Which feature of the placed piece the measurement reaches: a footprint vertex (by resolver vertex order) or an axis-aligned bounding face of the placed footprint.\n */\n ref:\n | {\n kind: \"vertex\";\n index: number;\n }\n | {\n kind: \"face\";\n side: \"min-x\" | \"max-x\" | \"min-y\" | \"max-y\";\n };\n }[];\n}\n/**\n * A 2D point in board inches. Origin at a board corner; JSON uses y-down (downstream renderers may flip to y-up).\n */\nexport interface Vec21 {\n x: number;\n y: number;\n}\n/**\n * A 2D point in board inches. Origin at a board corner; JSON uses y-down (downstream renderers may flip to y-up).\n */\nexport interface Vec22 {\n x: number;\n y: number;\n}\n/**\n * A recommended arrangement of terrain pieces on the board, independent of the deployment map (a deployment-pattern references the layouts it recommends via recommended_terrain_layout_ids). Each piece draws its geometry from a catalog `template` (a terrain-template entity) or an inline `footprint`; geometry is the source of truth. Placement is template-centroid-anchored: `position` is the piece's centroid, which is invariant under rotation and mirror, so orientation and location are decoupled. Resolved board-space vertices are derived by the shared terrain resolver (pinned by the conformance corpus), never stored here. No layout data is authored yet beyond migrated examples.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"terrain-layout\".\n */\nexport interface TerrainLayout {\n id: EntityId;\n name: string;\n /**\n * Mission pack or source the layout originates from.\n */\n source?: string;\n description?: string;\n /**\n * Kebab-case identifier\n */\n mission_matchup_id?: string;\n /**\n * The card's trailing variant number within its mission matchup (1–3 at launch, since three layouts share each pairing). No hard maximum, to avoid a breaking change if more variants ship.\n */\n variant?: number;\n /**\n * Kebab-case identifier\n */\n deployment_pattern_id?: string;\n /**\n * Terrain pieces composing the layout. May be empty while a layout is registered by name ahead of its confirmed geometry.\n */\n pieces?: Piece[];\n game_version: GameVersionReference;\n}\n/**\n * A feature placed on an area template, positioned in the area's centroid-local frame (y-down inches). When the area is placed, rotated, or mirrored, its composed features are carried along.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"composed-feature\".\n */\nexport interface ComposedFeature {\n /**\n * Kebab-case identifier\n */\n id?: string;\n /**\n * Kebab-case identifier\n */\n template: string;\n position: Vec23;\n /**\n * Clockwise rotation of the feature about its own centroid, within the area-local frame.\n */\n rotation_degrees?: number;\n mirror?: \"none\" | \"horizontal\" | \"vertical\";\n /**\n * Ruin floor this feature occupies (0 = ground level).\n */\n floor?: number;\n}\n/**\n * A 2D point in board inches. Origin at a board corner; JSON uses y-down (downstream renderers may flip to y-up).\n */\nexport interface Vec23 {\n x: number;\n y: number;\n}\n/**\n * A reusable terrain piece in the standard catalog: a gameplay area (the 11e terrain-area templates) or a scenery feature (walls, containers, pipes, floor segments). Footprints are authored in natural local inches; the terrain resolver derives each footprint's polygon area centroid and re-centers on it, so a layout piece that instances a template places its centroid via the layout's `position`. An `area` template may carry an embedded `features` list — scenery placed in the area's centroid-local frame — making the template a reusable composition (e.g. a ruin with its walls). Placing such a template places all of its features, transformed by the area's own placement.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"terrain-template\".\n */\nexport interface TerrainTemplate {\n id: EntityId;\n name: string;\n /**\n * `area` = a gameplay terrain zone; `feature` = physical scenery placed on an area.\n */\n kind: \"area\" | \"feature\";\n /**\n * Catalog or mission pack the template originates from.\n */\n source?: string;\n footprint: Footprint;\n /**\n * Default height in inches for pieces instancing this template. Gates Plunging Fire (>= 3\").\n */\n default_height_inches?: number;\n /**\n * Whether the template blocks line of sight / movement by default.\n */\n default_blocking?: boolean;\n /**\n * Whether models may be placed on the ground footprint. `false` marks an elevated-only piece (a platform reachable only on its `upper_floor`, e.g. a gantry/catwalk) or a solid obstacle with no valid placement (e.g. a generator). Meaningful for `kind: \"feature\"`.\n */\n ground_accessible?: boolean;\n /**\n * An elevated platform carried by this feature (e.g. a ruin's second storey). Its footprint is authored in the SAME local frame as `footprint` and re-centered on the GROUND footprint's polygon area centroid, so the two floors stay registered when the piece is placed, rotated, or mirrored. Non-resolved metadata: the terrain resolver does not emit it; authoring/visualization tools render it as an overlay. Meaningful for `kind: \"feature\"`.\n */\n upper_floor?: {\n footprint: Footprint;\n /**\n * Ruin floor this platform occupies (1 = first floor above ground).\n */\n floor?: number;\n };\n /**\n * Terrain-area keywords areas of this template carry by default. Meaningful for `kind: \"area\"`.\n */\n default_terrain_area_keywords?: TerrainAreaKeyword[];\n /**\n * Composed scenery features, in the area's centroid-local frame. Only meaningful for `kind: \"area\"`.\n */\n features?: ComposedFeature[];\n game_version: GameVersionReference;\n}\n/**\n * Describes the internal model-type breakdown of a unit.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"unit-composition\".\n */\nexport interface UnitComposition {\n unit_id: EntityId;\n /**\n * @minItems 1\n */\n models: [\n {\n name: string;\n profile_name?: string | null;\n min: number;\n max: number;\n default_weapon_ids?: EntityId[];\n is_leader_model?: boolean;\n base_size_mm?: BaseSize1;\n },\n ...{\n name: string;\n profile_name?: string | null;\n min: number;\n max: number;\n default_weapon_ids?: EntityId[];\n is_leader_model?: boolean;\n base_size_mm?: BaseSize1;\n }[]\n ];\n game_version: GameVersionReference;\n}\n/**\n * This model's base. Absent when no base could be resolved for the model.\n */\nexport interface BaseSize1 {\n shape: \"round\" | \"oval\" | \"flying-base\" | \"hull\" | \"unique\";\n diameter?: number;\n width?: number;\n length?: number;\n /**\n * Flying-base size class, when 'shape' is 'flying-base'.\n */\n size?: \"small\" | \"large\";\n /**\n * True when the entry is provisional/guessed (e.g. a category without authoritative dimensions) and should be revisited.\n */\n draft?: boolean;\n}\n/**\n * A unit datasheet entry with stat profiles and point costs.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"unit\".\n */\nexport interface Unit {\n id: EntityId;\n name: string;\n faction_id: EntityId;\n /**\n * Battlefield role from the datasheet header. Unit types (Infantry, Vehicle, etc.) belong in keywords.\n */\n role?: \"character\" | \"battleline\" | \"dedicated-transport\" | \"fortification\" | \"allied\" | \"epic-hero\";\n /**\n * Character attachment role (11e). 'support' implies the unit is only legal when attached to a host unit (cannot be taken solo); 'leader' is valid as a standalone list entry. null/absent for non-attaching units.\n */\n attachment_role?: (\"leader\" | \"support\") | null;\n /**\n * @minItems 1\n */\n profiles: [\n {\n /**\n * Profile name (e.g., 'Wounded' for degrading)\n */\n name?: string;\n M: StatValue;\n T: number;\n W: number;\n Sv: number;\n invuln_sv?: number | null;\n Ld: number;\n OC: number;\n [k: string]: unknown;\n },\n ...{\n /**\n * Profile name (e.g., 'Wounded' for degrading)\n */\n name?: string;\n M: StatValue;\n T: number;\n W: number;\n Sv: number;\n invuln_sv?: number | null;\n Ld: number;\n OC: number;\n [k: string]: unknown;\n }[]\n ];\n points?: {\n models: number;\n cost: number;\n [k: string]: unknown;\n }[];\n /**\n * True when point costs are carried over provisionally (e.g. seeded from a prior edition during migration) and not yet confirmed against the current dataslate.\n */\n points_provisional?: boolean;\n keywords?: KeywordList;\n faction_keywords?: KeywordList;\n /**\n * The unit's representative base (the most-numerous model's base). Mixed-model units carry the full per-model breakdown in unit-composition; this top-level value is a convenience for consumers that need a single base.\n */\n base_size_mm?: BaseSize | null;\n model_count?: {\n min: number;\n max: number;\n [k: string]: unknown;\n };\n weapon_ids?: EntityId[];\n ability_ids?: EntityId[];\n transport_capacity?: {\n capacity: number;\n keyword_restrictions?: KeywordList | null;\n exclusion_keywords?: KeywordList | null;\n } | null;\n game_version: GameVersionReference;\n is_legend?: boolean;\n}\n/**\n * A wargear option available to models within a unit: a weapon/wargear swap, a pure add-on, or a choice between alternatives. Models start with the unit's base loadout; an option modifies that loadout for the number of models its `model_constraint` permits.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"wargear-option\".\n */\nexport interface WargearOption {\n id: EntityId;\n unit_id: EntityId;\n model_constraint?: {\n model_name?: string;\n per_n_models?: number;\n max_count?: number;\n /**\n * When true, every model in the unit may take the option ('Any number of models can each ...'). Mutually exclusive in spirit with `per_n_models`.\n */\n any_number?: boolean;\n } | null;\n /**\n * Weapon or wargear IDs removed from the model. Omit for a pure add-on (the option only equips new wargear).\n *\n * @minItems 1\n */\n replaces?: [EntityId, ...EntityId[]];\n /**\n * Weapon or wargear IDs added to the model — all of them. Exactly one of `replacement` / `replacement_choice` is present.\n *\n * @minItems 1\n */\n replacement?: [EntityId, ...EntityId[]];\n /**\n * A choice of replacements ('one of the following'): pick exactly one inner group; each group's IDs are all added together. Exactly one of `replacement` / `replacement_choice` is present.\n *\n * @minItems 2\n */\n replacement_choice?: [[EntityId, ...EntityId[]], [EntityId, ...EntityId[]], ...[EntityId, ...EntityId[]][]];\n is_free?: boolean;\n additional_cost?: number | null;\n game_version: GameVersionReference;\n}\n/**\n * A non-weapon item a model may carry — an icon, attachment, or other piece of equipment with no weapon profile. Weapons live in weapon.schema.json; this entity exists so wargear-option swaps and add-ons can reference equipment that is not a weapon.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"wargear\".\n */\nexport interface Wargear {\n id: EntityId;\n name: string;\n category?: string | null;\n game_version: GameVersionReference;\n}\n/**\n * Catalog entry for a weapon keyword (Lethal Hits, Sustained Hits N, Anti-X N+, etc.). Each weapon profile references entries here via {keyword_id, parameters?} instead of carrying free-text strings. The optional `effect` describes the keyword's game mechanic in the Ability DSL; null when the behaviour is faction-specific flavour not yet modelled.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"weapon-keyword\".\n */\nexport interface WeaponKeyword {\n id: EntityId;\n name: string;\n /**\n * Parameter keys that must be supplied at each reference site, in the order they would appear in a printed datasheet (e.g. Anti-INFANTRY 4+ → ['target_keyword', 'threshold']).\n *\n * @maxItems 3\n */\n required_parameters:\n | []\n | [\"value\" | \"target_keyword\" | \"threshold\"]\n | [\"value\" | \"target_keyword\" | \"threshold\", \"value\" | \"target_keyword\" | \"threshold\"]\n | [\n \"value\" | \"target_keyword\" | \"threshold\",\n \"value\" | \"target_keyword\" | \"threshold\",\n \"value\" | \"target_keyword\" | \"threshold\"\n ];\n /**\n * Mechanical effect of this keyword. Null when the behaviour is faction-specific flavour not yet expressible in the DSL — engines treat such references as no-op buffs and may surface them as 'cannot auto-apply'.\n */\n effect: AbilityEffect1 | null;\n game_version: GameVersionReference;\n}\n/**\n * A weapon entry with one or more stat profiles (e.g., standard and overcharge modes).\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"weapon\".\n */\nexport interface Weapon {\n id: EntityId;\n name: string;\n type: \"ranged\" | \"melee\";\n /**\n * @minItems 1\n */\n profiles: [\n {\n name: string;\n range?: number | \"Melee\";\n stats: {\n A: StatValue;\n BS?: number | null;\n WS?: number | null;\n S: StatValue;\n AP: number;\n D: StatValue;\n [k: string]: unknown;\n };\n /**\n * References into the weapon-keyword catalog. Each entry names the catalog id and supplies parameter values (e.g. `Sustained Hits 1` → `{keyword_id: 'sustained-hits', parameters: {value: 1}}`).\n */\n keywords?: {\n keyword_id: EntityId;\n /**\n * Reference-site parameters conforming to the catalog entry's required_parameters. Only the three documented keys are accepted; any other key is invalid.\n */\n parameters?: {\n value?: StatValue;\n target_keyword?: string;\n threshold?: number;\n };\n }[];\n },\n ...{\n name: string;\n range?: number | \"Melee\";\n stats: {\n A: StatValue;\n BS?: number | null;\n WS?: number | null;\n S: StatValue;\n AP: number;\n D: StatValue;\n [k: string]: unknown;\n };\n /**\n * References into the weapon-keyword catalog. Each entry names the catalog id and supplies parameter values (e.g. `Sustained Hits 1` → `{keyword_id: 'sustained-hits', parameters: {value: 1}}`).\n */\n keywords?: {\n keyword_id: EntityId;\n /**\n * Reference-site parameters conforming to the catalog entry's required_parameters. Only the three documented keys are accepted; any other key is invalid.\n */\n parameters?: {\n value?: StatValue;\n target_keyword?: string;\n threshold?: number;\n };\n }[];\n }[]\n ];\n game_version: GameVersionReference;\n}\n/**\n * Community-authored structured representation of what a game ability does. NOT GW text.\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"ability\".\n */\nexport interface AbilityDSLEntry {\n ability_id: EntityId;\n name: string;\n authored_by: ContributorRef;\n game_version: GameVersionReference;\n version?: DataslateVersion;\n supersedes?: DataslateVersion | null;\n unit_ids?: EntityId[];\n /**\n * For faction-type abilities, the faction this rule belongs to\n */\n faction_id?: EntityId | null;\n /**\n * For detachment/enhancement/stratagem-type abilities, the associated detachment\n */\n detachment_id?: EntityId | null;\n ability_type?: \"core\" | \"faction\" | \"detachment\" | \"unit\" | \"enhancement\" | \"stratagem\";\n /**\n * How this ability interacts with the game flow — not a runtime predicate\n */\n behavior?: \"passive\" | \"activated\" | \"reactive\" | \"aura\";\n effect: AbilityEffect1;\n scope: AbilityScope;\n interactions?: {\n ability_ref: EntityId;\n type: \"conflicts-with\" | \"combos-with\" | \"superseded-by\" | \"requires\" | \"replaces\";\n notes?: string;\n [k: string]: unknown;\n }[];\n disputed?: boolean;\n dispute_notes?: string;\n community_notes?: string;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"scope\".\n */\nexport interface AbilityScope {\n range:\n | \"self\"\n | \"unit\"\n | \"attached\"\n | \"aura-6\"\n | \"aura-9\"\n | \"aura-12\"\n | \"aura-custom\"\n | \"engagement-range\"\n | \"any-visible\"\n | \"any-on-battlefield\"\n | \"terrain-within-range\";\n duration: \"phase\" | \"turn\" | \"battle-round\" | \"battle\" | \"until-next-command-phase\" | \"one-use\" | \"permanent\";\n range_inches?: number;\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"interaction-flag\".\n */\nexport interface InteractionFlag {\n ability_a: EntityId;\n ability_b: EntityId;\n interaction_type: \"conflicts\" | \"combos\" | \"sequencing-dependent\" | \"stacks\" | \"does-not-stack\" | \"replaces\";\n resolution?: string;\n faq_reference?: string;\n disputed?: boolean;\n game_version: GameVersionReference;\n authored_by?: ContributorRef;\n [k: string]: unknown;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"phase-mapping\".\n */\nexport interface PhaseMapping {\n source_id: EntityId;\n source_type: SourceType;\n phases: PhaseList;\n game_version: GameVersionReference;\n authored_by?: ContributorRef;\n [k: string]: unknown;\n}\n/**\n * A faction's resource system (Miracle Dice, Pain tokens, Blessings dice pool, etc.).\n *\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"resource-pool\".\n */\nexport interface ResourcePool {\n id: EntityId;\n name: string;\n faction_id: EntityId;\n pool_type: \"token\" | \"dice-pool\" | \"counter\";\n generation?: {\n condition: AbilityCondition2;\n amount: StatValue;\n [k: string]: unknown;\n }[];\n max_size?: number | null;\n game_version: GameVersionReference;\n}\n/**\n * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema\n * via the `definition` \"timing-flag\".\n */\nexport interface TimingFlag {\n source_id: EntityId;\n source_type: SourceType;\n timing:\n | \"start-of-phase\"\n | \"end-of-phase\"\n | \"before-hit-roll\"\n | \"after-hit-roll\"\n | \"before-wound-roll\"\n | \"after-wound-roll\"\n | \"before-save-roll\"\n | \"after-save-roll\"\n | \"before-damage-roll\"\n | \"after-damage-roll\"\n | \"before-charge-roll\"\n | \"after-charge-roll\"\n | \"before-advance-roll\"\n | \"after-advance-roll\"\n | \"before-battle-shock\"\n | \"after-battle-shock\"\n | \"on-unit-selected\"\n | \"on-unit-destroyed\"\n | \"on-model-destroyed\"\n | \"on-damage-allocated\";\n game_version: GameVersionReference;\n authored_by?: ContributorRef;\n [k: string]: unknown;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../src/translate/condition.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,KAAK,CAAC;IAChC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,kFAAkF;AAClF,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AAWD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAwItD"}
1
+ {"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../src/translate/condition.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,KAAK,CAAC;IAChC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,kFAAkF;AAClF,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AAWD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CA4JtD"}
@@ -100,16 +100,42 @@ export function describeCondition(c) {
100
100
  case "new-objective-controlled":
101
101
  return `${negate}you newly control ${count(p.count_min ?? 1, "objective")} this turn`;
102
102
  case "destroyed-while-on-objective": {
103
+ const obj = p.objective_role ? `a ${dekebab(str(p.objective_role))} objective` : "an objective";
103
104
  let s = `${negate}${count(p.count_min ?? 1, "enemy unit")} destroyed`;
104
105
  if (p.destroyer_on_objective)
105
- s += " by a unit on an objective";
106
+ s += ` by a unit on ${obj}`;
106
107
  if (p.victim_on_objective)
107
- s += " while on an objective";
108
+ s += ` while on ${obj}`;
109
+ if (p.victim_started_turn_on_objective)
110
+ s += ` that started the turn on ${obj}`;
108
111
  return s;
109
112
  }
110
113
  case "destroyed-in-tagged-terrain": {
111
114
  const where = p.at_start_of_turn ? "that started the turn in" : "while in";
112
- return `${negate}${count(p.count_min ?? 1, "enemy unit")} destroyed ${where} ${dekebab(str(p.tag))} terrain`;
115
+ const terrain = p.tag != null ? `${dekebab(str(p.tag))} terrain` : "a terrain area";
116
+ return `${negate}${count(p.count_min ?? 1, "enemy unit")} destroyed ${where} ${terrain}`;
117
+ }
118
+ case "operation-markers": {
119
+ const side = p.side != null ? `${str(p.side)} ` : "";
120
+ const min = typeof p.count_min === "number" ? p.count_min : undefined;
121
+ const max = typeof p.count_max === "number" ? p.count_max : undefined;
122
+ let s;
123
+ if (max === 0) {
124
+ s = `no ${side}operation markers on the battlefield`;
125
+ }
126
+ else if (min != null && max != null && min === max) {
127
+ s = `exactly ${min} ${side}operation marker${min === 1 ? "" : "s"} on the battlefield`;
128
+ }
129
+ else {
130
+ s = `${str(min ?? 1)}+ ${side}operation markers on the battlefield`;
131
+ }
132
+ if (p.within_range_of != null)
133
+ s += ` within range of ${dekebab(str(p.within_range_of))}`;
134
+ if (p.friendly_unit_in_same_terrain_area)
135
+ s += " with a friendly unit in the same terrain area";
136
+ if (p.no_enemy_in_terrain_area)
137
+ s += " and no enemy units in that terrain area";
138
+ return `${negate}${s}`;
113
139
  }
114
140
  case "action-completed": {
115
141
  let s = `${negate}${count(p.count_min ?? 1, "action")} completed`;
@@ -1 +1 @@
1
- {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../src/translate/condition.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,kFAAkF;AAClF,MAAM,UAAU,OAAO,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,GAAG,CAAC,CAAU;IACrB,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,+EAA+E;AAC/E,SAAS,KAAK,C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iB,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC,cAAc,CAAC;YAC1F,OAAO,CAAC,CAAC;QACX,CAAC;QACD,KAAK,mBAAmB;YACtB,OAAO,GAAG,MAAM,sBAAsB,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,UAAU,CAAC;QAExE;YACE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,EAAE,CAAC;IACtD,CAAC;AACH,CAAC","sourcesContent":["/**\n * Humanize an Ability-DSL / scoring `condition` into plain English.\n *\n * Shared by the ability-text CLI (`commands/translate.ts`) and the scoring-card\n * translator (`scoring.ts`). Output is **ASCII-only** with a fixed clause and\n * parameter order: it is pinned byte-for-byte across the TS and Rust ports by\n * the `conformance/scoring-translation` corpus, so any phrasing change here is a\n * semantic corpus change (bump `conformance/SPEC_VERSION`).\n */\n\n/**\n * Minimal structural view of a condition node. Matches both the ability-dsl\n * condition schema and the `secondary-card` award `when` field (a simple node\n * carries `type` + `parameters` + `negated`; a compound node carries\n * `operator` + `operands`).\n */\nexport interface Condition {\n type?: string;\n operator?: \"and\" | \"or\" | \"not\";\n operands?: Condition[];\n parameters?: Record<string, unknown>;\n negated?: boolean;\n}\n\n/** kebab-case → space-separated words (`enemy-territory` → `enemy territory`). */\nexport function dekebab(s: string): string {\n return s.replace(/-/g, \" \");\n}\n\nfunction str(v: unknown): string {\n return typeof v === \"string\" ? v : String(v);\n}\n\n/** `2` + `objective` → `2+ objectives`. Nouns here are all regular plurals. */\nfunction count(n: unknown, noun: string): string {\n return `${str(n)}+ ${noun}s`;\n}\n\nexport function describeCondition(c: Condition): string {\n // Compound nodes first — join the operands with lowercase connectives so the\n // result reads naturally inside a \"... when X and Y\" clause.\n if (c.operator === \"and\" && c.operands) {\n return c.operands.map(describeCondition).join(\" and \");\n }\n if (c.operator === \"or\" && c.operands) {\n return c.operands.map(describeCondition).join(\" or \");\n }\n if (c.operator === \"not\" && c.operands) {\n return `not (${c.operands.map(describeCondition).join(\", \")})`;\n }\n\n const negate = c.negated ? \"not \" : \"\";\n const p = c.parameters ?? {};\n\n switch (c.type) {\n // ── Ability-DSL conditions (ported from commands/translate.ts) ──────────\n case \"phase-is\":\n return `${negate}during the ${str(p.phase)} phase`;\n case \"timing-is\":\n return `${negate}at ${dekebab(str(p.timing))}`;\n case \"player-turn-is\":\n return `${negate}in ${p.turn === \"your-turn\" ? \"your\" : p.turn === \"opponent-turn\" ? \"the opponent's\" : \"either player's\"} turn`;\n case \"charged-this-turn\":\n return `${negate}the unit charged this turn`;\n case \"advanced-this-turn\":\n return `${negate}the unit advanced this turn`;\n case \"remained-stationary\":\n return `${negate}the unit remained stationary`;\n case \"unit-below-starting-strength\":\n return `${negate}the unit is below starting strength`;\n case \"unit-below-half-strength\":\n return `${negate}the unit is below half strength`;\n case \"unit-has-keyword\":\n return `${negate}the unit has \"${str(p.keyword)}\"`;\n case \"target-has-keyword\":\n return `${negate}the target has \"${str(p.keyword)}\"`;\n case \"model-is-leader\":\n return `${negate}the model is leading a unit`;\n case \"is-attached\":\n return `${negate}attached to a ${p.keyword ? `${str(p.keyword)} ` : \"\"}unit`;\n case \"attack-is-type\":\n return `${negate}for ${str(p.attack_type)} attacks`;\n case \"is-battle-shocked\":\n return `${negate}the unit is battle-shocked`;\n case \"has-lost-wounds\":\n return `${negate}the model has lost wounds`;\n case \"opponent-unit-within-range\":\n return `${negate}an enemy unit is within ${p.range === \"engagement\" ? \"engagement range\" : `${str(p.range)}\"`}`;\n case \"unit-within-range-of\":\n return `${negate}within ${str(p.range)}\" of ${str(p.target_type ?? \"target\")}${p.keyword ? ` (${str(p.keyword)})` : \"\"}`;\n case \"within-range-of-objective\":\n return `${negate}within range of an objective`;\n case \"has-fought-this-phase\":\n return `${negate}has fought this phase`;\n case \"destroyed-by-attack-type\":\n return `${negate}destroyed by a ${str(p.attack_type)} attack`;\n\n // ── Scoring conditions (secondary-card award `when`) ────────────────────\n case \"objective-majority\":\n return `${negate}you hold more objectives than the ${dekebab(str(p.relative_to ?? \"opponent\"))}`;\n case \"controls-objective\": {\n const noun = p.objective_role ? `${dekebab(str(p.objective_role))} objective` : \"objective\";\n let s = `${negate}you control ${count(p.count_min ?? 1, noun)}`;\n if (p.objective != null) s += ` (${dekebab(str(p.objective))})`;\n if (p.scope != null) s += ` in ${dekebab(str(p.scope))}`;\n if (p.exclude != null) s += ` (excluding ${dekebab(str(p.exclude))})`;\n return s;\n }\n case \"units-destroyed\":\n return `${negate}${count(p.count_min ?? 1, `${str(p.side)} unit`)} destroyed ${dekebab(str(p.window))}`;\n case \"units-destroyed-comparison\": {\n const subj = (p.subject ?? {}) as Record<string, unknown>;\n const ref = (p.reference ?? {}) as Record<string, unknown>;\n const cmp = p.comparator === \"greater-or-equal\" ? \"at least as many\" : \"more\";\n const link = p.comparator === \"greater-or-equal\" ? \"as\" : \"than\";\n return `${negate}you destroyed ${cmp} ${str(subj.side)} units ${dekebab(str(subj.window))} ${link} ${str(ref.side)} units ${dekebab(str(ref.window))}`;\n }\n case \"new-objective-controlled\":\n return `${negate}you newly control ${count(p.count_min ?? 1, \"objective\")} this turn`;\n case \"destroyed-while-on-objective\": {\n let s = `${negate}${count(p.count_min ?? 1, \"enemy unit\")} destroyed`;\n if (p.destroyer_on_objective) s += \" by a unit on an objective\";\n if (p.victim_on_objective) s += \" while on an objective\";\n return s;\n }\n case \"destroyed-in-tagged-terrain\": {\n const where = p.at_start_of_turn ? \"that started the turn in\" : \"while in\";\n return `${negate}${count(p.count_min ?? 1, \"enemy unit\")} destroyed ${where} ${dekebab(str(p.tag))} terrain`;\n }\n case \"action-completed\": {\n let s = `${negate}${count(p.count_min ?? 1, \"action\")} completed`;\n if (p.action_id != null) s += ` (${dekebab(str(p.action_id))})`;\n if (p.target_kind != null) s += ` on ${dekebab(str(p.target_kind))}`;\n const tf = (p.target_filter ?? {}) as Record<string, unknown>;\n if (tf.objective_role != null) s += ` (${dekebab(str(tf.objective_role))})`;\n if (tf.in_enemy_territory) s += \" in enemy territory\";\n if (tf.exclude != null) s += ` (excluding ${dekebab(str(tf.exclude))})`;\n if (p.window != null) s += ` ${dekebab(str(p.window))}`;\n return s;\n }\n case \"objective-has-tag\": {\n let s = `${negate}${count(p.count_min ?? 1, \"objective\")} tagged ${dekebab(str(p.tag))}`;\n if (p.count_max != null) s += ` (at most ${str(p.count_max)})`;\n if (p.objective != null) s += ` (${dekebab(str(p.objective))})`;\n if (p.scope != null) s += ` in ${dekebab(str(p.scope))}`;\n if (p.last_marked) s += \" (most recently marked)\";\n return s;\n }\n case \"unit-has-tag\": {\n let s = `${negate}${count(p.count_min ?? 1, `${str(p.side)} unit`)} tagged ${dekebab(str(p.tag))}`;\n if (p.window != null) s += ` (${dekebab(str(p.window))})`;\n return s;\n }\n case \"terrain-has-tag\": {\n let s = `${negate}terrain tagged ${dekebab(str(p.tag))}`;\n if (p.friendly_units_min != null) s += ` with ${str(p.friendly_units_min)}+ friendly units`;\n if (p.enemy_units_max != null) s += ` and at most ${str(p.enemy_units_max)} enemy units`;\n if (p.last_marked) s += \" (most recently marked)\";\n if (p.in_enemy_dz) s += \" in the enemy deployment zone\";\n return s;\n }\n case \"terrain-area-control\":\n return `${negate}you control a terrain area with ${str(p.min_models ?? 1)}+ models`;\n case \"territory-control\": {\n let s = `${negate}you control ${dekebab(str(p.territory_ref ?? \"your-territory\"))}`;\n if (p.enemy_units_max != null) s += ` with at most ${str(p.enemy_units_max)} enemy units`;\n return s;\n }\n case \"engagement-fronts\":\n return `${negate}you are engaged on ${str(p.count_min ?? 1)}+ fronts`;\n\n default:\n return `${negate}${dekebab(c.type ?? \"unknown\")}`;\n }\n}\n"]}
1
+ {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../src/translate/condition.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,kFAAkF;AAClF,MAAM,UAAU,OAAO,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI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AAI,CAAC,CAAC,eAAe,IAAI,IAAI;gBAAE,CAAC,IAAI,gBAAgB,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC,cAAc,CAAC;YACzF,IAAI,CAAC,CAAC,WAAW;gBAAE,CAAC,IAAI,yBAAyB,CAAC;YAClD,IAAI,CAAC,CAAC,WAAW;gBAAE,CAAC,IAAI,+BAA+B,CAAC;YACxD,OAAO,CAAC,CAAC;QACX,CAAC;QACD,KAAK,sBAAsB;YACzB,OAAO,GAAG,MAAM,mCAAmC,GAAG,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,UAAU,CAAC;QACtF,KAAK,mBAAmB,CAAC,CAAC,CAAC;YACzB,IAAI,CAAC,GAAG,GAAG,MAAM,eAAe,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,IAAI,gBAAgB,CAAC,CAAC,EAAE,CAAC;YACpF,IAAI,CAAC,CAAC,eAAe,IAAI,IAAI;gBAAE,CAAC,IAAI,iBAAiB,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC,cAAc,CAAC;YAC1F,OAAO,CAAC,CAAC;QACX,CAAC;QACD,KAAK,mBAAmB;YACtB,OAAO,GAAG,MAAM,sBAAsB,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,UAAU,CAAC;QAExE;YACE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,EAAE,CAAC;IACtD,CAAC;AACH,CAAC","sourcesContent":["/**\n * Humanize an Ability-DSL / scoring `condition` into plain English.\n *\n * Shared by the ability-text CLI (`commands/translate.ts`) and the scoring-card\n * translator (`scoring.ts`). Output is **ASCII-only** with a fixed clause and\n * parameter order: it is pinned byte-for-byte across the TS and Rust ports by\n * the `conformance/scoring-translation` corpus, so any phrasing change here is a\n * semantic corpus change (bump `conformance/SPEC_VERSION`).\n */\n\n/**\n * Minimal structural view of a condition node. Matches both the ability-dsl\n * condition schema and the `secondary-card` award `when` field (a simple node\n * carries `type` + `parameters` + `negated`; a compound node carries\n * `operator` + `operands`).\n */\nexport interface Condition {\n type?: string;\n operator?: \"and\" | \"or\" | \"not\";\n operands?: Condition[];\n parameters?: Record<string, unknown>;\n negated?: boolean;\n}\n\n/** kebab-case → space-separated words (`enemy-territory` → `enemy territory`). */\nexport function dekebab(s: string): string {\n return s.replace(/-/g, \" \");\n}\n\nfunction str(v: unknown): string {\n return typeof v === \"string\" ? v : String(v);\n}\n\n/** `2` + `objective` → `2+ objectives`. Nouns here are all regular plurals. */\nfunction count(n: unknown, noun: string): string {\n return `${str(n)}+ ${noun}s`;\n}\n\nexport function describeCondition(c: Condition): string {\n // Compound nodes first — join the operands with lowercase connectives so the\n // result reads naturally inside a \"... when X and Y\" clause.\n if (c.operator === \"and\" && c.operands) {\n return c.operands.map(describeCondition).join(\" and \");\n }\n if (c.operator === \"or\" && c.operands) {\n return c.operands.map(describeCondition).join(\" or \");\n }\n if (c.operator === \"not\" && c.operands) {\n return `not (${c.operands.map(describeCondition).join(\", \")})`;\n }\n\n const negate = c.negated ? \"not \" : \"\";\n const p = c.parameters ?? {};\n\n switch (c.type) {\n // ── Ability-DSL conditions (ported from commands/translate.ts) ──────────\n case \"phase-is\":\n return `${negate}during the ${str(p.phase)} phase`;\n case \"timing-is\":\n return `${negate}at ${dekebab(str(p.timing))}`;\n case \"player-turn-is\":\n return `${negate}in ${p.turn === \"your-turn\" ? \"your\" : p.turn === \"opponent-turn\" ? \"the opponent's\" : \"either player's\"} turn`;\n case \"charged-this-turn\":\n return `${negate}the unit charged this turn`;\n case \"advanced-this-turn\":\n return `${negate}the unit advanced this turn`;\n case \"remained-stationary\":\n return `${negate}the unit remained stationary`;\n case \"unit-below-starting-strength\":\n return `${negate}the unit is below starting strength`;\n case \"unit-below-half-strength\":\n return `${negate}the unit is below half strength`;\n case \"unit-has-keyword\":\n return `${negate}the unit has \"${str(p.keyword)}\"`;\n case \"target-has-keyword\":\n return `${negate}the target has \"${str(p.keyword)}\"`;\n case \"model-is-leader\":\n return `${negate}the model is leading a unit`;\n case \"is-attached\":\n return `${negate}attached to a ${p.keyword ? `${str(p.keyword)} ` : \"\"}unit`;\n case \"attack-is-type\":\n return `${negate}for ${str(p.attack_type)} attacks`;\n case \"is-battle-shocked\":\n return `${negate}the unit is battle-shocked`;\n case \"has-lost-wounds\":\n return `${negate}the model has lost wounds`;\n case \"opponent-unit-within-range\":\n return `${negate}an enemy unit is within ${p.range === \"engagement\" ? \"engagement range\" : `${str(p.range)}\"`}`;\n case \"unit-within-range-of\":\n return `${negate}within ${str(p.range)}\" of ${str(p.target_type ?? \"target\")}${p.keyword ? ` (${str(p.keyword)})` : \"\"}`;\n case \"within-range-of-objective\":\n return `${negate}within range of an objective`;\n case \"has-fought-this-phase\":\n return `${negate}has fought this phase`;\n case \"destroyed-by-attack-type\":\n return `${negate}destroyed by a ${str(p.attack_type)} attack`;\n\n // ── Scoring conditions (secondary-card award `when`) ────────────────────\n case \"objective-majority\":\n return `${negate}you hold more objectives than the ${dekebab(str(p.relative_to ?? \"opponent\"))}`;\n case \"controls-objective\": {\n const noun = p.objective_role ? `${dekebab(str(p.objective_role))} objective` : \"objective\";\n let s = `${negate}you control ${count(p.count_min ?? 1, noun)}`;\n if (p.objective != null) s += ` (${dekebab(str(p.objective))})`;\n if (p.scope != null) s += ` in ${dekebab(str(p.scope))}`;\n if (p.exclude != null) s += ` (excluding ${dekebab(str(p.exclude))})`;\n return s;\n }\n case \"units-destroyed\":\n return `${negate}${count(p.count_min ?? 1, `${str(p.side)} unit`)} destroyed ${dekebab(str(p.window))}`;\n case \"units-destroyed-comparison\": {\n const subj = (p.subject ?? {}) as Record<string, unknown>;\n const ref = (p.reference ?? {}) as Record<string, unknown>;\n const cmp = p.comparator === \"greater-or-equal\" ? \"at least as many\" : \"more\";\n const link = p.comparator === \"greater-or-equal\" ? \"as\" : \"than\";\n return `${negate}you destroyed ${cmp} ${str(subj.side)} units ${dekebab(str(subj.window))} ${link} ${str(ref.side)} units ${dekebab(str(ref.window))}`;\n }\n case \"new-objective-controlled\":\n return `${negate}you newly control ${count(p.count_min ?? 1, \"objective\")} this turn`;\n case \"destroyed-while-on-objective\": {\n const obj = p.objective_role ? `a ${dekebab(str(p.objective_role))} objective` : \"an objective\";\n let s = `${negate}${count(p.count_min ?? 1, \"enemy unit\")} destroyed`;\n if (p.destroyer_on_objective) s += ` by a unit on ${obj}`;\n if (p.victim_on_objective) s += ` while on ${obj}`;\n if (p.victim_started_turn_on_objective) s += ` that started the turn on ${obj}`;\n return s;\n }\n case \"destroyed-in-tagged-terrain\": {\n const where = p.at_start_of_turn ? \"that started the turn in\" : \"while in\";\n const terrain = p.tag != null ? `${dekebab(str(p.tag))} terrain` : \"a terrain area\";\n return `${negate}${count(p.count_min ?? 1, \"enemy unit\")} destroyed ${where} ${terrain}`;\n }\n case \"operation-markers\": {\n const side = p.side != null ? `${str(p.side)} ` : \"\";\n const min = typeof p.count_min === \"number\" ? p.count_min : undefined;\n const max = typeof p.count_max === \"number\" ? p.count_max : undefined;\n let s: string;\n if (max === 0) {\n s = `no ${side}operation markers on the battlefield`;\n } else if (min != null && max != null && min === max) {\n s = `exactly ${min} ${side}operation marker${min === 1 ? \"\" : \"s\"} on the battlefield`;\n } else {\n s = `${str(min ?? 1)}+ ${side}operation markers on the battlefield`;\n }\n if (p.within_range_of != null) s += ` within range of ${dekebab(str(p.within_range_of))}`;\n if (p.friendly_unit_in_same_terrain_area) s += \" with a friendly unit in the same terrain area\";\n if (p.no_enemy_in_terrain_area) s += \" and no enemy units in that terrain area\";\n return `${negate}${s}`;\n }\n case \"action-completed\": {\n let s = `${negate}${count(p.count_min ?? 1, \"action\")} completed`;\n if (p.action_id != null) s += ` (${dekebab(str(p.action_id))})`;\n if (p.target_kind != null) s += ` on ${dekebab(str(p.target_kind))}`;\n const tf = (p.target_filter ?? {}) as Record<string, unknown>;\n if (tf.objective_role != null) s += ` (${dekebab(str(tf.objective_role))})`;\n if (tf.in_enemy_territory) s += \" in enemy territory\";\n if (tf.exclude != null) s += ` (excluding ${dekebab(str(tf.exclude))})`;\n if (p.window != null) s += ` ${dekebab(str(p.window))}`;\n return s;\n }\n case \"objective-has-tag\": {\n let s = `${negate}${count(p.count_min ?? 1, \"objective\")} tagged ${dekebab(str(p.tag))}`;\n if (p.count_max != null) s += ` (at most ${str(p.count_max)})`;\n if (p.objective != null) s += ` (${dekebab(str(p.objective))})`;\n if (p.scope != null) s += ` in ${dekebab(str(p.scope))}`;\n if (p.last_marked) s += \" (most recently marked)\";\n return s;\n }\n case \"unit-has-tag\": {\n let s = `${negate}${count(p.count_min ?? 1, `${str(p.side)} unit`)} tagged ${dekebab(str(p.tag))}`;\n if (p.window != null) s += ` (${dekebab(str(p.window))})`;\n return s;\n }\n case \"terrain-has-tag\": {\n let s = `${negate}terrain tagged ${dekebab(str(p.tag))}`;\n if (p.friendly_units_min != null) s += ` with ${str(p.friendly_units_min)}+ friendly units`;\n if (p.enemy_units_max != null) s += ` and at most ${str(p.enemy_units_max)} enemy units`;\n if (p.last_marked) s += \" (most recently marked)\";\n if (p.in_enemy_dz) s += \" in the enemy deployment zone\";\n return s;\n }\n case \"terrain-area-control\":\n return `${negate}you control a terrain area with ${str(p.min_models ?? 1)}+ models`;\n case \"territory-control\": {\n let s = `${negate}you control ${dekebab(str(p.territory_ref ?? \"your-territory\"))}`;\n if (p.enemy_units_max != null) s += ` with at most ${str(p.enemy_units_max)} enemy units`;\n return s;\n }\n case \"engagement-fronts\":\n return `${negate}you are engaged on ${str(p.count_min ?? 1)}+ fronts`;\n\n default:\n return `${negate}${dekebab(c.type ?? \"unknown\")}`;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpaca-software/40kdc-data",
3
- "version": "0.4.7",
3
+ "version": "0.4.11",
4
4
  "type": "module",
5
5
  "description": "The 40kdc Warhammer 40K dataset behind a linked, typed API — find units, follow them to their weapons, abilities, phases, and factions. Also validates data against the canonical JSON Schemas.",
6
6
  "keywords": [
@@ -138,6 +138,21 @@
138
138
  "$ref": "../defs/common.schema.json#/$defs/phase",
139
139
  "description": "Phase in which the action can be started."
140
140
  },
141
+ "timing": {
142
+ "type": "string",
143
+ "enum": ["start-of-battle", "start-of-turn", "end-of-turn"],
144
+ "description": "Non-phase moment the action happens, for card rules that are not started in a phase (Locate and Deny's start-of-battle marker placement, Punishment's start-of-turn condemnation, Consecrate's end-of-turn objective selection). Mutually informative with `starts` — a card action uses one or the other."
145
+ },
146
+ "battle_round": {
147
+ "type": "object",
148
+ "description": "Battle-round window in which the action can be started. Absent means any battle round. 'From the second battle round onwards' (Triangulate, Extract Intelligence) is { min: 2 }.",
149
+ "properties": {
150
+ "min": { "type": "integer", "minimum": 1, "maximum": 5 },
151
+ "max": { "type": "integer", "minimum": 1, "maximum": 5 }
152
+ },
153
+ "minProperties": 1,
154
+ "additionalProperties": false
155
+ },
141
156
  "player_turn": { "$ref": "../defs/common.schema.json#/$defs/player-turn" },
142
157
  "units": {
143
158
  "$ref": "../enrichment/ability-dsl/condition.schema.json",
@@ -161,6 +176,10 @@
161
176
  "effect": {
162
177
  "$ref": "../enrichment/ability-dsl/effect.schema.json",
163
178
  "description": "Effect applied when the action completes (e.g. terrain-area-tag, objective-tag, or unit-tag to mark transient state)."
179
+ },
180
+ "restrictions": {
181
+ "$ref": "../enrichment/ability-dsl/condition.schema.json",
182
+ "description": "Predicate that BLOCKS starting the action while it holds (Sensor Sweep: a unit cannot start this action if there is only one operation marker on the battlefield)."
164
183
  }
165
184
  },
166
185
  "additionalProperties": false
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "simple-condition": {
13
13
  "type": "object",
14
- "$comment": "Board/meta-state and scoring predicates. `parameters` is intentionally open (additionalProperties: true); each type documents its own param convention. Scoring predicates added for mission cards: `units-destroyed` { side: 'enemy'|'friendly', window: 'this-turn'|'previous-turn', count_min: int } — at least count_min units of `side` were destroyed in `window`. `units-destroyed-comparison` { subject: {side, window}, comparator: 'greater-than'|'greater-or-equal', reference: {side, window} } — compares two destruction tallies (e.g. more enemy units destroyed this turn than friendly last turn). `objective-majority` { relative_to: 'opponent' } — you control more objectives than the named party. `controls-objective` params: { count_min: int, objective_role?: 'central'|'expansion'|'non-home'|'home', exclude?: 'home', objective?: 'opponent-home'|'your-home', scope?: 'enemy-territory'|'your-territory' }. Mission-card extensions (11e primary deck): `action-completed` { action_id?: string, target_kind?: 'objective'|'terrain'|'enemy-unit'|'self', target_filter?: { in_enemy_territory?: bool, objective_role?: 'central'|'non-home', exclude?: 'home' }, count_min: int, window?: 'this-turn'|'previous-turn'|'cumulative' } — at least count_min instances of a named action were completed in the window. `objective-has-tag` { tag: 'baited'|'cleansed'|'triangulated'|'consecrated'|'sabotaged'|'marked'|'vanguard'|'spotted', count_min: int, count_max?: int, objective?: 'opponent-home'|'your-home', scope?: 'enemy-territory'|'your-territory' } — at least count_min objectives carry the named transient tag. `unit-has-tag` { tag: 'doomed'|'spotted', side: 'enemy'|'friendly', count_min: int, window?: 'destroyed-this-turn'|'still-on-board' } — at least count_min units of `side` carry the tag (optionally with a destruction filter — Punishment scores when a Doomed unit was destroyed or left the battlefield). `terrain-has-tag` { tag: 'mined'|'marked'|'vanguard'|'plundered', friendly_units_min?: int, enemy_units_max?: int, last_marked?: bool, in_enemy_dz?: bool } — terrain piece state predicate; `last_marked` selects the most-recently-marked piece (Find and Deny / Recover the Relics' Overwhelming Force trigger). `new-objective-controlled` { count_min: int } — at least count_min objectives are controlled this turn that were not controlled in the previous command phase. `engagement-fronts` { count_min: int } — friendly units engage enemies in at least count_min distinct fronts; a 'front' is one of the four table quarters (board quadrants about the board's centre — each of the four areas formed by dividing the table along both centre lines). `destroyed-while-on-objective` { destroyer_on_objective?: bool, victim_on_objective?: bool, count_min: int } — count_min enemy units were destroyed this turn under the named spatial condition (the destroying friendly unit, the destroyed enemy unit, or both were standing on an objective at the moment of the kill). `destroyed-in-tagged-terrain` { tag: 'mined'|'marked'|'vanguard'|'plundered', at_start_of_turn?: bool, count_min: int } — count_min enemy units were destroyed this turn while in terrain carrying the named tag; with `at_start_of_turn` the victim must have been in that terrain at the start of the turn (Death Trap's Disruption kill bonus), otherwise the spatial test is at the moment of the kill (parallels `destroyed-while-on-objective`).",
14
+ "$comment": "Board/meta-state and scoring predicates. `parameters` is intentionally open (additionalProperties: true); each type documents its own param convention. Scoring predicates added for mission cards: `units-destroyed` { side: 'enemy'|'friendly', window: 'this-turn'|'previous-turn', count_min: int } — at least count_min units of `side` were destroyed in `window`. `units-destroyed-comparison` { subject: {side, window}, comparator: 'greater-than'|'greater-or-equal', reference: {side, window} } — compares two destruction tallies (e.g. more enemy units destroyed this turn than friendly last turn). `objective-majority` { relative_to: 'opponent' } — you control more objectives than the named party. `controls-objective` params: { count_min: int, objective_role?: 'central'|'expansion'|'non-home'|'home', exclude?: 'home', objective?: 'opponent-home'|'your-home', scope?: 'enemy-territory'|'your-territory' }. Mission-card extensions (11e primary deck): `action-completed` { action_id?: string, target_kind?: 'objective'|'terrain'|'enemy-unit'|'self', target_filter?: { in_enemy_territory?: bool, objective_role?: 'central'|'non-home', exclude?: 'home' }, count_min: int, window?: 'this-turn'|'previous-turn'|'cumulative' } — at least count_min instances of a named action were completed in the window. `objective-has-tag` { tag: 'baited'|'decoyed'|'cleansed'|'triangulated'|'consecrated'|'sabotaged'|'marked'|'vanguard'|'spotted', count_min: int, count_max?: int, objective?: 'opponent-home'|'your-home', scope?: 'enemy-territory'|'your-territory' } — at least count_min objectives carry the named transient tag. `unit-has-tag` { tag: 'doomed'|'condemned'|'spotted'|'surveilled', side: 'enemy'|'friendly', count_min: int, window?: 'destroyed-this-turn'|'left-battlefield-this-turn'|'this-turn'|'still-on-board' } — at least count_min units of `side` carry the tag (optionally with an event window — Punishment scores when a condemned unit was destroyed or left the battlefield this turn; Surveil the Foe scores on units tagged this turn). `terrain-has-tag` { tag: 'mined'|'trapped'|'marked'|'vanguard'|'plundered', friendly_units_min?: int, enemy_units_max?: int, last_marked?: bool, in_enemy_dz?: bool } — terrain piece state predicate; `last_marked` selects the most-recently-marked piece (Find and Deny / Recover the Relics' Overwhelming Force trigger). `new-objective-controlled` { count_min: int } — at least count_min objectives are controlled this turn that were not controlled in the previous command phase. `engagement-fronts` { count_min: int } — friendly units engage enemies in at least count_min distinct fronts; a 'front' is one of the four table quarters (board quadrants about the board's centre — each of the four areas formed by dividing the table along both centre lines). `destroyed-while-on-objective` { destroyer_on_objective?: bool, victim_on_objective?: bool, victim_started_turn_on_objective?: bool, objective_role?: 'central', count_min: int } — count_min enemy units were destroyed this turn under the named spatial condition (the destroying friendly unit, the destroyed enemy unit, or both were within range of an objective at the moment of the kill; `victim_started_turn_on_objective` instead tests the victim's position at the start of the turn, and `objective_role` narrows which objectives count — Secure Asset's central-objective kill row). `destroyed-in-tagged-terrain` { tag?: 'mined'|'trapped'|'marked'|'vanguard'|'plundered', at_start_of_turn?: bool, count_min: int } — count_min enemy units were destroyed this turn while in terrain carrying the named tag; with `at_start_of_turn` the victim must have been in that terrain at the start of the turn (Death Trap's kill bonus), otherwise the spatial test is at the moment of the kill (parallels `destroyed-while-on-objective`). With `tag` omitted, any terrain area qualifies (Search and Scour). `operation-markers` { side?: 'friendly'|'opponent', count_min?: int, count_max?: int, within_range_of?: 'opponent-home-objective', friendly_unit_in_same_terrain_area?: bool, no_enemy_in_terrain_area?: bool } — counts operation markers on the battlefield (side omitted counts both sides' markers); count_max: 0 is 'none remain', count_min == count_max == 1 is 'exactly one'; the terrain-area flags add the co-location proviso used by Locate and Deny / Extract Relic ('one of your units is within the same terrain area as that marker, and no enemy units are within it').",
15
15
  "properties": {
16
16
  "type": {
17
17
  "type": "string",
@@ -31,7 +31,7 @@
31
31
  "action-completed", "objective-has-tag", "unit-has-tag",
32
32
  "terrain-has-tag", "new-objective-controlled",
33
33
  "engagement-fronts", "destroyed-while-on-objective",
34
- "destroyed-in-tagged-terrain"
34
+ "destroyed-in-tagged-terrain", "operation-markers"
35
35
  ]
36
36
  },
37
37
  "parameters": { "type": "object", "additionalProperties": true },