ReRollModifier

ReRollModifier ⇐ ComparisonModifier

A ReRollModifier re-rolls dice that match a given test, and replaces the new value with the old one.

Kind: global class
Extends: ComparisonModifier
See: ExplodeModifier if you want to keep the old value as well

new ReRollModifier([once], [comparePoint])

Create a ReRollModifier instance.

ParamTypeDefaultDescription
[once]booleanfalseWhether to only re-roll once or not
[comparePoint]ComparePointThe comparison object

reRollModifier.order : number

The default modifier execution order.

Kind: instance property of ReRollModifier

reRollModifier.name ⇒ string

The name of the modifier.

Kind: instance property of ReRollModifier
Returns: string - 're-roll'

reRollModifier.notation ⇒ string

The modifier's notation.

Kind: instance property of ReRollModifier

reRollModifier.once ⇒ boolean

Whether the modifier should only re-roll once or not.

Kind: instance property of ReRollModifier
Returns: boolean - true if it should re-roll once, false otherwise

reRollModifier.once

Set whether the modifier should only re-roll once or not.

Kind: instance property of ReRollModifier

ParamType
valueboolean

reRollModifier.defaultComparePoint(_context) ⇒ array

The default compare point definition

Kind: instance method of ReRollModifier

ParamTypeDescription
_contextStandardDice | RollGroupThe object that the modifier is attached to

reRollModifier.run(results, _context) ⇒ RollResults

Run the modifier on the results.

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

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

reRollModifier.toJSON() ⇒ Object

Return an object for JSON serialising.

This is called automatically when JSON encoding the object.

Kind: instance method of ReRollModifier