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

    Actor Document

    Provides baseline support for system datamodels and module added subtypes.

    Hierarchy (View Summary)

    Index

    General

    alignment: Alignment | undefined
    alignmentChanges: any[] | undefined
    changeFlags: Set<
        | "haste"
        | "powerAttack"
        | "piranhaStrike"
        | "deadlyAim"
        | "doubleSlice"
        | "weaponFinesse"
        | "rapidShot"
        | "manyshot"
        | "pointBlankShot"
        | "lowLightVision"
        | "seeInDarkness"
        | "seeInvisibility"
        | "immuneToMorale"
        | "loseDexToAC"
        | "noMediumEncumbrance"
        | "noHeavyEncumbrance"
        | "mediumArmorFullSpeed"
        | "heavyArmorFullSpeed"
        | "noAblScore.str"
        | "noAblScore.dex"
        | "noAblScore.con"
        | "noAblScore.int"
        | "noAblScore.wis"
        | "noAblScore.cha",
    >

    Change flags

    changeOverrides: Record<
        string,
        Record<"add" | "set", Record<ModifierType, { value: number | null }>>,
    >

    Overrides applied by changes

    changes: Collection<ItemChange>

    All changes from carried items and virtual ones.

    constructor: typeof ActorBasePF
    itemFlags: {
        boolean: Record<string, { sources: ItemPF[] }>;
        dictionary: Record<string, Record<any>>;
    }

    Item dictionary and boolean flags

    sourceInfo: Record<string, SourceInfoGroup>

    Source info

    Partial duplicate of changes and manual adjustments.

    This structure should be removed in favor of storing the info in changes.

    • get allItems(): ItemPF[]

      Returns ItemPF[]

      All items on this actor, including those in containers.

    • get auraStrength(): any

      Returns any

      • Use HauntModel#auraStrength instead.
    • get containerItems(): ItemPF[]
      Internal

      All items this actor is holding in containers.

      Returns ItemPF[]

    • Returns any

      • Use TrapModel#getPerceptionModifier() instead.
    • Parameters

      • options: {} = {}

      Returns Promise<any>

      • Use TrapModel#rollPerception() instead.
    • Internal

      Add default artwork.

      Parameters

      • OptionalactorData: object

        Actor data to guide creation if any

      Returns object

      • Resulting data alterations

    Document

    • Internal

      Returns void

    Advanced

    • get activeOwner(): any

      Returns first active owner, favoring players and uses active GM as fallback.

      Returns any

    • get sharesVision(): boolean

      Whether current user can see through this actor.

      Returns boolean

    • Deletes expired temporary active effects and disables linked expired buffs.

      Parameters

      • Optionaloptions: {
            combat?: any;
            event?: "combat" | "time" | "turnStart" | "turnEnd";
            initiative?: number;
            timeOffset?: number;
            worldTime?: number;
        } = {}

        Additional options

        • Optionalcombat?: any

          Combat to expire data in, if relevant

        • Optionalevent?: "combat" | "time" | "turnStart" | "turnEnd"

          Expiration event

        • Optionalinitiative?: number

          Initiative based expiration marker

        • OptionaltimeOffset?: number

          Time offset from world time

        • OptionalworldTime?: number

          World time

      • Optionalcontext: any = {}

        Document update context

      Returns void

      • With insufficient permissions to control the actor.
    • Get related combatants.

      Parameters

      • Optionalcombat: any = game.combat

        Combat instance

      Returns Combatant[]

      Related combatants.

    • Experimental

      Condition immunities

      Returns Set<string>

      • Set of immunity IDs.
    • Retrieve source details regarding a change target.

      Parameters

      • path: string

        Change target path

      Returns SourceInfo[]

      actor.getSourceDetails("system.attributes.hp.max");
      
      • Merge sourceInfo into the change system to reduce underlying system complexity

    Foundry

    • Prepare actor data before items are prepared.

      Returns void

      • Called after system.prepareBaseData() by Foundry

    Internal

    • get _skillTargets(): string[]

      Retrieve valid skill change targets for this actor.

      Returns string[]

      • Skill target array
    • Internal

      Parameters

      • conditions: Record<string, boolean> = {}

        Condition toggle state

      Returns void

      • The condition notification needs to be smarter.
    • Internal Experimental

      Get source details from items.

      Parameters

      Returns void

    • Protected Internal

      Get item sources for a trait

      Parameters

      Returns void

    • Internal

      Handle condition track toggling post active effect creation if there's still some issues.

      Parameters

      • documents: ActiveEffect[]

        Updated active effect documents

      Returns Promise<object>

    • Internal

      Returns void

    • Internal

      Returns void

    • Protected

      Prepare boolean and dictionary flags.

      Returns void

    • Internal

      Returns void

    • Internal

      Called just before the first change is applied, and after every change is applied. Sets additional variables (such as spellbook range)

      Returns void

    • Experimental

      Per-actor type initiative options

      Returns object | undefined

      • Options object
    • Internal

      Categorize classes

      Parameters

      • classes: Item

        Class items. Must be already sorted as needed.

      Returns Item[][]

      • Array of class groups in order of priority

    User

    • get race(): ItemRacePF | null

      Actor's current race item.

      Returns ItemRacePF | null

    • Apply damage or healing to actor.

      Does not handle ER/DR or anything else special.

      Parameters

      • value: number = 0

        Value to adjust health by. Positive values deal damage, negative values heal.

      • Optionaloptions: ApplyDamageOptions = {}

        Additional options. This object will be transformed in-place as the damage application is processed.

      Returns Promise<any>

      • Updated actor or false.

      ActorPF.applyDamage - For more general use.

      Cause 10 damage

      await actor.applyDamage(10);
      

      Heal 10 damage

      await actor.applyDamage(-10);
      

      Apply 3 damage directly to Wounds instead of Vigor

      await actor.applyDamage(3, { asWounds: true });
      
      • pf1ApplyDamage
    • Internal

      Get challenge rating. Applies CR offset modifications from templates.

      Parameters

      • Optionaloptions: object

        Additional options

      Returns number

      • CR
    • Get Defenses

      Calls this.system.getDefenses().

      Returns void | Defenses

      • Collected defense data
    • Get item by its identifier tag.

      Parameters

      • tag: string

        Desired tag.

      Returns any

      • Matching item or undefined if no item is found.
    • Easy way to determine whether this actor has a condition.

      Parameters

      • conditionId: string

        A direct condition key, as per pf1.registry.conditions, such as shaken or dazed.

      Returns boolean

      Condition state

      Test if user is grappled

      actor.hasCondition("grappled");
      

      This is identical to actor.statuses.has("conditionId")

    • Easy way to set a condition.

      Parameters

      • conditionId: string

        A direct condition key, as per pf1.registry.conditions, such as shaken or dazed.

      • enabled: boolean | object

        Whether to enable (true) the condition, or disable (false) it. Or object for merging into the active effect as part of enabling.

      • Optionalcontext: object

        Update context

      Returns Promise<object>

      Condition ID to boolean mapping of actual updates.

      Enable Dazzled

      await actor.setCondition("dazzled", true);
      

      Enable Sleep for 10 rounds

      await actor.setCondition("sleep", { duration: { seconds: 60 } });
      
    • Set state of multiple conditions. Also handles condition tracks to minimize number of updates.

      Parameters

      • conditions: object = {}

        Condition ID to boolean (or update data) mapping of new condition states. See ()

      • Optionalcontext: object = {}

        Update context

      Returns Record<string, boolean>

      Condition ID to boolean mapping of actual updates.

      Enable Blinded and Shaken conditions but disable Sleeping

      await actor.setConditions({ blind: true, sleep: false, shaken:true });
      

      Enable Deafened with UI notification if immune

      await actor.setConditions({ deaf: true }, { pf1: { interactive: true } });
      
      • If the interactive flag is not set, UI noise is reduced to avoid out of context notifications.
    • Easy way to toggle a condition.

      Parameters

      • conditionId: boolean

        A direct condition key, as per pf1.registry.conditions, such as shaken or dazed.

      • OptionalaeData: object

        Extra data to add to the AE if it's being enabled

      • Optionalcontext: object

        Additional context options to pass to ()

      Returns Promise<object>

      Condition ID to boolean mapping of actual updates.

      Toggle Dazzled

      await actor.toggleCondition("dazzled");
      

      Toggle Blinded, set duration for 3 rounds if it's being enabled.

      await actor.toggleCondition("blinded", { duration: { seconds: 18 } });
      
    • Apply damage to the token or tokens which are currently controlled.

      If Shift is held, will prompt for adjustments based on damage reduction and energy resistances.

      Parameters

      • value: number = 0

        The amount of damage to deal. Negative values heal instead.

      • Optionaloptions: TargetedApplyDamageOptions = {}

        Object containing default settings for overriding

      Returns Promise<false | Actor[]>

      • False if cancelled or array of updated actors.
      • If no valid targets are provided.