MaxModifier
MaxModifier ⇐ Modifier
A MaxModifier causes die rolls over a maximum value to be treated as the maximum value.
Kind: global class
Extends: Modifier
See: MinModifier for the opposite of this modifier
Since: 4.3.0
- MaxModifier ⇐
Modifier- new MaxModifier(max)
- .order :
number - .max ⇒
Number - .max
- .name ⇒
string - .notation ⇒
string - .run(results, _context) ⇒
RollResults - .toJSON() ⇒
Object
new MaxModifier(max)
Create a MaxModifier instance.
Throws:
TypeErrormax must be a number
| Param | Type | Description |
|---|---|---|
| max | number | The maximum value |
maxModifier.order : number
The default modifier execution order.
Kind: instance property of MaxModifier
maxModifier.max ⇒ Number
The maximum value.
Kind: instance property of MaxModifier
maxModifier.max
Set the maximum value.
Kind: instance property of MaxModifier
Throws:
TypeErrormax must be a number
| Param | Type |
|---|---|
| value | number |
maxModifier.name ⇒ string
The name of the modifier.
Kind: instance property of MaxModifier
Returns: string - 'max'
maxModifier.notation ⇒ string
The modifier's notation.
Kind: instance property of MaxModifier
maxModifier.run(results, _context) ⇒ RollResults
Run the modifier on the results.
Kind: instance method of MaxModifier
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 |
maxModifier.toJSON() ⇒ Object
Return an object for JSON serialising.
This is called automatically when JSON encoding the object.
Kind: instance method of MaxModifier