- Fix for math.cos(), math.sin(), math.tan(), math.acos(), math.asin(), math.atan() macro functions.
- Added json.rolls() macro function.
- Added json.objrolls() macro function.
- Overdue update to the credits file.
Build Related
- Continuous Integration using Travis CI (joshsziegler)
json.rolls
This function takes 2 or 3 parameters and returns a json array
json.rolls(roll, dim1, dim2) => returns a json array with the rolls performed
e.g.
{json.rolls("3d6", 6),2} => [ 11, 7, 15, 8, 10, 13 ]
The three parameter version returns a two dimensional array
e.g.
{json.rolls("3d6", 6, 4),2} => [ [ 11, 13, 11, 13 ], [ 8, 11, 17, 10 ], [ 8, 11, 14, 11 ], [ 6, 8, 13, 6 ], [ 6, 11, 8, 10 ], [ 10, 7, 17, 11 ] ]
json.objrolls
Is similar to json.rolls() but returns a json object.
It takes 3 parameters
json.objrolls(names, stat, rolls)
This will generate rolls for all the stat for each "name". rolls is either a single string with a roll expression in which case every stat will use same roll expression, or a json array with a roll expression for each stat (so must be same size as stat).
e.g.
<pre>{json.indent(json.objrolls("['henchman1', 'henchman2', 'henchman3']", "['Str', 'Dex', 'Con', 'Int', 'Wis', 'Chr']", "3d6"),2)}</pre>
Code: Select all
{
"henchman1": {
"Str": 10,
"Dex": 12,
"Con": 10,
"Int": 10,
"Wis": 8,
"Chr": 12
},
"henchman2": {
"Str": 11,
"Dex": 10,
"Con": 7,
"Int": 13,
"Wis": 9,
"Chr": 7
},
"henchman3": {
"Str": 10,
"Dex": 10,
"Con": 10,
"Int": 12,
"Wis": 15,
"Chr": 13
}
}
Code: Select all
{
"henchman1": {
"Str": 11,
"Dex": 12,
"Con": 13,
"Int": 8,
"Wis": 10,
"Chr": 11
},
"henchman2": {
"Str": 12,
"Dex": 11,
"Con": 12,
"Int": 8,
"Wis": 12,
"Chr": 3
},
"henchman3": {
"Str": 12,
"Dex": 13,
"Con": 9,
"Int": 8,
"Wis": 13,
"Chr": 7
}
}