/* Print the weapons base damage dice */
sprintf(tmp_str, " %2d %2d %2d %2d %2d (%%)",
- hit_chance(o_ptr->to_h, 0), hit_chance(o_ptr->to_h, 50), hit_chance(o_ptr->to_h, 100),
- hit_chance(o_ptr->to_h, 150), hit_chance(o_ptr->to_h, 200));
+ hit_chance(o_ptr->to_h, 0),
+ hit_chance(o_ptr->to_h, 50),
+ hit_chance(o_ptr->to_h, 100),
+ hit_chance(o_ptr->to_h, 150),
+ hit_chance(o_ptr->to_h, 200));
put_str(tmp_str, row+3, col);
c_put_str(TERM_YELLOW, _("可能なダメージ:", "Possible Damage:"), row+5, col);
*/
PERCENTAGE hit_chance(HIT_PROB to_h, ARMOUR_CLASS ac)
{
- PERCENTAGE chance = 0;
+ PERCENTAGE chance = 5, chance_left = 90;
int meichuu = p_ptr->skill_thn + (p_ptr->to_h[0] + to_h) * BTH_PLUS_ADJ;
- if (meichuu <= 0) return 5;
+ if (p_ptr->pseikaku == SEIKAKU_NAMAKE) chance_left = (chance_left * 19 + 9) / 20;
+ chance += (100 - ((ac * 75) / meichuu)) * chance_left / 100;
- chance = 100 - ((ac * 75) / meichuu);
-
- if (chance > 95) chance = 95;
- if (chance < 5) chance = 5;
- if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
- chance = (chance * 19 + 9) / 20;
return chance;
}