Skip to content

feat: report reroll, explosion and drop counts for a roll - #14

Merged
darkliquid merged 7 commits into
masterfrom
feat/roll-event-counts
Oct 6, 2026
Merged

darkliquid merged 7 commits into
masterfrom
feat/roll-event-counts

Conversation

@darkliquid

Copy link
Copy Markdown
Owner

Summary

  • The roll Result now reports how many dice were rerolled, added by explosions, or dropped by keep/drop limits. Counters aggregate across the whole expression (including nested groups) and exclude events from dynamic die face calculations.
  • Explosions count every contributing explosion (each extra !/!p die and each explosion feeding a !! compound); a penetrating die elided at zero contributes nothing and is not counted.
  • The website shows a stats line only when the expression contains the relevant modifier, displaying 0 when a present modifier did not fire (e.g. 4d6! with no sixes).

Adds counts_test.go, engine coverage, updates the design spec/plan, and rebuilds the wasm bundle.

Fixes #10

💘 Generated with Crush

Capture the design for exposing how many dice were rerolled, added by
explosions, or dropped by keep/drop limits (issue #10). Rerolls count
every reroll, compounded explosions count each feeding explosion, and a
penetrating die elided at zero is not counted. Includes how the counters
aggregate and how the website should surface them.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
The result now records how many rerolls a roll performed, so callers can
tell how much work the expression did beyond the surviving dice.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
The result now records how many explosions contributed a die: each extra
exploding or penetrating die, and each explosion feeding a compound. A
penetrating die elided at zero contributes nothing and is not counted.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
Keep/drop limits now record how many dice they removed, for both dice
terms and groups.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
Binary combinations and groups now add up the reroll, explosion and drop
counts of their operands, so the top-level result reflects the whole
expression including nested groups.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
Locks in that events from a dynamic die's side expression (rerolls,
explosions, drops) do not appear in the outer result's counts.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
The wasm response now carries the roll counts and flags for whether the
expression contains each modifier, and the result card shows a stats
line only when a modifier is present. A modifier that is present but
did not fire is shown as zero.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
@darkliquid
darkliquid merged commit e515e24 into master Oct 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The results struct doesn't allow seeing how many explosions occurred or how many dice were dropped from the results set

1 participant