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

    Class UnitView

    A unit, linked to its faction, weapons, and abilities.

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    raw: Unit

    The full generated Unit record.

    Accessors

    • get weapons(): WeaponView[]

      Weapons referenced by weapon_ids, resolved within the unit's own faction — a bare id shared across factions (e.g. close-combat-weapon) resolves to the wielder's own copy (issue #59), falling back to global first-wins only for a genuinely cross-faction id. Unresolved ids are skipped.

      Returns WeaponView[]

    Methods

    • The stat profile at index i (default 0). Returns the schema-generated profile object directly so callers can feed it straight to the engine without an intermediate wrapper.

      Parameters

      • i: number = 0

      Returns
          | {
              name?: string;
              M: StatValue;
              T: number;
              W: number;
              Sv: number;
              invuln_sv?: number
              | null;
              invuln_sv_ranged?: number | null;
              invuln_sv_melee?: number | null;
              Ld: number;
              OC: number;
              [k: string]: unknown;
          }
          | {
              name?: string;
              M: StatValue;
              T: number;
              W: number;
              Sv: number;
              invuln_sv?: number
              | null;
              invuln_sv_ranged?: number | null;
              invuln_sv_melee?: number | null;
              Ld: number;
              OC: number;
              [k: string]: unknown;
          }

      • {
            name?: string;
            M: StatValue;
            T: number;
            W: number;
            Sv: number;
            invuln_sv?: number | null;
            invuln_sv_ranged?: number | null;
            invuln_sv_melee?: number | null;
            Ld: number;
            OC: number;
            [k: string]: unknown;
        }
        • [k: string]: unknown
        • Optionalname?: string

          Profile name (e.g., 'Wounded' for degrading)

        • M: StatValue
        • T: number
        • W: number
        • Sv: number
        • Optionalinvuln_sv?: number | null
        • Optionalinvuln_sv_ranged?: number | null

          Attack-scoped invulnerable save that applies only to ranged attacks.

        • Optionalinvuln_sv_melee?: number | null

          Attack-scoped invulnerable save that applies only to melee attacks.

        • Ld: number
        • OC: number
      • {
            name?: string;
            M: StatValue;
            T: number;
            W: number;
            Sv: number;
            invuln_sv?: number | null;
            invuln_sv_ranged?: number | null;
            invuln_sv_melee?: number | null;
            Ld: number;
            OC: number;
            [k: string]: unknown;
        }
        • [k: string]: unknown
        • Optionalname?: string

          Profile name (e.g., 'Wounded' for degrading)

        • M: StatValue
        • T: number
        • W: number
        • Sv: number
        • Optionalinvuln_sv?: number | null
        • Optionalinvuln_sv_ranged?: number | null

          Attack-scoped invulnerable save that applies only to ranged attacks.

        • Optionalinvuln_sv_melee?: number | null

          Attack-scoped invulnerable save that applies only to melee attacks.

        • Ld: number
        • OC: number