D&D 5e d20 checks with bucket
At the table
A D&D attack or save is not just “did the total beat the DC?” Natural 1 and natural 20 are special on the d20 you keep. Advantage and disadvantage change which natural faces are likely before you add your modifier.
Lesson 11 buckets a raw d20 face into four fixed ranges. That teaches ordered labels, but it is not the same as a DC check with a modifier. Here we stay on the natural die (1d20, 2d20kh1, …) and put the modifier into the target number instead of into the roll.
Adjusted target (stay on 1..20)
Table rule: success when natural + MOD >= DC. For integer faces that is the same as:
T = DC - MOD
advantage_check · Outcomes
| outcome | % | frac | X/400 |
|---|---|---|---|
| CRITICAL_FAIL | 0.25 | 1/400 | 1 |
| FAIL | 20.0 | 1/5 | 80 |
| SUCCESS | 70.0 | 7/10 | 280 |
| CRITICAL_SUCCESS | 9.75 | 39/400 | 39 |
p_hit_or_better · Prob
| outcome | % | frac | X/400 |
|---|---|---|---|
| p_hit_or_better | 79.8 | 319/400 | 319 |
check_scalebuilds the four-band scale fromT = DC - MOD; call it wherever you need a check (1d20.bucket(check_scale(12, 4)), loops over DCs, and so on).at_most/at_leastaccept expressions; use them whenTcomes fromDCandMOD(range sugar..(T - 1)only works with numeric literals in source).2d20kh1is advantage. Use1d20for a normal roll or2d20kl1for disadvantage.- Without
early=Trueon crit bands, overlapping open ranges would mis-label nat 1 or nat 20—see lesson 11.
Reading the result
You get a four-row probability breakdown (one row per outcome label) plus p_at_least("SUCCESS"), which includes both ordinary successes and critical successes.
Try this
- Change
DCandMOD(or add aforloop) and callcheck_scale(DC, MOD)for each combination. - Swap
2d20kh1for1d20and compare probabilities. - Compare with lesson 11’s fixed bands on
1d20—notice how crit + DC logic differs.
Builtin details: standard library reference (scale, Scale.step, bucket, at_most, at_least, keep_highest, keep_lowest). Use classify when house rules do not fit four face bands.
What’s next
Powered by the Apocalypse (2d6 + stat)—miss / partial / full on the total with bucket, the usual PbtA pattern.
See the user guide index.