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

    Function useAction

    • Use one of an actor's top-level action items.

      Flow: consume the action's resources, then either queue it at swing 0 (when combat has started) or ask whether to resolve it instantly (out of combat).

      NOTE: resources are consumed BEFORE the out-of-combat confirm, so declining the prompt still spends the slot (there is no refund). This is current behavior and is pinned by the quench/suite-actor-actions.mjs characterization suite. Changing it is a design decision.

      Config:

      • actor: the owning actor. Nothing happens unless actor.isOwner.
      • actionItem: the action item to use. Nothing happens when falsy.
      • busyElement: optional element disabled while the in-combat queue call runs.

      Parameters

      • options: { actionItem: any; actor: any; busyElement?: BusyElement }

        Workflow inputs.

        • actionItem: any

          The action item (must have _sortedSwings for the combat path).

        • actor: any

          The actor using the action.

        • OptionalbusyElement?: BusyElement

          Optional element to disable during the in-combat queue call.

      Returns Promise<void>

      Resolves when the workflow finishes or stops early (no swings, not consumed, declined).