OSDN Git Service

Add Helm ego -- of Protection. Only has high AC
[hengband/hengband.git] / src / cmd1.c
index 977bfa2..28e4ad4 100644 (file)
@@ -24,7 +24,10 @@ bool test_hit_fire(int chance, int ac, int vis)
 
        /* Percentile dice */
        k = randint0(100);
-
+       
+       /* Snipers with high-concentration reduce instant miss percentage.*/
+       k += p_ptr->concent;
+       
        /* Hack -- Instant miss or hit */
        if (k < 10) return (k < 5);
 
@@ -83,19 +86,29 @@ bool test_hit_norm(int chance, int ac, int vis)
  * Critical hits (from objects thrown by player)
  * Factor in item weight, total plusses, and player level.
  */
-s16b critical_shot(int weight, int plus, int dam)
+s16b critical_shot(int weight, int plus_ammo, int plus_bow, int dam)
 {
        int i, k;
-
+       object_type *j_ptr =  &inventory[INVEN_BOW];
+       
        /* Extract "shot" power */
-       i = ((p_ptr->to_h_b + plus) * 4) + (p_ptr->lev * 2);
+       i = p_ptr->to_h_b + plus_ammo;
+       
+       if (p_ptr->tval_ammo == TV_BOLT)
+               i = (p_ptr->skill_thb + (p_ptr->weapon_exp[0][j_ptr->sval] / 400 + i) * BTH_PLUS_ADJ);
+       else
+               i = (p_ptr->skill_thb + ((p_ptr->weapon_exp[0][j_ptr->sval] - (WEAPON_EXP_MASTER / 2)) / 200 + i) * BTH_PLUS_ADJ);
 
+       
        /* Snipers can shot more critically with crossbows */
        if (p_ptr->concent) i += ((i * p_ptr->concent) / 5);
        if ((p_ptr->pclass == CLASS_SNIPER) && (p_ptr->tval_ammo == TV_BOLT)) i *= 2;
-
+       
+       /* Good bow makes more critical */
+       i += plus_bow * 8 * (p_ptr->concent ? p_ptr->concent + 5 : 5);
+       
        /* Critical hit */
-       if (randint1(5000) <= i)
+       if (randint1(10000) <= i)
        {
                k = weight * randint1(500);
 
@@ -139,14 +152,14 @@ s16b critical_shot(int weight, int plus, int dam)
 /*
  * Critical hits (by player)
  *
- * Factor in weapon weight, total plusses, player level.
+ * Factor in weapon weight, total plusses, player melee bonus
  */
 s16b critical_norm(int weight, int plus, int dam, s16b meichuu, int mode)
 {
        int i, k;
-
+       
        /* Extract "blow" power */
-       i = (weight + (meichuu * 3 + plus * 5) + (p_ptr->lev * 3));
+       i = (weight + (meichuu * 3 + plus * 5) + p_ptr->skill_thn);
 
        /* Chance */
        if ((randint1((p_ptr->pclass == CLASS_NINJA) ? 4444 : 5000) <= i) || (mode == HISSATSU_MAJIN) || (mode == HISSATSU_3DAN))