Merge lp://staging/~andrenasturas/synapse-project/rolldice-plugin into lp://staging/synapse-project
Status: | Needs review |
---|---|
Proposed branch: | lp://staging/~andrenasturas/synapse-project/rolldice-plugin |
Merge into: | lp://staging/synapse-project |
Diff against target: |
192 lines (+166/-0) 3 files modified
src/plugins/Makefile.am (+1/-0) src/plugins/rolldice-plugin.vala (+164/-0) src/ui/synapse-main.vala (+1/-0) |
To merge this branch: | bzr merge lp://staging/~andrenasturas/synapse-project/rolldice-plugin |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Synapse core team | Pending | ||
Review via email: mp+334442@code.staging.launchpad.net |
Description of the change
Plugin for Rolldice.
Adds a plugin for the command-line program rolldice, allowing the user to throw dices and see results in synapse as easily as the calculator plugin.
User only have to type a command in rolldice syntax like "6d10+5" and the result will be printed.
Supports multiple dices rolls by returning as many results as rolls requested by the user.
Should be answering any string supported by rolldice :
Pseudo regex : [Ax]?[B]
All parts between brackets are optional.
The command can be interpreted as : "Roll B C-sized dices, drop the lowest F, multiply the result by D and add or subtract E, and do it A times independently".
A, B, C, D, E and F are all numbers.
C can also be "%", which is here a shortcut for "100-sized dice".
C cannot be 0 or 1, as these are not supported as number of faces by rolldice, and lead to unexpected results (rolldice use a default 6-sized dice instead).
Usage example :
"d6" : return a random number between 1 and 6.
"3xd4" : return three results, each being a random number between 1 and 4.
"6d10s4" : return a random number between 2 and 20 with a non-normal distribution, as it will roll 6 dices and keep only the two highest scores (dropping the 4 lowest) before summing.
"d5*2" : return a random even number between 2 and 10.
"d6+6" : return a random number between 7 and 12.
Andre, this project isnt really active right now (from what I can tell). For this reason I have a fork on github that has a few improvements https:/ /github. com/MichaelAqui lina/synapse- project. Could I suggest you also open a PR there so that we get something released?