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.
modifier.order : number
The default modifier execution order.
Kind: instance property of Modifier
modifier.name ⇒ string
The name of the modifier.
Kind: instance property of Modifier
Returns: string - 'modifier'
modifier.notation ⇒ string
The modifier's notation.
Kind: instance property of Modifier
modifier.maxIterations ⇒ number
The maximum number of iterations that the modifier can apply to a single die roll
Kind: instance property of Modifier
Returns: number - 1000
modifier.defaults(_context) ⇒ object
No default values present
Kind: instance method of Modifier
| Param | Type | Description |
|---|---|---|
| _context | StandardDice | RollGroup | The object that the modifier is attached to |
modifier.useDefaultsIfNeeded(_context) ⇒ void
Processing default values definitions
Kind: instance method of Modifier
| Param | Type | Description |
|---|---|---|
| _context | StandardDice | RollGroup | The object that the modifier is attached to |
modifier.run(results, _context) ⇒ RollResults
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 |
modifier.toJSON() ⇒ Object
Return an object for JSON serialising.
This is called automatically when JSON encoding the object.
Kind: instance method of Modifier
modifier.toString() ⇒ string
Return the String representation of the object.
This is called automatically when casting the object to a string.