Open sirkerry opened 5 years ago
Could you give me an example with details on values and when reroll/add must be trigger. I don't know the Tunnels and Trolls system.
Sure, this occurs with 2d6 (aka DARO - Doubles And Roll Again) and 3d6 (aka TARO - Triples And Roll Again) rolls. So when rolling 2d6 if you roll the same number on both dice (i.e. doubles,) you would roll the 2d6 again and add to the original roll and keep doing so until doubles were not rolled. And when rolling 3d6 if you roll the same number on all 3 dice (i.e. triples) you would roll the 3d6 again and add to original roll and keep doing so until triples were not rolled again.
So if I understand well:
2d6
[2,5]
No double, we stop! Final result => 2+5 = 7 Right ?
2d6
[5,5]
2d6
[6,3]
No more double, we stop! Final result => 5+5+6+3 => 19
3d6
[2,5,6]
No triple, we stop! Final result => 2+5+6 = 13
3d6
[5,5,5]
3d6
[6,3,2]
No more triple, we stop! Final result => 5+5+5+6+3+2 => 26
The detection of double is only triggered when we roll 2d6. If there is a double when we roll 3d6 ([5,5,1]), Do we need to reroll or not ?
Because the condition is not double or triple, currently the condition is "While all dice have the same values then reroll and add"
Sorry for not being clearer. Your examples are all correct. And yes the double or triple condition is actually "While all dice have the same values then reroll and add". If there's a double in a roll of 3d6 it's ignored, it's has to be all dice values match to trigger the Add Roll Again.
I worked a bit on it. And there is two options:
Add a specific node which managed exactly this behaviour or make it more generic and improve current operators to managed this behaviour.
First solution will produce command lines like this:
3d6t > node of type T will do the job.
But T is node really specific to Tunnels and Trolls system and I did not design diceparser to get some specific game code.
The other way is to manage comparing method in every operator. Which make diceparser so much powerful. So we will be able to write:
3d6r[=] // meaning reroll when ALL are equals to ALL
First solution will be implemented quickly and when the second is ready, the first will be removed.
That sounds great, thanks!
commit d94207bc22768e579766b281c28f211d25d2d9d4 provide the t operator. I will test it a bit and then deploy it for the discord bot, in few days.
@obiwankennedy has any work been done on the comparison operator? I was looking to implement a system where matching doubles or triples get reported from a larger role (so for example something like 5d6[=*]kl1
to report the lowest set of doubles, if I understand your proposed syntax correctly)
A feature to consider: The game system Tunnels and Trolls has a thing similar to exploding dice, but slightly different. It's doubles and triples of the same value rolled get added and rolled over.
If possible, would be a nice feature to add.