09-06-2013, 07:46 PM
I'm working on building a D&D styled battle system, and i need to know how to call random numbers from a specific range. for example, to hit with an attack, the basic formula goes like this:
if d20 + Actor strength mod + BAB > target AC
Hit
Else
Miss
I know this isn't proper code, but i'm still working on it. anyways, where it says d20, i need it to call a random number from 1-20. i'll add Critical functionality later, but for now, this is it.
if d20 + Actor strength mod + BAB > target AC
Hit
Else
Miss
I know this isn't proper code, but i'm still working on it. anyways, where it says d20, i need it to call a random number from 1-20. i'll add Critical functionality later, but for now, this is it.