The actor data interface, extending SohlActorData.
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 actor's tactical move (feet per combat round) as a sohl.entity.modifier.ValueModifier so runtime modifiers (haste, encumbrance, etc.) can layer on. Seeded from the active moveProfile when it is enabled.
The actor's overland travel speed (leagues per watch) as a sohl.entity.modifier.ValueModifier. Seeded from the active moveProfile when it is enabled.
The active movement profile, selected during initialize by this actor's SohlActorData.currentMoveMedium. A disabled MOVEMENT_MEDIUM.NONE profile when the actor has no matching profile (a non-mover).
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 logic instances of every embedded item — the logic-layer analogue of Foundry's foundry.documents.Actor#allItems.
One SohlItemLogic per embedded item, in items order.
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 the actor is owned by at least one player (non-GM) user.
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.
Every item's logic instance grouped by item kind — the logic-layer analogue of Foundry's foundry.documents.Actor#itemTypes.
A record of item kind → that kind's logic instances.
Every ItemKind key is present; kinds with no items map to an empty
array. Each group is typed to the concrete logic for that kind, so
logicTypes.skill is SkillLogic[].
The owning document's name.
A SohlSpeaker for the owning actor/item (a blank speaker if neither resolves).
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.
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.
Find an embedded item's logic by its shortcode and item kind.
The item kind, inferred from the type argument.
The matching item's logic typed for type, or undefined if
no item matches.
Both arguments are required: a shortcode is only unique within a given
item kind, so matching the type as well prevents returning an
unexpected item that happens to share the shortcode. The item kind also
drives the return type — the concrete logic for that kind is resolved
from ItemLogicByKind, so no cast is needed at the call site:
const stealth = actor.logic.getItemLogic("stealth", ITEM_KIND.SKILL);
// ^? SkillLogic | undefined
Find an embedded item's logic by its id.
The item's id.
The matching item's logic or undefined if no item matches.
Handle a trigger dispatched by the SoHL event queue. Override in subclasses to implement actor-specific trigger handling.
Subscription kind identifier
Trigger context (discriminated by context.name)
Optional_payload: Record<string, unknown>Optional context data attached when subscribing
Select the active movement profile from SohlActorData.currentMoveMedium and seed the feetPerRound / leaguesPerWatch modifiers.
Movement is a universal actor capability, so it is derived on the
base actor logic. Subclasses that layer encumbrance/strength effects onto
the selected profile (e.g. Being) must call super.initialize() first.
See sohl.core.logic.SohlLogic.initialize for the lifecycle phase.
Set this actor's SohlActorData.currentMoveMedium — the active movement profile — to the medium carried in the action scope.
Intrinsic-action executor for the makeDefaultMedium action.
The action context; context.scope.medium names the
MovementMedium to make current. Absent, the medium is chosen in
a dialog unless skipDialog forbids one.
Resolves once the actor update completes, or immediately when no medium was chosen.
The Profile-tab star names the medium in scope and applies it directly. Invoked any other way — from the Actions menu, a macro, a script — there is no medium to apply, so the action offers the choice (the prefer-dialog rule) rather than returning silently as it once did (#1098). The prompt lists the no-movement medium plus every medium this actor authors a profile for, preselected at the current one. A caller that suppressed the dialog cannot be prompted, so it gets a notice instead of an unexplained no-op.
GM re-edit of a settled opposed contest (#1082) — the edit pencil in the Opposed Action Result card's header, and the two-sided counterpart to the standard card's sohl.document.item.logic.SohlItemBaseLogic.resultEdit (#856).
Re-opens the standard test dialog for each side in turn, pre-filled
with that side's current situational and success-level modifiers, applies
the new values, re-evaluates the contest on both frozen rolls (never a
re-roll, no Fate cost), and reposts the Opposed Action Result card. The
settled contest rides in context.scope.opposedTestResult — the whole
result serialized into the pencil's data-scope and revived by the
chat-card dispatcher — so the edit acts on that contest.
The contest lives only in the chat log, never on a document, so an edit mutates nothing persistent: it posts a new, corrected card and leaves the original standing (see the action-card consent model). Dismissing either side's dialog cancels the whole edit — no re-evaluation, no repost.
GM-only. The pencil is render-hidden from non-GMs (sohl.document.chat.gateEditActionPencil); this is the click-time half of that gate — a synthesized click from a non-GM is refused here.
The action context; context.scope.opposedTestResult is
the settled contest. When skipDialog is set, each side's new
situationalModifier / successLevelMod are taken from
context.scope.source / context.scope.target instead of the dialogs.
The re-evaluated contest, or undefined when refused (non-GM),
missing a contest, or cancelled (a dialog dismissed).
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.
Sets up the intrinsic actions for this actor.
The action context to use for setup.
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 and return all intrinsic actions for this logic type.
A map of action shortcodes to their definitions
Base logic class for all actor types (Being, Cohort, Structure, Vehicle).
Provides the foundation that all actor logic classes build upon. Concrete actor logic classes extend this to implement type-specific rules: health tracking, anatomy modeling, passenger management, etc.