Avoid min and max rolls being highlighted incorrectly

This commit is contained in:
Johannes Loher 2021-07-01 02:09:34 +02:00
parent 7a37f46017
commit 2161a8e92a

View file

@ -107,6 +107,16 @@ export class DS4Check extends DiceTerm {
this.fumble = results[0].failure ?? false; this.fumble = results[0].failure ?? false;
} }
/**
* @override
* @remarks "min" and "max" are filtered out because they are irrelevant for
* {@link DS4Check}s and only result in some dice rolls being highlighted
* incorrectly.
*/
getResultCSS(result: DiceTerm.Result): (string | null)[] {
return super.getResultCSS(result).filter((cssClass) => cssClass !== "min" && cssClass !== "max");
}
static readonly DEFAULT_CHECK_TARGET_NUMBER = 10; static readonly DEFAULT_CHECK_TARGET_NUMBER = 10;
static readonly DEFAULT_MAXIMUM_COUP_RESULT = 1; static readonly DEFAULT_MAXIMUM_COUP_RESULT = 1;
static readonly DEFAULT_MINIMUM_FUMBLE_RESULT = 20; static readonly DEFAULT_MINIMUM_FUMBLE_RESULT = 20;