DiceMaiden icon indicating copy to clipboard operation
DiceMaiden copied to clipboard

Explosions and keeping don't mix

Open luciansmith opened this issue 4 years ago • 1 comments

Describe the bug If you roll exploding dice and only keep some, the bot keeps the top n in the entire pool of original+exploded, instead of treating original max+explosion as 'one value' to keep.

To Reproduce Steps to reproduce the behavior:

[11:03 AM] Lucian: !r 10d2e2k3 [11:03 AM] BOT Dice Maiden: Lucian Roll: [2, 2, 2, 2, 2, 1, 1, 1, 1, 1], [2, 2, 2, 1, 1] Result: 6

or:

11:13 AM] Lucian: !r 10d2ie2k3 [11:13 AM] BOT Dice Maiden: Lucian Roll: [2, 2, 2, 2, 2, 2, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1], [1] Result: 6

Expected behavior [11:03 AM] Lucian: !r 10d2e2k3 [11:03 AM] BOT Dice Maiden: Lucian Roll: [2, 2, 2, 2, 2, 1, 1, 1, 1, 1], [2, 2, 2, 1, 1] Result: 12 i.e. 4 + 4 + 4

11:13 AM] Lucian: !r 10d2ie2k3 [11:13 AM] BOT Dice Maiden: Lucian Roll: [2, 2, 2, 2, 2, 2, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1], [1] Result: 11 i.e. 5 + 3 + 3

luciansmith avatar Jul 06 '21 18:07 luciansmith

I don't know the underlying code, but I would imagine that the 'k' system could keep the first n values of all vectors instead of the first n values of the concatenated vector?

luciansmith avatar Jul 06 '21 18:07 luciansmith

Hey so this is working as expected. Below is the description for the explosion mechanic:

"Roll three six-sided dice and explode on sixes. Some game systems call this 'open ended' dice. If the number rolled is greater than or equal to the value given for this option, the die is rolled again and added to the total. If no number is given for this option, it is assumed to be the same as the number of sides on the die. Thus, '3d6 e' is the same as '3d6 e6'. The dice will only explode once with this command. Use "ie" for indefinite explosions."

The way its going to work is we read the whole pool of dice, combining the tally and the explosion tally. From there we keep dice from the total pool

Humblemonk avatar Jun 25 '24 23:06 Humblemonk

By 'working as expected' do you mean that you fixed the bug, or that you believe there is no problem? We did just re-add 'Dice Maiden' to a discord server and see the same behavior, but maybe the fix hasn't been pushed yet.

Thanks again for all your work on this!

luciansmith avatar Jul 01 '24 22:07 luciansmith