-
Notifications
You must be signed in to change notification settings - Fork 1
[E-PF2E-1] Core roll and degrees of success #966
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgame-packageA game-specific dice packageA game-specific dice packagephaseA phase within an epicA phase within an epic
Description
Part of #942
Phase 1: Core roll and degrees of success
Updated 2026-03-24: Game packages now use
.randsum.jsonspecs + codegen, not standalone TypeScript packages. See existing games inpackages/games/for the pattern.
Scope
Implement the PF2e core roll mechanic: 1d20 + modifier vs DC, with full degrees of success including the natural 1/20 shift rule.
Acceptance Criteria
-
pf2e.randsum.jsonspec inpackages/games/expressing 1d20 + modifier vs DC - Codegen produces
src/pf2e.generated.ts— accessible viaimport { roll } from '@randsum/games/pf2e' -
DegreeOfSuccessresult values:CRITICAL_SUCCESS,SUCCESS,FAILURE,CRITICAL_FAILURE - Degree calculation: beat DC by 10+ -> Critical Success; meet or beat -> Success; miss by 1-9 -> Failure; miss by 10+ -> Critical Failure
- Natural 20 shifts degree up one (clamped at Critical Success)
- Natural 1 shifts degree down one (clamped at Critical Failure)
- Edge cases: nat 20 on already-Critical-Success (no-op), nat 1 on Critical-Failure (no-op), nat 1 overriding a DC+10 beat (resolves to Success)
- Result includes human-readable description alongside degree value
- Spec validated against boundary test cases: exactly DC, DC+-9, DC+-10
Mechanics Reference
- Beat DC by 10+: Critical Success
- Meet or beat DC: Success
- Miss DC by 1-9: Failure
- Miss DC by 10+: Critical Failure
- Natural 20: shift result one step up
- Natural 1: shift result one step down
- Shifts are clamped
Out of Scope
- MAP (Phase 2, [E-PF2E-2] Multiple Attack Penalty (MAP) #967)
- Hero point reroll (Phase 3, [E-PF2E-3] Fortune/Misfortune and Hero Point reroll #968)
- Fortune/Misfortune (Phase 3, [E-PF2E-3] Fortune/Misfortune and Hero Point reroll #968)
- Incapacitation trait
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgame-packageA game-specific dice packageA game-specific dice packagephaseA phase within an epicA phase within an epic