You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fixed
Critical damage preserves dice modifiers — DiceEngine.roll_damage(expr, is_critical=True)
doubled die counts by rebuilding the expression as bare XdY, silently dropping per-group keep/drop/reroll/exploding flags. A crit on 1d6!+2 now stays exploding (2d6!+2)
instead of becoming a plain 2d6+2. As part of the fix, str(DiceGroup) now serialises
reroll-once as ro (was r), so the spec round-trips through parse_expression.
Species damage immunities mis-categorised — _build_species_traits tagged damage
immunities with category: "resistance" (condition immunities were already correct); they
are now category: "immunity".
Changed
compose() fails loudly on contradictory contributions — a target that receives both a union (set-valued) and an add/set (numeric) contribution now raises ValueError instead
of silently dropping the numeric ones.
Performance
Topological sort uses a binary heap (heapq) instead of re-sorting the ready-queue every
iteration — same deterministic order, O(V·log V + E) instead of O(V²·log V). (Result is
still cached per ruleset, so this only matters the first time a large graph is evaluated.)
Internal
cli._read_json closes the file it opens (was leaked); cli content lookup calls categories() once instead of twice.
assembler.assemble_inputs copies the ability-score dict once up front rather than on each
increase.