OSDN Git Service
(root)
/
hengband
/
hengband.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
スナイパーの集中度に関する命中率計算バグを修正。 / Fix bug in calculation of hit rate with sniper concentrati...
[hengband/hengband.git]
/
src
/
cmd1.c
diff --git
a/src/cmd1.c
b/src/cmd1.c
index
bf117ed
..
1125f5a
100644
(file)
--- a/
src/cmd1.c
+++ b/
src/cmd1.c
@@
-158,18
+158,16
@@
bool test_hit_fire(int chance, monster_type *m_ptr, int vis, char* o_name)
{
int k, ac;
monster_race *r_ptr = &r_info[m_ptr->r_idx];
{
int k, ac;
monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- ac = r_ptr->ac;
- if(m_ptr->r_idx == MON_GOEMON && !MON_CSLEEP(m_ptr)) ac *= 3;
/* Percentile dice */
/* Percentile dice */
- k = randint
0
(100);
+ k = randint
1
(100);
/* Snipers with high-concentration reduce instant miss percentage.*/
k += p_ptr->concent;
/* Hack -- Instant miss or hit */
/* Snipers with high-concentration reduce instant miss percentage.*/
k += p_ptr->concent;
/* Hack -- Instant miss or hit */
- if (k < 10) return (k < 5);
+ if (k <= 5) return (FALSE);
+ if (k > 95) return (TRUE);
if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
if (one_in_(20)) return (FALSE);
if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
if (one_in_(20)) return (FALSE);
@@
-177,6
+175,15
@@
bool test_hit_fire(int chance, monster_type *m_ptr, int vis, char* o_name)
/* Never hit */
if (chance <= 0) return (FALSE);
/* Never hit */
if (chance <= 0) return (FALSE);
+ ac = r_ptr->ac;
+ if (p_ptr->concent)
+ {
+ ac *= (8 - p_ptr->concent);
+ ac /= 8;
+ }
+
+ if(m_ptr->r_idx == MON_GOEMON && !MON_CSLEEP(m_ptr)) ac *= 3;
+
/* Invisible monsters are harder to hit */
if (!vis) chance = (chance + 1) / 2;
/* Invisible monsters are harder to hit */
if (!vis) chance = (chance + 1) / 2;