int res_calc_dam(int which, int dam) { int pct1 = res_pct(which); int pct2 = _randomize(pct1); int result = dam; result -= pct2 * dam / 100; if (result < 0) result = 0; return result; }
void Field::randomize(short percentage_fill) { _randomize(percentage_fill); }