The default mechanic - a proficiency plus a die roll, compared against a target number -
is deliberately the simplest one that exists, because it is a shape every game recognises
and every game also wants to replace with its own dice. Pass roll to use anything else;
the default draws from mwg/core's seeded RNG, so a check replays the same way from a
save file.
Parameters
value: number
difficulty: number
roll: ()=>number = ...
Returns boolean
true if the check succeeds
Example
import { skillCheck } from'@datamoc/mwg/actors';
constsuccess = skillCheck(5, 15); // proficiency 5, difficulty 15, default d20 roll constwithCustomDice = skillCheck(5, 15, () =>12); // an injected, non-random roll
A skill checked against a difficulty.
The default mechanic - a proficiency plus a die roll, compared against a target number - is deliberately the simplest one that exists, because it is a shape every game recognises and every game also wants to replace with its own dice. Pass
rollto use anything else; the default draws frommwg/core's seeded RNG, so a check replays the same way from a save file.