UniqueModifier
UniqueModifier ⇐ ComparisonModifier
A UniqueModifier re-rolls any non-unique dice values and, optionally that match a given test.
Kind: global class
Extends: ComparisonModifier
- UniqueModifier ⇐
ComparisonModifier- new UniqueModifier([once], [comparePoint])
- .order :
number - .name ⇒
string - .notation ⇒
string - .once ⇒
boolean - .once
- .run(results, _context) ⇒
RollResults - .toJSON() ⇒
Object
new UniqueModifier([once], [comparePoint])
Create a UniqueModifier instance.
| Param | Type | Default | Description |
|---|---|---|---|
| [once] | boolean | false | Whether to only re-roll once or not |
| [comparePoint] | ComparePoint | | The 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
| Param | Type |
|---|---|
| value | boolean |
uniqueModifier.run(results, _context) ⇒ RollResults
Run the modifier on the results.
Kind: instance method of UniqueModifier
Returns: RollResults - The modified results
| Param | Type | Description |
|---|---|---|
| results | RollResults | The results to run the modifier against |
| _context | StandardDice | RollGroup | The 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