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
- ReRollModifier ⇐
ComparisonModifier- new ReRollModifier([once], [comparePoint])
- .order :
number - .name ⇒
string - .notation ⇒
string - .once ⇒
boolean - .once
- .defaultComparePoint(_context) ⇒
array - .run(results, _context) ⇒
RollResults - .toJSON() ⇒
Object
new ReRollModifier([once], [comparePoint])
Create a ReRollModifier instance.
| Param | Type | Default | Description |
|---|---|---|---|
| [once] | boolean | false | Whether to only re-roll once or not |
| [comparePoint] | ComparePoint | | The 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
| Param | Type |
|---|---|
| value | boolean |
reRollModifier.defaultComparePoint(_context) ⇒ array
The default compare point definition
Kind: instance method of ReRollModifier
| Param | Type | Description |
|---|---|---|
| _context | StandardDice | RollGroup | The 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
| Param | Type | Description |
|---|---|---|
| results | RollResults | The results to run the modifier against |
| _context | StandardDice | RollGroup | The 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