An abstract class which represents a single token that can be used as part of a Roll formula. Every portion of a Roll formula is parsed into a subclass of RollTerm in order for the Roll to be fully evaluated.
An object of additional options which describes and modifies the term.
An internal flag for whether the term has been evaluated
Is this term intermediate, and should be evaluated first as part of the simplification process?
A regular expression pattern which identifies optional term-level flavor text
A regular expression which identifies term-level flavor text
A regular expression used to match a term of this type
An array of additional attributes which should be retained when the term is serialized
A string representation of the formula expression for this RollTerm, prior to evaluation.
A string representation of the formula, including optional flavor text.
A string or numeric representation of the final output for this term, after evaluation.
Optional flavor text which modifies and describes this term.
Whether this term is entirely deterministic or contains some randomness.
Evaluate the term, processing its inputs and finalizing its total.
Options which modify how the RollTerm is evaluated
The evaluated RollTerm
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.
Evaluate the term.
Options which modify how the RollTerm is evaluated, see RollTerm#evaluate
This method is temporarily factored out in order to provide different behaviors synchronous evaluation. This will be removed in 0.10.x
Construct a RollTerm from a provided data object
Provided data from an un-serialized term
The constructed RollTerm
Reconstruct a RollTerm instance from a provided JSON string
A serialized JSON representation of a DiceTerm
A reconstructed RollTerm from the provided JSON
Define term-specific logic for how a de-serialized data object is restored as a functional RollTerm
The de-serialized term data
The re-constructed RollTerm object