Initial data provided to construct the Actor document
Optional
context: Context<TokenDocument>The document context, see foundry.abstract.Document
Internal
_itemCached result of .itemTypes
Internal
Temporary solution until Foundry v12 where visibility of AE no longer controls if it's temporary.
Internal
Retrieve valid skill change targets for this actor.
Internal
Change targets for spellbooks on the actor.
Returns first active owner, favoring players and GM as fallback.
An array of all context note data for this actor.
Cached override
Actor's current race item.
The VisionSharingSheet instance for this actor
Internal
Computes armor penalties for this actor.
The resulting penalties from armor.
Internal
Item documents to clean links to.
Internal
Computes encumbrance values for this actor.
The resulting penalties from encumbrance.
Internal
Internal
Parent document
Collection name
Created documents
Creation data for the documents
Create context options
Triggering user's ID
Rest
...args: anyProtected
_prepareProtected
_prepareProtected
_prepareProtected
_prepareProtected
Internal
Add actor type specific changes.
Protected
_resetProtected
_restingAdjust temporary hit points.
Value to add to temp HP
Optional
options: { Additonal optons
If true, the temporary hit points are set to the provide value instead of added to existing.
actor.addTempHP(50); // Gain 50 THP
actor.addTempHP(-10); // Lose 10 THP
actor.addTempHP(0, {set:true}); // Set THP to zero
Wrapper for the static function, taking this actor as the only target.
Value to adjust health by.
Additional options.
await actor.applyDamage(10); // Cause 10 damage
await actor.applyDamage(-10): // Heal 10 damage
await actor.applyDamage(3, { asWounds: true }); // Apply 3 damage directly to Wounds instead of Vigor
Converts currencies of the given category to the given currency type
Optional
category: "currency" | "altCurrency" = "currency"Currency category, altCurrency is for weightless
Optional
type: "pp" | "gp" | "sp" | "cp" = "pp"Target currency.
Updated document or undefined if no update occurred.
Enable and configure a new spellbook.
Optional
casting: { Book casting configuration
Spellcasting ability score ID
Has cantrips?
Class tag
Domain/School slots
Level offset
Casting progression type
Spell/spellcasting type
Spellbook type
// Create spellbook for inquisitor
actor.createSpellbook({ type: "spontaneous", progression: "med", ability: "wis", spells: "divine", class: "inquisitor", cantrips: true, domain: 0 });
Show defenses in chat
Optional
options: { Additional options
The roll mode to use for the roll; defaults to the user's current preference when null
.
Relevant token if any.
Enrich context notes with item specific roll data.
Adds enriched
array to each note object.
Optional
rollData: objectRoll data instance
Optional
options: { Additional options
Handle rolls
Deletes expired temporary active effects and disables linked expired buffs.
Optional
options: { Additional options
Combat to expire data in, if relevant
Expiration event
Initiative based expiration marker
Time offset from world time
World time
Optional
context: DocumentModificationContext = {}Document update context
Generates an array with all the active context-sensitive notes for the given context on this actor.
The context to draw from.
Optional
all: boolean = trueRetrieve notes meant for all, such as notes targeting all skills.
Returns a list of already parsed context notes.
The context to draw notes from.
Optional
options: { Additional options
Option to pass to getContextNotes
Whether to roll inline rolls or not.
The resulting notes, already parsed.
Get total currency in category.
Optional
category: "currency" | "altCurrency" = "currency"Currency category.
Optional
options: { Additional options
Return result in lowest denomination. If false, returns gold instead.
Protected
getProtected
Optional
options: { Additional options
If false, damage resistances (DR, ER) are omitted.
If false, damage vulnerabilities are omitted.
Return feat counts.
An object with a property value
which refers to the current used feats, and max
which refers to the maximum available feats.
Protected
getProtected
getProtected
getProtected
Create a new Token document, not yet saved to the database, which represents the Actor, and apply actor size to it.
Optional
data: object = {}Additional data, such as x, y, rotation, etc. for the created token data
Optional
options: object = {}The options passed to the TokenDocument constructor
The created TokenDocument instance
Total coinage in both weighted and weightless.
Optional
options: { Additional options
Use copper for calculations and return.
Protected
getProtected
Returns Wound Threshold relevant data.
Optional
options: { PC/NPC health config variant data
Protected
getEasy way to determine whether this actor has a condition.
A direct condition key, as per pf1.registry.conditions, such as shaken
or dazed
.
Condition state
actor.hasCondition("grappled");
This is identical to actor.statuses.has("conditionId")
Test if actor is proficient with specified weapon.
Item to test
Optional
options: { Additional options
Allow item's proficiency override to influence the result.
Natural attacks incorrectly do not count as proficient.
Protected
modifyProtected
Protected
parsePerform all changes related to an actor resting, including restoring HP, ability scores, item uses, etc.
Options affecting an actor's resting
Updates applied to the actor, if resting was completed
Protected
preProtected
prepareProtected
prepareCMBProtected
prepareProtected
prepareProtected
prepareRecharge all owned items.
Optional
options: RechargeActorItemsOptions = {}Additional options
pf1.documents.item.ItemPF.recharge
await actor.rechargeItems(); // Recharge items with default settings.
await actor.rechargeItems({ period: "week" }); // Recharge items as if week had passed.
Restore spellbook used slots and spellpoints.
Optional
options: { Additional options
If false, return update data object instead of directly updating the actor.
Roll data
Result of update or the update data.
Roll an Ability Test Prompt the user for input regarding Advantage/Disadvantage and any Situational Bonus
The ability ID (e.g. "str")
Optional
options: object = {}Additional options
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
Optional
options: ActorRollOptions = {}The chat message if one was created, or its data if not. void
if the roll was cancelled.
await actor.rollAttack({ ranged: true }); // Basic ranged attack
await actor.rollAttack({ maneuver: true }); // Basic melee maneuver
Roll basic BAB check
Optional
options: ActorRollOptions = {}Additional options
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
Spellbook identifier
Optional
options: ActorRollOptions = {}Roll options
The chat message if one was created, or its data if not. void
if the roll was cancelled.
await actor.rollCL("primary");
Roll a concentration check using a particular spellbook of this actor
Spellbook identifier
Optional
options: ActorRollOptions = {}Roll options
The chat message if one was created, or its data if not. void
if the roll was cancelled.
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.
Optional
options: { Options which configure how initiative is rolled
Formula for bonus to initiative
Create new Combatant entries for tokens associated with this actor.
Formula override for dice to roll
Reroll initiative for existing Combatants
Roll mode override
Skip roll dialog
For which token this initiative roll is for
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 });
@override
Roll a specific saving throw
Identifier for saving throw type.
Optional
options: ActorRollOptions = {}Roll options.
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
The skill id (e.g. "per", "prf.prf1", or "crf.alchemy")
Optional
options: ActorRollOptions = {}Options which configure how the skill check is rolled
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.
A direct condition key, as per pf1.registry.conditions, such as shaken
or dazed
.
Whether to enable (true) the condition, or disable (false) it. Or object for merging into the active effect as part of enabling.
Optional
context: objectUpdate context
Condition ID to boolean mapping of actual updates.
await actor.setCondition("dazzled", true);
await actor.setCondition("sleep", { duration: { seconds: 60 } });
Set state of multiple conditions. Also handles condition tracks to minimize number of updates.
Condition ID to boolean (or update data) mapping of new condition states. See ()
Optional
context: object = {}Update context
Condition ID to boolean mapping of actual updates.
await actor.setConditions({ blind: true, sleep: false, shaken:true });
Easy way to toggle a condition.
A direct condition key, as per pf1.registry.conditions, such as shaken
or dazed
.
Optional
aeData: objectExtra data to add to the AE if it's being enabled
Condition ID to boolean mapping of actual updates.
await actor.toggleCondition("dazzled");
Synced with Foundry v12.328
Called by TokenHUD
Internal
the item to add to the actor's resources
Optional
options: { extra options
Skips warning if item tag already exists in dictionary flags
True if resources were set
Internal
Resize token sizes based on actor size.
Ignores tokens with static size set.
Optional
sizeKey: string = undefinedSize key to update to. If not provided, will use actor's current size.
Optional
options: object = {}Additional options
Add option to update token size on all scenes.
Protected
updateStatic
_getInternal
Source info
Static
_onStatic
applyApply rolled dice damage to the token or tokens which are currently controlled. This allows for damage to be scaled by a multiplier to account for healing, critical hits, or resistance If Shift is held, will prompt for adjustments based on damage reduction and energy resistances
The amount of damage to deal.
Optional
options: { Object containing default settings for overriding
Marks the damage as non-lethal
Apply damage to wounds directly instead of vigor, as needed for Wounds & Vigor variant health rule.
Critical multiplier as needed for Wounds & Vigor variant health rule. Set to 0 for non-critical hits.
Is this dual dealing? If enabled, healing affects both normal health and nonlethal.
Triggering element, if any.
Triggering event, if any
Forces the opening of a Dialog as if Shift was pressed
Individual instances of damage. This is not processed currently.
Chat message reference if any. This is to help modules, the system does not use it.
Default value for Damage Reduction
Override the targets to apply damage to
Static
chatStatic
getStatic
getGet melee and reach maximum ranges.
Actor size as size key or number
Actor stature
Static
getStatic
getReturn increased amount of spell slots by ability score modifier.
The associated ability modifier.
Spell level.
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
Generated using TypeDoc
Shared functionality for PCs and NPCs.
Todo
Move PC/NPC functionality from ActorPF here.
Abstract