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

    await pf1.applications.ApplyDamage.wait({ value: 20, targets: canvas.tokens.controlled });
    

    Hierarchy

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

    Constructors

    • Parameters

      • options: any

      Returns ApplyDamage

    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:
        | undefined
        | { asNonlethal: any; asWounds: any; critMult: any; dualHeal: any }
    extraOptions:
        | undefined
        | {
            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.

    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
    value: any

    Accessors

    • get promise(): Promise<any>

      Returns Promise<any>

    • get title(): any

      A convenience reference to the title of the Application window.

      Returns any

    Methods

    • Experimental

      Parameters

      • flags: object[]

      Returns void

    • Internal

      Add Data to Target

      Used by _onSubmit

      Parameters

      • targetId: string
      • data: object

      Returns void

    • Apply hardness modification

      Parameters

      Returns number

      • New hardness
    • 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
    • Get relevant damage type information.

      Parameters

      • trait: "dv" | "di"
      • enable: boolean = false

      Returns DamageTypeChoice[]

    • Returns void

    • Parameters

      • options: any

      Returns any

    • 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?
    • Internal

      Used by addTargetData

      Parameters

      • dest: any
      • source: any

      Returns void

    • Is hardness needing to be modified by any reason?

      Parameters

      Returns boolean

    • Parameters

      • options: any

      Returns void

    • Parameters

      • context: any

      Returns void

    • Prepare damage/healing instances.

      Merge damage instances of same type.

      Returns void

    • 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

    • Returns void

    • Apply Immunities

      Parameters

      Returns number

    • Process reductions against available instances.

      Parameters

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

        Are these DR or ER?

      Returns number

      • Total reduction
    • Apply Vulnerabilities

      Parameters

      Returns number

    • Internal

      Update target data based on form data and recalculate values.

      Parameters

      • targetId: string

      Returns void

    • Internal

      Refresh All Targets

      Returns void

    • Parameters

      • actor: ActorPF

        The actor to retrieve resistances for

      • resistanceType: "dr" | "er" = "dr"

        The type of resistance to retrieve

      • defs: any

      Returns EnrichedResistanceEntry[]

      • Array of processed resistance entries with extra info
    • 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.