Ger wrote: ↑Mon Nov 06, 2017 2:59 pm
...so I extracted these basic requirements:
- Be able to put some BBcode specifying the number of dice and how many sides each dice has
- Showing and protecting the result
- Allow only dice rolls belonging to the post, unless you're quoting someone else
- Prevent edits and such
Yep, that's about it for a basic implementation.
It needs to allow for things like:
[ROLL]2d4+5[/ROLL]
[ROLL=Morck Cures Dregs]2d8+3[/ROLL]
If a bit more advanced, it would allow a special Dice (which is like 90% of rolls in a PbP) and a more complex parsing:
1d20+4;1d6+4+2d6
Used like this (an attack action also requires a damage result in case the attack succeeds):
[ROLLATK=Aragorn Sneak Attack on Orc #1]1d20+4;1d6+4+2d6[/ROLLATK]
With a result of:
Aragorn Sneak Attack on Orc #1
.....Attack: 14+4 → 18
.....Damage: 3+4+6 → 13
(I used dots because I can't use white-spaces or a tab in a forum post - but "...." is a tab!)
You can (obviously) use the
Standard Dice notation for the rolls - there might even be existing libraries that provide functions for that - like on GitHub
In any case, if you wish to go forward, I can help out in testing or other questions you might have (dice related!)
THANKS!!
RiTz21
P.S.
[ROLL]
would be a much better tag than DICE! (and not break my old forum which has lots of outdated [DICE] all over the place... )