The original provided terms to the Dice Pool
The string modifiers applied to resolve the pool
Each component term of the dice pool as a Roll instance.
The array of dice pool results which have been rolled
An object of additional options which describes and modifies the term.
Internal
_rootA reference to the Roll at the root of the evaluation tree.
Is this term intermediate, and should be evaluated first as part of the simplification process?
Static
MODIFIERSDefine the modifiers that can be used for this particular DiceTerm type.
Static
OPEN_The regular expression pattern used to identify the opening of a dice pool expression.
Static
CLOSE_A regular expression pattern used to identify the closing of a dice pool expression.
Static
REGEXPA regular expression pattern used to match the entirety of a DicePool expression.
Static
SERIALIZE_An array of additional attributes which should be retained when the term is serialized
Static
FLAVOR_A regular expression pattern which identifies optional term-level flavor text
Static
FLAVOR_A regular expression which identifies term-level flavor text
A string representation of the formula expression for this RollTerm, prior to evaluation.
A string or numeric representation of the final output for this term, after evaluation.
Return an array of rolled values which are still active within the PoolTerm
Whether this term is entirely deterministic or contains some randomness.
A string representation of the formula, including optional flavor text.
Optional flavor text which modifies and describes this term.
A reference to the RollResolver app being used to externally resolve this term.
Count the number of successful results which occurred in the pool. Successes are counted relative to some target, or relative to the maximum possible value if no target is given. Applying a count-success modifier to the results re-casts all results to 1 (success) or 0 (failure)
20d20cs Count the number of dice which rolled a 20 20d20cs>10 Count the number of dice which rolled higher than 10 20d20cs<10 Count the number of dice which rolled less than 10
The matched modifier query
Count the number of failed results which occurred in a given result set. Failures are counted relative to some target, or relative to the lowest possible value if no target is given. Applying a count-failures modifier to the results re-casts all results to 1 (failure) or 0 (non-failure)
6d6cf Count the number of dice which rolled a 1 as failures 6d6cf<=3 Count the number of dice which rolled less than 3 as failures 6d6cf>4 Count the number of dice which rolled greater than 4 as failures
The matched modifier query
Evaluate the term, processing its inputs and finalizing its total.
Optional
options: { Options which modify how the RollTerm is evaluated
Minimize the result, obtaining the smallest possible value.
Maximize the result, obtaining the largest possible value.
If true, string terms will not throw an error when evaluated.
Returns a Promise if the term is non-deterministic.
Protected
_evaluateProtected
_evaluateStatic
_fromStatic
fromGiven a string formula, create and return an evaluated PoolTerm object
The string formula to parse
Optional
options: object = {}Additional options applied to the PoolTerm
The evaluated PoolTerm object or null if the formula is invalid
Static
fromStatic
fromStatic
isDetermine if evaluating a given RollTerm with certain evaluation options can be done so deterministically.
The term.
Optional
options: { Options for evaluating the term.
Force the result to be maximized.
Force the result to be minimized.
Static
fromStatic
fromJSON
A type of RollTerm which encloses a pool of multiple inner Rolls which are evaluated jointly.
A dice pool represents a set of Roll expressions which are collectively modified to compute an effective total across all Rolls in the pool. The final total for the pool is defined as the sum over kept rolls, relative to any success count or margin.
Example: Keep the highest of the 3 roll expressions