MaxModifier

MaxModifier ⇐ Modifier

A MaxModifier causes die rolls over a maximum value to be treated as the maximum value.

Kind: global class
Extends: Modifier
See: MinModifier for the opposite of this modifier
Since: 4.3.0

new MaxModifier(max)

Create a MaxModifier instance.

Throws:

  • TypeError max must be a number
ParamTypeDescription
maxnumberThe maximum value

maxModifier.order : number

The default modifier execution order.

Kind: instance property of MaxModifier

maxModifier.max ⇒ Number

The maximum value.

Kind: instance property of MaxModifier

maxModifier.max

Set the maximum value.

Kind: instance property of MaxModifier
Throws:

  • TypeError max must be a number
ParamType
valuenumber

maxModifier.name ⇒ string

The name of the modifier.

Kind: instance property of MaxModifier
Returns: string - 'max'

maxModifier.notation ⇒ string

The modifier's notation.

Kind: instance property of MaxModifier

maxModifier.run(results, _context) ⇒ RollResults

Run the modifier on the results.

Kind: instance method of MaxModifier
Returns: RollResults - The modified results

ParamTypeDescription
resultsRollResultsThe results to run the modifier against
_contextStandardDice | RollGroupThe object that the modifier is attached to

maxModifier.toJSON() ⇒ Object

Return an object for JSON serialising.

This is called automatically when JSON encoding the object.

Kind: instance method of MaxModifier