Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New dice expressions to reroll exactly once, and either keep the new value or choose the higher #27

Closed
selquest opened this issue Apr 22, 2020 · 5 comments
Assignees

Comments

@selquest
Copy link
Contributor

Is your feature request related to a problem? Please describe.
D&D 5th edition (and likely other systems) has a number of features that allow for dice below a certain threshold to be rerolled once, and either the new value must be kept or a choice is allowed to take the higher. The existing 2d6r3 syntax doesn't work here, as dice are rerolled repeatedly until all results are at least the threshold.

Describe the solution you'd like

  • A new expression syntax like 2d6rk3 to reroll dice exactly once, and force the use of the new value.
  • A new expression syntax like 2d6rc3 to reroll dice exactly once, and choose the higher result

Describe alternatives you've considered
This is currently achievable through macros checking the values in getNewRolls(), but would be much easier to manipulate in framework implementations as a dice expression.

@Phergus Phergus transferred this issue from RPTools/maptool Apr 22, 2020
selquest added a commit to selquest/rptools-dicelib that referenced this issue Apr 25, 2020
@Phergus
Copy link
Contributor

Phergus commented Apr 26, 2020

Appears to be a bug when more than one die is less than keep value.
[2d5rk3] returned 5 though [getNewRolls()] showed [1,2,1,3]. Result should be 4 as both of th second rolls should be used.

Also saw return of 7 with getNewRolls() of [2,2,1,5]. Result should be 6.

For [2d6rc3], it appears to be rerolling the rerolls
Result of 9 with getNewRolls() of [2,6,2,3]

Also saw result of 8 with getNewRolls() of [2,2,6]. Should have been two rerolls.

@selquest
Copy link
Contributor Author

selquest commented Apr 26, 2020

Ahh ok, actually in your examples here I think it's working as intended - since it's rolling each die at a time (and re-rolling if necessary), [1, 2, 1, 3] is showing that the 1 was re-rolled (and became a 2), and then the "second die" was originally a 1, re-rolled to become a 3. Total is 5.

I'll still take a look to confirm, but that's the sequence I'd expect.

@selquest
Copy link
Contributor Author

@Phergus confirmed working as expected. The confusion here is that it re-rolls each die immediately in sequence - the same way the repeating reroll() function does.

@Phergus
Copy link
Contributor

Phergus commented Apr 26, 2020

That's it. Didn't realize it was doing the rerolls immediately.

Tested. Rolls performing as expected.

@Phergus Phergus closed this as completed Apr 26, 2020
@selquest
Copy link
Contributor Author

Updated wiki page for Dice Expressions, added page for rerollOnce() function

cwisniew pushed a commit to cwisniew/maptool that referenced this issue Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants