Hierarchy

  • Combat
    • CombatPF

Constructors

  • Parameters

    • Optionaldata: any

      Initial data provided to construct the Combat document

    • Optionalcontext: any

    Returns CombatPF

Accessors

Methods

  • Internal

    Determine skipped turns

    Parameters

    • from: {
          round: number;
          turn: number;
      } = {}

      Origin combat time frame

      • round: number

        From round

      • turn: number

        From turn

    • context: object

      Update context

    Returns Set<Combatant>

    • Set of combatant IDs whose turn was skipped
  • Internal

    Handle effects of skipped turns.

    Parameters

    • skipped: Set<Combatant>

      Combatant IDs of those whose turn was skipped.

    • context: object

      Combat update context

    Returns void

  • Parameters

    • changed: object

      Update data

    • context: options

      Context options

    • userId: string

      Triggering user ID

    Returns void

  • Internal

    Parameters

    • changed: object

      Changed data

    • context: object

      Context

    • user: User

      Triggering user

    Returns Promise<void>

  • Internal

    Handle end of turn

    Parameters

    • originTime: {
          round: number;
          turn: number;
      } = {}

      Origin time frame

      • round: number

        Round on which the turn ended

      • turn: number

        Turn that ended

    • context: object = {}

      Context

    Returns Promise<void>

  • Internal

    Process end of durations based on initiative.

    Only active GM processes these to avoid conflicts and logic bloat.

    Parameters

    • Optionalcontext: object = {}

      Update context

    Returns void

  • Process current combatant: expire active effects & buffs.

    Parameters

    • changed: object

      Update data

    • context: options

      Context options

    Returns Promise<void>

  • Parameters

    • ids: string[]

      Combatant IDs to roll initiative for.

    • Optionaloptions: {
          bonus: undefined | string;
          d20: undefined | string;
          formula: undefined | string;
          messageOptions: undefined | object;
          rollMode: undefined | string;
          skipDialog: undefined | boolean;
          updateTurn: undefined | boolean;
      } = {}

      Additional options

      • bonus: undefined | string

        Formula for bonus to initiative

      • d20: undefined | string

        d20 override. Passed to Combatant.getInitiativeRoll

      • formula: undefined | string

        Formula override. Passed to Combatant.getInitiativeRoll

      • messageOptions: undefined | object

        Additional data for created chat message

      • rollMode: undefined | string

        Roll mode override.

      • skipDialog: undefined | boolean

        Skip roll dialog Synced with Foundry v12.331

      • updateTurn: undefined | boolean

        Adjust current turn if the new init would shift it

    Returns Promise<CombatPF>

  • Parameters

    • Optionaloptions: {
          bonus: undefined | string;
          check: undefined | boolean;
          d20: undefined | string;
          name: string;
      } = {}

      Additional options

      • bonus: undefined | string

        Bonus formula override

      • check: undefined | boolean

        If false, no base d20 check is provided

      • d20: undefined | string

        Formula override

      • name: string

        Name of the roller

    Returns object

    • Result