OSDN Git Service

adjust critical_shot -- consider race/class/personality
authordis- <dis-@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 27 Mar 2013 14:42:05 +0000 (14:42 +0000)
committerdis- <dis-@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 27 Mar 2013 14:42:05 +0000 (14:42 +0000)
src/bldg.c
src/cmd1.c

index 0f6bcb3..d22fadf 100644 (file)
@@ -3117,10 +3117,16 @@ static void town_history(void)
 s16b calc_crit_ratio_shot(int weight, int plus_ammo, int plus_bow,  int dam)
 {
        int i;
+       object_type *j_ptr =  &inventory[INVEN_BOW];
        
        /* Extract "shot" power */
-       i = p_ptr->to_h_b * 4 + plus_ammo + (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;
@@ -3130,7 +3136,7 @@ s16b calc_crit_ratio_shot(int weight, int plus_ammo, int plus_bow,  int dam)
        
        if (i < 0) i = 0;
        
-       return i * 2;
+       return i * 5 / 3;
 }
 
 s16b calc_expect_crit_shot(int weight, int plus_ammo, int plus_bow,  int dam)
index 51347f5..6b883bb 100644 (file)
@@ -89,9 +89,16 @@ bool test_hit_norm(int chance, int ac, int vis)
 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 * 4 + plus_ammo + (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);
@@ -101,7 +108,7 @@ s16b critical_shot(int weight, int plus_ammo, int plus_bow, int dam)
        i += MAX(0, plus_bow - 15) * 4 * (p_ptr->concent ? p_ptr->concent + 5 : 5);
        
        /* Critical hit */
-       if (randint1(5000) <= i)
+       if (randint1(6000) <= i)
        {
                k = weight * randint1(500);