ReRollModifier
ComparisonModifier
ReRollModifier ⇐ 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 |
number
reRollModifier.order : The default modifier execution order.
Kind: instance property of ReRollModifier
string
reRollModifier.name ⇒ The name of the modifier.
Kind: instance property of ReRollModifier
Returns: string
- 're-roll'
string
reRollModifier.notation ⇒ The modifier's notation.
Kind: instance property of ReRollModifier
boolean
reRollModifier.once ⇒ 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 |
array
reRollModifier.defaultComparePoint(_context) ⇒ The default compare point definition
Kind: instance method of ReRollModifier
Param | Type | Description |
---|---|---|
_context | StandardDice | RollGroup | The object that the modifier is attached to |
RollResults
reRollModifier.run(results, _context) ⇒ 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 |
Object
reRollModifier.toJSON() ⇒ Return an object for JSON serialising.
This is called automatically when JSON encoding the object.
Kind: instance method of ReRollModifier