Skip to main content
3 of 4
added 10 characters in body
doppelgreener
  • 36.6k
  • 16
  • 162
  • 255

How can have the highest result in a dice pool be rerolled if the lowest die is a 1

This is an odd request, but I am having trouble figuring out what I am asking in title. Let me explain.

The system uses a dice pool of d4s (don't judge me) of up to 3 dice (3d4 is the maximum number of dice you can roll).

If at least a 4 comes up in the pool, thats a success, if the highest number is a 3, its a partial success. If the highest is lower than 3 it's a failure.

Output [count {3..4} in 3d4]

I was able to calculate that with ease, but here's the part I am stuck with:

If you get any number of 1s in your pool, the highest die is rerolled if it's a 3 or a 4. The second result is kept.

Example 1: You roll 2d4 and get 4, 1. Since you got a 1, you reroll the 4 and keep the second result. We get a 3, which means the result is a partial success instead of a success.

Example 2: You roll 3d4 and get 3, 1, 1. Since there's a 1, you reroll the 3 and get 4. Lucky you, you got a success instead of a partial.

How can I code this to accuretly calculate a player's chance of success, partial success or failure?