Skip to content

Change Formula

baileymh edited this page May 4, 2021 · 5 revisions

'Change' Tips

  • Most values are listed via hovering over the appropriate value in the character sheet
  • Ability modifier: @abilities.con.mod
  • Ability modifier without temporary buffs (i.e. Rage): @abilities.con.baseMod
  • Changes can be set to Add to the value (+) or Replace (=)
  • Scripts using js can also be used for changes, for more complicated things.
  • Not everything available in Pathfinder can currently be accomplished through changes

Math functions

Basic

Round Up

Function: ceil()

Example: ceil(5 / 2)

Result: 3


Round Down

Function: floor()

Example: floor(@attributes.bab.total / 6)

Result: Divide by 6 and round down


Minimum

Function: min(x, y)

Example: min(5,@cl)d6

Result: Scales from caster level, up to a max value of 5d6


Maximum

Function: max(x, y)

Example: max(4, (@classes.class.level))

Result: Uses 4, unless class level is greater. Effectively creates a lower bounds until class level > 4, then uses class levels.


Conditional

Function: (X > Y ? A : B)

Example: @attributes.hd.total > 9 ? 4 : 2

Result: If HD is greater than 9, output is 4, if it is not then 2


Absolute value

Function: abs()

Example: abs(2 - 4)

Result: Outputs 2 (rather than -2)


Foundry uses JS Math. For more math functions, go here. Reading how JS handles math might make things easier to understand.


Combined examples

Increase by 1 for every 4 BAB

max(1, floor(@attributes.bab.total / 4)))

Result: BAB = 3: 1; BAB = 6: 1; BAB = 14: 3


Half Class level, minimum 1

max(1, floor(@classes.boo.level / 2))


Specific Use Examples

Cavalier Challenge Uses

Once per day, plus one for every three levels beyond (1, 4, 7, 10, ...)

Limited Uses: 1 + floor((@classes.cavalier.level - 1) / 3)


Channel Positive Energy

Heals 1d6 + 1d6 for every 2 levels beyond 1st (3, 5, 7, ...)

Healing: ceil(@classes.cleric.level / 2))d6 DC for the save is 10 + 1/2 cleric level + Cha mod

Save DC: 10 + floor(@classes.cleric.level / 2) + @abilities.cha.mod


Cure Light Wounds

Heals 1d8 + cl (max of 5)

Healing: 1d8 + min(5, @cl)


Fireball

Deals 1d6 per caster level, max 10d6

Damage: (min(10, @cl))d6


Fleet

Increase movement speed by 5, while wearing light (1) or no armor (0) and not encumbered. (@armor.type - medium armor = 2, heavy = 3)

Change (+): (@armor.type < 2 && @attributes.encumbrance.level < 1) ? 5 : 0


Kinetic Blasts

These are some of the more complex formula I've seen, that also include the use of resources.

Elemental Overflow (added to attack bonus of blasts)

See Elemental Overflow for description

Attack: min(@resources.burn.value, floor(@classes.kineticist.level / 3))


Energy Blast

Deals 1d6 plus 1d6 every 2 levels beyond 1st (1, 3, 5, ...) + damage from Elemental Overflow

Attack: min(@resources.burn.value, floor(@classes.kineticist.level / 3)) Damage: (ceil(@classes.kineticist.level/2))d6 + min(@resources.burn.value, floor(@classes.kineticist.level/3)) * 2 * @critMult


Physical Blast

Deals 1d6+1, plus 1d6+1 every 2 levels beyond 1st (1, 3, 5, ...) + damage from Elemental Overflow

Attack: min(@resources.burn.value, floor(@classes.kineticist.level / 3)) Damage: (ceil(@classes.kineticist.level/2))d6 + ceil(@classes.kineticist.level/2) + min(@resources.burn.value, floor(@classes.kineticist.level/3)) * 2 * @critMult


Energy Composite Blasts

Attack: min(@resources.burn.value, floor(@classes.kineticist.level / 3)) Damage: (2 * ceil(@classes.kineticist.level/2))d6 + floor(@abilities.con.mod/2) + min(@resources.burn.value, floor(@classes.kineticist.level/3)) * 2 * @critMult


Power Attack

Gives -1 Atk / +2 Dmg, increasing by -1/+2 when BAB = 4, and every 4 points after

Attack: -floor((@attributes.bab.total+4)/4) Damage: floor((@attributes.bab.total+4)/4)*2


Sneak Attack

Rogue sneak attack (Levels 1, 3, 5, ...)

Damage: ceil(@classes.rogue.level / 2)d6


Slayer sneak attack (Levels 3, 6, 9, ...)

Damage: floor(@classes.slayer.level / 3)d6


Skill Focus (Perception)

Gives +3 base, +6 at 10 ranks+

Change: @skills.per.rank > 9 ? 6 : 3