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

    Class ActorPF<Model>

    Actor Document

    Provides baseline support for system datamodels and module added subtypes.

    Type Parameters

    • Model

    Hierarchy

    • any
      • ActorPF
    Index

    General

    Document

    Advanced

    Foundry API

    Internal

    Inventory Management

    REFACTOR ME

    User

    General

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

    Change flags

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

    Overrides applied by changes

    changes: Collection<string, Change>

    All changes from carried items and virtual ones.

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

    Item dictionary and boolean flags

    itemTypes: ItemTypesMap
    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.

    system: Model
    type: "character" | "npc" | "haunt" | "trap" | "vehicle"
    • get _spellbookTargets(): string[]
      Internal

      Change target paths for spellbooks on the actor.

      Returns string[]

      Move to base character model

    • get allNotes(): AllNotesEntry[]

      An array of all context note data for this actor.

      Returns AllNotesEntry[]

    • get auraStrength(): any

      Returns any

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

      All items this actor is holding in containers.

      Returns ItemPF<ContainerModel>[]

      • Does not provide anything notable anymore
    • get spellFailure(): number

      Spell Failure Percentage as number from 0 to 100.

      Returns number

      Move to base character datamodel

    • get visionSharingSheet(): VisionSharingSheet

      The VisionSharingSheet instance for this actor

      Returns VisionSharingSheet

    • Protected

      Finalize preparing protections and weaknesses.

      Called in prepareDerivedData()

      Returns void

      Move to base character model

    • Internal

      Get active conditions marked for context

      Parameters

      • context: string

        Context ID

      Returns model[]

      • Array of conditions
    • 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

      Resize token sizes based on actor size.

      Ignores tokens with static size set.

      Returns Promise<TokenDocument[] | null>

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

      Add option to update token size on all scenes.

      • On invalid parameters
    • 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 Promise<ActorPF<Model>> | undefined

      Updated document or undefined if no update occurred.

      • Since PF1 v12
    • 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<Model>>

      • Promise to updated document

      Move to base character model

      Create spellbook for inquisitor

      actor.createSpellbook({
      type: "spontaneous",
      progression: "med",
      ability: "wis",
      spells: "divine",
      class: "inquisitor",
      cantrips: true,
      domain: 0
      });
    • 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>

    • Calculate current carry capacity limits.

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

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

    • 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

      Move most functionality to datamodels

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

    • Protected

      Returns this actor's labels for use with sheets.

      Returns Record<string, string>

      • Label object
    • Amount of experience required to gain next level at specific character level.

      Parameters

      • level: number

        Desired level to level-up.

      • Optionaloptions: { rollData?: object }

        Additional options

        • OptionalrollData?: object

          Roll data instance

      Returns number

      • The XP required for next level.
      getLevelExp(1); // -> 3000, the XP needed for level 2
      
      • Use .system.getLevelExp() instead
      • If invalid level is provided.
    • Returns any

      • Use TrapModel#getPerceptionModifier() instead.
    • Protected

      Quick Actions

      Returns Readonly<
          {
              charges: number;
              haveAnyCharges: boolean;
              id: string;
              img: string;
              isSingleUse: boolean;
              item: ItemPF;
              max: number;
              maxCharge: number;
              name: string;
              recharging: boolean;
              type: string;
              uses: number;
          },
      >[]

      • Array of item defining objects
    • 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 SkillInfo | null

      • Skill information or null if the skill was not found
      actor.getSkillInfo("per"); // Perception skill info
      actor.getSkillInfo("crf.alchemy"); // Craft (Alchemy) subskill info

      Move most functionality to base character model

    • 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

      Move to base character model

    • 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

      Move to base character model

    • Checks if there's any matching proficiency

      Parameters

      Returns boolean

      Whether the actor is proficient with that item.

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

        Item to test

      • Optionaloptions: { override?: boolean }

        Additional options

        • Optionaloverride?: boolean

          Allow item's proficiency override to influence the result.

      Returns boolean

      • Proficiency state
      • Calls system.hasWeaponProficiency()
    • 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.

    • Parameters

      • options: {} = {}

      Returns Promise<any>

      • Use TrapModel#rollPerception() instead.
    • 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<any>

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

      Move most functionality to datamodels

    • Protected

      Updates attributes.woundThresholds.level variable.

      Returns void

      Move to base character model

    • Get melee and reach maximum ranges.

      Parameters

      • size: number | "med" | "fine" | "dim" | "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

      Move to utility functions

    • Reduced Movement Speed

      Parameters

      • value: number

        The non-reduced movement speed.

      Returns number

      The reduced movement speed.

      pf1.documents.actor.ActorPF.getReducedMovementSpeed(30); // => 20
      

      Move to utility function

    • 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

    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.
    • Movement details for current movement

      Parameters

      Returns any

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

    • Prepare actor data before items are prepared.

      Returns void

      • Called after system.prepareBaseData() by Foundry
    • 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?: string | null;
            createCombatants?: boolean;
            dice?: string | null;
            initiativeOptions?: object;
            rerollInitiative?: boolean;
            rollMode?: string;
            skipDialog?: boolean;
            token?: TokenDocumentPF;
        } = {}

        Options which configure how initiative is rolled

        • Optionalbonus?: string | null

          Formula for bonus to initiative

        • OptionalcreateCombatants?: boolean

          Create new Combatant entries for tokens associated with this actor.

        • Optionaldice?: string | null

          Formula override for dice to roll

        • OptionalinitiativeOptions?: object

          Options to pass to CombatPF.rollInitiative()

        • 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<CombatPF | null>

      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 });
      

      pf1.documents.CombatPF#rollInitiative

    Internal

    • get _skillTargets(): string[]

      Retrieve valid skill change targets for this actor.

      Returns string[]

      • Skill target array
    • Internal

      Parameters

      Returns Promise<Document[]>

      • Updated documents
    • Internal

      Parameters

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

        Condition toggle state

      Returns void

      • The condition notification needs to be smarter.
    • Internal

      Returns {
          acp: {
              armor: { broken: boolean; item: null; value: number };
              attack: {
                  sources: { item: ItemPF<EquipmentModel>; value: number }[];
                  total: number;
              };
              shield: { broken: boolean; item: null; value: number };
              skill: number;
              total: number;
          };
          maxDex: {
              armor: { item: null; value: number };
              shield: { item: null; value: number };
              total: null;
          };
      }

    • 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

    • Internal

      Synchronize actor and token vision

      Parameters

      • initializeVision: boolean = false

        Initialize vision

      • refreshLighting: boolean = false

        Refresh lightning

      Returns void

    • Experimental

      Per-actor type initiative options

      Returns object | undefined

      • Options object
    • Internal

      Categorize classes

      Parameters

      • classes: any

        Class items. Must be already sorted as needed.

      Returns any[][]

      • Array of class groups in order of priority

    Inventory Management

    • Total Carried Weight

      Returns number

      • kg or lbs of all carried things, including currency
    • 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.
      • Move implementation details to datamodels
    • 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.
      • Since PF1 v12

    REFACTOR ME

    • Internal

      Computes armor penalties for this actor.

      Returns MobilityPenaltyResult

      The resulting penalties from armor.

      Move to base character model

    User

    • get allSkills(): string[]

      All skill IDs relevant to this actor

      Returns string[]

      Move most functionality to base character datamodel

    • 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<ActorPF<Model> | undefined>

      • 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<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
    • Show defenses in chat

      Parameters

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

        Additional options

        • OptionalrollMode?: string | null

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

        • Optionaltoken?: any

          Relevant token if any.

      Returns Promise<any>

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

    • 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.
    • Recharge all owned items.

      Parameters

      Returns Promise<any[] | object[]>

      • 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" });
      
    • 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<Model>>

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

      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.

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

        • OptionalformData?: PromptFormData

          Dialog form data from external source

        • Optionalitem?: any

          Associated item

        • Optionalmaneuver?: string | boolean | null

          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?: any

          Associated token if any.

      Returns Promise<any>

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

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

      Move most functionality to datamodels

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

      Parameters

      • bookId: string

        Spellbook identifier

      • Optionaloptions: ActorRollOptions = {}

        Roll options

      Returns Promise<any>

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

      Move most functionality to datamodels

    • Roll a concentration check using a particular spellbook of this actor

      Parameters

      • bookId: string

        Spellbook identifier

      • Optionaloptions: ActorRollOptions = {}

        Roll options

      Returns Promise<any>

      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

      Move most functionality to datamodels

    • Roll a specific saving throw

      Parameters

      • saveId: "fort" | "ref" | "will"

        Identifier for saving throw type.

      • Optionaloptions: ActorRollOptions = {}

        Roll options.

      Returns Promise<any>

      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" });
      
    • 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 | any[]>

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