Examples - danfolkes/phonegap-dice GitHub Wiki
dice = d(6); 2d6 = d(6,2);
modify each roll: d(6,2,-1);
make variables: Lvl = 7; use them: d(4,Lvl);
do math: d(6)*2+Lvl;
round down: rdown(d(6)/2);
round up: rup(2/5);
use any javascript functions: Math.Random();
===
Examples:
//Set a level:
L=6;
=
//Magic Missle
// d(dicetype,how many rolls, modifier per roll)
d(4,(1 + rdown(L / 2)), 1);
=
//Burning Hands
// 1d4 points of fire damage per caster level (maximum 5d4)
d(4,L)
=
//Floating Disk
// Close (25 ft. + 5 ft./2 levels), It can hold 100 pounds of weight per caster level.
25+(5*(1+rdown(L / 2)))//Range
(100*L); //Can Hold
=