Persisted data model for a Trauma item.

The shape of system on a trauma item — i.e. item.system (equivalently item.logic.data) when item.type === "trauma". The backing DataModel implements this interface.

interface TraumaData<TLogic extends TraumaLogic<TraumaData> = TraumaLogic<any>> {
    actionDefs: sohl.entity.action.SohlAction.Data[];
    actorLogic: null | SohlActorLogic<any>;
    aspect: null | ImpactAspect;
    bloodLossAdvanceDurationBase: null | number;
    bloodLossAdvanceDurationFormula: null | string;
    bodyLocationCode: null | string;
    category: null | string;
    contractDate: null | number;
    courseDurationBase: null | number;
    courseDurationFormula: null | string;
    docHtml: HTMLString;
    healingCheckDurationBase: null | number;
    healingCheckDurationFormula: null | string;
    healingRateBase: null | number;
    id: string;
    infectable: boolean;
    isOwner: boolean;
    kind: string;
    lastRun?: Record<string, number>;
    levelBase: null | number;
    logic: TLogic;
    name: string;
    notes: HTMLString;
    parent: null | SohlItem;
    permanentImpairmentEligible: boolean;
    scheduledActions?: ScheduledAction[];
    shortcode: string;
    subType: TraumaSubType;
    treatmentDate: null | number;
    treatmentModifierBase: null | number;
    type: string;
    uuid: string;
    get item(): SohlItem;
    getFlag(scope: string, key: string): unknown;
    label(options?: { withName: boolean; withSubType: boolean }): string;
    setFlag(scope: string, key: string, value: unknown): Promise<unknown>;
    update(data: object): Promise<unknown>;
}

Type Parameters

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.

aspect: null | ImpactAspect

Type of damage: Blunt, Edged, Piercing, or Fire; null for non-injuries.

bloodLossAdvanceDurationBase: null | number

Rolled seconds between blood-loss advances; null until rolled.

bloodLossAdvanceDurationFormula: null | string

Formula rolled to seed the blood-loss-advance interval.

bodyLocationCode: null | string

Shortcode of the body location on the being's body where this trauma occurred. null means the trauma is not tied to a specific location (affects the whole body, or a descriptive condition).

category: null | string

Sub-category within a subtype — e.g. a fatigue trauma's category is a FATIGUE_CATEGORY (windedness / weariness / weakness), a psychological condition's is a TRAUMA_PSYCOND_CATEGORY, a physical condition's a TRAUMA_PHYSCOND_CATEGORY. null for subtypes with no sub-category.

contractDate: null | number

World-time (seconds) at which the injury was contracted.

courseDurationBase: null | number

Rolled seconds between course checks; null until rolled.

courseDurationFormula: null | string

Formula rolled to seed the Extended Shock / Coma course-check interval.

docHtml: HTMLString

Rich-text description shown on the item's sheet and chat cards.

healingCheckDurationBase: null | number

Rolled seconds between healing checks; null until rolled.

healingCheckDurationFormula: null | string

Formula rolled to seed the healing-check interval.

healingRateBase: null | number

Base rate of wound healing per time period; null until established.

id: string

The owning document's id.

infectable: boolean

Whether this injury is exposed to infection — set by the Treatment Test for a poorly-treated wound (#553). A Critical-Failure Injury Healing Test on an infectable wound contracts an infection (#557).

isOwner: boolean

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

kind: string

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

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.

levelBase: null | number

Severity on a graduated scale: M1, S2-S3, G4-G5. null for descriptive conditions that carry no level.

logic: TLogic

The logic instance built from this data.

name: string

The owning document's name.

notes: HTMLString

Rich-text GM/player notes for the item.

parent: null | SohlItem

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

permanentImpairmentEligible: boolean

Whether this injury is eligible for permanent impairment should it heal slowly. Set by the Treatment Test (#553) from the wound's aspect, severity, and resulting Healing Rate; the impairment magnitude itself is applied by the Impairment system (#554). Always false for non-injury traumas.

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.

subType: TraumaSubType

The trauma's nature — an injury, or a mind/spirit/body condition (fear, morale, pall, psychological-condition, aural-shock, fatigue, infection, shock, coma).

treatmentDate: null | number

World-time (seconds) at which medical treatment was applied, or null if untreated. isTreated is derived from this on the logic.

treatmentModifierBase: null | number

Treatment modifier for the trauma; null (or 0) means no modifier.

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.

Accessors

Methods

  • The item's display label; with withName, includes the item's name, and with withSubType, includes its sub-type.

    Parameters

    • Optionaloptions: { withName: boolean; withSubType: boolean }

    Returns string

  • Write a namespaced flag on the owning document.

    Parameters

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

    Returns Promise<unknown>