SoHL's Combatant document. Adds strike-mode memory (last attack/block) and threat queries on top of Foundry's combatant.

Type Parameters

Hierarchy

Constructors

Accessors

  • get groupId(): null | string
  • The id of this combatant's CombatantGroup, or null when ungrouped.

    Returns null | string

    _source.group is the canonical stored id. Core's _prepareGroup() reassigns the derived this.group to the resolved CombatantGroup document when it resolves, but leaves it as the raw id (or null) otherwise — so reading _source avoids that heterogeneity.

  • get reach(): number
  • This combatant's melee reach (feet): the reach of its actor — the greatest reach among the actor's currently available melee strike modes. 0 when the actor is absent or is not a Being.

    Returns number

Methods

  • The computed tactical move (feet per combat round) for this combatant, read from the actor's movement for its active medium.

    Returns null when the actor has no movement model.

    Returns null | number

    The tactical move, or null when movement is unavailable.

  • Pure relational predicate: two combatants are enemies iff they belong to different CombatantGroups. A combatant is never its own enemy, and an absent group on either side is treated defensively as enemy.

    Reads only already-loaded combatant fields — no Foundry API calls.

    Parameters

    Returns boolean

    true if the two combatants are enemies.

  • Dispatch a chat-card button click to this combatant's logic — the automated-combat defense resumes (Block/Dodge/Counterstrike/Ignore) live on sohl.document.combatant.logic.SohlCombatantLogic as intrinsic actions, and the attack card's defense buttons address the defender's combatant. The button's dataset becomes the action's scope.

    Parameters

    • btn: HTMLElement

      The clicked chat-card button element.

    Returns Promise<void>

  • Whether this combatant's melee reach extends to other — i.e. the center-to-center grid distance between the two combatants' tokens is within this combatant's reach. Returns false when either token position is unavailable.

    Parameters

    Returns boolean

    true if this combatant's reach extends to other.

    Distance is measured center-to-center by design: a large creature's body size is folded into its body reachBase, so a big token's reach already accounts for the distance from its center to an adjacent target. Do not "fix" this to edge-to-edge.

  • Remember the strike mode just used to attack (persisted on the combatant).

    Parameters

    • itemUuid: string

      The id of the item owning the strike mode.

    • smId: string

      The strike mode id.

    Returns Promise<void>

  • Remember the strike mode just used to block (persisted on the combatant).

    Parameters

    • itemUuid: string

      The id of the item owning the strike mode.

    • smId: string

      The strike mode id.

    Returns Promise<void>