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

    Extend the base Actor class to implement additional game system logic.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Parameters

      • data: CreateData

        Initial data from which to construct the Actor

      • Optionalcontext: ConstructionContext

        Construction context options

      Returns ActorPF

    Properties

    _rollData: undefined | null | WeakRef<any>
    changeFlags: Record<string, boolean>

    Change flags

    changeOverrides: Record<keyof typeof buffTargets, Record<"add" | "set", any>>

    Overrides applied by changes

    changes: Collection<ItemChange>

    All changes from carried items and virtual ones.

    classes: Record<string, ClassInfo>
    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.

    Accessors

    • get _skillTargets(): string[]

      Retrieve valid skill change targets for this actor.

      Returns string[]

      • Skill target array
    • get _spellbookTargets(): string[]
      Internal

      Change target paths for spellbooks on the actor.

      Returns string[]

    • get activeOwner(): null | User

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

      Returns null | User

    • get allItems(): ItemPF[]

      Returns ItemPF[]

      All items on this actor, including those in containers.

    • get allNotes(): { item: ItemPF; notes: ContextNote[] }[]

      An array of all context note data for this actor.

      Returns { item: ItemPF; notes: ContextNote[] }[]

    • get allSkills(): string[]

      All skill IDs relevant to this actor

      Returns string[]

    • get race(): null | ItemRacePF

      Actor's current race item.

      Returns null | ItemRacePF

    • get sharesVision(): boolean

      Whether current user can see through this actor.

      Returns boolean

    • get spellFailure(): number

      Spell Failure Percentage as number from 0 to 100.

      Returns number

    Methods

    • Internal

      Parameters

      • items: ItemPF[]

        Item documents to clean links to.

      Returns Promise<Document[]>

      • Updated documents
    • Internal

      Parameters

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

        Condition toggle state

      Returns void

      • The condition notification needs to be smarter.
    • Configure actor before data preparation.

      Parameters

      • options: object = {}

        Document options

      Returns void

    • Returns void

    • Protected

      Finalize preparing protections and weaknesses.

      Called in ()

      Returns void

    • Internal

      Get active conditions marked for context

      Parameters

      • context: string

        Context ID

      Returns model[]

      • Array of conditions
    • Internal

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

      Parameters

      • documents: ActiveEffect<"base" | ModuleSubType>[]

        Updated active effect documents

      Returns Promise<object>

    • Parameters

      • options: any

      Returns void

    • Internal

      Parameters

      • parent: Actor<"base" | ModuleSubType> | Item<"base" | ModuleSubType>

        Parent document

      • collection: "items" | "effects"

        Collection name

      • documents: ActiveEffect<"base" | ModuleSubType>[] | Item<"base" | ModuleSubType>[]

        Created documents

      • result: object[]

        Creation data for the documents

      • context: object

        Create context options

      • userId: string

        Triggering user's ID

      • ...args: any

      Returns void

    • Internal

      Parameters

      • parent: any

        Parent document

      • collection: "items" | "effects"

        Collection name

      • documents: Item<"base" | ModuleSubType> | ActiveEffect<"base" | ModuleSubType>[]

        Document array

      • ids: string[]

        Document ID array

      • context: object

        Delete context

      • userId: string

        User ID

      Returns void

    • Parameters

      • changed: object

        Changed data

      • context: object

        Context

      • userId: string

        User ID

      Returns void

    • Internal

      Parse resistance entry

      Primarily called from parseResistances

      Parameters

      • entry: string | object
      • OptionalresistanceType: "dr" | "er" = "dr"

      Returns ParsedResistanceEntry

    • Internal

      Prepare armor/shield data for roll data

      Parameters

      • equipment: { id: string; type: string } = {}

        Equipment info

        • id: string

          Item ID

        • type: string

          Armor/Shield type

      • armorData: object

        Armor data object

      Returns void

    • Internal Experimental

      Data preparation dependent on embedded documents ... but before prepareDerivedData() runs for system or document and before changes are applied.

      Returns void

    • Protected

      Prepare boolean and dictionary flags.

      Returns void

    • Internal

      Resize token sizes based on actor size.

      Ignores tokens with static size set.

      Parameters

      • OptionalsizeKey: string

        Size key to update to. If not provided, will use actor's current size.

      Returns Promise<null | TokenDocument[]>

      • Updated token documents, or null if no update was performed.

      Add option to update token size on all scenes.

      • On invalid parameters
    • Adjust temporary hit points.

      Parameters

      • value: number

        Value to add to temp HP

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

        Additional options

        • Optionalset?: boolean

          If true, the temporary hit points are set to the provide value instead of added to existing.

      Returns Promise<undefined | ActorPF>

      • Updated document or undefined if no update occurred

      Gain 50 THP

      actor.addTempHP(50);
      

      Lose 10 THP

      actor.addTempHP(-10);
      

      Set THP to zero

      actor.addTempHP(0, { set: true });
      
    • 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<false | Actor<"base" | ModuleSubType>>

      • 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
    • Converts currencies of the given category to the given currency type

      Parameters

      • Optionalcategory: "currency" | "altCurrency" = "currency"

        Currency category, altCurrency is for weightless

      • Optionaltype: "gp" | "cp" | "pp" | "sp" = "pp"

        Target currency.

      Returns undefined | Promise<ActorPF>

      Updated document or undefined if no update occurred.

    • Enable and configure a new spellbook.

      Parameters

      • Optionalcasting: {
            ability?: string;
            cantrips?: boolean;
            class?: string;
            domain?: number;
            offset?: number;
            progression?: "high" | "med" | "low";
            spells?: "arcane" | "divine" | "psychic" | "alchemy";
            type?: "prepared" | "spontaneous" | "hybrid";
        } = {}

        Book casting configuration

        • Optionalability?: string

          Spellcasting ability score ID

        • Optionalcantrips?: boolean

          Has cantrips?

        • Optionalclass?: string

          Class tag

        • Optionaldomain?: number

          Domain/School slots

        • Optionaloffset?: number

          Level offset

        • Optionalprogression?: "high" | "med" | "low"

          Casting progression type

        • Optionalspells?: "arcane" | "divine" | "psychic" | "alchemy"

          Spell/spellcasting type

        • Optionaltype?: "prepared" | "spontaneous" | "hybrid"

          Spellbook type

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

        Additional options

        • Optionalcommit?: boolean

          Commit modifications. If false, update data is returned instead of committing.

      Returns Promise<ActorPF>

      • Promise to updated document

      Create spellbook for inquisitor

      actor.createSpellbook({
      type: "spontaneous",
      progression: "med",
      ability: "wis",
      spells: "divine",
      class: "inquisitor",
      cantrips: true,
      domain: 0
      });
    • Show defenses in chat

      Parameters

      • Optionaloptions: { rollMode?: null | string; token?: TokenDocument } = {}

        Additional options

        • OptionalrollMode?: null | string

          The roll mode to use for the roll; defaults to the user's current preference when null.

        • Optionaltoken?: TokenDocument

          Relevant token if any.

      Returns Promise<undefined | ChatMessage<"base" | ModuleSubType>>

      • Created message
    • Enrich context notes with item specific roll data.

      Adds enriched array to each note object.

      Parameters

      • notes: ItemContextNotes

        Context notes

      • OptionalrollData: object

        Roll data instance

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

        Additional options

        • Optionalroll?: boolean

          Handle rolls

      Returns Promise<void>

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

      Parameters

      • Optionaloptions: {
            combat?: Combat<"base" | ModuleSubType>;
            event?: "combat" | "time" | "turnStart" | "turnEnd";
            initiative?: number;
            timeOffset?: number;
            worldTime?: number;
        } = {}

        Additional options

        • Optionalcombat?: Combat<"base" | ModuleSubType>

          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 Promise<void>

      • With insufficient permissions to control the actor.
    • Determines carried weight.

      Returns number

      • kg or lbs of all carried things, including currency
    • Calculate current carry capacity limits.

      Returns { heavy: number; light: number; medium: number }

      • Capacity info
    • Get related combatants.

      Parameters

      • Optionalcombat: Combat<"base" | ModuleSubType> = game.combat

        Combat instance

      Returns Combatant<"base" | ModuleSubType>[]

      Related combatants.

    • Internal

      Condition immunities

      Returns Set<string>

      • Set of immunity IDs.
    • Generates an array with all the active context-sensitive notes for the given context on this actor.

      Parameters

      • context: string

        The context to draw from.

      • Optionalall: boolean = true

        Retrieve notes meant for all, such as notes targeting all skills.

      Returns ItemContextNotes[]

      • Context notes
    • Returns a list of already parsed context notes.

      Parameters

      • context: string

        The context to draw notes from.

      • Optionaloptions: { all?: boolean; roll?: boolean } = {}

        Additional options

        • Optionalall?: boolean

          Option to pass to getContextNotes

        • Optionalroll?: boolean

          Whether to roll inline rolls or not.

      Returns Promise<ParsedContextNoteEntry[]>

      The resulting notes, already parsed.

    • Internal

      Get challenge rating. Applies CR offset modifications from templates.

      Parameters

      • Optionaloptions: object

        Additional options

      Returns number

      • CR
    • Get total currency in category.

      Parameters

      • Optionalcategory: "currency" | "altCurrency" = "currency"

        Currency category.

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

        Additional options

        • OptionalinLowestDenomination?: boolean

          Return result in lowest denomination (default copper). If false, returns standard currency (default gold) instead.

      Returns number

      • Total currency in category.
    • Protected

      Parameters

      • Optionaloptions: { damageResistances?: boolean; damageVulnerabilities?: boolean } = {}

        Additional options

        • OptionaldamageResistances?: boolean

          If false, damage resistances (DR, ER) are omitted.

        • OptionaldamageVulnerabilities?: boolean

          If false, damage vulnerabilities are omitted.

      Returns any

      • Header data
    • Get Defenses

      Calls this.system.getDefenses().

      Returns void | Defenses

      • Collected defense data
    • Return feat counts.

      Returns FeatCounts

      An object with a property value which refers to the current used feats, and max which refers to the maximum available feats.

    • Per-actor type initiative options

      Returns object

      • Options object
    • Get item by its identifier tag.

      Parameters

      • tag: string

        Desired tag.

      Returns undefined | Item<"base" | ModuleSubType>

      • Matching item or undefined if no item is found.
    • Protected

      Returns this actor's labels for use with sheets.

      Returns Record<string, string>

      • Label object
    • Return the amount of experience required to gain a certain character level.

      Parameters

      • level: number

        The desired level

      Returns number

      • The XP required
    • Protected

      Returns object[]

      • Array of item defining objects
    • Retrieve data used to fill in roll variables.

      Parameters

      • Optionaloptions: { cache?: boolean; refresh?: boolean } = ...

        Additional options

        • Optionalcache?: boolean

          Use cache. If set to false, new fresh copy is returned without caching it.

        • Optionalrefresh?: boolean

          Refresh cache

      Returns object

      • Roll data object
      await new Roll("1d20 + @abilities.wis.mod[Wis]", actor.getRollData()).toMessage();
      
    • Retrieve information about a skill.

      Parameters

      • skillId: string

        Skill ID

      • Optionaloptions: { rollData?: { skills: Record<string, SkillData> } } = {}

        Additional options

        • OptionalrollData?: { skills: Record<string, SkillData> }

          Roll data instance to use.

      Returns null | SkillInfo

      • Skill information or null if the skill was not found
      actor.getSkillInfo("per"); // Perception skill info
      actor.getSkillInfo("crf.alchemy"); // Craft (Alchemy) subskill info
    • 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
    • Create a new Token document, not yet saved to the database, which represents the Actor, and apply actor size to it.

      Parameters

      • Optionaldata: object = {}

        Additional data, such as x, y, rotation, etc. for the created token data

      • Optionaloptions: object = {}

        The options passed to the TokenDocument constructor

      Returns Promise<TokenDocumentPF>

      The created TokenDocument instance

    • Total coinage in both weighted and weightless.

      Parameters

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

        Additional options

        • OptionalinLowestDenomination?: boolean

          Use copper for calculations, otherwise standard denomination is used.

      Returns number

      • The total amount of currency, in copper pieces.
    • Protected

      Returns Wound Threshold relevant data.

      Parameters

      • Optionaloptions: { healthConfig?: object } = {}

        Additional options

        • OptionalhealthConfig?: object

          PC/NPC health config variant data

      Returns { level: number; multiplier: number; penalty: number; valid: boolean }

      • Wound threshold info
    • Protected

      Returns effective Wound Threshold multiplier with rules and overrides applied.

      Parameters

      • Optionaloptions: { healthConfig?: object } = {}

        Additional options

        • OptionalhealthConfig?: object

          PC/NPC health config variant data

      Returns number

      Multiplier

    • Checks if there's any matching proficiency

      Parameters

      • item: ItemEquipmentPF

        The item to check for.

      Returns boolean

      Whether the actor is proficient with that item.

    • 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")

    • Check if actor has item with specified boolean flag.

      Parameters

      • flagName: string

        The name/key of the flag to search for.

      Returns boolean

      Whether this actor has any owned item with the given flag.

    • Test if actor is proficient with specified weapon.

      Parameters

      • item: ItemPF

        Item to test

      • Optionaloptions: { override?: boolean }

        Additional options

        • Optionaloverride?: boolean

          Allow item's proficiency override to influence the result.

      Returns boolean

      • Proficiency state

      Natural attacks incorrectly do not count as proficient.

    • Initialization before system or document prepareBaseData()

      Returns void

    • Protected

      Parameters

      • attribute: any
      • value: any
      • isDelta: boolean = false
      • isBar: boolean = true

      Returns Promise<undefined | ActorPF>

    • Helper function for actor energy resistance and damage reduction feedback.

      Parameters

      • resistanceType: "dr" | "eres"

        Value to check resistances for.

      Returns Record<string, string>

      Entry to label mapping of resistances or reductions.

      Use pf1.utils.internal.parseResistances instead.

    • Perform all changes related to an actor resting, including restoring HP, ability scores, item uses, etc.

      Parameters

      Returns Promise<void | ActorRestData>

      Updates applied to the actor, if resting was completed

      Rest with default settings

      await actor.performRest();
      
      • pf1PreActorRest - Called just before committing changes.
      • pf1ActorRest - Called after the changes have been committed.
    • Prepare actor data before items are prepared.

      Returns void

      • Called after system.prepareBaseData() by Foundry
    • Returns void

      • Only because system.prepareBaseData() runs before this.prepareData()
    • Augment the basic actor data with additional dynamic data.

      Returns void

    • Internal

      Returns void

    • Protected

      Returns void

    • Recharge all owned items.

      Parameters

      Returns Promise<object[] | Item<"base" | ModuleSubType>[]>

      • Result of an update or the update data.

      Recharge items with default settings.

      await actor.rechargeItems();
      

      Recharge items as if week had passed.

      await actor.rechargeItems({ period: "week" });
      
    • Internal

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

      Returns void

    • Restore spellbook used slots and spellpoints.

      Parameters

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

        Additional options

        • Optionalcommit?: boolean

          If false, return update data object instead of directly updating the actor.

        • OptionalrollData?: object

          Roll data

      Returns Promise<object | ActorPF>

      Result of update or the update data.

    • Roll an Ability Test Prompt the user for input regarding Advantage/Disadvantage and any Situational Bonus

      Parameters

      • abilityId: "str" | "dex" | "con" | "int" | "wis" | "cha"

        The ability ID (e.g. "str")

      • Optionaloptions: ActorRollOptions = {}

        Additional options

      Returns Promise<void | object | ChatMessage<"base" | ModuleSubType>>

      The chat message if one was created, or its data if not. void if the roll was cancelled.

      await actor.rollAbilityTest("str");
      
    • Roll a generic attack

      Parameters

      • Optionaloptions: ActorRollOptions = {}

        Roll options

        • Optionalaction?: string

          The selected sub-action depending on the context.

        • Optionalactions?: SubAction[]

          The sub-actions to show in the dialog (dependant on the context)

        • Optionalbonus?: string

          Bonus to the roll.

        • OptionalchatMessage?: boolean

          Whether a chat message should be created.

          true

        • Optionaldc?: number

          DC threshold

        • Optionaldice?: string

          The roll's d20 die (replacement), or the static result the d20 should have.

          "1d20"

        • Optionalitem?: Item<"base" | ModuleSubType>

          Associated item

        • Optionalmaneuver?: null | string | boolean

          Whether this is a maneuver and its id.

        • OptionalmessageData?: object

          Additional data to add to the chat message.

        • OptionalnoSound?: boolean

          Whether no dice sound should be played when the chat message is created.

          false

        • OptionalrollMode?: string

          The rollMode with which the chat message is created.

          game.settings.get("core", "rollMode")

        • OptionalskipDialog?: boolean

          Whether a user facing dialog should be shown.

          true

        • Optionalsl?: number

          Spell level

        • OptionalstaticRoll?: number

          A number used as a static roll result of the d20. If null, the d20 is rolled normally and the result is used.

          undefined

        • Optionaltoken?: TokenDocument

          Associated token if any.

      Returns Promise<void | object | ChatMessage<"base" | ModuleSubType>>

      The chat message if one was created, or its data if not. void if the roll was cancelled.

      Basic ranged attack

      await actor.rollAttack({ ranged: true });
      

      Basic melee maneuver

      await actor.rollAttack({ maneuver: true });
      
    • Roll basic BAB check

      Parameters

      Returns Promise<void | object | ChatMessage<"base" | ModuleSubType>>

      The chat message if one was created, or its data if not. void if the roll was cancelled.

    • Roll a Caster Level check using a particular spellbook of this actor

      Parameters

      • bookId: string

        Spellbook identifier

      • Optionaloptions: ActorRollOptions = {}

        Roll options

      Returns Promise<void | object | ChatMessage<"base" | ModuleSubType>>

      The chat message if one was created, or its data if not. void if the roll was cancelled.

      Roll caster level check for primary spellbook.

      await actor.rollCL("primary");
      
    • Roll a concentration check using a particular spellbook of this actor

      Parameters

      • bookId: string

        Spellbook identifier

      • Optionaloptions: ActorRollOptions = {}

        Roll options

      Returns Promise<void | object | ChatMessage<"base" | ModuleSubType>>

      The chat message if one was created, or its data if not. void if the roll was cancelled.

      Add support for concentration check type, e.g. defensive casting

    • Roll initiative for one or multiple Combatants associated with this actor. If no combat exists, GMs have the option to create one. If viewing a full Actor document, all Tokens which map to that actor will be targeted for initiative rolls. If viewing a synthetic Token actor, only that particular Token will be targeted for an initiative roll.

      Parameters

      • Optionaloptions: {
            bonus?: null | string;
            createCombatants?: boolean;
            dice?: null | string;
            initiativeOptions?: object;
            rerollInitiative?: boolean;
            rollMode?: string;
            skipDialog?: boolean;
            token?: TokenDocumentPF;
        } = {}

        Options which configure how initiative is rolled

        • Optionalbonus?: null | string

          Formula for bonus to initiative

        • OptionalcreateCombatants?: boolean

          Create new Combatant entries for tokens associated with this actor.

        • Optionaldice?: null | string

          Formula override for dice to roll

        • OptionalinitiativeOptions?: object

          Options to pass to ()

        • OptionalrerollInitiative?: boolean

          Reroll initiative for existing Combatants

        • OptionalrollMode?: string

          Roll mode override

        • OptionalskipDialog?: boolean

          Skip roll dialog

        • Optionaltoken?: TokenDocumentPF

          For which token this initiative roll is for

      Returns Promise<null | CombatPF>

      The updated Combat document in which initiative was rolled, or null if no initiative was rolled

      await actor.rollInitiative({ dice: "2d20kh", createCombatants: true, skipDialog: true });
      
    • Roll a specific saving throw

      Parameters

      • savingThrowId: "fort" | "ref" | "will"

        Identifier for saving throw type.

      • Optionaloptions: ActorRollOptions = {}

        Roll options.

      Returns Promise<void | object | ChatMessage<"base" | ModuleSubType>>

      The chat message if one was created, or its data if not. void if the roll was cancelled.

      await actor.rollSavingThrow("ref", { skipDialog: true, dice: "2d20kh", bonus: "4" });
      
    • Roll a Skill Check

      Parameters

      • skillId: string

        The skill id (e.g. "per", "prf.prf1", or "crf.alchemy")

      • Optionaloptions: ActorRollOptions = {}

        Options which configure how the skill check is rolled

      Returns Promise<void | object | ChatMessage<"base" | ModuleSubType>>

      • The chat message if one was created, or its data if not. void if the roll was cancelled.
      await actor.rollSkill("per", { skipDialog: true, bonus: "1d6", dice: "2d20kh" });
      
    • 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 } });
      
    • Override to support toggling buffs and operating the system's condition tracks

      Called by TokenHUD

      Parameters

      • statusId: string

        Status/condition ID

      • Optionaloptions: { active?: boolean; interaction?: boolean; overlay?: boolean } = {}

        Additional options

        • Optionalactive?: boolean

          Force active state

        • Optionalinteraction?: boolean

          Nonstandard. Is this triggered by user interaction?

        • Optionaloverlay?: boolean

          Overlay effect

      Returns Promise<undefined | boolean | ActiveEffect<"base" | ModuleSubType>>

      Synced with Foundry v13.342

      Add separate listener for buffs

    • Internal

      Parameters

      • item: ItemPF

        the item to add to the actor's resources

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

        extra options

        • OptionalwarnOnDuplicate?: boolean

          Skips warning if item tag already exists in dictionary flags

      Returns boolean

      True if resources were set

    • Internal

      Synchronize actor and token vision

      Parameters

      • initializeVision: boolean = false

        Initialize vision

      • refreshLighting: boolean = false

        Refresh lightning

      Returns void

    • Protected

      Updates attributes.woundThresholds.level variable.

      Returns void

    • Internal

      Parameters

      Returns string

      • Label for source
    • 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<"base" | ModuleSubType>[]>

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

      Add default artwork.

      Parameters

      • OptionalactorData: object

        Actor data to guide creation if any

      Returns object

      • Resulting data alterations
    • Get melee and reach maximum ranges.

      Parameters

      • size: number | "dim" | "med" | "fine" | "tiny" | "sm" | "lg" | "huge" | "grg" | "col" = "med"

        Actor size as size key or number

      • stature: "long" | "tall" = "tall"

        Actor stature

      Returns { melee: number; reach: number }

      • Ranges
    • Return reduced movement speed.

      Parameters

      • value: number

        The non-reduced movement speed.

      Returns number

      The reduced movement speed.

      pf1.documents.actor.ActorPF.getReducedMovementSpeed(30); // => 20
      
    • Return increased amount of spell slots by ability score modifier.

      Parameters

      • mod: number

        The associated ability modifier.

      • level: number

        Spell level.

      Returns number

      Amount of spell levels to increase.

      pf1.documents.actor.ActorPF.getSpellSlotIncrease(2, 1); // => 1
      pf1.documents.actor.ActorPF.getSpellSlotIncrease(6, 1); // => 2
      pf1.documents.actor.ActorPF.getSpellSlotIncrease(6, 7); // => 0