Body, Mind & Soul — API Reference
    Preparing search index...

    Hierarchy (View Summary)

    Index
    advantage: string | undefined
    checkAdvantage: { global: number } | undefined
    disposition: any
    durationModifiers:
        | {
            effect: { bonus: number; multiplier: number };
            swing: { all: { bonus: number; multiplier: number } };
        }
        | {
            effect: { bonus: number; multiplier: number };
            swing: { all: { bonus: number; multiplier: number } };
        }
        | undefined
    incomingAdvantage: number | undefined
    incomingDamageBonus: number | undefined
    incomingDamageMultiplier: number | undefined
    incomingDamagePerKeyword: {} | undefined
    incomingRequireConfirmCrit: boolean | undefined
    incomingRequireConfirmNegate: boolean | undefined
    incomingRestoreBonus: number | undefined
    incomingRestoreMultiplier: number | undefined
    incomingStartingLayer: any
    isBloodied: boolean | undefined
    isDead: boolean | undefined
    isDeathsDoor: boolean | undefined
    isDowned: boolean | undefined
    outgoingDamageBonus: number | undefined
    outgoingDamageMultiplier: number | undefined
    outgoingDamagePerKeyword: {} | undefined
    outgoingDamagePerType: {} | undefined
    outgoingDamageTypeOverride: any
    outgoingRequireConfirmCrit: boolean | undefined
    outgoingRequireConfirmNegate: boolean | undefined
    outgoingResistancePiercing: { all: number } | undefined
    outgoingRestoreBonus: number | undefined
    outgoingRestoreMultiplier: number | undefined
    perVitalRestore: {} | undefined
    regen: { resource: {}; vital: {} } | undefined
    trackerRevealKeywords: boolean | undefined
    unarmedStrikeFormula: string | undefined
    • Apply modifications to this actor's derived data. appliedMods (active effects) use best-buff / worst-debuff take-highest stacking. localMods (feature items on the sheet) stack additively with each other. Both pools combine at application: localSum + bestBuff + worstDebuff. setStage overrides all addStages; last setStage in the list wins.

      Parameters

      • appliedMods: ModificationModel[]

        Mods from active effects (take-highest stacking)

      • localMods: ModificationModel[] = []

        Mods from feature items (additive stacking)

      Returns void

    • Distribute an effective damage amount across vitals without modifying state. Shared by calculateDamage and applyDamage.

      Parameters

      • remaining: number

        Post-resistance (and post-block) damage to distribute

      • layer: string

        Starting layer

      Returns { actual: number; updates: object; vitalDamage: object }

    • Resolve incoming damage through the resistance/piercing ladder and per-keyword modifiers. Returns the floored effective damage after all incoming multipliers and bonuses are applied, but before distribution across vitals. Does not modify state or trigger hooks.

      Parameters

      • damage: number

        The raw damage amount

      • type: string

        The damage type

      • Optionaloptions: {
            attacker?: object;
            extraPiercing?: number;
            ignoreResistances?: boolean;
            keywords?: string[];
        } = {}
        • Optionalattacker?: object

          Attacker document (used for outgoingResistancePiercing)

        • OptionalextraPiercing?: number

          Additional piercing from callee context

        • OptionalignoreResistances?: boolean

          Skip resistance ladder entirely

        • Optionalkeywords?: string[]

          Damage keywords for per-keyword incoming mods

      Returns number

      The floored remaining damage after all modifiers

    • Calculate how damage would be distributed, applying resistance but not modifying state or firing hooks. Use this for damage previews (rollDamage outcome). For actual application, use applyDamage.

      Parameters

      • damage: number

        The raw damage amount

      • type: string

        The damage type

      • Optionallayer: string = "tempHp"

        Starting layer

      • Optionaloptions: {
            attacker?: object;
            extraPiercing?: number;
            ignoreResistances?: boolean;
            keywords?: string[];
        } = {}
        • Optionalattacker?: object

          Attacker document for piercing calculation

        • OptionalextraPiercing?: number

          Additional piercing stages

        • OptionalignoreResistances?: boolean

          Skip resistance ladder

        • Optionalkeywords?: string[]

          Damage keywords for per-keyword incoming mods

      Returns { actual: number; original: number; vitalDamage: object }

    • Construct the roll data object for use in Foundry Roll() formulas. This method supports @-prefixed flat addressing used by Foundry's Roll engine (distinct from the system's own parseFormula/resolveActorVars which use single-brace {fth} and dotted system.attributes.* syntax).

      Return shape (for use in new Roll(formula, actor.getRollData())): @str.value, @str.total, @str.bonus — for each attribute key in CONFIG.BODY_MIND_SOUL.calculator.mapping @vitals.health.value, @vitals.health.max, @vitals.health.label — likewise for shields, tempHp, sanity, effectiveHp @resources..value, @resources..max, @resources..label — for each resource @vectors..total, @vectors..value, @vectors..bonus — for each vector

      Note: Addresses like @vitals.health.value and @vitals.effectiveHp.value use a different convention than the system's parseFormula option actor, which resolves {health} and {fth} through a separate mechanism. See parseFormula docs for roll-data vs. formula vars.

      Returns object

      Flattened roll data with attribute/vital/resource/vector values

    • Convert the schema to a plain object.

      The built in toObject() method will ignore derived data when using Data Models. This additional method will instead use the spread operator to return a simplified version of the data.

      Returns object

      Plain object either via deepClone or the spread operator.

    • Returns {
          actionGroups: MergeableArrayField;
          advantage: any;
          attributes: any;
          biography: any;
          decks: any;
          defaultDeck: any;
          disposition: any;
          drawOverrides: MergeableArrayField;
          effectiveHp: any;
          health: any;
          items: any;
          markConfig: any;
          resistances: any;
          resources: any;
          sanity: any;
          shields: any;
          tags: any;
          tempHp: any;
          tempStacks: MergeableArrayField;
          vectors: any;
      }

    • Parameters

      • source: any

      Returns any