X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fcmd1.c;h=28e4ad4f5d801246aa7bb427d9203b018f348c87;hb=827b58461e81870e2d93e290078b8e9e0649d580;hp=977bfa258d1581eee02c85ac63d199d39d250460;hpb=1e842d47aef480bb02e2da43d1cd7d30322afd65;p=hengband%2Fhengband.git diff --git a/src/cmd1.c b/src/cmd1.c index 977bfa258..28e4ad4f5 100644 --- a/src/cmd1.c +++ b/src/cmd1.c @@ -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))