You're correct. It's kind of a pseudo-function that tells the template parser how to treat that section of the roll template. In the simple case, a roll is a crit if the value of the roll is equal to the number of sides. It gets more complicated when you have things like [[1d20cs>19]], which will be a crit on a 19 or 20 (> in dice parlance is >=). In that case, there will be a mods key on the roll: "mods": {
"customCrit": [
{
"comp": ">=",
"point": 19
}
]
}, Since the cs modifier can be specified multiple times, you can end up with multiple entries. This shows the 3 possible types, all on one roll: [[1d20cs<3cs11cs>16]] "mods": {
"customCrit": [
{
"comp": "<=",
"point": 3
},
{
"comp": "==",
"point": 11
},
{
"comp": ">=",
"point": 16
}
]
}, Each type can be repeated multiple times. Example: [[1d20cs1cs3cs5cs7cs9cs11cs13cs15cs17cs19]] "mods": {
"customCrit": [
{
"comp": "==",
"point": 1
},
{
"comp": "==",
"point": 3
},
{
"comp": "==",
"point": 5
},
{
"comp": "==",
"point": 7
},
{
"comp": "==",
"point": 9
},
{
"comp": "==",
"point": 11
},
{
"comp": "==",
"point": 13
},
{
"comp": "==",
"point": 15
},
{
"comp": "==",
"point": 17
},
{
"comp": "==",
"point": 19
}
]
},
Note that there are also other modifiers: [[6d20cf<3cs>19rokh1>3]] "mods": {
"customCrit": [
{
"comp": ">=",
"point": 19
}
],
"customFumble": [
{
"comp": "<=",
"point": 3
}
],
"keep": {
"count": 1,
"end": "h"
},
"reroll": [
{
"maxrerolls": 1
}
],
"success": {
"comp": ">=",
"point": 3
}
},
Anyway, if you're after crits, your isCrit() function would need to parse the mods section of the roll and for each entry in customCrit build up a rule engine that can handle determining if a roll is a crit.