4 * @brief プレイヤーからモンスターへの射撃命中判定 /
5 * Determine if the player "hits" a monster (normal combat).
7 * @param m_ptr モンスターの構造体参照ポインタ
8 * @param vis 目標を視界に捕らえているならばTRUEを指定
9 * @param o_name メッセージ表示時のモンスター名
10 * @return 命中と判定された場合TRUEを返す
11 * @note Always miss 5%, always hit 5%, otherwise random.
13 bool test_hit_fire(int chance, monster_type *m_ptr, int vis, char* o_name)
16 monster_race *r_ptr = &r_info[m_ptr->r_idx];
21 /* Snipers with high-concentration reduce instant miss percentage.*/
24 /* Hack -- Instant miss or hit */
25 if (k <= 5) return (FALSE);
26 if (k > 95) return (TRUE);
28 if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
29 if (one_in_(20)) return (FALSE);
32 if (chance <= 0) return (FALSE);
37 ac *= (8 - p_ptr->concent);
41 if (m_ptr->r_idx == MON_GOEMON && !MON_CSLEEP(m_ptr)) ac *= 3;
43 /* Invisible monsters are harder to hit */
44 if (!vis) chance = (chance + 1) / 2;
46 /* Power competes against armor */
47 if (randint0(chance) < (ac * 3 / 4))
49 if (m_ptr->r_idx == MON_GOEMON && !MON_CSLEEP(m_ptr))
53 /* Extract monster name */
54 monster_desc(m_name, m_ptr, 0);
55 msg_format(_("%sは%sを斬り捨てた!", "%s cuts down %s!"), m_name, o_name);
68 * @brief プレイヤーからモンスターへの射撃クリティカル判定 /
69 * Critical hits (from objects thrown by player) Factor in item weight, total plusses, and player level.
71 * @param plus_ammo 矢弾の命中修正
72 * @param plus_bow 弓の命中修正
73 * @param dam 現在算出中のダメージ値
74 * @return クリティカル修正が入ったダメージ値
76 HIT_POINT critical_shot(int weight, int plus_ammo, int plus_bow, HIT_POINT dam)
79 object_type *j_ptr = &inventory[INVEN_BOW];
81 /* Extract "shot" power */
82 i = p_ptr->to_h_b + plus_ammo;
84 if (p_ptr->tval_ammo == TV_BOLT)
85 i = (p_ptr->skill_thb + (p_ptr->weapon_exp[0][j_ptr->sval] / 400 + i) * BTH_PLUS_ADJ);
87 i = (p_ptr->skill_thb + ((p_ptr->weapon_exp[0][j_ptr->sval] - (WEAPON_EXP_MASTER / 2)) / 200 + i) * BTH_PLUS_ADJ);
90 /* Snipers can shot more critically with crossbows */
91 if (p_ptr->concent) i += ((i * p_ptr->concent) / 5);
92 if ((p_ptr->pclass == CLASS_SNIPER) && (p_ptr->tval_ammo == TV_BOLT)) i *= 2;
94 /* Good bow makes more critical */
95 i += plus_bow * 8 * (p_ptr->concent ? p_ptr->concent + 5 : 5);
98 if (randint1(10000) <= i)
100 k = weight * randint1(500);
104 msg_print(_("手ごたえがあった!", "It was a good hit!"));
109 msg_print(_("かなりの手ごたえがあった!", "It was a great hit!"));
114 msg_print(_("会心の一撃だ!", "It was a superb hit!"));