OSDN Git Service
(root)
/
hengband
/
hengband.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
437adaf
)
[Refactor] #38997 get_fear_moves_aux() にplayer_type * 引数を追加 / Added player_type ...
author
Hourier
<hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 06:21:39 +0000
(15:21 +0900)
committer
Hourier
<hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 06:21:39 +0000
(15:21 +0900)
src/monster-process.c
patch
|
blob
|
history
diff --git
a/src/monster-process.c
b/src/monster-process.c
index
171d39d
..
b32c41f
100644
(file)
--- a/
src/monster-process.c
+++ b/
src/monster-process.c
@@
-522,13
+522,13
@@
static bool get_moves_aux(player_type *target_ptr, MONSTER_IDX m_idx, POSITION *
* but instead of heading directly for it, the monster should "swerve"\n
* around the player so that he has a smaller chance of getting hit.\n
*/
* but instead of heading directly for it, the monster should "swerve"\n
* around the player so that he has a smaller chance of getting hit.\n
*/
-static bool get_fear_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
+static bool get_fear_moves_aux(
floor_type *floor_ptr,
MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
{
POSITION y, x, y1, x1, fy, fx, gy = 0, gx = 0;
int score = -1;
int i;
{
POSITION y, x, y1, x1, fy, fx, gy = 0, gx = 0;
int score = -1;
int i;
- monster_type *m_ptr = &
p_ptr->current_
floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &floor_ptr->m_list[m_idx];
/* Monster location */
fy = m_ptr->fy;
/* Monster location */
fy = m_ptr->fy;
@@
-547,13
+547,13
@@
static bool get_fear_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
x = fx + ddx_ddd[i];
/* Ignore locations off of edge */
x = fx + ddx_ddd[i];
/* Ignore locations off of edge */
- if (!in_bounds2(
p_ptr->current_
floor_ptr, y, x)) continue;
+ if (!in_bounds2(floor_ptr, y, x)) continue;
/* Calculate distance of this grid from our destination */
dis = distance(y, x, y1, x1);
/* Score this grid */
/* Calculate distance of this grid from our destination */
dis = distance(y, x, y1, x1);
/* Score this grid */
- s = 5000 / (dis + 3) - 500 / (
p_ptr->current_
floor_ptr->grid_array[y][x].dist + 1);
+ s = 5000 / (dis + 3) - 500 / (floor_ptr->grid_array[y][x].dist + 1);
/* No negative scores */
if (s < 0) s = 0;
/* No negative scores */
if (s < 0) s = 0;
@@
-1030,7
+1030,7
@@
static bool get_moves(player_type *target_ptr, MONSTER_IDX m_idx, DIRECTION *mm)
if (!no_flow)
{
/* Adjust movement */
if (!no_flow)
{
/* Adjust movement */
- if (get_fear_moves_aux(m_idx, &y, &x)) done = TRUE;
+ if (get_fear_moves_aux(
target_ptr->current_floor_ptr,
m_idx, &y, &x)) done = TRUE;
}
}
}
}