Modifier

Modifier

Abstract class

This is an abstract class and should not be used directly. You should use one of the extended classes, or extend the class yourself.

A Modifier is the base modifier class that all others extend from.

Kind: global abstract class

new Modifier()

Create a Modifier instance.

modifier.order : number

The default modifier execution order.

Kind: instance property of Modifier

modifier.name ⇒ string

The name of the modifier.

Kind: instance property of Modifier
Returns: string - 'modifier'

modifier.notation ⇒ string

The modifier's notation.

Kind: instance property of Modifier

modifier.maxIterations ⇒ number

The maximum number of iterations that the modifier can apply to a single die roll

Kind: instance property of Modifier
Returns: number - 1000

modifier.defaults(_context) ⇒ object

No default values present

Kind: instance method of Modifier

ParamTypeDescription
_contextStandardDice | RollGroupThe object that the modifier is attached to

modifier.useDefaultsIfNeeded(_context) ⇒ void

Processing default values definitions

Kind: instance method of Modifier

ParamTypeDescription
_contextStandardDice | RollGroupThe object that the modifier is attached to

modifier.run(results, _context) ⇒ RollResults

Run the modifier on the results.

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

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

modifier.toJSON() ⇒ Object

Return an object for JSON serialising.

This is called automatically when JSON encoding the object.

Kind: instance method of Modifier

modifier.toString() ⇒ string

Return the String representation of the object.

This is called automatically when casting the object to a string.

Kind: instance method of Modifier
See: notation