aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/HelpMe.md
blob: 150d5725e726823001e5c02b0f6905105deea65f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
[![Logo](http://www.rolisteam.org/sites/default/files/pixture_reloaded_logo.png)](http://www.rolisteam.org)
# Documentation:

## Build

```
git clone git@github.com:Rolisteam/DiceParser.git
cd DiceParser
mkdir build
cd build
cmake ../
make
make install
```

## Irc and Chat

Please, remember it is important to prefix all you command by `!`. This will allow the system to identify your command. To clarify the documentation, the `!` is not repeated before all commands.

## How to roll a die 

It is real simple. you have to call:
> 1d6

The first number is the count of dice you want to roll. The second number should be die's faces count.

### Examples
> 1d6

Roll one six-faced die.

> 1d10

Roll one ten-faced die.

> 5d10

Roll five ten-faced die.

> 777d6

Roll 777 six-faced die.


Thanks of several operations and options, you can tune a bit your rolling command.

## List of operator
* k : Keep
* K : Keep And Explose
* s : Sort
* c : Count
* r : Reroll
* e : Explose
* a : Reroll and add
* @ : Backward Jump
* p : Paint dice
* m : Merge
* i : if

### Keep

> kX

The option sorts the resulting die list and select the X higher dice.

### Keep And Explose

> KX

Dice explose if their value are at the die maximum, the option sorts the resulting die list, the it selects the X higher dice.

### Keep Lower dice

> klX

Dice explose if their value are at the die maximum, the option sorts the resulting die list, the it selects the X lowest dice.

### Sorting

> 3D10s

The dice list is sorted in descending order.

> 10d6sl

Roll 6 dice at 6 faces and then sort them ascendingly

### Counter

> 3D10c[Validator]

Count how many dice respect the condition and display the number (See Validator for more details about syntax)

### Reroll

> 3D10r[Validator]

Reroll the die if the previous value fits the validator (See Validator for more details about syntax).

### Explose

> 3D10e[Validator]

Explose while the value fits the Validator (See Validator for more details about syntax).

### Add

> 3D10a[Validator]

Reroll the die if its value fits the Validator and add the new value to the previous one. It does that only once.

### Roll dice in Range

> 4d[-1-1]

Rolling 4 dice with value between -1 to 1. (Fudge/Fate system)

> 3d[0-9]

Rolling 3 dice with 10 faces starting at 0.

> 3d[-20--9]

Rolling 3 dice, values ars between -20 and -9.

### Backward Jump

This operator is dedicated to apply its next operator to the second to last result.
For example: 

> 8D10c[>=7]+@c[=10]

c[=10] in this command is counting the number of 10 in the result of 8D10, if you remove the @, it will try to count the number of 10 in the result of c[>=7]. The result of c[>=7] is a scalar number (1 or 2 ... (max value 8)); it is not dice list.

### Painter

> 8D10p[1:blue]

Paint the first die in the list in blue

> 8d10p[2:blue] 

Paint the two first dice in the list in blue.

https://gist.github.com/obiwankennedy/62101383d411e55d205e44df78aa5299


The amount of color is depending of client application of DiceParser.
With Rolisteam, you may set any Qt color's name or set the Hexcode of your color: #ff28AC.
The cli application supports few colors.

# Merge

Merge operator is used for gathering several dice rolls from different die type into one dice result and then you may apply any kind of operator.

> 1d6;1d8mk1

This command merges together the result from the d6 and the d8. Then, it applied the k operator on both result to keep the best.

# if

If operator means to allow you to do one thing if some conditions are true.
The if operator has 2 mandatory parameters:
* The condition (see validator)
* the instruction to do when it is true.

There is also 2 optional parameters
* the compare method
* the instruction to do when it is false.

> i*[]{}{}

* \* : the compare method
* [] : the validator
* {} : the true instruction
* {} : the false instruction

## Compare method

There are 3 different methods.
* **On Each** : the condition is tested on each die from the previous part of the command. \[Default method\]
* **All Of Them** : All dice must fit the condition to trigger the true instruction. If all dice do not fit the condition the false instruction is run.
* **One Of Them** : at least one die must fit the condition to trigger the true instruction. If no dices fit the condition the false instruction is run.
* **On Scalar** : the condition is evaluated on the scalar result of the dice roll.

To switch the operator to act in **All Of Them** method you must add **\*** character as compare method position.
To switch the operator to act in **One Of Them** method you must add **.** character as compare method position.
To switch the operator to act in **On Scalar** method you must add **:** character as compare method position.


## example:

>  1d6i[<4]{3}

If the value of the die is less than 4, the die value is 3. (So 1, 2 , 3 become 3).

>  4d6e6i[=4]{-4}

If die has 4 as value, it remove it. \[Kuro System\]

> 4d6i.[=6]{+1d6}

if at least one die is equal to 6, then roll another d6 and add it to the result.

> 4d6i*[=6]{+1d6}

if all dice are equal to 6, then roll another d6 and add it to the result.


> 2d10i:[>15]{"Success"}

if the sum of two dice is greater than 15, It displays "Success".


## Arithmetic

Rolisteam Dice Parser is able to compute primary arithmetic operation such as: +, -, /, * and it also manages those operator priority and it can also manage parenthesis. 

> 8+8+8

Result: 24

> 24-4

Result: 20

> (3+4)*2

Result: 14

> 7/2

Result: 3.5

> (3+2D6)D10

Roll 2 dice and add 3 to the sum of those dice. Then the result is used for rolling dice.

## Arithmetic and Dice

It is possible to use arithmetic opearation on dice. Please pay attention that the default operation to translate a 
dice list to scalar is the sum. So if you roll `3d6`, the result will be a list with 3 values {2, 5 ,1}. Now, we 
change a bit the command `3d6+4`: It is resolved like this: {2, 5 ,1} = 8; 8+4 = 12. The final result is 12.

> 3d6+4

Roll 3 dice; sum the result; and add 4

> 10D10-2

Roll 10 dice; sum the result; and then substract 2

> 87-1D20

Substract the result of 1 die to 87

> (6-4)D10

Substract 4 to 6 and then roll two dice. 

> 1D10/2

Divide by 2 the result of 1 die.

## Roll two (or more) kinds of dice at once.

To make it, you have to separate all dice commands by `;`

> 1d10;1d6

or

> 5d6;1d10;4d100;3d20

## Validator

There are three kind of Validator:
-Scalar
-Range
-Boolean expression

Any operator which requires validator (such as `a,r,e,c') can use those three kind.

### Scalar 

The scalar value sets the validator on eguality between the dice value and the validator

> 4d10e10

This command means : roll 4 dice and they explose on 10.

### Range

The range is defined as two bounds. You have to use square brackets and the two bounds are separated by `-`.

> 4d10c[8-10]

### Boolean Condition

The command counts how many dice have values between >=8 and <=10.

> 4d10c[>7]

The command counts how many dice are aboved 7.

#### Logic Operator

The Rolisteam Dice Parser allows you to use several logic operator:
* Egual : =
* Greater or egual :  >=
* Lesser or egual : <=
* Lesser : <
* Greater : >

## Select value from List

The L operator (meaning list) can offer you the opportunity to pick up value from list.

> 1L[sword,bow,knife,gun,shotgun]

## Examples

> 3D100

Roll 3 dice with 100 faces

> 10D10e[=10]s

Roll 10 dice with 10 faces, 10 exploses, and sort the result.

> 100291D66666666s

Roll 100291 dice with 66666666666 faces and sort result

> 15D10c[>7]

roll 15 dice with 10 faces and it counts number of dice which are above 7

> 1D8+2D6+7

roll 1 die with 8 faces and add the result to 2 dice with 6 faces and add 7.

> D25

roll 1 die with 25 faces

> 88-1D20

88 minus the value of 1 die of 20 faces

> 8+8+8

compute: 24

> 1L[sword,bow,knife,gun,shotgun]

One of this word will be picked. 

> 8D10c[Validator1]-@c[validator2]

Roll 8 dice with 10 faces then it counts how many dice respect the condition Validator1 and substract the number of dice which respect the validator2 and display the number (See Validator for more details about syntax)

> 8D10c[>=6]-@c[=1]

Old World in darkness system.

> 8D10c[>=7]+@c[=10]

Exalted 2nd edition system.