Basic support for the d20 test
Summary
Types
Many rules rely on a simple d20 test that compares a d20 roll total against a target number. These rules need the actual value as well as the unmodified (natural) roll. The D20 type exposes that functionality to other rules.
Functions
Performs the d20 test against a completed die roll
Types
@type t() :: %Srd.Rules.D20{ margin: integer(), natural: 1..20, success?: boolean(), target: integer(), total: integer() }
Many rules rely on a simple d20 test that compares a d20 roll total against a target number. These rules need the actual value as well as the unmodified (natural) roll. The D20 type exposes that functionality to other rules.
Attack, save, and ability check are all rulesets that rely on the d20 test.
Functions
@spec test(Srd.Dice.Roll.t(), integer()) :: t()
Performs the d20 test against a completed die roll