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

    Function executeOutcomesForAllIterator

    • Execute a trigger's outcome list for an "all"-family iterator (allTargets, allTemplate, allCombat, allCloseBurst).

      Unlike an each* iterator — which independently evaluates and executes the whole outcome list once per caught target — an "all" iterator evaluates shared state (damage rolls, card draws, conditions) once for the whole declaration, then dispatches each outcome according to its own target scope:

      • target-scoped outcomes (the default, including an unset target) are dispatched once per caught actor, in targetActors order. With zero caught actors they simply never fire.
      • self- and attacker-scoped outcomes fire exactly once for the whole declaration, regardless of how many actors were caught — including zero. (Under swing execution attacker resolves identically to self, since swing triggers never set eventTriggerer; both must therefore be treated as "fires once".) This is what makes a self-cast zone/aura on an allTemplate action work when the template catches nothing.

      Outcomes are dispatched in order, and every dispatch — self-scoped and per-target alike — shares ONE outcomeResults map and ONE _actorUpdateBatch, so formula-token chaining via context.outcomeResults still resolves across the scope boundary in either direction.

      A NegateSignal thrown at any point aborts everything remaining: the remaining targets of the current outcome and every subsequent outcome.

      Parameters

      • trigger: object

        trigger DataModel instance; iterates trigger._sortedOutcomes.

      • declContext: object

        the declaration-scoped execution context. Its advantageStage is treated as the base stage; each per-target dispatch adds that actor's system.incomingAdvantage offset on top.

      • targetActors: Actor[]

        actors caught by this declaration (may be empty).

      Returns Promise<{ results: object; wasNegated: boolean }>

      results = accumulated outcomeResults; wasNegated = true if a NegateSignal was thrown