* @return 命中と判定された場合TRUEを返す
* @note Always miss 5%, always hit 5%, otherwise random.
*/
-bool test_hit_norm(player_type *attacker_ptr, HIT_RELIABILITY chance, ARMOUR_CLASS ac, bool visible)
+bool test_hit_norm(player_type *attacker_ptr, int chance, ARMOUR_CLASS ac, bool visible)
{
if (!visible)
chance = (chance + 1) / 2;
* @param ac 敵AC
* @return 命中確率
*/
-PERCENTAGE hit_chance(player_type *attacker_ptr, HIT_RELIABILITY reli, ARMOUR_CLASS ac)
+PERCENTAGE hit_chance(player_type *attacker_ptr, int reli, ARMOUR_CLASS ac)
{
PERCENTAGE chance = 5, chance_left = 90;
if (reli <= 0)
typedef struct player_attack_type player_attack_type;
typedef struct player_type player_type;
-bool test_hit_norm(player_type *attacker_ptr, HIT_RELIABILITY chance, ARMOUR_CLASS ac, bool visible);
-PERCENTAGE hit_chance(player_type *attacker_ptr, HIT_RELIABILITY chance, ARMOUR_CLASS ac);
+bool test_hit_norm(player_type *attacker_ptr, int chance, ARMOUR_CLASS ac, bool visible);
+PERCENTAGE hit_chance(player_type *attacker_ptr, int chance, ARMOUR_CLASS ac);
bool check_hit_from_monster_to_player(player_type *target_ptr, int power, DEPTH level, int stun);
bool check_hit_from_monster_to_monster(int power, DEPTH level, ARMOUR_CLASS ac, int stun);
bool process_attack_hit(player_type *attacker_ptr, player_attack_type *pa_ptr, int chance);
DICE_NUMBER eff_dd = o_ptr->dd + player_ptr->to_dd[0];
DICE_SID eff_ds = o_ptr->ds + player_ptr->to_ds[0];
- HIT_RELIABILITY reli = player_ptr->skill_thn + (player_ptr->to_h[0] + o_ptr->to_h) * BTH_PLUS_ADJ;
+ auto hit_reliability = player_ptr->skill_thn + (player_ptr->to_h[0] + o_ptr->to_h) * BTH_PLUS_ADJ;
describe_flavor(player_ptr, o_name, o_ptr, OD_NAME_ONLY);
c_put_str(TERM_YELLOW, o_name, row, col);
sprintf(tmp_str, _("命中率: 0 50 100 150 200 (敵のAC)", "To Hit: 0 50 100 150 200 (AC)"));
put_str(tmp_str, row + 2, col);
- sprintf(tmp_str, " %2d %2d %2d %2d %2d (%%)", (int)hit_chance(player_ptr, reli, 0), (int)hit_chance(player_ptr, reli, 50),
- (int)hit_chance(player_ptr, reli, 100), (int)hit_chance(player_ptr, reli, 150), (int)hit_chance(player_ptr, reli, 200));
+ sprintf(tmp_str, " %2d %2d %2d %2d %2d (%%)", (int)hit_chance(player_ptr, hit_reliability, 0), (int)hit_chance(player_ptr, hit_reliability, 50),
+ (int)hit_chance(player_ptr, hit_reliability, 100), (int)hit_chance(player_ptr, hit_reliability, 150), (int)hit_chance(player_ptr, hit_reliability, 200));
put_str(tmp_str, row + 3, col);
c_put_str(TERM_YELLOW, _("可能なダメージ:", "Possible Damage:"), row + 5, col);