Commit 2dfb1fb
Refactor dice face handling with centralized face type definitions, tests, and added light/dark side support (#15)
* refactor(dice): use centralized dice face mappings for result calculations
- Introduced diceFaces.ts to centralize die face symbol mappings.
- Updated dice.ts to replace switch-case with lookups from diceFaces constants.
- Added new types for die face values in types.ts.
- Exported dice face constants and types from index.ts.
- Updated tests to reflect new dice face mappings and fixed inconsistencies.
This refactor improves maintainability and consistency by consolidating die face data.
Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
* feat!: add automatic light/dark side points to dice pools
- Added automaticLightSide and automaticDarkSide to DicePool type
- Updated sumResults function to handle automatic force points
- Updated CLI to parse +ls/lightside and +ds/darkside modifiers
- Added comprehensive tests for automatic force points
BREAKING CHANGE: Dice face mappings have been corrected to match official SWRPG specifications. Boost die faces 3-6 and Force die face distributions have been fixed. This changes the probability distributions for these dice.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: correct boost die face mappings to match official specification
- Face 3: Changed from (A)(A) to (S)
- Face 4: Changed from (A) to (S)(A)
- Face 5: Remains (S)(A) - already correct
- Face 6: Changed from (S) to (A)
Updated all corresponding tests to match corrected face mappings.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent bf7609d commit 2dfb1fb
File tree
10 files changed
+490
-484
lines changed- src
- tests
10 files changed
+490
-484
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| |||
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
99 | 111 | | |
100 | 112 | | |
101 | 113 | | |
| |||
0 commit comments