-
-
Notifications
You must be signed in to change notification settings - Fork 1
PF2eHelper.js
PF2eHelper module
Author: William Leemans
Copyright: William Leemans 2024
-
PF2eHelper
-
static
-
.pf2eHelper ⇐
genericHelper
- instance
-
static
-
.abbreviateSource(value) ⇒
string
-
.strikeDamage(strike, actor) ⇒
string
-
.damageFormula(strike, actor) ⇒
string
-
.formatActivity(actionType, activity, symbols) ⇒
string
-
.formatAttributeBoosts(attributes) ⇒
string
-
.runesToTraits(runes) ⇒
array
-
.formatRunes(runes) ⇒
string
-
.formatTrait(trait) ⇒
string
-
.formatSpellCastingTime(activity, symbols) ⇒
string
-
.formatTraits(traitList) ⇒
string
-
.frequencyToHuman(frequency) ⇒
string
-
.getActorObject(game, actor) ⇒
Object
-
.isPartialBoost(actor, attribute) ⇒
boolean
-
.resolveSize(size) ⇒
string
-
.abbreviateSource(value) ⇒
-
.pf2eHelper ⇐
-
inner
-
~pf2eActor
- new pf2eActor(game, actor)
-
.name :
string
-
.ownerName :
string
-
.traits :
array
-
.ancestry :
string
-
.heritage :
string
-
.size :
string
-
.background :
Object
-
.class :
string
-
.level :
number
|string
-
.xp :
number
|string
-
.heroPoints :
number
-
.attributes :
Object
-
.ac :
Object
-
.hasShieldEquipped :
boolean
-
.equippedShield :
Object
-
.defenseProficiencies :
Object
-
.savingThrows :
Object
-
.hp :
Object
-
.dying :
Object
-
.wounded :
Object
-
.immunities :
string
-
.resistance :
string
-
.weaknesses :
string
-
.conditions :
string
-
.skills :
Object
-
.languages :
string
-
.perception :
Object
-
.senses :
string
-
.hasArmorEquipped :
boolean
-
.equippedArmor :
Object
-
.baseSpeed :
string
-
.baseMovement :
Object
-
.movement :
array
-
.strikes :
array
-
.weaponProficiencies :
Object
-
.classDC :
Object
-
.ancestryAndHeritageAbilities :
array
-
.ancestryFeats :
array
-
.backgroundSkillFeats :
array
-
.skillFeats :
array
-
.generalFeats :
array
-
.attributeBoosts :
array
-
.classFeats :
array
-
.classFeatures :
array
-
.items :
array
-
.heldItems :
array
-
.consumables :
array
-
.wornItems :
array
-
.coins :
Object
-
.totalBulk :
number
-
.gemsAndArtwork :
array
-
.details :
Object
-
.activities :
array
-
.hasArcaneTradition :
boolean
-
.hasOccultTradition :
boolean
-
.hasPrimalTradition :
boolean
-
.hasDivineTradition :
boolean
-
.isPreparedCaster :
boolean
-
.isSpontaneousCaster :
boolean
-
.spellCastingEntries :
array
-
.spellProficiency :
Object
-
.highestSpellProficiency :
Object
-
.spellSlots :
array
-
.cantripRank :
number
-
.focusPoints :
Object
-
.focusSpellRank :
number
-
.maximumSpellRank :
number
-
.knownSpells :
array
-
.knownFormulas :
array
-
.knownRituals :
array
-
._items(containerId, level) ⇒
array
-
._rawItem(item) ⇒
Object
-
.flatItems(itemList) ⇒
array
-
._calculatePrice(price) ⇒
array
-
~f2eActorPropertyError ⇐
Error
-
~pf2ePlayer ⇐
pf2eActor
- new pf2ePlayer(game, actor)
-
.background :
Object
-
.knownFormulas :
array
-
~pf2eNPC ⇐
pf2eActor
- new pf2eNPC(game, actor)
-
.ac :
Object
-
.strikes :
array
-
.skills :
Object
-
~pf2eActor
-
static
Kind: static class of PF2eHelper
Extends: genericHelper
-
.pf2eHelper ⇐
genericHelper
- instance
-
static
-
.abbreviateSource(value) ⇒
string
-
.strikeDamage(strike, actor) ⇒
string
-
.damageFormula(strike, actor) ⇒
string
-
.formatActivity(actionType, activity, symbols) ⇒
string
-
.formatAttributeBoosts(attributes) ⇒
string
-
.runesToTraits(runes) ⇒
array
-
.formatRunes(runes) ⇒
string
-
.formatTrait(trait) ⇒
string
-
.formatSpellCastingTime(activity, symbols) ⇒
string
-
.formatTraits(traitList) ⇒
string
-
.frequencyToHuman(frequency) ⇒
string
-
.getActorObject(game, actor) ⇒
Object
-
.isPartialBoost(actor, attribute) ⇒
boolean
-
.resolveSize(size) ⇒
string
-
.abbreviateSource(value) ⇒
Activity Glyph set for the action icons font. To be used with pf2eHelper.formatActivity
Kind: instance property of pf2eHelper
Activity Glyph set for scribe.pf2.tools. To be used with pf2eHelper.formatActivity
Kind: instance property of pf2eHelper
Abbreviate the names of the sourcebooks a resource is from.
Kind: static method of pf2eHelper
Returns: string
- PF2e Source abbreviation
Param | Type | Description |
---|---|---|
value | string |
Source name |
simple function to generate the damage of a strike
Kind: static method of pf2eHelper
Param | Type | Description |
---|---|---|
strike | Object |
the strike object as found in actor.system.actions |
actor | Object |
the actor object to check for additional feats like weapon specialization |
simple function to generate the damage formula of a strike
Kind: static method of pf2eHelper
Param | Type | Description |
---|---|---|
strike | Object |
the strike object as found in actor.system.actions |
actor | Object |
the actor object to check for additional feats like weapon specialization |
Format the activity according to actionType and activity
Kind: static method of pf2eHelper
Returns: string
- Activity Glyph
Param | Type | Description |
---|---|---|
actionType | string |
action type: action, free, or reaction |
activity | string |
the activity |
symbols | Object |
the symbol set to use |
Format and sort attribute boosts according to their order
Kind: static method of pf2eHelper
Returns: string
- Sorted list of attribute boosts
Param | Type | Description |
---|---|---|
attributes | array |
list of attributes |
Format runes as traits
Kind: static method of pf2eHelper
Param | Type | Description |
---|---|---|
runes | Object |
the runes object associated with a weapon |
Format runes into a string
Kind: static method of pf2eHelper
Returns: string
- list of runes
Param | Type | Description |
---|---|---|
runes | Object |
a rune entry from the PF2e actor |
Format an individual trait according to certain rules
Kind: static method of pf2eHelper
Returns: string
- formatted trait
Param | Type | Description |
---|---|---|
trait | string |
trait to be formatted |
Format Spell Casting Times
Kind: static method of pf2eHelper
Returns: string
- Activiy Glyph
Param | Type | Description |
---|---|---|
activity | string |
the activity |
symbols | Object |
the symbol set to use |
Order and format traits
Kind: static method of pf2eHelper
Returns: string
- sorted list of traits
Param | Type | Description |
---|---|---|
traitList | array |
an array of traits to be formatted |
Resolve pf2e system frequency to human
Kind: static method of pf2eHelper
Returns: string
- human readable frequency
Param | Type | Description |
---|---|---|
frequency | string |
PF2e system frequency |
Determine what type of actor we're dealing with and return an object which can parse all data
Kind: static method of pf2eHelper
Param | Type | Description |
---|---|---|
game | Object |
the Foundry VTT game object |
actor | Object |
the Foundry VTT actor object |
Return whether or not an attribute boost is partial
Kind: static method of pf2eHelper
Returns: boolean
- whether the given attribute has a partial boost
Param | Type | Description |
---|---|---|
actor | * |
the actor object |
attribute | * |
the attribute for which to discover if there is a partial boost |
Return full size name
Kind: static method of pf2eHelper
Returns: string
- Full size name
Param | Type | Description |
---|---|---|
size | string |
the abbreviated size entry |
pf2e actor abstraction base class
Kind: inner class of PF2eHelper
-
~pf2eActor
- new pf2eActor(game, actor)
-
.name :
string
-
.ownerName :
string
-
.traits :
array
-
.ancestry :
string
-
.heritage :
string
-
.size :
string
-
.background :
Object
-
.class :
string
-
.level :
number
|string
-
.xp :
number
|string
-
.heroPoints :
number
-
.attributes :
Object
-
.ac :
Object
-
.hasShieldEquipped :
boolean
-
.equippedShield :
Object
-
.defenseProficiencies :
Object
-
.savingThrows :
Object
-
.hp :
Object
-
.dying :
Object
-
.wounded :
Object
-
.immunities :
string
-
.resistance :
string
-
.weaknesses :
string
-
.conditions :
string
-
.skills :
Object
-
.languages :
string
-
.perception :
Object
-
.senses :
string
-
.hasArmorEquipped :
boolean
-
.equippedArmor :
Object
-
.baseSpeed :
string
-
.baseMovement :
Object
-
.movement :
array
-
.strikes :
array
-
.weaponProficiencies :
Object
-
.classDC :
Object
-
.ancestryAndHeritageAbilities :
array
-
.ancestryFeats :
array
-
.backgroundSkillFeats :
array
-
.skillFeats :
array
-
.generalFeats :
array
-
.attributeBoosts :
array
-
.classFeats :
array
-
.classFeatures :
array
-
.items :
array
-
.heldItems :
array
-
.consumables :
array
-
.wornItems :
array
-
.coins :
Object
-
.totalBulk :
number
-
.gemsAndArtwork :
array
-
.details :
Object
-
.activities :
array
-
.hasArcaneTradition :
boolean
-
.hasOccultTradition :
boolean
-
.hasPrimalTradition :
boolean
-
.hasDivineTradition :
boolean
-
.isPreparedCaster :
boolean
-
.isSpontaneousCaster :
boolean
-
.spellCastingEntries :
array
-
.spellProficiency :
Object
-
.highestSpellProficiency :
Object
-
.spellSlots :
array
-
.cantripRank :
number
-
.focusPoints :
Object
-
.focusSpellRank :
number
-
.maximumSpellRank :
number
-
.knownSpells :
array
-
.knownFormulas :
array
-
.knownRituals :
array
-
._items(containerId, level) ⇒
array
-
._rawItem(item) ⇒
Object
-
.flatItems(itemList) ⇒
array
-
._calculatePrice(price) ⇒
array
Param | Type | Description |
---|---|---|
game | Object |
The foundry VTT game object |
actor | Object |
Foundry VTT actor object |
actor name
Kind: instance property of pf2eActor
actor owner name
Kind: instance property of pf2eActor
actor traits
Kind: instance property of pf2eActor
actor ancestry
Kind: instance property of pf2eActor
actor heritage
Kind: instance property of pf2eActor
actor (small) size
Kind: instance property of pf2eActor
actor background
Kind: instance property of pf2eActor
actor class
Kind: instance property of pf2eActor
actor level
Kind: instance property of pf2eActor
actor XPs
Kind: instance property of pf2eActor
actor hero points
Kind: instance property of pf2eActor
actor attributes
Kind: instance property of pf2eActor
actor ac
Kind: instance property of pf2eActor
actor has a shield equipped
Kind: instance property of pf2eActor
actor equipped shield
Kind: instance property of pf2eActor
actor defense proficiencies
Kind: instance property of pf2eActor
actor saving throws
Kind: instance property of pf2eActor
actor HP
Kind: instance property of pf2eActor
actor dying
Kind: instance property of pf2eActor
actor wounds
Kind: instance property of pf2eActor
actor immunities
Kind: instance property of pf2eActor
actor resistance
Kind: instance property of pf2eActor
actor weaknesses
Kind: instance property of pf2eActor
actor conditions
Kind: instance property of pf2eActor
actor skills
Kind: instance property of pf2eActor
actor languages
Kind: instance property of pf2eActor
actor perception
Kind: instance property of pf2eActor
actor senses
Kind: instance property of pf2eActor
actor is wearing armor
Kind: instance property of pf2eActor
actor armor worn
Kind: instance property of pf2eActor
actor base speed
Kind: instance property of pf2eActor
actor base movement
Kind: instance property of pf2eActor
actor list of movement
Kind: instance property of pf2eActor
actor strikes
Kind: instance property of pf2eActor
actor weapon proficiencies
Kind: instance property of pf2eActor
actor class DC
Kind: instance property of pf2eActor
actor ancestry and heritage abilities
Kind: instance property of pf2eActor
actor ancestry feats
Kind: instance property of pf2eActor
actor background skill feats
Kind: instance property of pf2eActor
actor skill feats
Kind: instance property of pf2eActor
actor general feats
Kind: instance property of pf2eActor
actor attribute boosts
Kind: instance property of pf2eActor
actor class feats
Kind: instance property of pf2eActor
actor class features
Kind: instance property of pf2eActor
all actor items
Kind: instance property of pf2eActor
actor held items
Kind: instance property of pf2eActor
actor consumables
Kind: instance property of pf2eActor
actor worn items
Kind: instance property of pf2eActor
actor coins
Kind: instance property of pf2eActor
actor total bulk
Kind: instance property of pf2eActor
actor gems and artwork
Kind: instance property of pf2eActor
actor details
Kind: instance property of pf2eActor
actor actions, free actions and reactions
Kind: instance property of pf2eActor
actor has spells belonging to the arcane tradition
Kind: instance property of pf2eActor
actor has spells belonging to the occult tradition
Kind: instance property of pf2eActor
actor has spells belonging to the primal tradition
Kind: instance property of pf2eActor
actor has spells belonging to the divine tradition
Kind: instance property of pf2eActor
actor is a prepared caster
Kind: instance property of pf2eActor
actor is a spontaneous caster
Kind: instance property of pf2eActor
actor spellcasting entries
Kind: instance property of pf2eActor
actor spell proficiency
Kind: instance property of pf2eActor
actor's highest spellcasting proficiency
Kind: instance property of pf2eActor
actor spellslots
Kind: instance property of pf2eActor
actor cantrip rank
Kind: instance property of pf2eActor
actor focus points
Kind: instance property of pf2eActor
actor focus spell rank
Kind: instance property of pf2eActor
actor maximum spell rank
Kind: instance property of pf2eActor
actor known spells
Kind: instance property of pf2eActor
actor know formulas
Kind: instance property of pf2eActor
actor known rituals
Kind: instance property of pf2eActor
Enumerate actor items in a container
Kind: instance method of pf2eActor
Param | Type | Default | Description |
---|---|---|---|
containerId |
null | string
|
|
the id of the container to get the items from (null for the root) |
level | number |
0 |
a number indicating the level of depth the item is in |
parse an item into the requested format
Kind: instance method of pf2eActor
Param | Type | Description |
---|---|---|
item | Object |
the item to parse |
return a flat list of items
Kind: instance method of pf2eActor
Param | Type | Description |
---|---|---|
itemList | array |
list of items to parse |
Calculate the price based on the price object
Kind: instance method of pf2eActor
Returns: array
- an array containing all coins
Param | Type | Description |
---|---|---|
price | Object |
the price object |
pf2e Actor Property Error
Kind: inner class of PF2eHelper
Extends: Error
Param | Type | Description |
---|---|---|
moduleName | string |
the name of the module the error has occurred in |
className | string |
the name of the class the error has occurred in |
methodName | string |
the name of the method the error has occurred in |
message | string |
the error message |
pf2e player character class
Kind: inner class of PF2eHelper
Extends: pf2eActor
-
~pf2ePlayer ⇐
pf2eActor
- new pf2ePlayer(game, actor)
-
.background :
Object
-
.knownFormulas :
array
Param | Type | Description |
---|---|---|
game | Object |
the Foundry VTT game object |
actor | Object |
the Foundry VTT actor object |
actor background
Kind: instance property of pf2ePlayer
actor know formulas
Kind: instance property of pf2ePlayer
pf2e player NPC class
Kind: inner class of PF2eHelper
Extends: pf2eActor
-
~pf2eNPC ⇐
pf2eActor
- new pf2eNPC(game, actor)
-
.ac :
Object
-
.strikes :
array
-
.skills :
Object
Param | Type | Description |
---|---|---|
game | Object |
the Foundry VTT game object |
actor | Object |
the Foundry VTT actor object |
actor ac
Kind: instance property of pf2eNPC
actor strikes
Kind: instance property of pf2eNPC
actor skills
Kind: instance property of pf2eNPC