creature_ptr->to_h[0] -= 20;
creature_ptr->to_h[1] -= 20;
creature_ptr->to_h_b -= 20;
- creature_ptr->to_h_m -= 20;
creature_ptr->dis_to_h[0] -= 20;
creature_ptr->dis_to_h[1] -= 20;
creature_ptr->dis_to_h_b -= 20;
creature_ptr->to_h[0] -= 5;
creature_ptr->to_h[1] -= 5;
creature_ptr->to_h_b -= 5;
- creature_ptr->to_h_m -= 5;
creature_ptr->dis_to_h[0] -= 5;
creature_ptr->dis_to_h[1] -= 5;
creature_ptr->dis_to_h_b -= 5;
creature_ptr->to_h[0] += 10;
creature_ptr->to_h[1] += 10;
creature_ptr->to_h_b += 10;
- creature_ptr->to_h_m += 10;
creature_ptr->dis_to_h[0] += 10;
creature_ptr->dis_to_h[1] += 10;
creature_ptr->dis_to_h_b += 10;
creature_ptr->to_h[0] += 12;
creature_ptr->to_h[1] += 12;
creature_ptr->to_h_b += 12;
- creature_ptr->to_h_m += 12;
creature_ptr->dis_to_h[0] += 12;
creature_ptr->dis_to_h[1] += 12;
creature_ptr->dis_to_h_b += 12;
creature_ptr->to_h[0] += 12;
creature_ptr->to_h[1] += 12;
creature_ptr->to_h_b -= 12;
- creature_ptr->to_h_m += 12;
creature_ptr->to_d[0] += 3 + (creature_ptr->lev / 5);
creature_ptr->to_d[1] += 3 + (creature_ptr->lev / 5);
creature_ptr->to_d_m += 3 + (creature_ptr->lev / 5);
static void calc_riding_weapon_penalty(player_type *creature_ptr);
static void put_equipment_warning(player_type *creature_ptr);
+static void calc_to_hit_misc(player_type *creature_ptr);
+
/*!
* @brief 能力値テーブル / Abbreviations of healthy stats
*/
creature_ptr->dis_to_d[0] = creature_ptr->to_d[0] = 0;
creature_ptr->dis_to_d[1] = creature_ptr->to_d[1] = 0;
creature_ptr->dis_to_h_b = creature_ptr->to_h_b = 0;
- creature_ptr->to_h_m = 0;
creature_ptr->to_d_m = 0;
creature_ptr->to_dd[0] = creature_ptr->to_ds[0] = 0;
creature_ptr->to_dd[1] = creature_ptr->to_ds[1] = 0;
creature_ptr->to_h[0] += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
creature_ptr->to_h[1] += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
creature_ptr->to_h_b += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
- creature_ptr->to_h_m += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
creature_ptr->to_h[0] += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
creature_ptr->to_h[1] += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
creature_ptr->to_h_b += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
- creature_ptr->to_h_m += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
creature_ptr->dis_to_d[0] += ((int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128);
creature_ptr->dis_to_d[1] += ((int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128);
creature_ptr->dis_to_h[0] += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
if (creature_ptr->ryoute)
hold *= 2;
- for (int i = 0; i < 2; i++) {
+
+ for (int i = 0; i < 2; i++) {
o_ptr = &creature_ptr->inventory_list[INVEN_RARM + i];
object_flags(o_ptr, flgs);
calc_to_hit_melee(creature_ptr);
calc_to_hit_shoot(creature_ptr);
calc_to_hit_throw(creature_ptr);
- calc_dig(creature_ptr);
+ calc_to_hit_misc(creature_ptr);
+ calc_dig(creature_ptr);
if (current_world_ptr->character_xtra)
return;
}
}
+static void calc_to_hit_misc(player_type* creature_ptr) {
+ object_type *o_ptr;
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
+
+ creature_ptr->to_h_m = 0;
+
+ for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
+ int bonus_to_h, bonus_to_d;
+ o_ptr = &creature_ptr->inventory_list[i];
+ if (!o_ptr->k_idx)
+ continue;
+
+ object_flags(o_ptr, flgs);
+ creature_ptr->to_h_m += (s16b)o_ptr->to_h;
+ }
+
+ if (is_blessed(creature_ptr)) {
+ creature_ptr->to_h_m += 10;
+ }
+
+ if (IS_HERO(creature_ptr)) {
+ creature_ptr->to_h_m += 12;
+ }
+
+ if (creature_ptr->shero) {
+ creature_ptr->to_h_m += 12;
+ }
+
+ if (creature_ptr->stun > 50) {
+ creature_ptr->to_h_m -= 20;
+ } else if (creature_ptr->stun) {
+ creature_ptr->to_h_m -= 5;
+ }
+
+ creature_ptr->to_h_m += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
+ creature_ptr->to_h_m += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
+}
+
/*!
* @brief プレイヤーの所持重量制限を計算する /
* Computes current weight limit.