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

    Type Alias EngineContext

    Shared engine context. Carries the phase plus a few attacker/target flags the keyword translator and the resolver both need. The engine fills it from its EngineInput.context plus the unit-keyword unions; the resolver reads only the subset relevant to its applicableWhen checks.

    type EngineContext = {
        phase: Phase;
        attackerStationary?: boolean;
        attackerCharged?: boolean;
        withinHalfRange?: boolean;
        attackerInCover?: boolean;
        targetInCover?: boolean;
        attackerKeywords?: ReadonlyArray<string>;
        targetKeywords?: ReadonlyArray<string>;
        timing?: string;
        attackerAttached?: boolean;
    }
    Index

    Properties

    phase: Phase
    attackerStationary?: boolean

    Attacker has not moved this turn — Heavy fires its +1 to hit.

    attackerCharged?: boolean

    Attacker made a charge move this turn — drives the charged-this-turn condition (e.g. World Eaters' Relentless Rage). Left undefined when the caller can't determine it — the condition then evaluates as "unknown" and the SPA surfaces a diagnostic (mirrors attackerStationary / timing).

    withinHalfRange?: boolean

    Within half the weapon's range — Melta / Rapid Fire fire.

    attackerInCover?: boolean

    Attacker benefits from cover (mostly informational; cover applies to defenders).

    targetInCover?: boolean

    Target is in cover — the resolver flips on cover, the engine applies +1 to save.

    attackerKeywords?: ReadonlyArray<string>

    Attacker keywords (union of unit.keywords + faction_keywords), lower-cased.

    targetKeywords?: ReadonlyArray<string>

    Target keywords (union of unit.keywords + faction_keywords), lower-cased.

    timing?: string

    Sub-phase timing flag (e.g. "start-of-phase", "end-of-phase", "on-destroyed"). Consumed by the timing-is condition. Left undefined when the caller can't pin a sub-phase down — the condition then evaluates as "unknown" and the SPA surfaces a diagnostic.

    attackerAttached?: boolean

    The buffed unit is part of a combined ("attached") unit — a leader is attached to a bodyguard, or vice-versa. Drives the is-attached and model-is-leader conditions. Derived from a non-empty EligibilityInput.attachedUnitIds. Left undefined when the caller can't determine attachment — the conditions then evaluate as "unknown" and the SPA surfaces a diagnostic (mirrors how timing undefined behaves).