Initial data from which to construct the Actor
Optional
context: ConstructionContextConstruction context options
Change flags
Overrides applied by changes
All changes from carried items and virtual ones.
Item dictionary and boolean flags
Source info
Partial duplicate of changes and manual adjustments.
Static
BASE_Internal
Retrieve valid skill change targets for this actor.
Internal
Change target paths for spellbooks on the actor.
Returns first active owner, favoring players and GM as fallback.
All items on this actor, including those in containers.
An array of all context note data for this actor.
All skill IDs relevant to this actor
Cached override
Actor's current race item.
Whether current user can see through this actor.
Spell Failure Percentage as number from 0 to 100.
The VisionSharingSheet instance for this actor
Internal
Computes armor penalties for this actor.
The resulting penalties from armor.
Internal
Internal
Calculate maximum health
All classes, sorted in order to be applied
Changes to
Internal
Item documents to clean links to.
Internal
Computes encumbrance values for this actor.
The resulting penalties from encumbrance.
Configure actor before data preparation.
Document options
Internal
Detect Health Changes
Builds data for post-update handling of deltas, stored in context.pf1.deltas
.
Finalize preparing protections and weaknesses.
Called in ()
Protected
_Protected
Finalize preparing armor, weapon, and language proficiencies and other traits.
Called in prepareDerivedData()
Internal
Collect some basic spellbook info so it doesn't need to be gathered again for each spellbook.
Spellbook cache
Internal
Get active conditions marked for context
Context ID
Internal
Internal
Handle condition track toggling post active effect creation if there's still some issues.
Updated active effect documents
Internal
Parent document
Collection name
Created documents
Creation data for the documents
Create context options
Triggering user's ID
Internal
Parent document
Collection name
Document array
Document ID array
Delete context
User ID
Handle Deltas in update context
Produces scrolling text for health changes.
Internal
Parse resistance entry
Primarily called from parseResistances
Optional
resistanceType: "dr" | "er" = "dr"Internal
Creation data
Context
Triggering user
Internal
Prepare armor/shield data for roll data
Equipment info
Item ID
Armor/Shield type
Armor data object
Protected
_Protected
Reset class skills.
Prepare combat maneuvers derived data.
Prepare creature type info
Protected
_Protected
Prepare boolean and dictionary flags.
Protected
_Protected
Prepare natural reach for melee range and for reach weapons.
Protected
_Protected
Calculate overland speeds.
Prepare senses
Internal
Internal
Add actor type specific changes.
Array of changes
Internal
Changed data
Context
Triggering user
Protected
_Protected
Protected
_Protected
Handler for character healing during rest.
Resting options.
Update data object
Internal
Update specific spellbook.
Spellbook identifier
Optional
rollData: objectRoll data instance
Pre-calculated data for re-use from _generateSpellbookCache
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.
Adjust temporary hit points.
Value to add to temp HP
Optional
options: { set?: boolean } = {}Additional options
Optional
set?: booleanIf true, the temporary hit points are set to the provide value instead of added to existing.
Internal
Apply damage or healing to actor.
Does not handle ER/DR or anything else special.
Value to adjust health by. Positive values deal damage, negative values heal.
Optional
options: ApplyDamageOptions = {}Additional options. This object will be transformed in-place as the damage application is processed.
ActorPF.applyDamage - For more general use.
Converts currencies of the given category to the given currency type
Optional
category: "currency" | "altCurrency" = "currency"Currency category, altCurrency is for weightless
Optional
type: any = "pp"Target currency.
Updated document or undefined if no update occurred.
Enable and configure a new spellbook.
Optional
casting: {Book casting configuration
Optional
ability?: stringSpellcasting ability score ID
Optional
cantrips?: booleanHas cantrips?
Optional
class?: stringClass tag
Optional
domain?: numberDomain/School slots
Optional
offset?: numberLevel offset
Optional
progression?: "high" | "med" | "low"Casting progression type
Optional
spells?: "arcane" | "divine" | "psychic" | "alchemy"Spell/spellcasting type
Optional
type?: "prepared" | "spontaneous" | "hybrid"Spellbook type
Optional
options: { commit?: boolean } = {}Additional options
Optional
commit?: booleanCommit modifications. If false, update data is returned instead of committing.
Show defenses in chat
Optional
options: { rollMode?: null | string; token?: TokenDocument } = {}Additional options
Optional
rollMode?: null | stringThe roll mode to use for the roll; defaults to the user's current preference when null
.
Optional
token?: TokenDocumentRelevant token if any.
Enrich context notes with item specific roll data.
Adds enriched
array to each note object.
Context notes
Optional
rollData: objectRoll data instance
Optional
options: { roll?: boolean } = {}Additional options
Optional
roll?: booleanHandle rolls
Deletes expired temporary active effects and disables linked expired buffs.
Optional
options: {Additional options
Optional
combat?: Combat<"base" | ModuleSubType>Combat to expire data in, if relevant
Optional
event?: stringExpiration event
Optional
initiative?: numberInitiative based expiration marker
Optional
timeOffset?: numberTime offset from world time
Optional
worldTime?: numberWorld time
Optional
context: any = {}Document update context
Determines carried weight.
Calculate current carry capacity limits.
Get related combatants.
Optional
combat: Combat<"base" | ModuleSubType> = game.combatCombat instance
Related combatants.
Internal
Condition immunities
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: { all?: boolean; roll?: boolean } = {}Additional options
Optional
all?: booleanOption to pass to getContextNotes
Optional
roll?: booleanWhether to roll inline rolls or not.
The resulting notes, already parsed.
Get challenge rating. Applies CR offset modifications from templates.
Get total currency in category.
Optional
category: "currency" | "altCurrency" = "currency"Currency category.
Optional
options: { inLowestDenomination?: boolean } = {}Additional options
Optional
inLowestDenomination?: booleanReturn result in lowest denomination (default copper). If false, returns standard currency (default gold) instead.
Protected
getProtected
Optional
options: { damageResistances?: boolean; damageVulnerabilities?: boolean } = {}Additional options
Optional
damageResistances?: booleanIf false, damage resistances (DR, ER) are omitted.
Optional
damageVulnerabilities?: booleanIf 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.
Abstract
getPer-actor type initiative options
Get item by its identifier tag.
Desired tag.
Protected
getProtected
Returns this actor's labels for use with sheets.
Abstract
getReturn the amount of experience required to gain a certain character level.
The desired level
Abstract
getProtected
getProtected
Retrieve data used to fill in roll variables.
Optional
options: { cache?: boolean; refresh?: boolean } = ...Additional options
Optional
cache?: booleanUse cache. If set to false, new fresh copy is returned without caching it.
Optional
refresh?: booleanRefresh cache
Retrieve source details regarding a change target.
Change target path
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: { inLowestDenomination?: boolean } = {}Additional options
Optional
inLowestDenomination?: booleanUse copper for calculations, otherwise pf1.config.currency.standard standard denomination is used.
Protected
getProtected
Returns Wound Threshold relevant data.
Optional
options: { healthConfig?: object } = {}Additional options
Optional
healthConfig?: objectPC/NPC health config variant data
Protected
getProtected
Returns effective Wound Threshold multiplier with rules and overrides applied.
Optional
options: { healthConfig?: object } = {}Additional options
Optional
healthConfig?: objectPC/NPC health config variant data
Multiplier
Checks if there's any matching proficiency
The item to check for.
Whether the actor is proficient with that item.
Easy 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
Check if actor has item with specified boolean flag.
The name/key of the flag to search for.
Whether this actor has any owned item with the given flag.
Protected
modifyProtected
Helper function for actor energy resistance and damage reduction feedback.
Value to check resistances for.
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.
Options affecting an actor's resting
Updates applied to the actor, if resting was completed
Protected
prepareProtected
Protected
prepareAugment the basic actor data with additional dynamic data.
Internal
Protected
prepareProtected
Recharge all owned items.
Optional
options: RechargeActorItemsOptions = {}Additional options
Internal
Internal
Called just before the first change is applied, and after every change is applied. Sets additional variables (such as spellbook range)
Restore spellbook used slots and spellpoints.
Optional
options: { commit?: boolean; rollData?: object } = {}Additional options
Optional
commit?: booleanIf false, return update data object instead of directly updating the actor.
Optional
rollData?: objectRoll 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: ActorRollOptions = {}Additional options
The chat message if one was created, or its data if not. void
if the roll was cancelled.
Roll a generic attack
Optional
options: ActorRollOptions = {}Roll options
Optional
action?: stringThe selected sub-action depending on the context.
Optional
bonus?: stringBonus to the roll.
Optional
chatMessage?: booleanWhether a chat message should be created.
Optional
dc?: numberDC threshold
Optional
dice?: stringThe roll's d20 die (replacement), or the static result the d20 should have.
Optional
maneuver?: anyOptional
messageData?: objectAdditional data to add to the chat message.
Optional
noSound?: booleanWhether no dice sound should be played when the chat message is created.
Optional
rollMode?: stringThe rollMode with which the chat message is created.
Optional
skipDialog?: booleanWhether a user facing dialog should be shown.
Optional
staticRoll?: numberA number used as a static roll result of the d20. If null, the d20 is rolled normally and the result is used.
Optional
token?: TokenDocumentAssociated token if any.
The chat message if one was created, or its data if not. void
if the roll was cancelled.
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.
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
Optional
bonus?: null | stringFormula for bonus to initiative
Optional
createCombatants?: booleanCreate new Combatant entries for tokens associated with this actor.
Optional
dice?: null | stringFormula override for dice to roll
Optional
initiativeOptions?: objectOptions to pass to ()
Optional
rerollInitiative?: booleanReroll initiative for existing Combatants
Optional
rollMode?: stringRoll mode override
Optional
skipDialog?: booleanSkip roll dialog
Optional
token?: TokenDocumentPFFor which token this initiative roll is for
The updated Combat document in which initiative was rolled, or null if no initiative was rolled
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.
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
void
if the roll was cancelled.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.
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.
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.
Override to support toggling buffs and operating the system's condition tracks
Called by TokenHUD
Status/condition ID
Optional
options: { active?: boolean; interaction?: boolean; overlay?: boolean } = {}Additional options
Optional
active?: booleanForce active state
Optional
interaction?: booleanNonstandard. Is this triggered by user interaction?
Optional
overlay?: booleanOverlay effect
Synced with Foundry v13.342
Internal
the item to add to the actor's resources
Optional
options: { warnOnDuplicate?: boolean } = {}extra options
Optional
warnOnDuplicate?: booleanSkips warning if item tag already exists in dictionary flags
True if resources were set
Internal
Update all spellbooks
Optional
rollData: objectRoll data instance
Optional
cache: objectSpellbook cache
Internal
Synchronize actor and token vision
Initialize vision
Refresh lightning
Protected
updateProtected
Updates attributes.woundThresholds.level variable.
Static
_Static
applyApply 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.
The amount of damage to deal. Negative values heal instead.
Optional
options: TargetedApplyDamageOptions = {}Object containing default settings for overriding
Static
getInternal
Add default artwork.
Optional
actorData: objectActor data to guide creation if any
Static
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.
Shared functionality for PCs and NPCs.
Todo
Move PC/NPC functionality from ActorPF here.