Skip to content

Math Expressions

Frumple edited this page May 23, 2021 · 3 revisions

Available only in descriptions for Special Traits, Actions, Reactions, and Legendary Actions.

Five different types of math expressions are supported. This table summarizes the usage of each:

Type Prefix Usage Example
Basic Math Expressions (none) Add and subtract variables and integers [INT + 1]
Modifier Expressions MOD Prepends "+" plus sign for resulting positive numbers MOD[INT + 1]
Attack Expressions ATK Calculates attack roll modifiers ATK[DEX]
Damage Expressions DMG Calculates average damage for damage rolls DMG[1d10 + STR]
Spell Save DC Expressions SDC Calculates spell save DC SDC[WIS]

Basic Math Expressions: [...]

Basic math expressions consist of a series of operands that can be added with plus signs (+) or subtracted with minus signs (-), all within a pair of square brackets [].

Operands can be:

  • variables (e.g. ability modifiers represented by STR, DEX, INT, etc., and proficiency bonus represented by PROF), or
  • integers (e.g. 12, -3, or 0)

Example

If the creature's strength modifier is +5 and its proficiency bonus is +2:

[STR + PROF - 3]

will be calculated as 5 + 2 - 3, resulting in a final answer of 4.

Note that whitespace between the operands and operators is optional, meaning that [STR+PROF-3] is a valid and equivalent math expression.

Variables

Here are a list of variables that are currently supported in math expressions:

Variable Description Note
STR Strength Modifier
DEX Dexterity Modifier
CON Constitution Modifier
INT Intelligence Modifier
WIS Wisdom Modifier
CHA Charisma Modifier
FIN Finesse Modifier For use in finesse weapons. Equal to strength or dexterity modifier, whichever is highest.
PROF Proficiency Bonus

Modifier Expressions: MOD[...]

One limitation of basic math expressions is that positive number results will appear without a positive sign (e.g. 5 instead of +5). The positive sign is needed to accurately show some modifiers, so to make it appear, simply add the prefix MOD before the square brackets: MOD[...]

Example

Assuming again that the creature's strength modifier is +5 and its proficiency bonus is +2:

*Melee Weapon Attack:* MOD[STR + PROF - 3] to hit

will appear as:

Melee Weapon Attack: +4 to hit

Attack Expressions: ATK[...]

Attack expressions are a useful shorthand for calculating attack roll modifiers. They must satisfy the following conditions:

  • Begin with the prefix ATK before the square brackets
  • The first operand must be the ability modifier (usually STR, DEX, or FIN) on which the attack is based on.

Attack expressions will automatically add the proficiency bonus to the ability modifier without requiring the PROF variable to be added to the expression. Subsequent operands can then added or subtracted from the first operand.

Example

Assuming again that the creature's strength modifier is +5 and its proficiency bonus is +2:

*Melee Weapon Attack:* ATK[STR - 3] to hit

is effectively equivalent to the previous modifier expression example and will also appear as:

Melee Weapon Attack: +4 to hit

Damage Expressions: DMG[...]

Damage expressions calculate the average damage for a given damage roll. They must satisfy the following conditions:

  • Begin with the prefix DMG before the square brackets
  • The first operand must be a special dice operand (d8, 2d6, etc.).

Subsequent operands can then be added or subtracted from the dice operand.

Example

If the creature's dexterity modifier is +3, then:

DMG[1d8 + DEX + 2] slashing damage

will appear as:

9 (1d8 + 5) slashing damage

This is because since the average damage of 1d8 is 4.5 (rounded down to 4), then 4 + 3 + 2 equals 9 for the total average damage.

Spell Save DC Expressions: SDC[...]

Spell save DC expressions are another useful shorthand. They must satisfy the following conditions:

  • Begin with the prefix SDC before the square brackets
  • The first operand must be the creature's spellcasting ability modifier (usually INT, WIS, or CHA).

These expressions calculate the spell save DC, which is equal to 8 + proficiency bonus + spellcasting ability modifier. Subsequent operands can then be added or subtracted from the first operand.

Example

If the creature's intelligence modifier is +4 and its proficiency bonus is +2:

SDC[INT]

will be calculated as 8 + 4 + 2, totalling to a final result of 14.

Name Expression Menus

For convenience, you can add the most common math expressions to your description by hovering over the "MOD", "ATK", "DMG", or "SDC" menus to the left of the text area, and clicking the desired expression. The expression will be added to wherever your cursor is located in the text area, or if you selected some text, the expression will replace your selection.

Clone this wiki locally