Expressions

Operators

Table 1. Arithmetic operators
Operator Description

+

Addition of numerical values.

-

Subtraction of numerical values.

*

Multiplication of numerical values.

/

Division of numerical values.

Table 2. Comparison operators
Operator Description

<

Compares if the left operand is smaller than the right operand.

<=

Compares if the left operand is smaller than or equal to the right operand.

>

Compares if the left operand is bigger than the right operand.

>=

Compares if the left operand is bigger than or equal to the right operand.

==

Compares if the left operand is equal to the right operand.

Variables

Name Description

C

The current player count in the party.

L

The current scenario level selected on the level chart.

M

The current monster level according to the scenario level chart.

Trap

The current trap damage according to the scenario level chart.

Hazard

The current hazardous terrain damage according to the scenario level chart.

Gold

The current gold bonus according to the scenario level chart.

XP

The current experience bonus according to the scenario level chart.

For expressions on monster stats it’s also possible to reference the current value of the stat, e.g. in order to increase it by 1. This is done by using the variable stat. followed by the name of the stat, e.g.:

stats: {
  shield: "stats.shield + 1",
  retaliate: 2,
}
The name oft the variable implies that other stats can also be referenced (e.g. to set the attack value +1 of the movement value). This is also intended in the future but currently not possible. For now only the stat with the same name as the one being changed can be referenced.

Functions

Functions can be used in expression by writing their name and a pair of parentheses. Inside the parentheses the list of arguments are listed, separated by ,.

The following functions are available for expressions:

Name Description

max(number, number): number

Returns the maximum of two values.

min(number, number): number

Returns the minimum of two values.

roundDown(number): number

Rounds the given number to the nearest integer. Rounds to the lower integer if the decimal value is .5.

roundUp(number): number

Rounds the given number to the nearest integer. Rounds to the higher integer if the decimal value is .5.

Examples

roundDown(L * 3 / 2)