Action pseudo-document

Hierarchy

  • any
    • ItemAction

Constructors

  • Parameters

    • data: object

      Action data

    • options: any

      Data model options

    Returns ItemAction

Properties

activation: any
conditionals: any
FALLBACK_IMAGE: "systems/pf1/icons/skills/gray_04.jpg" = ...

Default image if the action has no image and it is not correctly linked to an item

metadata: Readonly<{ label: "PF1.Action" }> = ...

Metadata mimicking Foundry documents

Required by pf1.applications.ItemActionSheet#_createDocumentIdLink

Accessors

  • get enhancementBonus(): null | number
  • Effective enhancement bonus

    Action's enhancement override or what is inherited from item.

    Returns null | number

    • Null if not enhanced.
  • get isSpell(): boolean
  • Is spell-like action

    Returns boolean

    • Action type is set to melee/ranged spell attack or spell save.
  • get normalMaterial(): null | string
  • Normal material

    Returns null | string

    • Null if no material is configured in action or item.
  • get defaultDamageType(): { custom: string; values: never[] }
  • Returns { custom: string; values: never[] }

    • No replacement

Methods

  • Generate attacks.

    Parameters

    • Optionaloptions: {
          bonuses?: boolean;
          conditionals?: boolean;
          full?: boolean;
          resolve?: boolean;
          rollData?: object;
      } = {}

      Options

      • Optionalbonuses?: boolean

        Include other bonuses. Requires resolve to be enabled.

      • Optionalconditionals?: boolean

        Include conditional modifications. Requires resolve to be enabled.

      • Optionalfull?: boolean

        Full attack

      • Optionalresolve?: boolean

        If the bonuses are to be resolved directly.

      • OptionalrollData?: object

        Roll data

    Returns object[]

    • Array of attack data
  • Parameters

    • Optionaloptions: {
          interactive?: boolean;
          maximize?: boolean;
          minimize?: boolean;
          rollData?: object;
      } = {}

      Additional options to configure behavior.

      • Optionalinteractive?: boolean
      • Optionalmaximize?: boolean
      • Optionalminimize?: boolean
      • OptionalrollData?: object

        Pre-determined roll data to pass for determining the charge cost.

    Returns null | Roll<any>

    • Cost in charges for this action. Null if not charged.
  • Parameters

    • Optionaloptions: { maximize?: boolean; minimize?: boolean; rollData?: object } = {}

      Additional options to configure behavior.

      • Optionalmaximize?: boolean
      • Optionalminimize?: boolean
      • OptionalrollData?: object

        Pre-determined roll data to pass for determining the charge cost.

    Returns null | Roll<any>

    • Cost in charges for this action. Null if not charged.
  • Generates ChatData for this action's parent item, but with this action's data, regardless of whether it is the first action or not.

    Parameters

    • OptionalchatDataOptions: object = {}

      Options passed to ItemPF#getChatData affecting the chat data

    Returns Promise<ChatData>

    Chat data for this action's parent and this action

  • Generates lists of conditional subtargets this attack can have.

    Parameters

    • target: string

      The target key, as defined in PF1.conditionTargets.

    Returns {}

    A list of conditionals

  • Parameters

    • OptionalrollData: object = null

      Data to pass to the roll. If none is given, get new roll data.

    Returns number

    The Difficulty Class for this action.

  • Returns labels related to this particular action

    Parameters

    • Optionaloptions: { isolated?: boolean; rollData?: object } = {}
      • Optionalisolated?: boolean

        Are these labels generated for isolated information (that is, need more details)

      • OptionalrollData?: object

        Pre-determined roll data. If not provided, finds the action's own roll data.

    Returns Record<string, string>

    This action's labels

  • Get power attack, deadly aim or piranha strike multiplier.

    Parameters

    • Optionaloptions: { rollData?: object } = {}

      Additional options

      • OptionalrollData?: object

        Roll data instance

    Returns number

    • Effective multiplier
  • Parameters

    • Optionaloptions: { rollData?: object; type?: "single" | "min" | "max" } = {}

      Additional options to configure behavior.

      • OptionalrollData?: object

        Specific roll data to pass.

      • Optionaltype?: "single" | "min" | "max"

        What type of range to query. Either "single" (for a single range increment), "max" or "min".

    Returns null | number

    The given range, in system configured units, or null if no range is applicable.

  • Render all connected application instances.

    Parameters

    • Optionalforce: boolean = false

      Force rendering

    • Optionalcontext: object = {}

      Optional context

    Returns void

  • Place an attack roll using an item (weapon, feat, spell, or equipment)

    Parameters

    • Optionaloptions: { bonus?: string; data?: object; extraParts?: string[]; primary?: boolean } = {}

      Options

      • Optionalbonus?: string

        Additional attack bonus

      • Optionaldata?: object

        Roll data

      • OptionalextraParts?: string[]

        Additional attack parts

      • Optionalprimary?: boolean

        Treat as primary natural attack

    Returns D20RollPF

  • Roll damage for an action.

    Parameters

    • Optionaloptions: {
          conditionalParts?: object;
          critical?: boolean;
          data?: null | object;
          extraParts?: string[];
          primaryAttack?: boolean;
      } = {}

      Options configuring the damage roll

      • OptionalconditionalParts?: object

        Conditional data sets

      • Optionalcritical?: boolean

        Whether to roll critical damage

      • Optionaldata?: null | object

        rollData to be used

      • OptionalextraParts?: string[]

        Additional strings added to the roll formula

      • OptionalprimaryAttack?: boolean

        Whether this is the primary attack

    Returns Promise<DamageRoll[]>

    Created damage rolls, one roll per damage part

  • Update the action

    TODO: BROKEN

    Parameters

    • updateData: object

      Update data

    • context: object = {}

      Update context

    Returns Promise<void>

  • Creates an action.

    Parameters

    • data: object[]

      Data to initialize the action(s) with.

    • context: { parent?: ItemPF } = {}

      An object containing update context information.

      • Optionalparent?: ItemPF

        The parent entity to create the action within.

    Returns ItemAction[]

    • The resulting actions
    • If the action has no parent