Modifier
Modifier
Abstract class
This is an abstract class and should not be used directly. You should use one of the extended classes, or extend the class yourself.
A Modifier
is the base modifier class that all others extend from.
Kind: global abstract class
- Modifier
- new Modifier()
- .order :
number
- .name ⇒
string
- .notation ⇒
string
- .maxIterations ⇒
number
- .defaults(_context) ⇒
object
- .useDefaultsIfNeeded(_context) ⇒
void
- .run(results, _context) ⇒
RollResults
- .toJSON() ⇒
Object
- .toString() ⇒
string
new Modifier()
Create a Modifier
instance.
number
modifier.order : The default modifier execution order.
Kind: instance property of Modifier
string
modifier.name ⇒ The name of the modifier.
Kind: instance property of Modifier
Returns: string
- 'modifier'
string
modifier.notation ⇒ The modifier's notation.
Kind: instance property of Modifier
number
modifier.maxIterations ⇒ The maximum number of iterations that the modifier can apply to a single die roll
Kind: instance property of Modifier
Returns: number
- 1000
object
modifier.defaults(_context) ⇒ No default values present
Kind: instance method of Modifier
Param | Type | Description |
---|---|---|
_context | StandardDice | RollGroup | The object that the modifier is attached to |
void
modifier.useDefaultsIfNeeded(_context) ⇒ Processing default values definitions
Kind: instance method of Modifier
Param | Type | Description |
---|---|---|
_context | StandardDice | RollGroup | The object that the modifier is attached to |
RollResults
modifier.run(results, _context) ⇒ Run the modifier on the results.
Kind: instance method of Modifier
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
modifier.toJSON() ⇒ Return an object for JSON serialising.
This is called automatically when JSON encoding the object.
Kind: instance method of Modifier
string
modifier.toString() ⇒ Return the String representation of the object.
This is called automatically when casting the object to a string.