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

    Class ItemChange

    Change datamodel

    Hierarchy

    • any
      • ItemChange
    Index

    Constructors

    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 document(): | undefined
      | Actor<"base" | ModuleSubType>
      | Item<"base" | ModuleSubType>

      Parent document

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

    Methods

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

    • 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.
    • 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: StringField<
              { blank: false; initial: () => string; readonly: true; required: true },
              AssignmentType<
                  {
                      blank: false;
                      initial: () => string;
                      readonly: true;
                      required: true;
                  },
              >,
              string,
              string,
          >;
          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"]; initial: "add" },
              AssignmentType<
                  { blank: false; choices: readonly ["add", "set"]; initial: "add" },
              >,
              InitializedType<
                  { blank: false; choices: readonly ["add", "set"]; initial: "add" },
              >,
              InitializedType<
                  { blank: false; choices: readonly ["add", "set"]; initial: "add" },
              >,
          >;
          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 }>,
          >;
      }