javalent / dice-roller

Inline dice rolling for Obsidian.md
265 stars 27 forks source link

🐞 Inline dice rolls using keep/drop formatting returns sum that includes all dice #305

Open morgan-gilbert opened 4 months ago

morgan-gilbert commented 4 months ago

Check for existing bug reports before submitting.

Expected Behavior

I'm using a formula similar to this; dice-mod:3d6dl1 +1. I expect the output to return a sum of the two highest dice +1.

Current behaviour

Currently, all dice are summed by the formula. That is, summing 3d6dl1 +1 will return a sum that includes all three dice.

Reproduction

Behavior should be reproducible using dice-mod:3d6dl2 + 1 or similar code.
image

Which Operating Systems are you using?

Obsidian Version Check

1.28.7

Plugin Version

3.6.3

Confirmation

Possible solution

I'm not a coder, just an appreciator of this very versatile and useful mod.

AustinYQM commented 3 months ago

I can't recreate this locally. Here are some of my tests and results:

3d6dl2 + 1 -> [3d, 6, 4d] + 1 -> 7

2d6dl1 + 1 -> [4, 4d] + 1 -> 5

10d6dl2 + 1 -> [2, 2, 2, 4, 2, 2, 2d, 6, 5, 2d] + 1 -> 26