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

    Class BodyMindSoulActor

    Extend the base Actor document by defining a custom roll data structure which is ideal for the Simple system.

    Hierarchy

    • Actor
      • BodyMindSoulActor

    Indexable

    • [key: string]: any
    Index
    • get equippedGear(): BodyMindSoulItem[]

      All equipped gear items (type "item" with system.equipped true).

      Returns BodyMindSoulItem[]

    • get handWeapons(): { mhItem: any; ohItem: any }

      Hand weapons currently held by this actor. Returns the first two items of type "item" that are equipped and held, sorted by their sort order (ascending).

      Returns { mhItem: any; ohItem: any }

    • get ownedRunes(): BodyMindSoulItem[]

      All rune items owned directly by this actor (does not include socketed runes in gear).

      Returns BodyMindSoulItem[]

    • Returns the set of environmental geo type tags currently active for this actor, derived from the scene and any surveyed tiles the actor's token is standing on. Scene/Tile environmental data is stored in flags (Foundry v13 does not support TypeDataModel for Scene or Tile documents).

      In combat, resolves the token via the acting combatant (if available) for correctness with unlinked tokens and multiple active tokens. Falls back to getActiveTokens() for non-combat contexts.

      Returns Set<string>

    • Returns all glyph items socketed in currently-equipped gear items.

      Returns BodyMindSoulItem[]

    • Parameters

      • changed: any
      • options: any
      • userId: any

      Returns Promise<void>

    • Parameters

      • data: any
      • options: any
      • user: any

      Returns Promise<void>

    • Parameters

      • changed: any
      • options: any
      • userId: any

      Returns void

    • Returns true if this actor should log incoming damage rather than decrement health.

      Returns boolean

    • Returns Generator<ActiveEffect, void, unknown>

    • BMS uses system.modifications[] (processed in prepareDerivedData) instead of Foundry's changes pipeline. Override applyActiveEffects to skip change application entirely, preserving only status accumulation and the phase-completion guard.

      Parameters

      • phase: any

      Returns void

    • Apply damage to the actor, accounting for resistances, piercing, per-keyword mods, and layer cascading. When the caller does not own this actor, delegates to the GM over game.socket and returns asynchronously. The method must always be awaited — local mutations are not synchronous.

      Resistance calculation: base resistance from system.resistances[type] is shifted toward neutral by the attacker's outgoingResistancePiercing (all + type-specific), plus extraPiercing. Piercing moves up the ladder (toward 1.0x) by N stages, capped at neutral — it can reduce resistance but cannot push the target into vulnerability. ignoreResistances: true bypasses this entirely.

      Per-keyword mods (from system.incomingDamagePerKeyword) stack multiplicatively on each other and additively with the global incoming damage multiplier/bonus.

      When _shouldTrackDamage() is true (usually for NPCs), damage is logged to system.damageTaken[] instead of decrementing vitals.

      Config: source string — optional label for the damage log entry attacker Actor|null — source actor (used for resistance piercing resolution) silent boolean — suppress roll and action log notification (default false) ignoreResistances boolean — bypass resistance entirely, apply damage 1:1 (default false) keywords string[] — damage keywords for per-keyword mod lookups (default []) extraPiercing number — additional piercing stages to apply on top of attacker.outgoing... (default 0)

      Parameters

      • damage: number

        The amount of damage to apply.

      • type: string

        The type of damage (e.g., "slash", "fire").

      • Optionallayer: string = "tempHp"

        The starting layer ("tempHp", "shields", "health", "sanity").

      • Optionaloptions: object = {}

      Returns Promise<{ actual: number; original: number }>

    • Apply a restore to a target vital or resource. When the caller does not own this actor, delegates to the GM over game.socket and returns immediately (void); the actual restore completes asynchronously on the GM.

      When restoring a vital (not a resource) on an NPC with damage tracking enabled (_shouldTrackDamage), logs the heal to system.damageTaken[] and returns this. Otherwise, increments the target value up to max (or beyond if allowOverflow is true), decrements surges if requested, and returns this. If the target vital/resource does not exist or surges are exhausted when consumeSurge is true, returns void and logs a warning (unless silent is true).

      Config: useSurge boolean — add surge value to restore (default true) consumeSurge boolean — decrement surges.value by 1 (default true) allowOverflow boolean — permit restored value to exceed max (default false) bonusValue number — additional restore amount on top of surge (default 0) silent boolean — suppress warnings and action log notification (default false)

      Parameters

      • targetKey: string

        "health", "shields", "tempHp", "sanity", or "resources."

      • Optionaloptions: object = {}

      Returns Promise<void | BodyMindSoulActor>

      Resolves to this when restore succeeds; void on early return

    • Find the character deck for this actor created from a given base deck, or null if none exists.

      Parameters

      • baseDeck: Cards

        A base deck (type "deck") to search for

      Returns any

      The character deck, or null if not found

    • Clear the damage log for this NPC.

      Returns Promise<void>

    • Returns the actor's configured advantage stage for card draws.

      Returns number

    • Get or create a character deck for this actor from a base deck. Creates the deck under the "zzSystem Decks" folder and clones all cards from the base deck. Sets the new deck as default only if no default is currently set.

      Parameters

      • baseDeck: Cards

        The base deck to create from

      Returns Promise<{ created: boolean; deck: Cards }>

      The character deck and whether it was newly created

    • Augment the actor's default getRollData() method by appending the data object generated by its DataModel's getRollData(), or null. This polymorphic approach is useful when you have actors & items that share a parent Document but have slightly different data preparation needs.

      Note: effectiveHp is included at both data.vitals.effectiveHp (from DataModel) and data.effectiveHp (top-level copy below). Both address paths resolve in Roll formulas — this is a convenience duplication; scripts may reference either.

      Returns object

      Merged roll data from DataModel + this document level

    • Get the roll formula for a given attribute or vector.

      Parameters

      • options: { archetype?: string; attribute?: string; vector?: string } = {}
        • Optionalarchetype?: string

          The archetype key (required for attributes)

        • Optionalattribute?: string

          The attribute key

        • Optionalvector?: string

          The vector key

      Returns string

    • Returns the highest-priority rune item on this actor that responds to the given rune name (direct name match or subrune membership), or null if none is found. Note: This returns only direct-owned runes, not socketed runes. Use runeCandidatesFor for all candidates.

      Parameters

      • runeName: string

      Returns any

    • Returns void

    • Returns void

    • Returns void

    • Returns void

    • Open the resource management interface for this actor.

      Returns void

    • Open the rest dialog for this actor.

      Returns Promise<void>

    • Get all rune candidates (direct-owned and socketed) that respond to the given rune name, sorted by priority (direct first, then by item priority desc).

      Parameters

      • runeName: string

        The rune name to search for

      Returns {
          currentExpressions: number;
          gearItem?: any;
          item?: any;
          key?: string;
          socketIndex?: number;
          type: "rune" | "socket";
      }[]

    • Convert the actor document 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.

    • Open the roll data viewer for this actor.

      Returns void