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

    Class ItemChange

    Change datamodel

    Hierarchy

    • any
      • ItemChange
    Index

    Constructors

    • Returns ItemChange

    Properties

    _id: string
    continuous?: boolean
    flavor?: string
    formula: string
    operator?: "set" | "add"
    parent?: ActorPF | ItemPF
    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
    metadata: Readonly<{ label: "Change"; name: "Change" }> = ...

    Metadata mimicking Foundry documents

    Accessors

    • get cssClass(): string

      CSS Template Class

      Returns string

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

      Parent document

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

    • get id(): string

      Change ID

      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 source(): null

      Returns null

    • get uuid(): string

      Retrieve UUID

      Relies on Item#getEmbeddedDocument() override to function with fromUuid() and similar functions.

      Returns string

    Methods

    • Internal

      Parameters

      • data: object

        Data to update with

      Returns void

    • 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

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

    • Parameters

      • actor: any

      Returns string[]

    • Parameters

      Returns string[]

      • Valid targets for this change on specified actor
    • Internal

      Prepare in-memory data.

      Returns void

    • Parameters

      • source: any
      • prune: any

      Returns any

    • Update this change.

      Parameters

      • data: object

        Update data

      • options: object = {}

        Additional options

      • context: object = {}

        Update context

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

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

      • data: any
      • options: any

      Returns any

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

    • Returns {
          _id: IDField;
          continuous: BooleanField<
              { initial: undefined; required: false },
              AssignmentType<
                  SimpleMerge<{ initial: undefined; required: false }, DefaultOptions>,
              >,
              InitializedType<
                  SimpleMerge<{ initial: undefined; required: false }, DefaultOptions>,
              >,
              InitializedType<
                  SimpleMerge<{ initial: undefined; required: false }, DefaultOptions>,
              >,
          >;
          flavor: StringField<
              { blank: true; initial: undefined; required: false },
              AssignmentType<{ blank: true; initial: undefined; required: false }>,
              InitializedType<{ blank: true; initial: undefined; required: false }>,
              InitializedType<{ blank: true; initial: undefined; required: false }>,
          >;
          formula: FormulaField;
          operator: StringField<
              { blank: false; choices: readonly ["add", "set"]; required: false },
              AssignmentType<
                  { blank: false; choices: readonly ["add", "set"]; required: false },
              >,
              InitializedType<
                  { blank: false; choices: readonly ["add", "set"]; required: false },
              >,
              InitializedType<
                  { blank: false; choices: readonly ["add", "set"]; required: false },
              >,
          >;
          priority: NumberField<
              { required: false },
              AssignmentType<{ required: false }>,
              InitializedType<{ required: false }>,
              InitializedType<{ required: false }>,
          >;
          target: StringField<
              { blank: true; required: false },
              AssignmentType<{ blank: true; required: false }>,
              InitializedType<{ blank: true; required: false }>,
              InitializedType<{ blank: true; required: false }>,
          >;
          type: StringField<
              { blank: false; initial: "untyped"; required: false },
              AssignmentType<{ blank: false; initial: "untyped"; required: false }>,
              InitializedType<{ blank: false; initial: "untyped"; required: false }>,
              InitializedType<{ blank: false; initial: "untyped"; required: false }>,
          >;
          value: NumberField<
              { required: false },
              AssignmentType<{ required: false }>,
              InitializedType<{ required: false }>,
              InitializedType<{ required: false }>,
          >;
      }

    • Parameters

      • source: any

      Returns any

    • Parameters

      • source: any

      Returns void