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

    Apply Damage Prompt

    Handles damage application UX when adjustment is desired.

    Calls ActorPF#applyDamage when finally committing changes.

    Called primarily from ActorPF.applyDamage

    Hierarchy

    • HandlebarsApplication<this> & ApplicationV2<
          RenderContext,
          Configuration,
          RenderOptions,
          this,
      >
      • ApplyDamage
    Index

    Constructors

    Properties

    adamantine: boolean = false

    Does this count as real adamantine?

    asNonlethal: boolean

    Nonlethal

    asWounds: boolean

    Is this to be applied directly to wounds with Wounds & Vigor optional rule?

    bonus: number

    Arbitrary manual bonus

    bonusType: string = "untyped"

    Type of the custom bonus.

    critMult: number

    Critical multiplier.

    damageIds: Set<string> = ...

    All damage types that exist

    damageOptions: { asNonlethal: any; asWounds: any; critMult: any; dualHeal: any }
    extraOptions: {
        action: any;
        attackIndex: any;
        dialog: boolean;
        element: any;
        event: any;
        interactive: boolean;
        message: any;
        reference: any;
    }
    instances: DamagePartModel[] = []

    Damage instances

    isHealing: boolean

    Is this healing instead of damage?

    isMagic: boolean = false

    Does the damage have enhancement bonus or otherwise count as magic?

    materials: Set<string> = ...

    Damage materials

    reduction: number

    General reduction applied to all

    resistanceIds: Set<string> = ...

    All resistances that exist.

    resolve: Function
    targets: Collection<ApplyDamageTarget, Methods<ApplyDamageTarget>>

    Targets

    value: number = 0

    Base damage/healing value

    ADAMANTINE_ID: "adamantine" = ...
    ADAMANTINE_THRESHOLD: 20 = ...

    Adamantine penetration of hardness

    It however only ignores hardness up to 20, but if it's higher, hardness applies in full.

    • Move this datapoint elsewhere
    ALLOW_BONUS: boolean = true

    Allow bonus value

    bonus: any
    bonusType: any
    DEFAULT_OPTIONS: {
        actions: {
            apply: (
                ...this: any,
                event: Event,
                _target: HTMLElement,
            ) => Promise<void>;
        };
        classes: string[];
        form: {
            closeOnSubmit: boolean;
            handler: (
                ...this: any,
                event: Event,
                form: HTMLFormElement,
                formData: FormDataExtended,
            ) => void;
            submitOnChange: boolean;
        };
        position: { height: string; width: number };
        tag: string;
        window: { minimizable: boolean; resizable: boolean };
    } = ...
    PARTS: { footer: { template: string }; form: { template: string } } = ...
    reduction: any
    resolve: any
    value: any

    Accessors

    • get title(): string

      A convenience reference to the title of the Application window.

      Returns string

    Methods

    • Apply damage reduction

      Alters instance.total and reduction.available as necessary.

      Parameters

      • target: ApplyDamageTarget

        Target

      • instance: object

        Damage instance

      • reduction: object

        Reduction

      • dr: boolean

        Is this DR or ER?

      Returns number

      • How much did this reduce?
    • Evaluate attack and attacker info

      Determines attack materials, enhancement bonus, natural attack DR/magic penetration, etc.

      Returns void

      • Some of this data should be cached in the chat messages and not rely on the action's current state
    • Does the reduction match the damage?

      Parameters

      • target: ApplyDamageTarget

        Target

      • instance: object

        Damage instance

      • reduction: { custom: boolean; hasGeneric: boolean; typeIds: any[] }

        Reduction info

        • custom: boolean

          Is this a custom reduction?

        • hasGeneric: boolean

          Is this a generic reduction?

        • typeIds: any[]

          Types of the reduction

      • dr: boolean

        Is this DR or ER?

      Returns boolean

      • Does the reduction apply to this instance?
    • Prepare context that is specific to only a single rendered part.

      It is recommended to augment or mutate the shared context so that downstream methods like _onRender have visibility into the data that was used for rendering. It is acceptable to return a different context object rather than mutating the shared context at the expense of this transparency.

      Parameters

      • partId: any

        The part being rendered

      • context: any

        Shared context provided by _prepareContext

      • _options: any

      Returns any

      Context data for a specific part

    • Process reductions against available instances.

      Parameters

      • target: any
      • instances: object[]
      • reductions: object[]
      • dr: boolean

        Are these DR or ER?

      Returns number

      • Total reduction
    • Apply health change

      Parameters

      • ...this: any
      • event: Event
      • _target: HTMLElement

      Returns Promise<void>

    • Form change handler

      Parameters

      • ...this: any
      • event: Event

        Triggering event

      • form: HTMLFormElement

        Form

      • formData: FormDataExtended

        Form data

      Returns void

    • Parameters

      • options: object

        Options passed to apply damage

      • OptionalrenderOptions: object = {}

        Render options passed to the application.

      Returns Promise<null | object>

      • Null if cancelled, object describing applied settings.