UniqueModifier

UniqueModifier ⇐ ComparisonModifier

A UniqueModifier re-rolls any non-unique dice values and, optionally that match a given test.

Kind: global class
Extends: ComparisonModifier

new UniqueModifier([once], [comparePoint])

Create a UniqueModifier instance.

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

uniqueModifier.order : number

The default modifier execution order.

Kind: instance property of UniqueModifier

uniqueModifier.name ⇒ string

The name of the modifier.

Kind: instance property of UniqueModifier
Returns: string - 'unique'

uniqueModifier.notation ⇒ string

The modifier's notation.

Kind: instance property of UniqueModifier

uniqueModifier.once ⇒ boolean

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

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

uniqueModifier.once

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

Kind: instance property of UniqueModifier

ParamType
valueboolean

uniqueModifier.run(results, _context) ⇒ RollResults

Run the modifier on the results.

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

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

uniqueModifier.toJSON() ⇒ Object

Return an object for JSON serialising.

This is called automatically when JSON encoding the object.

Kind: instance method of UniqueModifier