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

    Class ItemChange

    Change datamodel

    Hierarchy

    • any
      • ItemChange
    Index

    General

    _id: string
    continuous?: boolean
    flavor?: string
    formula: string
    operator?: "set" | "add"
    priority?: number
    target:
        | "size"
        | "str"
        | "dex"
        | "con"
        | "int"
        | "wis"
        | "cha"
        | "attack"
        | "~attackCore"
        | "cl"
        | "allSavingThrows"
        | "ac"
        | "skills"
        | "allChecks"
        | "damage"
        | "aac"
        | "sac"
        | "nac"
        | "tac"
        | "ffac"
        | "mwdamage"
        | "twdamage"
        | "rwdamage"
        | "sdamage"
        | "reach"
        | "wounds"
        | "vigor"
        | "init"
        | "dexPen"
        | "strPen"
        | "dexMod"
        | "cmd"
        | "mattack"
        | "wdamage"
        | "dc"
        | "acpA"
        | "acpS"
        | "mDexA"
        | "mDexS"
        | "strMod"
        | "conMod"
        | "intMod"
        | "wisMod"
        | "chaMod"
        | "conPen"
        | "intPen"
        | "wisPen"
        | "chaPen"
        | "carryStr"
        | "carryMult"
        | "ageCategory"
        | "ageCategoryPhysical"
        | "ageCategoryMental"
        | "unskills"
        | "strSkills"
        | "dexSkills"
        | "conSkills"
        | "intSkills"
        | "wisSkills"
        | "chaSkills"
        | "skill.knowledge"
        | "strChecks"
        | "dexChecks"
        | "conChecks"
        | "intChecks"
        | "wisChecks"
        | "chaChecks"
        | "landSpeed"
        | "climbSpeed"
        | "swimSpeed"
        | "burrowSpeed"
        | "flySpeed"
        | "allSpeeds"
        | "bab"
        | "wattack"
        | "sattack"
        | "nattack"
        | "rattack"
        | "tattack"
        | "rdamage"
        | "mdamage"
        | "ndamage"
        | "critConfirm"
        | "fort"
        | "ref"
        | "will"
        | "cmb"
        | "ffcmd"
        | "mhp"
        | "spellResist"
        | "bonusFeats"
        | "bonusSkillRanks"
        | "concentration"
        | "senselv"
        | "sensedv"
        | "sensets"
        | "sensebse"
        | "sensebs"
        | "sensels"
        | "sensesc"
        | "sensetr"
        | "senseths"
    type: string
    updateTime: Date = ...
    value?: number
    • get cssClass(): string

      CSS Template Class

      Returns string

    • get isAC(): boolean

      Does this target any kind of AC?

      Returns boolean

    • get isDeferred(): boolean

      Is deferred?

      Deferred changes are evaluated only when rolled.

      Returns boolean

    • get isDistance(): boolean

      Does this change distance of something?

      Affects mostly presentation.

      Returns boolean

    • get isSimple(): boolean

      Is simple?

      Simple changes are evaluated before roll data becomes available.

      Returns boolean

    • get name(): string

      Either parent name or flavour text.

      Returns string

    • get uniqueId(): string

      Quasi-unique ID within actors change set to avoid conflicts

      This is not actually guaranteed to be unique, just more so than base id

      Returns string

    • Internal

      Safely apply this change to an actor, catching any errors.

      Parameters

      • actor: ActorPF

        The actor to apply the change's data to.

      • Optionaltargets: string[] = null

        Property paths to target on the actor's data.

      • Optionaloptions: { applySourceInfo?: boolean } = {}

        Optional options to change the behavior of this function.

        • OptionalapplySourceInfo?: boolean

          Whether to add the changes to the actor's source information.

      Returns void

    • Applies this change to an actor.

      Parameters

      • actor: ActorPF

        The actor to apply the change's data to.

      • Optionaltargets: string[] = null

        Property paths to target on the actor's data.

      • Optionaloptions: { applySourceInfo?: boolean; rollData?: object } = {}

        Optional options to change the behavior of this function.

        • OptionalapplySourceInfo?: boolean

          Whether to add the changes to the actor's source information.

        • OptionalrollData?: object

          Roll data

      Returns void

    • Applies this change's info to an actor's sourceInfo. Info is only added if either the modifier type allows stacking or the value is higher than the previous value. If the modifier type is not stacking and this change's info is added, existing and now ineffective info entries are removed.

      Parameters

      • actor: ActorPF

        The actor to apply the change's data to.

      Returns void

    • Parameters

      • actor: any

      Returns string[]

    • Parameters

      Returns string[]

      • Valid targets for this change on specified actor

    Document

    parent?: ActorPF | ItemPF
    metadata: Readonly<{ label: "Change"; name: "Change" }> = ...

    Metadata mimicking Foundry documents

    • get document(): | Actor<"base" | ModuleSubType>
      | Item<"base" | ModuleSubType>
      | undefined

      Parent document

      Returns Actor<"base" | ModuleSubType> | Item<"base" | ModuleSubType> | undefined

    • get id(): string

      Change ID

      Returns string

    • get uuid(): string

      Retrieve UUID

      Relies on pf1.documents.item.ItemBasePF.getEmbeddedDocument | Item#getEmbeddedDocument() override to function with fromUuid() and similar functions.

      Returns string

    • Returns Promise<
          Actor<"base" | ModuleSubType>
          | Item<"base" | ModuleSubType>
          | undefined,
      >

    • Internal

      Prepare in-memory data.

      Returns void

    • Update this change.

      Parameters

      • data: object

        Update data

      • options: object = {}

        Additional options

      • context: object = {}

        Update context

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

      • Updated parent, or null if no update was performed (e.g. nothing changed)
      • If change has no parent to update or the change does not exist on parent.
    • Creates a change.

      Parameters

      • data: object[]

        Data to initialize the change(s) with.

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

        An object containing context information.

        • Optionalparent?: ItemPF

          The parent entity to create the change within.

      Returns Promise<ItemChange[]>

      The resulting changes, or an empty array if nothing was created.

    • Parameters

      • source: any

      Returns void