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

    Class ItemChange

    Change datamodel

    Hierarchy

    • any
      • ItemChange
    Index

    General

    _id: string
    builtIn: boolean

    Is this built-in value (e.g. base value or something produced on fly).

    • Not saved.
    category: any = ...

    Target category.

    constraints: null
    continuous: boolean

    Is this continuously applied change.

    • Not saved.
    flavor?: string

    Label.

    • Not saved.
    formula: string
    operator: "add" | "set"

    add

    priority: number

    Priority.

    Higher value means earlier evaluation. Negative values are valid.

    0

    target?:
        | "str"
        | "dex"
        | "con"
        | "int"
        | "wis"
        | "cha"
        | "attack"
        | "~attackCore"
        | "cl"
        | "allSavingThrows"
        | "ac"
        | "skills"
        | "allChecks"
        | "skill"
        | "damage"
        | "aac"
        | "sac"
        | "nac"
        | "tac"
        | "ffac"
        | "mwdamage"
        | "twdamage"
        | "rwdamage"
        | "sdamage"
        | "reach"
        | "wounds"
        | "vigor"
        | "init"
        | "dexPen"
        | "strPen"
        | "dexMod"
        | "cmd"
        | "mattack"
        | "wdamage"
        | "dc"
        | "bab"
        | "cmb"
        | "concentration"
        | "acpA"
        | "acpS"
        | "mDexA"
        | "mDexS"
        | "strMod"
        | "conMod"
        | "intMod"
        | "wisMod"
        | "chaMod"
        | "conPen"
        | "intPen"
        | "wisPen"
        | "chaPen"
        | "~strDrain"
        | "~dexDrain"
        | "~conDrain"
        | "~intDrain"
        | "~wisDrain"
        | "~chaDrain"
        | "carryStr"
        | "carryMult"
        | "size"
        | "ageCategory"
        | "ageCategoryPhysical"
        | "ageCategoryMental"
        | "unskills"
        | "strSkills"
        | "dexSkills"
        | "conSkills"
        | "intSkills"
        | "wisSkills"
        | "chaSkills"
        | "skill.knowledge"
        | "strChecks"
        | "dexChecks"
        | "conChecks"
        | "intChecks"
        | "wisChecks"
        | "chaChecks"
        | "landSpeed"
        | "climbSpeed"
        | "swimSpeed"
        | "burrowSpeed"
        | "flySpeed"
        | "allSpeeds"
        | "wattack"
        | "sattack"
        | "nattack"
        | "rattack"
        | "tattack"
        | "rdamage"
        | "mdamage"
        | "ndamage"
        | "critConfirm"
        | "fort"
        | "ref"
        | "will"
        | "vehicleSave"
        | "ffcmd"
        | "mhp"
        | "woundThreshold"
        | "spellResist"
        | "bonusFeats"
        | "bonusSkillRanks"
        | "concn"
        | "senselv"
        | "sensedv"
        | "sensets"
        | "sensebse"
        | "sensebs"
        | "sensels"
        | "sensesc"
        | "sensetr"
        | "senseths"

    Target

    type:
        | "untyped"
        | "untypedPerm"
        | "dodge"
        | "racial"
        | "circumstance"
        | "base"
        | "deflection"
        | "resist"
        | "haste"
        | "trait"
        | "enh"
        | "size"
        | "inherent"
        | "morale"
        | "luck"
        | "sacred"
        | "insight"
        | "profane"
        | "competence"
        | "alchemical"

    Bonus type.

    untyped

    value: any

    Resolved value or description.

    • Not saved.
    • get cssClass(): string

      CSS Template Class

      Returns string

    • get isAC(): boolean

      Does this target any kind of AC?

      Returns boolean

    • get isActive(): boolean

      Is this Change active?

      Changes with either no target nor formula are considered inactive.

      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 isEmpty(): boolean

      Whether the change is empty by checking if the fields default values haven't changed.

      Returns boolean

    • get isEvaluated(): boolean

      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.

      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: { rollData?: object } = {}

        Optional options to change the behavior of this function.

        • OptionalrollData?: object

          Roll data

      Returns void

    • Evaluate change

      Parameters

      • rollData: object

        Roll data

      Returns void

    • Parameters

      • actor: any

      Returns string[]

    • Parameters

      Returns string[]

      • Valid targets for this change on specified actor
    • Internal Experimental

      Reset internal evaluation state.

      Automatically called by _safeApplyChange

      Returns void

    • Set roll data aliases

      Parameters

      • aliases: Record<string, string>

        Target to source mapping.

      Returns void

      ch.setAliases({ class: "classes.wizard" })
      
      • No deep aliasing is supported for target keys.

    Document

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

    Metadata mimicking Foundry documents

    • get document(): any

      Parent document

      Returns any

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

    • Internal

      Prepare in-memory data.

      Returns void

    • Update this change.

      Parameters

      • changes: object

        Update data

      • options: object = {}

        Additional options

      • context: object = {}

        Update context

      Returns Promise<any>

      • Updated parent, or undefined if no update was performed
      • If change has no parent to update or the change does not exist on parent.
    • Creates a change.

      Parameters

      • data: ChangeData | ChangeData[]

        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