Constructor
new FateDie()
Extends
Members
_evaluated :boolean
- Overrides:
An internal flag for whether the term has been evaluated
Type:
- boolean
DENOMINATION :string
- Overrides:
Define the denomination string used to register this DiceTerm type in CONFIG.Dice.terms
Type:
- string
faces :number
- Overrides:
The number of faces on the die
Type:
- number
flavor :string
- Overrides:
Optional flavor text which modifies and describes this term.
Type:
- string
FLAVOR_REGEXP :RegExp
- Overrides:
A regular expression which identifies term-level flavor text
Type:
FLAVOR_REGEXP_STRING :string
- Overrides:
A regular expression pattern which identifies optional term-level flavor text
Type:
- string
formula :string
- Overrides:
A string representation of the formula, including optional flavor text.
Type:
- string
isIntermediate :boolean
- Overrides:
Is this term intermediate, and should be evaluated first as part of the simplification process?
Type:
- boolean
MODIFIER_REGEXP :RegExp
- Overrides:
A regular expression used to separate individual modifiers
Type:
modifiers :Array.<string>
- Overrides:
An Array of dice term modifiers which are applied
Type:
- Array.<string>
MODIFIERS :Object
- Overrides:
Define the named modifiers that can be applied for this particular DiceTerm type.
Type:
- Object
MODIFIERS_REGEXP_STRING :string
- Overrides:
A regular expression pattern which captures the full set of term modifiers Anything until a space, group symbol, or arithmetic operator
Type:
- string
number :number
- Overrides:
The number of dice of this term to roll, before modifiers are applied
Type:
- number
options :object
- Overrides:
An object of additional options which describes and modifies the term.
Type:
- object
results :Array.<DiceTermResult>
- Overrides:
The array of dice term results which have been rolled
Type:
values :Array.<number>
- Overrides:
Return an array of rolled values which are still active within this term
Type:
- Array.<number>
Methods
alter(multiply, add) → {DiceTerm}
- Overrides:
Alter the DiceTerm by adding or multiplying the number of dice which are rolled
Parameters:
Name | Type | Description |
---|---|---|
multiply |
number | A factor to multiply. Dice are multiplied before any additions. |
add |
number | A number of dice to add. Dice are added after multiplication. |
Returns:
The altered term
- Type
- DiceTerm
evaluate(optionsopt) → {RollTerm}
- Overrides:
Evaluate the term, processing its inputs and finalizing its total.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
{}
|
Options which modify how the RollTerm is evaluated Properties
|
Returns:
The evaluated RollTerm
- Type
- RollTerm
getResultCSS(result) → {Array.<string>}
- Overrides:
Get the CSS classes that should be used to display each rolled result
Parameters:
Name | Type | Description |
---|---|---|
result |
DiceTermResult | The rolled result |
Returns:
The desired classes
- Type
- Array.<string>
getResultLabel(result) → {string}
- Overrides:
Return a string used as the label for each rolled result
Parameters:
Name | Type | Description |
---|---|---|
result |
DiceTermResult | The rolled result |
Returns:
The result label
- Type
- string
getTooltipData() → {object}
- Overrides:
Render the tooltip HTML for a Roll instance
Returns:
The data object used to render the default tooltip template for this DiceTerm
- Type
- object
roll(optionsopt) → {DiceTermResult}
- Overrides:
Roll the DiceTerm by mapping a random uniform draw against the faces of the dice term.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
{}
|
Options which modify how a random result is produced Properties
|
Returns:
The produced result
- Type
- DiceTermResult
toJSON() → {object}
- Overrides:
Serialize the RollTerm to a JSON string which allows it to be saved in the database or embedded in text. This method should return an object suitable for passing to the JSON.stringify function.
Returns:
- Type
- object