Pathfinder 1e for Foundry VTT
    Preparing search index...

    Class ItemAction

    Action pseudo-document

    Hierarchy

    • any
      • ItemAction
    Index

    Constructors

    • Returns ItemAction

    Properties

    _id: string
    ability: {
        attack: string;
        critMult?: number;
        critRange?: number;
        damage: string;
        damageMult?: number;
        max?: number;
    }
    actionType: string
    activation: any
    alignments: { chaotic: boolean; evil: boolean; good: boolean; lawful: boolean }
    alwaysUsable: boolean
    ammo: { cost: number; type: string }
    area: string
    attackBonus: string
    attackName: string
    bab: string
    conditionals: undefined | Collection<ItemConditional, Methods<ItemConditional>>
    damage: {
        critParts: DamagePartModel[];
        nonCritParts: DamagePartModel[];
        parts: DamagePartModel[];
    }
    description: string
    duration: {
        concentration: boolean;
        dismiss: boolean;
        units: string;
        value: string;
    }
    effect: string
    enh: { value?: number }
    extraAttacks: {
        formula: { bonus: string; count: string; label: string };
        manual: ExtraAttackModel[];
        type: string;
    }
    held: string
    img?: string
    maneuverType?: string
    material: { addon: Set<String>; normal: { custom: boolean; value: string } }
    measureTemplate: { color: string; size: string; texture: string; type: string }
    naturalAttack: {
        primary: boolean;
        secondary: { attackBonus: string; damageMult: number };
    }
    nonlethal: boolean
    notes: { effect: string[]; footer: string[] }
    parent?: ItemPF
    powerAttack: { critMultiplier: number; damageBonus: number; multiplier: number }
    range: {
        maxIncrements: number;
        minUnits: string;
        minValue: string;
        units: string;
        value: string;
    }
    save: { dc: string; description: string; harmless: boolean; type: string }
    soundEffect: string
    splash: boolean
    tag?: string
    target: { value: string }
    touch: boolean
    uses: {
        autoDeductChargesCost: string;
        perAttack: boolean;
        self: { maxFormula: string; per: string; value: number };
    }
    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: "Action"; name: "Action" }> = ...

    Metadata mimicking Foundry documents

    Required by pf1.applications.ItemActionSheet#_createDocumentIdLink

    Accessors

    • get critRange(): null | number

      Effective critical range when accounting for broken status and action type.

      Returns null when crit is not possible.

      Returns null | number

    • 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.

    Methods

    • Delete this action

      Returns Promise<Item<"base" | ModuleSubType>>

      • Updated parent item document.
    • 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 Promise<null | Roll<EmptyObject>>

      • 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<EmptyObject>

      • Cost in charges for this action. Null if not charged.
    • Generates a list of critical applications for a given formula target.

      Parameters

      Returns Record<string, string>

      A list of critical applications.

    • Generates lists of conditional modifier bonus types applicable to a formula.

      Parameters

      • target: string

        The target key as defined in pf1.config.conditionTargets.

      Returns Record<string, string>

      A list of bonus types.

    • Generates lists of conditional sub-targets this action can have.

      Parameters

      • entry: object

        The target entry

      Returns object

      • Same as the target entry parameter with added info.
    • Generates a list of targets this modifier can have.

      Returns Record<string, string>

      Target ID to label mapping.

    • 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.

    • For supporting conditionals in fromUuid()

      Synced with Foundry v12.331

      Parameters

      • embeddedName: string
      • id: string
      • options: object = {}

      Returns undefined | ItemConditional

    • 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?: "min" | "max" | "single" } = {}

        Additional options to configure behavior.

        • OptionalrollData?: object

          Specific roll data to pass.

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

          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;
            extraChanges?: ItemChange[];
            extraParts?: string[];
            primary?: boolean;
        } = {}

        Options

        • Optionalbonus?: string

          Additional attack bonus

        • Optionaldata?: object

          Roll data

        • OptionalextraChanges?: ItemChange[]

          Additional changes

        • OptionalextraParts?: string[]

          Additional attack parts

        • Optionalprimary?: boolean

          Treat as primary natural attack

      Returns Promise<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 | 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 Promise<ItemAction[]>

      • The resulting actions
      • If the action has no parent