UniqueModifier
ComparisonModifier
UniqueModifier ⇐ 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 |
number
uniqueModifier.order : The default modifier execution order.
Kind: instance property of UniqueModifier
string
uniqueModifier.name ⇒ The name of the modifier.
Kind: instance property of UniqueModifier
Returns: string
- 'unique'
string
uniqueModifier.notation ⇒ The modifier's notation.
Kind: instance property of UniqueModifier
boolean
uniqueModifier.once ⇒ 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 |
RollResults
uniqueModifier.run(results, _context) ⇒ 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 |
Object
uniqueModifier.toJSON() ⇒ Return an object for JSON serialising.
This is called automatically when JSON encoding the object.
Kind: instance method of UniqueModifier