The Foundry-free data contract for a SoHL combatant — the sohl.core.logic.SohlLogicData port specialized for sohl.document.combatant.foundry.SohlCombatant, plus the combatant's persisted combat-scoped state. Implemented by SohlCombatantDataModel.

interface SohlCombatantData {
    actionDefs: sohl.entity.action.SohlAction.Data[];
    actorLogic: null | SohlActorLogic<any>;
    didAction: boolean;
    displayedMedium: string;
    groupId: null | string;
    id: string;
    isDefeated: boolean;
    isHidden: boolean;
    isOwner: boolean;
    kind: string;
    lastAttackMode?: PointerData;
    lastBlockMode?: PointerData;
    lastRun?: Record<string, number>;
    logic: SohlLogic<any>;
    moveFactor: number;
    name: string;
    parent: null | SohlCombatant;
    scheduledActions?: ScheduledAction[];
    shortcode: string;
    startLocation: CombatantStartLocation;
    statuses: Set<string>;
    type: string;
    uuid: string;
    getFlag(scope: string, key: string): unknown;
    setFlag(scope: string, key: string, value: unknown): Promise<unknown>;
    update(data: object): Promise<unknown>;
}

Hierarchy (View Summary)

Properties

Serialized action definitions used to build the logic's actions map.

actorLogic: null | SohlActorLogic<any>

The logic of the owning actor — this actor's own logic when the data is an actor's, the owning actor's logic when it is an item's, or null.

didAction: boolean

Whether this combatant has acted this turn.

displayedMedium: string

Which movement medium's computed move the tracker displays.

groupId: null | string

This combatant's CombatantGroup id, or null when ungrouped.

id: string

The owning document's id.

isDefeated: boolean

Whether this combatant is defeated (Foundry DEFEATED special status).

isHidden: boolean

Whether this combatant's token is hidden from players.

isOwner: boolean

Whether the current user owns the document (edit permission).

kind: string

The document kind (its actor or item type id).

lastAttackMode?: PointerData

Strike mode last used to attack ({ itemId, smId }), or null.

lastBlockMode?: PointerData

Strike mode last used to block ({ itemId, smId }), or null.

lastRun?: Record<string, number>

Generic run record (issue #579) — a map of actionName → the world time (seconds) that action last performed on this document, stamped at the action chokepoint for actions flagged recordsLastRun. The past-tense mirror of scheduledActions: "when did X last happen here?" for any action, without a bespoke field, and it survives after a schedule ends. For an event-driven trigger (no computable next fire) it is the only meaningful temporal fact.

logic: SohlLogic<any>

The logic instance built from this data.

moveFactor: number

GM situational multiplier on computed move (run, terrain, …).

name: string

The owning document's name.

parent: null | SohlCombatant

The Foundry document (actor or item) this data belongs to, or null.

scheduledActions?: ScheduledAction[]

Persisted recurring/deferred schedules for this document (issue #588) — each entry defers actionName to anchor + interval. The generic store that replaces the retired bespoke last*Date anchors; a recurring effect's finalize() re-arms these into the event queue on every preparation. Only documents whose data model extends the base SohlDataModel (actors, items, combatants) carry it — hence optional here. See https://kb.heroiclands.org/dev/reference/event-queue/.

shortcode: string

Short identity code for this document.

startLocation: CombatantStartLocation

Turn-start location used to measure spaces moved this turn. Captured at the start of each round and compared to the current token position to compute SohlCombatantLogic.spacesMovedThisTurn.

statuses: Set<string>

The active status-effect ids on this combatant's actor.

type: string

The owning document's type (its actor or item kind).

uuid: string

The owning document's globally-unique id, treated as an opaque identity token: pass it through (e.g. into chat-card data) and resolve it back to logic via fvttLogicFromUuid / fvttLogicFromUuidSync — never fromUuid it to a Foundry document inside the logic layer.

Methods

  • Write a namespaced flag on the owning document.

    Parameters

    • scope: string
    • key: string
    • value: unknown

    Returns Promise<unknown>