Binds this logic to its parent data model and builds the actions map from the parent's intrinsic and scripted action definitions, selecting a default action.
Reserved base data (unused by the base class).
Must provide options.parent, the data model this logic
is embedded in; the parent's actionDefs are used to build
actions.
Executable actions for this document, keyed by shortcode — context-menu entries, chat-card buttons, and lifecycle hooks. A script action shadows (wholly overrides) the intrinsic action of the same shortcode (see the constructor).
The owning SohlActor — the document itself when it is an actor,
otherwise its owning actor (for an item, combatant, or effect), or null.
The logic of the owning actor — the Foundry-free way to reach the actor
layer from any logic. For an actor's own logic this is itself; for an
item's logic it is the owning actor's logic; otherwise null.
Resolved through the SohlLogicData port, so logic code
can navigate to the actor (and iterate items via allLogics /
logicTypes / getItemLogic) without touching the Foundry document.
The combatant logics sharing this one's (non-null) group — the inverse of isEnemyOf.
The owning sohl.document.combatant.foundry.SohlCombatant document — the combatant's scene edge.
The SohlCombatantLogic of every combatant in the same active combat (including this one), or an empty array when not in combat.
This logic's typed data — its *Data interface (e.g. SkillData), the same
persisted object as document.system. Prefer document.logic.data when
reading a document's fields from a macro, Script Action, or module: it is the
typed, API-documented surface (autocomplete and reference links resolve),
whereas document.system is typed as the internal DataModel.
Convenience accessor for parent.
Whether this combatant has acted this turn.
The computed move for the combat-tracker's displayed medium.
This combatant's group id, or null when ungrouped.
The owning document's id.
The owning SohlItem.
The owning document's kind (its actor or item type id).
Localized display label combining the typeLabel and the document's name.
The strike mode last used to attack, or undefined (combat-scoped).
The strike mode last used to block, or undefined (combat-scoped).
The owning document's name.
This combatant's melee reach (feet) — the reach of its actor (the greatest reach among the actor's available melee strike modes). 0 when the actor is absent or is not a Being.
The number of grid spaces moved since the start of this turn.
A SohlSpeaker for the owning actor/item (a blank speaker if neither resolves).
The combatant logics currently threatening this one — enemies that are not defeated, not incapacitated, not hidden, and within reach.
Return this Combatant's TokenDocument's Logic, or undefined when the
combatant has no token on the canvas.
the token document's logic, or undefined when there is no token.
The token hangs off the combatant document (combatant), not
off its data model — sohl.core.logic.SohlLogic.parent is the data
model, so reading parent.token yielded undefined and threw (#1079).
Localized type (and sub-type, when present) label for the owning document.
The owning document's UUID — the opaque identity token from the data port.
Resume automated combat with a Block — pick a blocking strike mode
(dialog, or from scope when skipDialog) and resolve the exchange.
Action context carrying the attack snapshot in its scope.
The result of the combat exchange, or undefined if blocked or no valid block mode.
Resume automated combat with a Counterstrike — a melee attack back at the original attacker; both sides can land in the same exchange.
Action context carrying the attacker's attack snapshot.
The combat result, or undefined if canceled.
Resume automated combat with a Dodge — roll the defender's Dodge skill.
Action context carrying the attack snapshot in its scope.
The combat result, or undefined if canceled.
Resume automated combat with Ignore — no defensive contest.
Action context carrying the attack snapshot in its scope.
The combat result, or undefined if canceled.
The computed tactical move (feet per combat round) for this combatant,
read from its actor's sohl.document.actor.logic.SohlActorBaseLogic.feetPerRound
for the actor's active movement medium and scaled by the combatant's
situational SohlCombatantData.moveFactor (run, difficult terrain,
haste, …; defaults to 1). null when the actor has no movement model.
The tactical move, or null when unavailable.
Delete the owning document, after confirming with the user.
The action context; unused.
Open the sheet for the owning document.
The action context; unused.
Compute derived values that depend on sibling items being initialized.
Called on every item after ALL items have completed initialize.
Safe to access: sibling items' initialized state (e.g., reading trait attribute values for a skill base formula).
Not safe to access: sibling items' evaluated state — another item's
evaluate() may not have run yet. Dependencies on evaluated state
belong in finalize.
Example: a Skill reads trait attribute values to compute its skill
base; a gear item resolves its containerId to find its parent container.
Execute an action by shortcode, using the provided context or creating a new one.
The shortcode of the action to execute.
Optionalcontext: sohl.entity.action.SohlActionContextThe action context to use, if any.
The result of the action execution, or undefined if the action was not found or could not be executed.
Resolve cross-item dependencies that require all items to have been evaluated.
Called on every item after ALL items have completed evaluate.
Safe to access: all sibling items' initialized and evaluated state.
Example: fate mastery level (which depends on an already-evaluated Aura trait); encumbrance totals summed across all evaluated gear.
The context-menu options — the actions currently available — for this logic's document.
The available context-menu entries.
Set up base state from persisted data: create ValueModifiers, set base values.
Called on every item before any item's evaluate runs.
Safe to access: own persisted data fields (this.data.*).
Not safe to access: sibling items on the same actor — they may not have initialized yet. Cross-item reads belong in evaluate.
Example: a Skill creates its MasteryLevelModifier
from persisted fields; it does not yet read trait attribute values.
Whether the two combatants are enemies — they belong to different groups.
The combatant logic to compare against.
true if they are enemies.
Pure predicate behind SohlCombatantLogic.threatenedBy: a candidate combatant threatens the subject iff it is an enemy that is alive, conscious, capable, visible, and within reach.
The combatant (logic) to test against
true if the candidate threatens the subject.
Reassign this combatant to a CombatantGroup — GM-only. The picker dialog and group creation/assignment are Foundry-document work, so this executor delegates to sohl.document.combatant.foundry.SohlCombatant.moveToGroup.
The action context (unused; the dialog gathers input).
Intrinsic action performed after finalize lifecycle stage. This is intended for modules to hook into (or ActionItems to override) to perform additional logic after the main lifecycle stages have completed.
The action context for the post-finalize hook.
Whether this combatant's melee reach extends to other — center-to-center
grid distance is within this combatant's reach.
The combatant logic to test reach against.
true if reach extends to other.
Remember the strike mode just used to attack (persisted on the combatant).
The strike mode to record.
Remember the strike mode just used to block (persisted on the combatant).
The strike mode to record.
Begin an automated attack — the single entry point for combat start.
Action context (supplies the target, scope, and chat
options); scope.mode pre-selects the strike mode in the attack dialog
(and is the mode used outright when skipDialog is set).
The attack result or undefined if cancelled.
Serialize this logic to a plain reference.
A uuid-keyed reference to this logic.
A logic is a behavior wrapper over a live Foundry document; it is never
revived from its own JSON (its constructor needs that document). Wherever a
logic is persisted — a chat card, an action sohl.entity.action.SohlActionContext.scope
— it is re-resolved from its uuid (e.g. via fvttLogicFromUuidSync), not
rebuilt from a payload. So it serializes as a compact, resolvable reference
(name/kind are carried for display and debugging); the owning document
holds the actual persisted state.
StaticdefineDefine the combatant's intrinsic actions — the automated-combat defense resumes, dispatched to this combatant from the attack card's defense buttons.
The combatant intrinsic-action definitions.
StaticfromFind the combatant logic for a given actor in the active combat.
Scans the active combat's combatants for the first whose actor matches
actorLogic (by id) and returns that combatant's logic. Use it to reach an
actor's combat-scoped state (e.g. lastAttackMode, didAction)
when you only hold the actor's logic.
The actor logic to look up.
The matching combatant's logic, or undefined if there is no
active combat or the actor is not a combatant in it.
StaticfromFind the combatant logic for a given token in the active combat.
Scans the active combat's combatants for the first whose token matches
tokenLogic (by id) and returns that combatant's logic. Use it to reach an
token's combat-scoped state (e.g. lastAttackMode, didAction)
when you only hold the token's logic.
The token logic to look up.
The matching combatant's logic, or undefined if there is no
active combat or the token is not a combatant in it.
Logic for a SoHL combatant — the combat-participation layer.
Remarks
Holds the combatant's combat-scoped state and the rules that operate on it (relational enemy/ally queries, strike-mode memory, movement, reach), reading the actor's capabilities through actorLogic. Spatial queries (reach to another combatant) are the one scene-coupled edge and route through the scene facade. Combat participation (the automated block/dodge/counterstrike resume flow) lives here as intrinsic actions, distinct from the actor's combat capability (strike modes, reach) on the actor logic.