Heya folks,
Long time lurker, first time poster. I'm not incredibly familiar with javascript (in general), but I have a decent grasp on a few concepts.
Anywho, so, I wanted to have a couple of parameters affect critical hit rate - Dexterity and Agility. It's a simple addition to the base critical hit rate the program already provides. '
If dDex = Dexterity - Agility:
dDex = 0-6, crit rate unchanged
dDex = 7-13, +1% to crit rate
dDex = 14-19, +2% to crit rate
dDex = 20-29, +3% to crit rate
dDex = 30-39, +4% to crit rate
dDex = 40-50, +((dDex-35)/100)% (5-15%)
So, this is the changes I made to the Game.Action.prototype.itemCrit function. Full disclosure, I haven't tested it yet, and I'm sure there's probably a better way of writing it (if it's current form is even correct). Here it is:
I'm sure there's probably a fancier way of writing it, but am I at least in the ballpark with the syntax?
Thanks for your time and your suggestions!
Long time lurker, first time poster. I'm not incredibly familiar with javascript (in general), but I have a decent grasp on a few concepts.
Anywho, so, I wanted to have a couple of parameters affect critical hit rate - Dexterity and Agility. It's a simple addition to the base critical hit rate the program already provides. '
If dDex = Dexterity - Agility:
dDex = 0-6, crit rate unchanged
dDex = 7-13, +1% to crit rate
dDex = 14-19, +2% to crit rate
dDex = 20-29, +3% to crit rate
dDex = 30-39, +4% to crit rate
dDex = 40-50, +((dDex-35)/100)% (5-15%)
So, this is the changes I made to the Game.Action.prototype.itemCrit function. Full disclosure, I haven't tested it yet, and I'm sure there's probably a better way of writing it (if it's current form is even correct). Here it is:
I'm sure there's probably a fancier way of writing it, but am I at least in the ballpark with the syntax?
Thanks for your time and your suggestions!