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

    Hierarchy (View Summary)

    Index
    _sortedTriggers: any[] | undefined
    • get availableCards(): any

      Returns any

    • get drawnCards(): any

      Returns any

    • get isExhausted(): boolean

      Returns boolean

    • get triggerConsumerType(): string

      Returns string

    • Parameters

      • card: any
      • speaker: null = null

      Returns Promise<void>

    • Apply scry results: reorder cards and optionally discard them.

      Parameters

      • results: object[]

        Array of {id, sort, discard} objects

      Returns Promise<void>

    • Draw the next available card from the deck.

      The read-pick-write core (availableCards filter → sort → pick → mark drawn) is serialized via mutex to prevent the concurrent-draw race: multiple concurrent drawCard() calls on the same deck would otherwise all read the same pre-drawn snapshot, pick the same card, and return it multiple times instead of distributing different cards.

      Post-draw logic (sideboard limits, trigger dispatch, hook firing) runs OUTSIDE the lock to avoid deadlock with reentrant drawCard() calls from within card-drawn hook handlers (e.g., disableNextDrawnCard replacement draws).

      Parameters

      • options: {
            actor?: any;
            extraActors?: BodyMindSoulActor[];
            silent?: boolean;
            speaker?: Object;
            suppressTriggers?: boolean;
            targetActor?: any;
        } = {}
        • Optionalactor?: any

          Actor triggering the draw (resolved from deck if omitted)

        • OptionalextraActors?: BodyMindSoulActor[]

          Additional targets for triggers

        • Optionalsilent?: boolean

          Skip posting draw message to chat

        • Optionalspeaker?: Object

          Chat message speaker object

        • OptionalsuppressTriggers?: boolean

          Skip trigger dispatch and hook firing

        • OptionaltargetActor?: any

          Pre-selected target, skips target picker

      Returns Promise<any>

      • Drawn Card document or null if deck is exhausted/all cards disabled
    • Returns {
          conditionChoices: { [k: string]: any };
          conditionConfigFields: {};
          conditionConfigPartials: {};
          conditionsNeedValue: {};
          conditionTargetScopeChoicesByType: {};
          conditionValueHints: {};
          hookChoices: { [k: string]: any };
          localizedConditionsByHook: {};
          localizedSubConditionsByMetaType: {};
          metaConditions: {};
          outcomeChoices: { [k: string]: any };
          outcomeConfigPartials: {};
          outcomeTargetScopeChoicesByType: {};
      }

    • Returns void

    • Return the top N available cards sorted by sort order. Pure read, no mutations.

      Parameters

      • count: number

        Number of cards to scry

      Returns object[]

      Array of card data objects

    • Returns Promise<void>

    • Scan the configured imageSourceFolder and update card face images to match files found there. Matching is case-insensitive by both the raw filename (without extension) and its slug form. A file named "card-back.*" (any image extension) updates the deck's own back image.

      Returns Promise<{ cardBack: boolean; updated: number }>

    • Returns {
          hasBeenShuffled: any;
          imageSourceFolder: any;
          shuffleOnDraw: any;
          triggers: TypedObjectField;
      }

    • Parameters

      • source: any

      Returns any

    • Build the shared triggers TypedObjectField schema.

      Returns TypedObjectField