Hit Chance
--%
var diff_def_acc = Math.max(Math.ceil(defense - accuracy), 0);
var max_dmg = Math.ceil(strength / 5);
if (diff_def_acc === 0) {
hit_chance = 1;
} else {
if ( (diff_def_acc - 1) / max_dmg > 1) {
hit_chance = (max_dmg + 2) / (2 * diff_def_acc);
} else {
hit_chance = 1 - ( (diff_def_acc * diff_def_acc - 2 * diff_def_acc + 1) / (2 * diff_def_acc * max_dmg) );
}
}