OSDN Git Service

Good to_h Bows makes more critical. Decrease ammo's contribution.
authordis- <dis-@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 19 Mar 2013 23:15:42 +0000 (23:15 +0000)
committerdis- <dis-@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 19 Mar 2013 23:15:42 +0000 (23:15 +0000)
src/bldg.c
src/cmd1.c
src/cmd2.c
src/externs.h
src/flavor.c

index 728888f..9be4995 100644 (file)
@@ -3113,18 +3113,21 @@ static void town_history(void)
        screen_load();
 }
 
-s16b calc_expect_crit_shot(int weight, int plus, int dam)
+s16b calc_expect_crit_shot(int weight, int plus_ammo, int plus_bow,  int dam)
 {
        u32b num;
        int i, k, crit;
 
        /* Extract "shot" power */
-       i = ((p_ptr->to_h_b + plus) * 4) + (p_ptr->lev * 2);
-
+       i = p_ptr->to_h_b * 4 + plus_ammo + (p_ptr->lev * 2);
+       
        /* 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 += MAX(0, plus_bow - 15) * 4 * (p_ptr->concent ? p_ptr->concent + 5 : 5);
+       
        if (i < 0) i = 0;
        
        k = 0;
index b33e457..51347f5 100644 (file)
@@ -86,17 +86,20 @@ 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;
-
+       
        /* Extract "shot" power */
-       i = ((p_ptr->to_h_b + plus) * 4) + (p_ptr->lev * 2);
-
+       i = p_ptr->to_h_b * 4 + plus_ammo + (p_ptr->lev * 2);
+       
        /* 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 += MAX(0, plus_bow - 15) * 4 * (p_ptr->concent ? p_ptr->concent + 5 : 5);
+       
        /* Critical hit */
        if (randint1(5000) <= i)
        {
index b96fd6a..c6af4a1 100644 (file)
@@ -3806,7 +3806,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
                                {
                                        /* Apply special damage XXX XXX XXX */
                                        tdam = tot_dam_aux_shot(q_ptr, tdam, m_ptr);
-                                       tdam = critical_shot(q_ptr->weight, q_ptr->to_h, tdam);
+                                       tdam = critical_shot(q_ptr->weight, q_ptr->to_h, j_ptr->to_h, tdam);
 
                                        /* No negative damage */
                                        if (tdam < 0) tdam = 0;
@@ -4472,7 +4472,7 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
                                tdam = damroll(dd, ds);
                                /* Apply special damage XXX XXX XXX */
                                tdam = tot_dam_aux(q_ptr, tdam, m_ptr, 0, TRUE);
-                               tdam = critical_shot(q_ptr->weight, q_ptr->to_h, tdam);
+                               tdam = critical_shot(q_ptr->weight, q_ptr->to_h, 0, tdam);
                                if (q_ptr->to_d > 0)
                                        tdam += q_ptr->to_d;
                                else
index 4949936..8feca19 100644 (file)
@@ -698,7 +698,7 @@ extern void glow_deep_lava_and_bldg(void);
 /* cmd1.c */
 extern bool test_hit_fire(int chance, int ac, int vis);
 extern bool test_hit_norm(int chance, int ac, int vis);
-extern s16b critical_shot(int weight, int plus, int dam);
+extern s16b critical_shot(int weight, int plus_ammo, int plus_bow, int dam);
 extern s16b critical_norm(int weight, int plus, int dam, s16b meichuu, int mode);
 extern s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, int mode, bool thrown);
 extern void search(void);
@@ -1299,7 +1299,7 @@ extern void quest_discovery(int q_idx);
 extern int quest_number(int level);
 extern int random_quest_number(int level);
 extern bool tele_town(void);
-extern s16b calc_expect_crit_shot(int weight, int plus, int dam);
+extern s16b calc_expect_crit_shot(int weight, int plus_ammo,int plus_bow, int dam);
 extern s16b calc_expect_crit(int weight, int plus, int dam, s16b meichuu, bool dokubari);
 
 /* util.c */
index 9fca28e..f98e7a6 100644 (file)
@@ -2444,7 +2444,7 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
                t = object_desc_str(t, "/shot, ");
                
                /* Apply Expect damage of Critical */
-               avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, avgdam);
+               avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
                t = object_desc_num(t, avgdam);
                t = object_desc_str(t, "/crit, ");