Fixes: adv/dis as a global toggle, auto-number duplicate combatants

- Advantage/Disadvantage are now toggle modes (rollStore.mode) applied to d20
  rolls everywhere (dice page, sheet skills/saves/attacks), preserving modifiers;
  applyRollMode() rewrites the first d20 -> 2d20kh1/kl1
- addCombatant auto-numbers duplicate names (Goblin 1, Goblin 2, …); the first
  duplicate also renames the original. Quantity add relies on this.
- Tests for applyRollMode + duplicate numbering

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 01:50:02 +02:00
parent ed3d967526
commit d5977e4c63
8 changed files with 135 additions and 18 deletions
+1 -1
View File
@@ -202,7 +202,7 @@ function AddCombatantBar({
for (let i = 0; i < n; i++) {
onAdd({
id: newId(),
name: n > 1 ? `${name.trim()} ${i + 1}` : name.trim(),
name: name.trim(), // engine auto-numbers duplicates
kind: 'monster',
initiative: init,
initBonus: 0,