diff --git a/src/module/rolls/check.ts b/src/module/rolls/check.ts index a3c3b1e9..e8c518c9 100644 --- a/src/module/rolls/check.ts +++ b/src/module/rolls/check.ts @@ -75,6 +75,15 @@ export class DS4Check extends DiceTerm { return super.total; } + /** + * @override + */ + evaluate({ minimize = false, maximize = false } = {}): this { + super.evaluate({ minimize, maximize }); + this.evaluateResults(); + return this; + } + /** * @override */ @@ -95,12 +104,23 @@ export class DS4Check extends DiceTerm { this.fumble = results[0].failure ?? false; } + /** + * @override + */ + static fromResults(options: Partial, results: DiceTerm.Result[]): DS4Check { + const term = new this(options); + term.results = results; + term.evaluateResults(); + term._evaluated = true; + return term; + } + static readonly DEFAULT_CHECK_TARGET_NUMBER = 10; static readonly DEFAULT_MAXIMUM_COUP_RESULT = 1; static readonly DEFAULT_MINIMUM_FUMBLE_RESULT = 20; static DENOMINATION = "s"; static MODIFIERS = { - c: (): void => undefined, // Modifier is consumed in constructor for crit - v: "evaluateResults", + c: (): void => undefined, // Modifier is consumed in constructor for maximumCoupResult / minimumFumbleResult + v: (): void => undefined, // Modifier is consumed in constructor for checkTargetNumber }; }