Repository metrics
- Stars
- (279 stars)
- PR merge metrics
- (PR metrics pending)
Description
Feature request Provide the ability to treat roll results as dice count or number of dice sides. A similar feature is implemented in Roll20: https://wiki.roll20.net/Dice_Reference#Inline_Dice_Rolls
Current behaviour
Input 4d(1d6) produces Invalid notation; Expected "%", "*", "**", "+", "-", "/", "^", [.], or [0-9] but "d" found. error.
Input (1d6)d6 produces Invalid notation; Expected "%", "*", "**", "+", "-", "/", "^", or end of input but "d" found. error.
etc.
Inputs such as 1d4*((3d10)*(4d6/2)) produce desired results.
Desired behaviour I would like to treat dice roll results in a way similar to equations, so they would be computed and used in notation as literal numbers. Examples:
(1d6)d6would be the same as rolling a d6, then using the result as number of d6 to roll on the next step. E.g. inline roll of1d6results in 4, then the overall result would be equal to rolling4d6. If a 2 is rolled on1d6, then overall result will be determined on roll of2d6. And so on(10d6>3)d6would be the same as rolling a 10d6, then roll d6 equal to the amount of successes (> 3) in the first roll3d(1d6)would be the same as rolling a d6, and then roll3d1,3d2,3d3,3d4,3d5or3d6, depending on result of first roll- Example output format:
((((4d3)d6>=4)d6>=3)d6<5)d6: ( ( ( ( ([1, 1, 2, 1] = 5) -> [3, 4*, 4*, 1, 6*] = 3) -> [4*, 1, 3*] = 2 ) -> [2*, 3*] = 2 ) -> [5, 6] = 11or a multi-lined, step-by-step format:
(((4d6>=4)d6>=3)d6<5)d6:
4d3: [1, 1, 2, 1] = 5
5d6>=4: [3, 4*, 4*, 1, 6*] = 3
3d6>=3: [4*, 1, 3*] = 2
2d6<5: [2*, 3*] = 2
2d6: [5, 6] = 11
Benefits
I play Warhammer 40,000. A common case of dice roll for Warhammer players (and probably in other wargames too) is to roll attacks in several steps ("To Hit" -> "To Wound" -> "Attempt saves against attacks" -> "Calculate damage" -> "Atttempt to ignore damage", etc.), using number of successes sum of rolled dice as dice pool for new rolls. A description of the rules can be found here.
Obviously, just saving simple dice rolls such as 24d6 does not help much, as number of dice rolled on each step is randomized. Saving the whole chain, like (((24d6>=4)d6>=3)d6<3, or at least typing it in a single roll instead of rolling each step separately, is something I have been looking for in a dice rolling app for a long time.
Concerns
- May be difficult to incorporate into current notation grammar
- Hard to come up with intuitive output format
- Some sort of parenthesis will probably have to be required in order to avoid ambiguity of notation