Apply Damage Prompt

Handles damage application UX when adjustment is desired.

Calls ActorPF#applyDamage when finally committing changes.

Called primarily from ActorPF.applyDamage

Hierarchy

  • any
    • ApplyDamage

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 }
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>

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

DEFAULT_OPTIONS: {
    actions: {
        apply: (
            ...this: any,
            event: Event,
            target: HTMLElement,
        ) => Promise<void>;
    };
    classes: string[];
    position: { height: string; width: number };
    tag: string;
    window: { minimizable: boolean; resizable: boolean };
} = ...
PARTS: { footer: { template: string }; form: { template: string } } = ...
resolve: any

Accessors

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

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