@alpaca-software/40kdc-data
    Preparing search index...

    Class AbilityView

    An ability, linked to the phases it acts in and the units that have it.

    Phases are not stored on the ability — they live in phase-mappings records.

    units.find("Kharn")!.abilities
    .filter(a => a.phases.includes("shooting"));
    Index

    Constructors

    Properties

    The full generated ability record.

    Accessors

    • get id(): string

      The ability's id (ability_id in the raw record).

      Returns string

    • get appliesTo(): AbilityAppliesTo | undefined

      The curated applies_to keyword filter, or undefined when this ability declares no resolvable unit scope. When present, it names which datasheet units the ability benefits — the contract for roster-side highlighting (e.g. a detachment rule that only buffs POSSESSED units).

      Returns AbilityAppliesTo | undefined

    Methods

    • Generated plain-English approximation of this ability's effect + scope, rendered from the DSL by the conformance-pinned describer (translate/effect.ts). The dataset carries no rules prose; this is the displayable stand-in.

      Returns string

    • Whether this ability's applies_to scope includes unit — true iff the unit carries every required_keywords entry and no excluded_keywords, across its keywords + faction_keywords. Always false when the ability has no applies_to (no resolvable scope → no highlight). Pinned by the conformance/applies-to corpus.

      Parameters

      Returns boolean

    • The subset of candidates (typically a roster's units) this ability's applies_to scope benefits, preserving input order. Empty when the ability declares no scope.

      Parameters

      Returns UnitView[]

    • Buff stack this ability contributes against context, with provenance tagged via source (the caller knows whether this ability is being read as army, detachment, unit, leader, etc.). DSL branches the buff layer can't auto-apply are dropped here; call describeBuffs if you also want the diagnostics. perspective defaults to "attacker"; pass "target" to translate the ability as a defensive buff (FNP, T/Sv stat-mods, save rerolls, incoming hit penalties).

      Parameters

      Returns Buff[]