Skip to content
This repository was archived by the owner on Oct 4, 2025. It is now read-only.

SF2eHelper.js

William edited this page Jan 16, 2025 · 1 revision

SF2eHelper

SF2eHelper module. Provides a couple of classes overriding PF2eHelper classes

Author: William Leemans
Copyright: William Leemans 2025

This module should allow future-proof management of SF2e resources. Changes may be made that break at some point. Be careful!

SF2eHelper.sf2eHelper ⇐ pf2eHelper

Kind: static class of SF2eHelper
Extends: pf2eHelper

sf2eHelper.getActorObject(game, actor) ⇒ Object

Determine what type of actor we're dealing with and return an object which can parse all data

Kind: static method of sf2eHelper

Param Type Description
game Object the Foundry VTT game object
actor Object the Foundry VTT actor object

SF2eHelper.sf2ePlayer ⇐ pf2ePlayer

sf2e player character class

Kind: static class of SF2eHelper
Extends: pf2ePlayer

new exports.sf2ePlayer(game, actor)

Param Type Description
game Object the Foundry VTT game object
actor Object the Foundry VTT actor object

sf2ePlayer.credits : string

Return the number of credits the character has

Kind: instance property of sf2ePlayer

sf2ePlayer.upb : string

Return the number of upb the character has

Kind: instance property of sf2ePlayer

sf2ePlayer.valuables : Array.<Item>

actor valuables

Kind: instance property of sf2ePlayer

sf2ePlayer._calculatePrice(price) ⇒ array

Calculate the price based on the price object

Kind: instance method of sf2ePlayer
Returns: array - an array containing all coins

Param Type Description
price Object the price object

sf2ePlayer._strike(rawStrike) ⇒ Object

Return a single strike with all calculated information

Kind: instance method of sf2ePlayer
Returns: Object - formatted strike

Param Type
rawStrike Object

SF2eHelper.sf2eNPC ⇐ pf2eNPC

sf2e player NPC class

Kind: static class of SF2eHelper
Extends: pf2eNPC

new exports.sf2eNPC(game, actor)

Param Type Description
game Object the Foundry VTT game object
actor Object the Foundry VTT actor object

sf2eNPC.credits : string

Return the number of credits the character has

Kind: instance property of sf2eNPC

sf2eNPC.upb : string

Return the number of upb the character has

Kind: instance property of sf2eNPC

sf2eNPC.valuables : Array.<Item>

actor valuables

Kind: instance property of sf2eNPC

sf2eNPC._calculatePrice(price) ⇒ array

Calculate the price based on the price object

Kind: instance method of sf2eNPC
Returns: array - an array containing all coins

Param Type Description
price Object the price object

sf2eNPC._strike(rawStrike) ⇒ Object

Return a single strike with all calculated information

Kind: instance method of sf2eNPC
Returns: Object - formatted strike

Param Type
rawStrike Object

SF2eHelper~_calculatePrice(price) ⇒ array

Calculate the price based on the price object

Kind: inner method of SF2eHelper
Returns: array - an array containing all coins

Param Type Description
price Object the price object

SF2eHelper~_strike(rawStrike, strike) ⇒ Object

Return a single strike with all calculated information

Kind: inner method of SF2eHelper
Returns: Object - formatted strike

Param Type
rawStrike Object
strike Object
Clone this wiki locally