autopick_delayed_alter_aux(item);
/* Scan the pile of objects */
- item = cave[p_ptr->y][p_ptr->x].o_idx;
+ item = grid_array[p_ptr->y][p_ptr->x].o_idx;
while (item)
{
OBJECT_IDX next = o_list[item].next_o_idx;
"Kobolds are a weak goblin race. They love poisoned weapons, and can learn to throw poisoned darts (of which they carry an unlimited supply). They are also inherently resistant to poison, although they are not one of the more powerful races.",
-"The hated and persecuted race of nocturnal dwarves, these cave-dwellers are not much bothered by darkness. Their natural inclination to magical items has made them immune to effects which could drain away magical energy.",
+"The hated and persecuted race of nocturnal dwarves, these cavedwellers are not much bothered by darkness. Their natural inclination to magical items has made them immune to effects which could drain away magical energy.",
-"Another dark, cave-dwelling race, likewise unhampered by darkness attacks, the Dark Elves have a long tradition and knowledge of magic. They have an inherent magic missile attack available to them at a low level. With their keen sight, they also learn to see invisible things as their relatives High-Elves do, but at a higher level.",
+"Another dark, cavedwelling race, likewise unhampered by darkness attacks, the Dark Elves have a long tradition and knowledge of magic. They have an inherent magic missile attack available to them at a low level. With their keen sight, they also learn to see invisible things as their relatives High-Elves do, but at a higher level.",
"A humanoid race with dragon-like attributes. As they advance levels, they gain new elemental resistances (up to Poison Resistance), and they also have a breath weapon, which becomes more powerful with experience. The exact type of the breath weapon depends on the Draconian's class and level. With their wings, they can easily escape any pit trap unharmed.",
clear_bldg(4, 18);
/* Current quest of the building */
- q_index = cave[p_ptr->y][p_ptr->x].special;
+ q_index = grid_array[p_ptr->y][p_ptr->x].special;
/* Is there a quest available at the building? */
if (!q_index)
leave_quest_check();
if (quest[p_ptr->inside_quest].type != QUEST_TYPE_RANDOM) dun_level = 1;
- p_ptr->inside_quest = cave[p_ptr->y][p_ptr->x].special;
+ p_ptr->inside_quest = grid_array[p_ptr->y][p_ptr->x].special;
p_ptr->leaving = TRUE;
}
return;
}
- which = f_info[cave[p_ptr->y][p_ptr->x].feat].subtype;
+ which = f_info[grid_array[p_ptr->y][p_ptr->x].feat].subtype;
bldg = &building[which];
/*!
- * @file cave.c
+ * @file grid_array.c
* @brief ダンジョンの基礎部分実装(主にマスの実装) / low level dungeon routines -BEN-
* @date 2013/12/30
* @author
#ifdef COMPLEX_WALL_ILLUMINATION /* COMPLEX_WALL_ILLUMINATION */
/* Check for "complex" illumination */
- if ((feat_supports_los(get_feat_mimic(&cave[yy][xx])) &&
- (cave[yy][xx].info & CAVE_GLOW)) ||
- (feat_supports_los(get_feat_mimic(&cave[y][xx])) &&
- (cave[y][xx].info & CAVE_GLOW)) ||
- (feat_supports_los(get_feat_mimic(&cave[yy][x])) &&
- (cave[yy][x].info & CAVE_GLOW)))
+ if ((feat_supports_los(get_feat_mimic(&grid_array[yy][xx])) &&
+ (grid_array[yy][xx].info & CAVE_GLOW)) ||
+ (feat_supports_los(get_feat_mimic(&grid_array[y][xx])) &&
+ (grid_array[y][xx].info & CAVE_GLOW)) ||
+ (feat_supports_los(get_feat_mimic(&grid_array[yy][x])) &&
+ (grid_array[yy][x].info & CAVE_GLOW)))
{
return TRUE;
}
#else /* COMPLEX_WALL_ILLUMINATION */
/* Check for "simple" illumination */
- return (cave[yy][xx].info & CAVE_GLOW) ? TRUE : FALSE;
+ return (grid_array[yy][xx].info & CAVE_GLOW) ? TRUE : FALSE;
#endif /* COMPLEX_WALL_ILLUMINATION */
}
if (player_has_los_bold((Y), (X))) \
{ \
/* Update the monster */ \
- if (cave[(Y)][(X)].m_idx) update_monster(cave[(Y)][(X)].m_idx, FALSE); \
+ if (grid_array[(Y)][(X)].m_idx) update_monster(grid_array[(Y)][(X)].m_idx, FALSE); \
\
/* Notice and redraw */ \
note_spot((Y), (X)); \
/* Blind players see nothing */
if (p_ptr->blind) return FALSE;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Note that "torch-lite" yields "illumination" */
if (c_ptr->info & (CAVE_LITE | CAVE_MNLT)) return TRUE;
*/
bool cave_valid_bold(POSITION y, POSITION x)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Forbid perma-grids */
* not any. If there were, they would have to set "shimmer_objects"\n
* when they were created, and then new "shimmer" code in "dungeon.c"\n
* would have to be created handle the "shimmer" effect, and the code\n
- * in "cave.c" would have to be updated to create the shimmer effect.\n
+ * in "grid_array.c" would have to be updated to create the shimmer effect.\n
*\n
* Note the effects of hallucination. Objects always appear as random\n
* "objects", monsters as random "monsters", and normal grids occasionally\n
*/
void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp)
{
- /* Get the cave */
- grid_type *c_ptr = &cave[y][x];
+ /* Get the grid_array */
+ grid_type *c_ptr = &grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Mega-Hack -- Handle "in-sight" and "darkened" grids */
else if (darkened_grid(c_ptr))
{
- /* Unsafe cave grid -- idea borrowed from Unangband */
+ /* Unsafe grid -- idea borrowed from Unangband */
feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
/* Access darkness */
/* Unknown */
else
{
- /* Unsafe cave grid -- idea borrowed from Unangband */
+ /* Unsafe grid -- idea borrowed from Unangband */
feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
/* Access darkness */
{
if (have_flag(f_ptr->flags, FF_LOS) && have_flag(f_ptr->flags, FF_PROJECT))
{
- /* Unsafe cave grid -- idea borrowed from Unangband */
+ /* Unsafe grid -- idea borrowed from Unangband */
feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
/* Access darkness */
/* Unknown */
else
{
- /* Unsafe cave grid -- idea borrowed from Unangband */
+ /* Unsafe grid -- idea borrowed from Unangband */
feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
/* Access feature */
*/
void note_spot(POSITION y, POSITION x)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Blind players see nothing */
{
POSITION ny = GRID_Y(path_g[i]);
POSITION nx = GRID_X(path_g[i]);
- grid_type *c_ptr = &cave[ny][nx];
+ grid_type *c_ptr = &grid_array[ny][nx];
if (panel_contains(ny, nx))
{
/*
- * Some comments on the cave grid flags. -BEN-
+ * Some comments on the grid flags. -BEN-
*
*
* One of the major bottlenecks in previous versions of Angband was in
x = lite_x[i];
/* Forget "LITE" flag */
- cave[y][x].info &= ~(CAVE_LITE);
+ grid_array[y][x].info &= ~(CAVE_LITE);
/* lite_spot(y, x); Perhaps don't need? */
}
*/
#define cave_lite_hack(Y,X) \
{\
- if (!(cave[Y][X].info & (CAVE_LITE))) \
+ if (!(grid_array[Y][X].info & (CAVE_LITE))) \
{ \
- cave[Y][X].info |= (CAVE_LITE); \
+ grid_array[Y][X].info |= (CAVE_LITE); \
lite_y[lite_n] = (Y); \
lite_x[lite_n++] = (X); \
} \
/* forget_lite(); Perhaps don't need? */
/* Add it to later visual update */
- cave_redraw_later(&cave[p_ptr->y][p_ptr->x], p_ptr->y, p_ptr->x);
+ cave_redraw_later(&grid_array[p_ptr->y][p_ptr->x], p_ptr->y, p_ptr->x);
}
#endif
x = lite_x[i];
/* Mark the grid as not "lite" */
- cave[y][x].info &= ~(CAVE_LITE);
+ grid_array[y][x].info &= ~(CAVE_LITE);
/* Mark the grid as "seen" */
- cave[y][x].info |= (CAVE_TEMP);
+ grid_array[y][x].info |= (CAVE_TEMP);
/* Add it to the "seen" set */
temp_y[temp_n] = y;
if (d > p) continue;
/* Viewable, nearby, grids get "torch lit" */
- if (cave[y][x].info & CAVE_VIEW)
+ if (grid_array[y][x].info & CAVE_VIEW)
{
/* This grid is "torch lit" */
cave_lite_hack(y, x);
y = lite_y[i];
x = lite_x[i];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Update fresh grids */
if (c_ptr->info & (CAVE_TEMP)) continue;
y = temp_y[i];
x = temp_x[i];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* No longer in the array */
c_ptr->info &= ~(CAVE_TEMP);
/* We trust this grid is in bounds */
/* if (!in_bounds2(y, x)) return; */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Want a unlit square in view of the player */
if ((c_ptr->info & (CAVE_MNLT | CAVE_VIEW)) != CAVE_VIEW) return;
/* We trust this grid is in bounds */
/* if (!in_bounds2(y, x)) return; */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Want a unlit and undarkened square in view of the player */
if ((c_ptr->info & (CAVE_LITE | CAVE_MNLT | CAVE_MNDK | CAVE_VIEW)) != CAVE_VIEW) return;
for (i = 0; i < mon_lite_n; i++)
{
/* Point to grid */
- c_ptr = &cave[mon_lite_y[i]][mon_lite_x[i]];
+ c_ptr = &grid_array[mon_lite_y[i]][mon_lite_x[i]];
/* Set temp or xtra flag */
c_ptr->info |= (c_ptr->info & CAVE_MNLT) ? CAVE_TEMP : CAVE_XTRA;
mon_fy = m_ptr->fy;
/* Is the monster visible? */
- mon_invis = !(cave[mon_fy][mon_fx].info & CAVE_VIEW);
+ mon_invis = !(grid_array[mon_fy][mon_fx].info & CAVE_VIEW);
/* The square it is on */
add_mon_lite(mon_fy, mon_fx);
add_mon_lite(mon_fy + 2, mon_fx);
add_mon_lite(mon_fy + 2, mon_fx - 1);
- c_ptr = &cave[mon_fy + 2][mon_fx];
+ c_ptr = &grid_array[mon_fy + 2][mon_fx];
/* Radius 3 */
if ((rad == 3) && cave_have_flag_grid(c_ptr, f_flag))
add_mon_lite(mon_fy - 2, mon_fx);
add_mon_lite(mon_fy - 2, mon_fx - 1);
- c_ptr = &cave[mon_fy - 2][mon_fx];
+ c_ptr = &grid_array[mon_fy - 2][mon_fx];
/* Radius 3 */
if ((rad == 3) && cave_have_flag_grid(c_ptr, f_flag))
add_mon_lite(mon_fy, mon_fx + 2);
add_mon_lite(mon_fy - 1, mon_fx + 2);
- c_ptr = &cave[mon_fy][mon_fx + 2];
+ c_ptr = &grid_array[mon_fy][mon_fx + 2];
/* Radius 3 */
if ((rad == 3) && cave_have_flag_grid(c_ptr, f_flag))
add_mon_lite(mon_fy, mon_fx - 2);
add_mon_lite(mon_fy - 1, mon_fx - 2);
- c_ptr = &cave[mon_fy][mon_fx - 2];
+ c_ptr = &grid_array[mon_fy][mon_fx - 2];
/* Radius 3 */
if ((rad == 3) && cave_have_flag_grid(c_ptr, f_flag))
/* We trust this grid is in bounds */
/* Point to grid */
- c_ptr = &cave[fy][fx];
+ c_ptr = &grid_array[fy][fx];
if (c_ptr->info & CAVE_TEMP) /* Pervious lit */
{
/* We trust this grid is in bounds */
/* Point to grid */
- c_ptr = &cave[fy][fx];
+ c_ptr = &grid_array[fy][fx];
if (c_ptr->info & CAVE_MNLT) /* Lit */
{
{
/* We trust this grid is in bounds */
- cave[temp_y[i]][temp_x[i]].info &= ~(CAVE_TEMP | CAVE_XTRA);
+ grid_array[temp_y[i]][temp_x[i]].info &= ~(CAVE_TEMP | CAVE_XTRA);
}
/* Finished with temp_n */
/* Mega-Hack -- Visual update later */
p_ptr->update |= (PU_DELAY_VIS);
- p_ptr->monlite = (cave[p_ptr->y][p_ptr->x].info & CAVE_MNLT) ? TRUE : FALSE;
+ p_ptr->monlite = (grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT) ? TRUE : FALSE;
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
for (i = 0; i < mon_lite_n; i++)
{
/* Point to grid */
- c_ptr = &cave[mon_lite_y[i]][mon_lite_x[i]];
+ c_ptr = &grid_array[mon_lite_y[i]][mon_lite_x[i]];
/* Clear monster illumination flag */
c_ptr->info &= ~(CAVE_MNLT | CAVE_MNDK);
{
POSITION y = view_y[i];
POSITION x = view_x[i];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Forget that the grid is viewable */
c_ptr->info &= ~(CAVE_VIEW);
grid_type *g2_c_ptr;
/* Access the grids */
- g1_c_ptr = &cave[y1][x1];
- g2_c_ptr = &cave[y2][x2];
+ g1_c_ptr = &grid_array[y1][x1];
+ g2_c_ptr = &grid_array[y2][x2];
/* Check for walls */
/* Totally blocked by "unviewable neighbors" */
if (!v1 && !v2) return (TRUE);
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Check for walls */
*
* Note the use of "inline" macros for efficiency. The "cave_los_grid()"
* macro is a replacement for "cave_los_bold()" which takes a pointer to
- * a cave grid instead of its location. The "cave_view_hack()" macro is a
+ * a grid instead of its location. The "cave_view_hack()" macro is a
* chunk of code which adds the given location to the "view" array if it
* is not already there, using both the actual location and a pointer to
- * the cave grid. See above.
+ * the grid. See above.
*
* By the way, the purpose of this code is to reduce the dependancy on the
* "los()" function which is slow, and, in some cases, not very accurate.
{
y = view_y[n];
x = view_x[n];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Mark the grid as not in "view" */
c_ptr->info &= ~(CAVE_VIEW);
/* Now start on the player */
y = p_ptr->y;
x = p_ptr->x;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Assume the player grid is easily viewable */
c_ptr->info |= (CAVE_XTRA);
/* Scan south-east */
for (d = 1; d <= z; d++)
{
- c_ptr = &cave[y+d][x+d];
+ c_ptr = &grid_array[y+d][x+d];
c_ptr->info |= (CAVE_XTRA);
cave_view_hack(c_ptr, y+d, x+d);
if (!cave_los_grid(c_ptr)) break;
/* Scan south-west */
for (d = 1; d <= z; d++)
{
- c_ptr = &cave[y+d][x-d];
+ c_ptr = &grid_array[y+d][x-d];
c_ptr->info |= (CAVE_XTRA);
cave_view_hack(c_ptr, y+d, x-d);
if (!cave_los_grid(c_ptr)) break;
/* Scan north-east */
for (d = 1; d <= z; d++)
{
- c_ptr = &cave[y-d][x+d];
+ c_ptr = &grid_array[y-d][x+d];
c_ptr->info |= (CAVE_XTRA);
cave_view_hack(c_ptr, y-d, x+d);
if (!cave_los_grid(c_ptr)) break;
/* Scan north-west */
for (d = 1; d <= z; d++)
{
- c_ptr = &cave[y-d][x-d];
+ c_ptr = &grid_array[y-d][x-d];
c_ptr->info |= (CAVE_XTRA);
cave_view_hack(c_ptr, y-d, x-d);
if (!cave_los_grid(c_ptr)) break;
/* Scan south */
for (d = 1; d <= full; d++)
{
- c_ptr = &cave[y+d][x];
+ c_ptr = &grid_array[y+d][x];
c_ptr->info |= (CAVE_XTRA);
cave_view_hack(c_ptr, y+d, x);
if (!cave_los_grid(c_ptr)) break;
/* Scan north */
for (d = 1; d <= full; d++)
{
- c_ptr = &cave[y-d][x];
+ c_ptr = &grid_array[y-d][x];
c_ptr->info |= (CAVE_XTRA);
cave_view_hack(c_ptr, y-d, x);
if (!cave_los_grid(c_ptr)) break;
/* Scan east */
for (d = 1; d <= full; d++)
{
- c_ptr = &cave[y][x+d];
+ c_ptr = &grid_array[y][x+d];
c_ptr->info |= (CAVE_XTRA);
cave_view_hack(c_ptr, y, x+d);
if (!cave_los_grid(c_ptr)) break;
/* Scan west */
for (d = 1; d <= full; d++)
{
- c_ptr = &cave[y][x-d];
+ c_ptr = &grid_array[y][x-d];
c_ptr->info |= (CAVE_XTRA);
cave_view_hack(c_ptr, y, x-d);
if (!cave_los_grid(c_ptr)) break;
{
y = view_y[n];
x = view_x[n];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Clear the "CAVE_XTRA" flag */
c_ptr->info &= ~(CAVE_XTRA);
{
y = temp_y[n];
x = temp_x[n];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* No longer in the array */
c_ptr->info &= ~(CAVE_TEMP);
{
y = redraw_y[i];
x = redraw_x[i];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Update only needed grids (prevent multiple updating) */
if (!(c_ptr->info & CAVE_REDRAW)) continue;
for (x = 0; x < cur_wid; x++)
{
/* Forget the old data */
- cave[y][x].dist = 0;
- cave[y][x].cost = 0;
- cave[y][x].when = 0;
+ grid_array[y][x].dist = 0;
+ grid_array[y][x].cost = 0;
+ grid_array[y][x].when = 0;
}
}
}
if (running && in_bounds(flow_y, flow_x))
{
/* The way point is in sight - do not update. (Speedup) */
- if (cave[flow_y][flow_x].info & CAVE_VIEW) return;
+ if (grid_array[flow_y][flow_x].info & CAVE_VIEW) return;
}
/* Erase all of the current flow information */
{
for (x = 0; x < cur_wid; x++)
{
- cave[y][x].cost = 0;
- cave[y][x].dist = 0;
+ grid_array[y][x].cost = 0;
+ grid_array[y][x].dist = 0;
}
}
for (d = 0; d < 8; d++)
{
int old_head = flow_head;
- byte_hack m = cave[ty][tx].cost + 1;
- byte_hack n = cave[ty][tx].dist + 1;
+ byte_hack m = grid_array[ty][tx].cost + 1;
+ byte_hack n = grid_array[ty][tx].dist + 1;
grid_type *c_ptr;
/* Child location */
/* Ignore player's grid */
if (player_bold(y, x)) continue;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
if (is_closed_door(c_ptr->feat)) m += 3;
{
for (x = 0; x < cur_wid; x++)
{
- int w = cave[y][x].when;
- cave[y][x].when = (w > 128) ? (w - 128) : 0;
+ int w = grid_array[y][x].when;
+ grid_array[y][x].when = (w > 128) ? (w - 128) : 0;
}
}
/* Check Bounds */
if (!in_bounds(y, x)) continue;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Walls, water, and lava cannot hold scent. */
if (!cave_have_flag_grid(c_ptr, FF_MOVE) && !is_closed_door(c_ptr->feat)) continue;
{
if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Memorize terrain of the grid */
c_ptr->info |= (CAVE_KNOWN);
/* Memorize known walls */
for (i = 0; i < 8; i++)
{
- c_ptr = &cave[y + ddy_ddd[i]][x + ddx_ddd[i]];
+ c_ptr = &grid_array[y + ddy_ddd[i]][x + ddx_ddd[i]];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(c_ptr);
/* Scan all normal grids */
for (x = 1; x < cur_wid - 1; x++)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
/* Memorize terrain of the grid */
c_ptr->info |= (CAVE_KNOWN);
POSITION xx = x + ddx_ddd[i];
/* Get the grid */
- c_ptr = &cave[yy][xx];
+ c_ptr = &grid_array[yy][xx];
/* Feature code (applying "mimic" field) */
f_ptr = &f_info[get_feat_mimic(c_ptr)];
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
{
for (x = 1; x < cur_wid - 1; x++)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
/* Process the grid */
c_ptr->info &= ~(CAVE_MARK | CAVE_IN_DETECT | CAVE_KNOWN);
/* Forget every grid on horizontal edge */
for (x = 0; x < cur_wid; x++)
{
- cave[0][x].info &= ~(CAVE_MARK);
- cave[cur_hgt - 1][x].info &= ~(CAVE_MARK);
+ grid_array[0][x].info &= ~(CAVE_MARK);
+ grid_array[cur_hgt - 1][x].info &= ~(CAVE_MARK);
}
/* Forget every grid on vertical edge */
for (y = 1; y < (cur_hgt - 1); y++)
{
- cave[y][0].info &= ~(CAVE_MARK);
- cave[y][cur_wid - 1].info &= ~(CAVE_MARK);
+ grid_array[y][0].info &= ~(CAVE_MARK);
+ grid_array[y][cur_wid - 1].info &= ~(CAVE_MARK);
}
/* Forget all objects */
*/
void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
feature_type *f_ptr = &f_info[feat];
bool old_los, old_mirror;
yy = y + ddy_ddd[i];
xx = x + ddx_ddd[i];
if (!in_bounds2(yy, xx)) continue;
- cave[yy][xx].info |= CAVE_GLOW;
+ grid_array[yy][xx].info |= CAVE_GLOW;
}
}
yy = y + ddy_ddd[i];
xx = x + ddx_ddd[i];
if (!in_bounds2(yy, xx)) continue;
- cc_ptr = &cave[yy][xx];
+ cc_ptr = &grid_array[yy][xx];
cc_ptr->info |= CAVE_GLOW;
if (player_has_los_grid(cc_ptr))
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
}
void cave_alter_feat(POSITION y, POSITION x, int action)
{
/* Set old feature */
- FEAT_IDX oldfeat = cave[y][x].feat;
+ FEAT_IDX oldfeat = grid_array[y][x].feat;
/* Get the new feat */
FEAT_IDX newfeat = feat_state(oldfeat, action);
/* Remove a mirror */
void remove_mirror(POSITION y, POSITION x)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
/* Remove the mirror */
c_ptr->info &= ~(CAVE_OBJECT);
{
for (x = 0; x < cur_wid; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Feature code (applying "mimic" field) */
yy = y + ddy_ddd[i];
xx = x + ddx_ddd[i];
if (!in_bounds2(yy, xx)) continue;
- cave[yy][xx].info |= CAVE_GLOW;
+ grid_array[yy][xx].info |= CAVE_GLOW;
}
}
}
bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode)
{
monster_type *m_ptr = &m_list[m_idx];
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
/* Require "teleportable" space */
*/
bool cave_player_teleportable_bold(POSITION y, POSITION x, BIT_FLAGS mode)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
/* Require "teleportable" space */
msg_print(_("そこは水辺ではない。", "There is no fishing place."));
return FALSE;
}
- else if (cave[y][x].m_idx)
+ else if (grid_array[y][x].m_idx)
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
+ monster_desc(m_name, &m_list[grid_array[y][x].m_idx], 0);
msg_format(_("%sが邪魔だ!", "%^s is stand in your way."), m_name);
free_turn(p_ptr);
return FALSE;
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
if (p_ptr->special_defense & KATA_MUSOU) set_action(ACTION_NONE);
}
target_pet = old_target_pet;
- if (cave[target_row][target_col].m_idx)
+ if (grid_array[target_row][target_col].m_idx)
{
- m_ptr = &m_list[cave[target_row][target_col].m_idx];
+ m_ptr = &m_list[grid_array[target_row][target_col].m_idx];
if (!is_pet(m_ptr))
{
if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
else
{
- grid_type *c_ptr = &cave[target_row][target_col];
+ grid_type *c_ptr = &grid_array[target_row][target_col];
if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
{
- pet_t_m_idx = cave[target_row][target_col].m_idx;
+ pet_t_m_idx = grid_array[target_row][target_col].m_idx;
p_ptr->pet_follow_distance = PET_DESTROY_DIST;
}
else pet_t_m_idx = 0;
y = p_ptr->y + ddy_ddd[i];
x = p_ptr->x + ddx_ddd[i];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
if (c_ptr->m_idx) continue;
bool go_up = FALSE;
/* Player grid */
- grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+ grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x];
feature_type *f_ptr = &f_info[c_ptr->feat];
int up_num = 0;
void do_cmd_go_down(void)
{
/* Player grid */
- grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+ grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x];
feature_type *f_ptr = &f_info[c_ptr->feat];
bool fall_trap = FALSE;
*/
static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Scan all objects in the grid */
yy = p_ptr->y + ddy_ddd[d];
xx = p_ptr->x + ddx_ddd[d];
- /* Get the cave */
- c_ptr = &cave[yy][xx];
+ /* Get the grid_array */
+ c_ptr = &grid_array[yy][xx];
/* Must have knowledge */
if (!(c_ptr->info & (CAVE_MARK))) continue;
int i, j;
/* Get requested grid */
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
bool more = FALSE;
x = p_ptr->x + ddx[dir];
/* Get requested grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(c_ptr);
*/
static bool do_cmd_close_aux(POSITION y, POSITION x)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
FEAT_IDX old_feat = c_ptr->feat;
bool more = FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(c_ptr);
*/
static bool do_cmd_tunnel_test(POSITION y, POSITION x)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
/* Must have knowledge */
if (!(c_ptr->info & CAVE_MARK))
take_turn(p_ptr, 100);;
/* Get grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
f_ptr = &f_info[c_ptr->feat];
power = f_ptr->power;
x = p_ptr->x + ddx[dir];
/* Get grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(c_ptr);
{
int i, j;
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
/* Must be a closed door */
bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
/* Get feature */
feature_type *f_ptr = &f_info[c_ptr->feat];
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(c_ptr);
static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir)
{
/* Get grid */
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
/* Get feature */
feature_type *f_ptr = &f_info[c_ptr->feat];
x = p_ptr->x + ddx[dir];
/* Get grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(c_ptr);
x = p_ptr->x + ddx[dir];
/* Get grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(c_ptr);
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(c_ptr);
if (!cave_have_flag_bold(ny[cur_dis], nx[cur_dis], FF_PROJECT))
{
hit_wall = TRUE;
- if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !cave[ny[cur_dis]][nx[cur_dis]].m_idx) break;
+ if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !grid_array[ny[cur_dis]][nx[cur_dis]].m_idx) break;
}
/* The player can see the (on screen) missile */
cur_dis++;
/* Monster here, Try to hit it */
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
monster_type *m_ptr = &m_list[c_ptr->m_idx];
/* Check the visibility */
if (potion_smash_effect(0, y, x, q_ptr->k_idx))
{
- monster_type *m_ptr = &m_list[cave[y][x].m_idx];
+ monster_type *m_ptr = &m_list[grid_array[y][x].m_idx];
/* ToDo (Robert): fix the invulnerability */
- if (cave[y][x].m_idx &&
- is_friendly(&m_list[cave[y][x].m_idx]) &&
+ if (grid_array[y][x].m_idx &&
+ is_friendly(&m_list[grid_array[y][x].m_idx]) &&
!MON_INVULNER(m_ptr))
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
+ monster_desc(m_name, &m_list[grid_array[y][x].m_idx], 0);
msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
- set_hostile(&m_list[cave[y][x].m_idx]);
+ set_hostile(&m_list[grid_array[y][x].m_idx]);
}
}
do_drop = FALSE;
*/
static int travel_flow_cost(POSITION y, POSITION x)
{
- feature_type *f_ptr = &f_info[cave[y][x].feat];
+ feature_type *f_ptr = &f_info[grid_array[y][x].feat];
int cost = 1;
/* Avoid obstacles (ex. trees) */
}
/* Detected traps and doors */
- if (cave[y][x].info & (CAVE_MARK))
+ if (grid_array[y][x].info & (CAVE_MARK))
{
if (have_flag(f_ptr->flags, FF_DOOR)) cost += 1;
if (have_flag(f_ptr->flags, FF_TRAP)) cost += 10;
*/
static void travel_flow_aux(POSITION y, POSITION x, int n, bool wall)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
int old_head = flow_head;
int add_cost = 1;
/* Ignore "walls" and "rubble" (include "secret doors") */
if (have_flag(f_ptr->flags, FF_WALL) ||
have_flag(f_ptr->flags, FF_CAN_DIG) ||
- (have_flag(f_ptr->flags, FF_DOOR) && cave[y][x].mimic) ||
+ (have_flag(f_ptr->flags, FF_DOOR) && grid_array[y][x].mimic) ||
(!have_flag(f_ptr->flags, FF_MOVE) && have_flag(f_ptr->flags, FF_CAN_FLY) && !p_ptr->levitation))
{
if (!wall || !from_wall) return;
{
POSITION x, y, d;
bool wall = FALSE;
- feature_type *f_ptr = &f_info[cave[p_ptr->y][p_ptr->x].feat];
+ feature_type *f_ptr = &f_info[grid_array[p_ptr->y][p_ptr->x].feat];
/* Reset the "queue" */
flow_head = flow_tail = 0;
return;
}
- f_ptr = &f_info[cave[y][x].feat];
+ f_ptr = &f_info[grid_array[y][x].feat];
- if ((cave[y][x].info & CAVE_MARK) &&
+ if ((grid_array[y][x].info & CAVE_MARK) &&
(have_flag(f_ptr->flags, FF_WALL) ||
have_flag(f_ptr->flags, FF_CAN_DIG) ||
- (have_flag(f_ptr->flags, FF_DOOR) && cave[y][x].mimic)))
+ (have_flag(f_ptr->flags, FF_DOOR) && grid_array[y][x].mimic)))
{
msg_print(_("そこには行くことができません!", "You cannot travel there!"));
return;
{
for (x = 0; x < cur_wid; x++)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
#define MAX_SAVED_FLOORS 20 /*!< 保存フロアの最大数 / Maximum number of saved floors. */
/*!
- * @brief プレイヤー用光源処理配列サイズ / Maximum size of the "lite" array (see "cave.c")
+ * @brief プレイヤー用光源処理配列サイズ / Maximum size of the "lite" array (see "grid_array.c")
* @details Note that the "lite radius" will NEVER exceed 14, and we would
* never require more than 581 entries in the array for circular "lite".
*/
#define LITE_MAX 600
/*!
- * @brief モンスター用光源処理配列サイズ / Maximum size of the "mon_lite" array (see "cave.c")
+ * @brief モンスター用光源処理配列サイズ / Maximum size of the "mon_lite" array (see "grid_array.c")
* @details Note that the "view radius" will NEVER exceed 20, monster illumination
* flags are dependent on CAVE_VIEW, and even if the "view" was octagonal,
* we would never require more than 1520 entries in the array.
#define MON_LITE_MAX 1536
/*!
- * @brief 視界処理配列サイズ / Maximum size of the "view" array (see "cave.c")
+ * @brief 視界処理配列サイズ / Maximum size of the "view" array (see "grid_array.c")
* @details Note that the "view radius" will NEVER exceed 20, and even if the "view"
* was octagonal, we would never require more than 1520 entries in the array.
*/
#define VIEW_MAX 1536
/*!
- * @brief 視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "cave.c")
+ * @brief 視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "grid_array.c")
* @details We must be as large as "VIEW_MAX" and "LITE_MAX" for proper functioning
* of "update_view()" and "update_lite()". We must also be as large as the
* largest illuminatable room, but no room is larger than 800 grids. We
#define TEMP_MAX 2298
/*!
- * @brief 再描画処理用配列サイズ / Maximum size of the "redraw" array (see "cave.c")
+ * @brief 再描画処理用配列サイズ / Maximum size of the "redraw" array (see "grid_array.c")
* @details We must be large for proper functioning of delayed redrawing.
* We must also be as large as two times of the largest view area.
* Note that maximum view grids are 1149 entries.
/*
- * 特殊なマス状態フラグ / Special cave grid flags
+ * 特殊なマス状態フラグ / Special grid flags
*/
#define CAVE_MARK 0x0001 /*!< 現在プレイヤーの記憶に収まっている / memorized feature */
#define CAVE_GLOW 0x0002 /*!< マス自体が光源を持っている / self-illuminating */
#define CAVE_MNLT 0x0100 /*!< モンスターの光源によって照らされている / Illuminated by monster */
#define CAVE_MNDK 0x8000 /*!< モンスターの暗源によって暗闇になっている / Darken by monster */
-/* Used only while cave generation */
+/* Used only while grid_array generation */
#define CAVE_FLOOR 0x0200 /*!< フロア属性のあるマス */
#define CAVE_EXTRA 0x0400
#define CAVE_INNER 0x0800
#define CAVE_VAULT 0x4000
#define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT)
-/* Used only after cave generation */
+/* Used only after grid_array generation */
#define CAVE_KNOWN 0x0200 /* Directly viewed or map detected flag */
#define CAVE_NOTE 0x0400 /* Flag for delayed visual update (needs note_spot()) */
#define CAVE_REDRAW 0x0800 /* Flag for delayed visual update (needs lite_spot()) */
* Grid based version of "player_bold()"
*/
#define player_grid(C) \
- ((C) == &cave[p_ptr->y][p_ptr->x])
+ ((C) == &grid_array[p_ptr->y][p_ptr->x])
#define cave_have_flag_bold(Y,X,INDEX) \
- (have_flag(f_info[cave[(Y)][(X)].feat].flags, (INDEX)))
+ (have_flag(f_info[grid_array[(Y)][(X)].feat].flags, (INDEX)))
#define cave_have_flag_grid(C,INDEX) \
* Determine if a "legal" grid supports "los"
*/
#define cave_los_bold(Y,X) \
- (feat_supports_los(cave[(Y)][(X)].feat))
+ (feat_supports_los(grid_array[(Y)][(X)].feat))
#define cave_los_grid(C) \
(feat_supports_los((C)->feat))
*/
#define cave_clean_bold(Y,X) \
(cave_have_flag_bold((Y), (X), FF_FLOOR) && \
- !(cave[Y][X].info & CAVE_OBJECT) && \
- (cave[Y][X].o_idx == 0))
+ !(grid_array[Y][X].info & CAVE_OBJECT) && \
+ (grid_array[Y][X].o_idx == 0))
/*
*/
#define cave_drop_bold(Y,X) \
(cave_have_flag_bold((Y), (X), FF_DROP) && \
- !(cave[Y][X].info & CAVE_OBJECT))
+ !(grid_array[Y][X].info & CAVE_OBJECT))
/*
*/
#define cave_empty_bold(Y,X) \
(cave_have_flag_bold((Y), (X), FF_PLACE) && \
- !(cave[Y][X].m_idx) && \
+ !(grid_array[Y][X].m_idx) && \
!player_bold(Y,X))
*/
#define cave_naked_bold(Y,X) \
(cave_clean_bold(Y,X) && \
- !(cave[Y][X].m_idx) && \
+ !(grid_array[Y][X].m_idx) && \
!player_bold(Y,X))
* Note the use of comparison to zero to force a "boolean" result
*/
#define player_has_los_bold(Y,X) \
- (((cave[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->inside_battle)
+ (((grid_array[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->inside_battle)
/*
{
int to_ruin = 0;
POSITION r_y, r_x;
- int pattern_type = f_info[cave[p_ptr->y][p_ptr->x].feat].subtype;
+ int pattern_type = f_info[grid_array[p_ptr->y][p_ptr->x].feat].subtype;
if (pattern_type == PATTERN_TILE_WRECKED)
{
scatter(&r_y, &r_x, p_ptr->y, p_ptr->x, 4, 0);
if (pattern_tile(r_y, r_x) &&
- (f_info[cave[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
+ (f_info[grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
{
cave_set_feat(r_y, r_x, feat_pattern_corrupted);
}
wreck_the_pattern();
}
- pattern_type = f_info[cave[p_ptr->y][p_ptr->x].feat].subtype;
+ pattern_type = f_info[grid_array[p_ptr->y][p_ptr->x].feat].subtype;
switch (pattern_type)
{
*/
static void process_world_aux_hp_and_sp(void)
{
- feature_type *f_ptr = &f_info[cave[p_ptr->y][p_ptr->x].feat];
+ feature_type *f_ptr = &f_info[grid_array[p_ptr->y][p_ptr->x].feat];
bool cave_no_regen = FALSE;
int upkeep_factor = 0;
{
if (!dun_level && !p_ptr->resist_lite && !IS_INVULN() && is_daytime())
{
- if ((cave[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+ if ((grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
{
msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!"));
take_hit(DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
{
msg_print(_("熱で火傷した!", "The heat burns you!"));
take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
msg_format(_("%sで火傷した!", "The %s burns you!"), name);
take_hit(DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("冷気に覆われた!", "The cold engulfs you!"));
take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
msg_format(_("%sに凍えた!", "The %s frostbites you!"), name);
take_hit(DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("電撃を受けた!", "The electric shocks you!"));
take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
msg_format(_("%sに感電した!", "The %s shocks you!"), name);
take_hit(DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("酸が飛び散った!", "The acid melt you!"));
take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
msg_format(_("%sに溶かされた!", "The %s melts you!"), name);
take_hit(DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("毒気を吸い込んだ!", "The gas poisons you!"));
take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name), -1);
if (p_ptr->resist_pois) (void)set_poisoned(p_ptr->poisoned + 1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name;
msg_format(_("%sに毒された!", "The %s poisons you!"), name);
take_hit(DAMAGE_NOESCAPE, damage, name, -1);
if (p_ptr->resist_pois) (void)set_poisoned(p_ptr->poisoned + 3);
msg_print(NULL);
/* Absorb light from the current possition */
- if ((cave[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+ if ((grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
{
hp_player(10);
}
if (!in_bounds(ay, ax)) continue;
/* Count number of monsters */
- if (cave[ay][ax].m_idx > 0) count++;
+ if (grid_array[ay][ax].m_idx > 0) count++;
}
return count;
for (i2 = 0; i2 < cur_wid; ++i2)
for (j2 = 0; j2 < cur_hgt; j2++)
{
- grid_type *c_ptr = &cave[j2][i2];
+ grid_type *c_ptr = &grid_array[j2][i2];
if ((c_ptr->m_idx > 0) && (c_ptr->m_idx != p_ptr->riding))
{
if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
+ monster_desc(m_name, &m_list[grid_array[y][x].m_idx], 0);
msg_format(_("%sが釣れた!", "You have a good catch!"), m_name);
success = TRUE;
}
/* Handle "quit and save" */
if (!p_ptr->playing && !p_ptr->is_dead) break;
- /* Erase the old cave */
+ /* Erase the old grid_array */
wipe_o_list();
if (!p_ptr->is_dead) wipe_m_list();
{
if (!(p_ptr->special_defense & NINJA_S_STEALTH))
{
- if (cave[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
+ if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
{
msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
p_ptr->monlite = p_ptr->old_monlite = TRUE;
extern byte angband_color_table[256][4];
extern const concptr angband_sound_name[SOUND_MAX];
extern const concptr angband_music_basic_name[MUSIC_BASIC_MAX];
-extern grid_type *cave[MAX_HGT];
+extern grid_type *grid_array[MAX_HGT];
extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
extern FLOOR_IDX max_floor_id;
extern u32b saved_floor_file_sign;
extern void player_outfit(void);
extern void dump_yourself(FILE *fff);
-/* cave.c */
+/* grid_array.c */
extern POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
extern bool is_trap(IDX feat);
extern bool is_known_trap(grid_type *c_ptr);
{
for (x = 0; x < cur_wid; x++)
{
- /* Get the cave grid */
- grid_type *c_ptr = &cave[y][x];
+ /* Get the grid */
+ grid_type *c_ptr = &grid_array[y][x];
/* Assume lit */
c_ptr->info |= (CAVE_GLOW);
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
{
for (x = 0; x < cur_wid; x++)
{
- /* Get the cave grid */
- grid_type *c_ptr = &cave[y][x];
+ /* Get the grid */
+ grid_type *c_ptr = &grid_array[y][x];
/* Feature code (applying "mimic" field) */
feature_type *f_ptr = &f_info[get_feat_mimic(c_ptr)];
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
{
for (y = 0; y < cur_hgt; ++y)
{
- MONSTER_IDX m_idx = cave[y][x].m_idx;
+ MONSTER_IDX m_idx = grid_array[y][x].m_idx;
if (m_idx > 0 && is_hostile(&m_list[m_idx]))
{
* demon). Note that both "nests" and "pits" are now "level dependant",\n
* and both make 16 "expensive" calls to the "get_mon_num()" function.\n
*\n
- * Note that the cave grid flags changed in a rather drastic manner\n
+ * Note that the grid flags changed in a rather drastic manner\n
* for Angband 2.8.0 (and 2.7.9+), in particular, dungeon terrain\n
* features, such as doors and stairs and traps and rubble and walls,\n
* are all handled as a set of 64 possible "terrain features", and\n
*/
static bool alloc_stairs_aux(POSITION y, POSITION x, int walls)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
/* Require "naked" floor grid */
if (!is_floor_grid(c_ptr)) return FALSE;
if (!pick) break;
}
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Clear possible garbage of hidden trap */
c_ptr->mimic = 0;
y = randint0(cur_hgt);
x = randint0(cur_wid);
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Require "naked" floor grid */
if (!is_floor_grid(c_ptr) || c_ptr->o_idx || c_ptr->m_idx) continue;
if (player_bold(y, x)) continue;
/* Check for "room" */
- room = (cave[y][x].info & CAVE_ROOM) ? TRUE : FALSE;
+ room = (grid_array[y][x].info & CAVE_ROOM) ? TRUE : FALSE;
/* Require corridor? */
if ((set == ALLOC_SET_CORR) && room) continue;
case ALLOC_TYP_RUBBLE:
{
place_rubble(y, x);
- cave[y][x].info &= ~(CAVE_FLOOR);
+ grid_array[y][x].info &= ~(CAVE_FLOOR);
break;
}
case ALLOC_TYP_TRAP:
{
place_trap(y, x);
- cave[y][x].info &= ~(CAVE_FLOOR);
+ grid_array[y][x].info &= ~(CAVE_FLOOR);
break;
}
y = randint0(cur_hgt);
x = randint0(cur_wid);
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
f_ptr = &f_info[c_ptr->feat];
if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) continue;
{
dun->cavern = TRUE;
- /* make a large fractal cave in the middle of the dungeon */
+ /* make a large fractal grid_array in the middle of the dungeon */
msg_print_wizard(CHEAT_DUNGEON, _("洞窟を生成。", "Cavern on level."));
build_cavern();
/* Connect the room to the previous room */
if (randint1(dun_level) > d_info[p_ptr->dungeon_idx].tunnel_percent)
{
- /* make cave-like tunnel */
+ /* make cavelike tunnel */
(void)build_tunnel2(dun->cent[i].x, dun->cent[i].y, x, y, 2, 2);
}
else
feature_type *f_ptr;
y = dun->tunn[j].y;
x = dun->tunn[j].x;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
f_ptr = &f_info[c_ptr->feat];
/* Clear previous contents (if not a lake), add a floor */
grid_type *c_ptr;
y = dun->wall[j].y;
x = dun->wall[j].x;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Clear mimic type */
c_ptr->mimic = 0;
/* Special boundary walls -- Top and bottom */
for (x = 0; x < cur_wid; x++)
{
- set_bound_perm_wall(&cave[0][x]);
- set_bound_perm_wall(&cave[cur_hgt - 1][x]);
+ set_bound_perm_wall(&grid_array[0][x]);
+ set_bound_perm_wall(&grid_array[cur_hgt - 1][x]);
}
/* Special boundary walls -- Left and right */
for (y = 1; y < (cur_hgt - 1); y++)
{
- set_bound_perm_wall(&cave[y][0]);
- set_bound_perm_wall(&cave[y][cur_wid - 1]);
+ set_bound_perm_wall(&grid_array[y][0]);
+ set_bound_perm_wall(&grid_array[y][cur_wid - 1]);
}
/* Determine the character location */
if (dun->empty_level && (!one_in_(DARK_EMPTY) || (randint1(100) > dun_level)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
{
- /* Lite the cave */
+ /* Lite the grid_array */
for (y = 0; y < cur_hgt; y++)
{
for (x = 0; x < cur_wid; x++)
{
- cave[y][x].info |= (CAVE_GLOW);
+ grid_array[y][x].info |= (CAVE_GLOW);
}
}
}
for (j = x_left; j <= x_right; j++)
{
place_extra_perm_bold(i, j);
- cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
for (i = y_depth; i >= y_depth - 5; i--)
for (j = x_left; j <= x_right; j++)
{
place_extra_perm_bold(i, j);
- cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
for (j = x_left; j <= x_left + 17; j++)
for (i = y_height; i <= y_depth; i++)
{
place_extra_perm_bold(i, j);
- cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
for (j = x_right; j >= x_right - 17; j--)
for (i = y_height; i <= y_depth; i++)
{
place_extra_perm_bold(i, j);
- cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
place_extra_perm_bold(y_height+6, x_left+18);
- cave[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_depth-6, x_left+18);
- cave[y_depth-6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[y_depth-6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_height+6, x_right-18);
- cave[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_depth-6, x_right-18);
- cave[y_depth-6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[y_depth-6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
i = y_height + 5;
j = xval;
- cave[i][j].feat = f_tag_to_index("ARENA_GATE");
- cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[i][j].feat = f_tag_to_index("ARENA_GATE");
+ grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
player_place(i, j);
}
place_solid_perm_bold(y, x);
/* Illuminate and memorize the walls */
- cave[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
}
for (x = qx + 1; x < qx + SCREEN_WID - 1; x++)
{
/* Create empty floor */
- cave[y][x].feat = feat_floor;
+ grid_array[y][x].feat = feat_floor;
}
}
for (j = x_left; j <= x_right; j++)
{
place_extra_perm_bold(i, j);
- cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
for (i = y_depth; i >= y_depth - 3; i--)
for (j = x_left; j <= x_right; j++)
{
place_extra_perm_bold(i, j);
- cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
for (j = x_left; j <= x_left + 17; j++)
for (i = y_height; i <= y_depth; i++)
{
place_extra_perm_bold(i, j);
- cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
for (j = x_right; j >= x_right - 17; j--)
for (i = y_height; i <= y_depth; i++)
{
place_extra_perm_bold(i, j);
- cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
place_extra_perm_bold(y_height+6, x_left+18);
- cave[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_depth-4, x_left+18);
- cave[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_height+6, x_right-18);
- cave[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_depth-4, x_right-18);
- cave[y_depth-4][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[y_depth-4][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
for (i = y_height + 1; i <= y_height + 5; i++)
for (j = x_left + 20 + 2 * (y_height + 5 - i); j <= x_right - 20 - 2 * (y_height + 5 - i); j++)
{
- cave[i][j].feat = feat_permanent_glass_wall;
+ grid_array[i][j].feat = feat_permanent_glass_wall;
}
i = y_height + 1;
j = xval;
- cave[i][j].feat = f_tag_to_index("BUILDING_3");
- cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[i][j].feat = f_tag_to_index("BUILDING_3");
+ grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
player_place(i, j);
}
place_solid_perm_bold(y, x);
/* Illuminate and memorize the walls */
- cave[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
}
for (x = qx + 1; x < qx + SCREEN_WID - 1; x++)
{
/* Create empty floor */
- cave[y][x].feat = feat_floor;
+ grid_array[y][x].feat = feat_floor;
}
}
for(i = 0; i < 4; i++)
{
place_monster_aux(0, p_ptr->y + 8 + (i/2)*4, p_ptr->x - 2 + (i%2)*4, battle_mon[i], (PM_NO_KAGE | PM_NO_PET));
- set_friendly(&m_list[cave[p_ptr->y+8+(i/2)*4][p_ptr->x-2+(i%2)*4].m_idx]);
+ set_friendly(&m_list[grid_array[p_ptr->y+8+(i/2)*4][p_ptr->x-2+(i%2)*4].m_idx]);
}
for(i = 1; i < m_max; i++)
{
}
/*!
- * @brief フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after cave generation
+ * @brief フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after grid_array generation
* @return なし
*/
void wipe_generate_cave_flags(void)
for (x = 0; x < cur_wid; x++)
{
/* Wipe unused flags */
- cave[y][x].info &= ~(CAVE_MASK);
+ grid_array[y][x].info &= ~(CAVE_MASK);
}
}
for (x = 1; x < cur_wid - 1; x++)
{
/* There might be trap */
- cave[y][x].info |= CAVE_UNSAFE;
+ grid_array[y][x].info |= CAVE_UNSAFE;
}
}
}
}
/*!
- * @brief フロアの全情報を初期化する / Clear and empty the cave
+ * @brief フロアの全情報を初期化する / Clear and empty the grid_array
* @return なし
*/
void clear_cave(void)
precalc_cur_num_of_pet();
- /* Start with a blank cave */
+ /* Start with a blank grid_array */
for (y = 0; y < MAX_HGT; y++)
{
for (x = 0; x < MAX_WID; x++)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
c_ptr->info = 0;
c_ptr->feat = 0;
c_ptr->o_idx = 0;
concptr why = NULL;
- /* Clear and empty the cave */
+ /* Clear and empty the grid_array */
clear_cave();
/* Build the arena -KMW- */
/* Access the location */
- c_ptr = &cave[tmp_row][tmp_col];
+ c_ptr = &grid_array[tmp_row][tmp_col];
/* Avoid "solid" walls */
if (is_solid_grid(c_ptr)) continue;
{
int i, j, dx, dy;
- grid_type *c_ptr = &cave[*y][*x];
+ grid_type *c_ptr = &grid_array[*y][*x];
if (!in_bounds(*y, *x)) return TRUE;
}
/* Clear mimic type */
- cave[*y][*x].mimic = 0;
+ grid_array[*y][*x].mimic = 0;
place_floor_bold(*y, *x);
y3 = (y1 + y2) / 2;
}
/* cache c_ptr */
- c_ptr = &cave[y3][x3];
+ c_ptr = &grid_array[y3][x3];
if (is_solid_grid(c_ptr))
{
/* move midpoint a bit to avoid problem. */
}
y3 += dy;
x3 += dx;
- c_ptr = &cave[y3][x3];
+ c_ptr = &grid_array[y3][x3];
}
if (is_floor_grid(c_ptr))
{
if (build_tunnel2(x1, y1, x3, y3, type, cutoff))
{
- if ((cave[y3][x3].info & CAVE_ROOM) || (randint1(100) > 95))
+ if ((grid_array[y3][x3].info & CAVE_ROOM) || (randint1(100) > 95))
{
/* do second half only if works + if have hit a room */
retval = build_tunnel2(x3, y3, x2, y2, type, cutoff);
{
POSITION x, y;
- /* Clear and empty the cave */
+ /* Clear and empty the grid_array */
clear_cave();
/* Fill the arrays of floors and walls in the good proportions */
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr;
- cave[cy][cx].m_idx = m_idx;
+ grid_array[cy][cx].m_idx = m_idx;
m_ptr->r_idx = party_mon[i].r_idx;
POSITION dis = 1;
POSITION oy = p_ptr->y;
POSITION ox = p_ptr->x;
- MONSTER_IDX m_idx = cave[oy][ox].m_idx;
+ MONSTER_IDX m_idx = grid_array[oy][ox].m_idx;
/* Nothing to do if no monster */
if (!m_idx) return;
if (!cave_empty_bold(ny, nx)) continue;
/* Hack -- no teleport onto glyph of warding */
- if (is_glyph_grid(&cave[ny][nx])) continue;
- if (is_explosive_rune_grid(&cave[ny][nx])) continue;
+ if (is_glyph_grid(&grid_array[ny][nx])) continue;
+ if (is_explosive_rune_grid(&grid_array[ny][nx])) continue;
/* ...nor onto the Pattern */
if (pattern_tile(ny, nx)) continue;
m_ptr = &m_list[m_idx];
/* Update the old location */
- cave[oy][ox].m_idx = 0;
+ grid_array[oy][ox].m_idx = 0;
/* Update the new location */
- cave[ny][nx].m_idx = m_idx;
+ grid_array[ny][nx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ny;
{
for (x = 0; x < cur_wid; x++)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
bool ok = FALSE;
prepare_change_floor_mode(CFM_RAND_PLACE | CFM_NO_RETURN);
/* Mega Hack -- It's not the stairs you enter. Disable it. */
- if (!feat_uses_special(cave[p_ptr->y][p_ptr->x].feat)) cave[p_ptr->y][p_ptr->x].special = 0;
+ if (!feat_uses_special(grid_array[p_ptr->y][p_ptr->x].feat)) grid_array[p_ptr->y][p_ptr->x].special = 0;
}
else
{
if (change_floor_mode & CFM_SAVE_FLOORS)
{
/* Extract stair position */
- c_ptr = &cave[p_ptr->y][p_ptr->x];
+ c_ptr = &grid_array[p_ptr->y][p_ptr->x];
f_ptr = &f_info[c_ptr->feat];
/* Get back to old saved floor? */
* @return なし
* @details
* If the floor is an old saved floor, it will be\n
- * restored from the temporal file. If the floor is new one, new cave\n
+ * restored from the temporal file. If the floor is new one, new grid_array\n
* will be generated.\n
*/
void change_floor(void)
if (!(change_floor_mode & CFM_SAVE_FLOORS) &&
!(change_floor_mode & CFM_FIRST_FLOOR))
{
- /* Create cave */
+ /* Create grid_array */
generate_cave();
/* Paranoia -- No new saved floor */
/* Forbid return stairs */
if (change_floor_mode & CFM_NO_RETURN)
{
- grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+ grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x];
if (!feat_uses_special(c_ptr->feat))
{
}
else
{
- /* Newly create cave */
+ /* Newly create grid_array */
generate_cave();
}
if (!(change_floor_mode & CFM_NO_RETURN))
{
/* Extract stair position */
- grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+ grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x];
/*** Create connected stairs ***/
{
for (x = 0; x < cur_wid; x++)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
if (!c_ptr->special) continue;
if (feat_uses_special(c_ptr->feat)) continue;
/* Connect this stairs to the destination */
- cave[p_ptr->y][p_ptr->x].special = dest_floor_id;
+ grid_array[p_ptr->y][p_ptr->x].special = dest_floor_id;
}
{
if (!in_bounds2(ty, tx)) continue;
- c_ptr = &cave[ty][tx];
+ c_ptr = &grid_array[ty][tx];
if (c_ptr->feat == feat1) continue;
if (c_ptr->feat == feat2) continue;
if (!in_bounds2(ty, tx)) continue;
break;
}
- c_ptr = &cave[ty][tx];
+ c_ptr = &grid_array[ty][tx];
f_ptr = &f_info[c_ptr->feat];
if (have_flag(f_ptr->flags, FF_MOVE) && (have_flag(f_ptr->flags, FF_WATER) || have_flag(f_ptr->flags, FF_LAVA)))
for (j = y - 3; j < y + 4; j++)
{
if (!in_bounds(j, i)) continue;
- c_ptr = &cave[j][i];
+ c_ptr = &grid_array[j][i];
if (c_ptr->info & CAVE_ICKY) continue;
if (c_ptr->o_idx) continue;
if ((distance(j, i, y, x) > 1) || (randint1(100) < 25))
{
if (randint1(100) < 75)
- cave[j][i].feat = feat_tree;
+ grid_array[j][i].feat = feat_tree;
}
else
{
- cave[j][i].feat = feat_rubble;
+ grid_array[j][i].feat = feat_rubble;
}
/* Clear garbage of hidden trap or door */
c_ptr->mimic = 0;
/* Light area since is open above */
- if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) cave[j][i].info |= (CAVE_GLOW | CAVE_ROOM);
+ if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) grid_array[j][i].info |= (CAVE_GLOW | CAVE_ROOM);
}
}
}
if (!ironman_downward && one_in_(3))
{
/* up stair */
- cave[y][x].feat = feat_up_stair;
+ grid_array[y][x].feat = feat_up_stair;
}
}
y = (POSITION)rand_range(1, cur_hgt - 2);
x = (POSITION)rand_range(1, cur_wid - 2);
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Must be a "naked" floor grid */
if (c_ptr->m_idx) continue;
grid_type *c_ptr;
/* Paranoia */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
if (!is_floor_grid(c_ptr) || c_ptr->o_idx) return;
/* Town */
{
int tmp, type;
FEAT_IDX feat = feat_none;
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
/* Initialize mimic info */
c_ptr->mimic = 0;
cave_set_feat(y, x, feat);
/* Now it is not floor */
- cave[y][x].info &= ~(CAVE_MASK);
+ grid_array[y][x].info &= ~(CAVE_MASK);
}
else
{
else
{
set_cave_feat(y, x, feat_locked_door_random((d_info[p_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR));
- cave[y][x].info &= ~(CAVE_FLOOR);
+ grid_array[y][x].info &= ~(CAVE_FLOOR);
delete_monster(y, x);
}
}
}
else
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
if (type == DOOR_DEFAULT)
{
/* Extract the location */
y = y1 + ddy_ddd[i];
x = x1 + ddx_ddd[i];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Skip non floors */
if (cave_have_flag_grid(c_ptr, FF_WALL)) continue;
if (cave_have_flag_bold(y, x, FF_WALL)) return;
/* Ignore room grids */
- if (cave[y][x].info & (CAVE_ROOM)) return;
+ if (grid_array[y][x].info & (CAVE_ROOM)) return;
/* Occasional door (if allowed) */
if ((randint0(100) < dun_tun_jct) && possible_doorway(y, x) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_DOORS))
}
/* Require "clean" floor space */
- c_ptr = &cave[j][k];
+ c_ptr = &grid_array[j][k];
if (!is_floor_grid(c_ptr) || c_ptr->o_idx) continue;
if (randint0(100) < 75)
}
/* Require "naked" floor grids */
- c_ptr = &cave[y1][x1];
+ c_ptr = &grid_array[y1][x1];
if (!is_floor_grid(c_ptr) || c_ptr->o_idx || c_ptr->m_idx) continue;
/* Place the trap */
scatter(&y, &x, y1, x1, d, 0);
/* Require "empty" floor grids */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
if (!cave_empty_grid(c_ptr)) continue;
/* Place the monster (allow groups) */
return;
}
- if (cave[y][x].info & CAVE_ROOM)
+ if (grid_array[y][x].info & CAVE_ROOM)
{
/* A room border don't touch. */
return;
/* Macros */
-#define set_cave_feat(Y,X,F) (cave[(Y)][(X)].feat = (F))
-#define add_cave_info(Y,X,I) (cave[(Y)][(X)].info |= (I))
+#define set_cave_feat(Y,X,F) (grid_array[(Y)][(X)].feat = (F))
+#define add_cave_info(Y,X,I) (grid_array[(Y)][(X)].info |= (I))
/* This should not be used */
-/*#define set_cave_info(Y,X,I) (cave[(Y)][(X)].info = (I)) */
+/*#define set_cave_info(Y,X,I) (grid_array[(Y)][(X)].info = (I)) */
/*!
* @brief 指定座標が瓦礫かどうかを返す
* @param X 指定X座標
* @return FLOOR属性を持っているならばTRUE
*/
-#define is_floor_bold(Y,X) (cave[Y][X].info & CAVE_FLOOR)
-#define is_extra_bold(Y,X) (cave[Y][X].info & CAVE_EXTRA)
+#define is_floor_bold(Y,X) (grid_array[Y][X].info & CAVE_FLOOR)
+#define is_extra_bold(Y,X) (grid_array[Y][X].info & CAVE_EXTRA)
-#define is_inner_bold(Y,X) (cave[Y][X].info & CAVE_INNER)
-#define is_outer_bold(Y,X) (cave[Y][X].info & CAVE_OUTER)
-#define is_solid_bold(Y,X) (cave[Y][X].info & CAVE_SOLID)
+#define is_inner_bold(Y,X) (grid_array[Y][X].info & CAVE_INNER)
+#define is_outer_bold(Y,X) (grid_array[Y][X].info & CAVE_OUTER)
+#define is_solid_bold(Y,X) (grid_array[Y][X].info & CAVE_SOLID)
#define is_floor_grid(C) ((C)->info & CAVE_FLOOR)
#define is_extra_grid(C) ((C)->info & CAVE_EXTRA)
#define place_floor_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_ground_type[randint0(100)]); \
- cave[Y][X].info &= ~(CAVE_MASK); \
+ grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_FLOOR); \
delete_monster(Y, X); \
}
#define place_extra_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_wall_type[randint0(100)]); \
- cave[Y][X].info &= ~(CAVE_MASK); \
+ grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_EXTRA); \
delete_monster(Y, X); \
}
#define place_extra_perm_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_permanent); \
- cave[Y][X].info &= ~(CAVE_MASK); \
+ grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_EXTRA); \
delete_monster(Y, X); \
}
{ \
feature_type *_f_ptr; \
set_cave_feat(Y,X,feat_wall_type[randint0(100)]); \
- _f_ptr = &f_info[cave[Y][X].feat]; \
- if (permanent_wall(_f_ptr)) cave[Y][X].feat = feat_state(cave[Y][X].feat, FF_UNPERM); \
- cave[Y][X].info &= ~(CAVE_MASK); \
+ _f_ptr = &f_info[grid_array[Y][X].feat]; \
+ if (permanent_wall(_f_ptr)) grid_array[Y][X].feat = feat_state(grid_array[Y][X].feat, FF_UNPERM); \
+ grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_EXTRA); \
delete_monster(Y, X); \
}
#define place_inner_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_wall_inner); \
- cave[Y][X].info &= ~(CAVE_MASK); \
+ grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_INNER); \
delete_monster(Y, X); \
}
#define place_inner_perm_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_permanent); \
- cave[Y][X].info &= ~(CAVE_MASK); \
+ grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_INNER); \
delete_monster(Y, X); \
}
#define place_outer_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_wall_outer); \
- cave[Y][X].info &= ~(CAVE_MASK); \
+ grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_OUTER); \
delete_monster(Y, X); \
}
#define place_outer_perm_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_permanent); \
- cave[Y][X].info &= ~(CAVE_MASK); \
+ grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_OUTER); \
delete_monster(Y, X); \
}
feature_type *_f_ptr = &f_info[feat_wall_outer]; \
if (permanent_wall(_f_ptr)) set_cave_feat(Y, X, (s16b)feat_state(feat_wall_outer, FF_UNPERM)); \
else set_cave_feat(Y,X,feat_wall_outer); \
- cave[Y][X].info &= ~(CAVE_MASK); \
+ grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,(CAVE_OUTER | CAVE_VAULT)); \
delete_monster(Y, X); \
}
#define place_solid_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_wall_solid); \
- cave[Y][X].info &= ~(CAVE_MASK); \
+ grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_SOLID); \
delete_monster(Y, X); \
}
#define place_solid_perm_bold(Y, X) \
{ \
set_cave_feat(Y,X,feat_permanent); \
- cave[Y][X].info &= ~(CAVE_MASK); \
+ grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_SOLID); \
delete_monster(Y, X); \
}
#define place_solid_noperm_bold(Y, X) \
{ \
feature_type *_f_ptr = &f_info[feat_wall_solid]; \
- if ((cave[Y][X].info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
+ if ((grid_array[Y][X].info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
set_cave_feat(Y, X, feat_state(feat_wall_solid, FF_UNPERM)); \
else set_cave_feat(Y,X,feat_wall_solid); \
- cave[Y][X].info &= ~(CAVE_MASK); \
+ grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_SOLID); \
delete_monster(Y, X); \
}
*/
static void drop_here(object_type *j_ptr, POSITION y, POSITION x)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
object_type *o_ptr;
OBJECT_IDX o_idx = o_pop();
return parse_line_feature(buf);
}
- /* Process "D:<dungeon>" -- info for the cave grids */
+ /* Process "D:<dungeon>" -- info for the grid_array grids */
else if (buf[0] == 'D')
{
object_type object_type_body;
for (*x = xmin, i = 0; ((*x < xmax) && (i < len)); (*x)++, s++, i++)
{
- grid_type *c_ptr = &cave[*y][*x];
+ grid_type *c_ptr = &grid_array[*y][*x];
int idx = s[0];
/* Allocate and Wipe the max dungeon level */
C_MAKE(max_dlv, max_d_idx, DEPTH);
- /* Allocate and wipe each line of the cave */
+ /* Allocate and wipe each line of the grid_array */
for (i = 0; i < MAX_HGT; i++)
{
- /* Allocate one row of the cave */
- C_MAKE(cave[i], MAX_WID, grid_type);
+ /* Allocate one row of the grid_array */
+ C_MAKE(grid_array[i], MAX_WID, grid_type);
}
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the cave */
- c_ptr = &cave[y][x];
+ /* Access the grid_array */
+ c_ptr = &grid_array[y][x];
/* Extract "info" */
c_ptr->info = info;
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the cave */
- c_ptr = &cave[y][x];
+ /* Access the grid_array */
+ c_ptr = &grid_array[y][x];
/* Extract "feat" */
c_ptr->feat = (s16b)tmp8u;
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the cave */
- c_ptr = &cave[y][x];
+ /* Access the grid_array */
+ c_ptr = &grid_array[y][x];
/* Extract "mimic" */
c_ptr->mimic = (s16b)tmp8u;
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the cave */
- c_ptr = &cave[y][x];
+ /* Access the grid_array */
+ c_ptr = &grid_array[y][x];
/* Extract "feat" */
c_ptr->special = tmp16s;
}
}
- /* Convert cave data */
+ /* Convert grid_array data */
if (z_older_than(11, 0, 99))
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
/* Wipe old unused flags */
- cave[y][x].info &= ~(CAVE_MASK);
+ grid_array[y][x].info &= ~(CAVE_MASK);
}
}
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
- /* Access the cave */
- c_ptr = &cave[y][x];
+ /* Access the grid_array */
+ c_ptr = &grid_array[y][x];
/* Very old */
if (c_ptr->feat == OLD_FEAT_INVIS)
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
- /* Access the cave */
- c_ptr = &cave[y][x];
+ /* Access the grid_array */
+ c_ptr = &grid_array[y][x];
/* Old CAVE_IN_MIRROR flag */
if (c_ptr->info & CAVE_OBJECT)
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
- /* Access the cave */
- c_ptr = &cave[y][x];
+ /* Access the grid_array */
+ c_ptr = &grid_array[y][x];
if ((c_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level)
{
else
{
/* Access the item location */
- c_ptr = &cave[o_ptr->iy][o_ptr->ix];
+ c_ptr = &grid_array[o_ptr->iy][o_ptr->ix];
/* Build a stack */
o_ptr->next_o_idx = c_ptr->o_idx;
/* Access grid */
- c_ptr = &cave[m_ptr->fy][m_ptr->fx];
+ c_ptr = &grid_array[m_ptr->fy][m_ptr->fx];
/* Mark the location */
c_ptr->m_idx = m_idx;
cave_template_type *templates;
- /*** Wipe all cave ***/
+ /*** Wipe all grid_array ***/
clear_cave();
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the cave */
- grid_type *c_ptr = &cave[y][x];
+ /* Access the grid_array */
+ grid_type *c_ptr = &grid_array[y][x];
- /* Extract cave data */
+ /* Extract grid_array data */
c_ptr->info = templates[id].info;
c_ptr->feat = templates[id].feat;
c_ptr->mimic = templates[id].mimic;
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
- /* Access the cave */
- grid_type *c_ptr = &cave[y][x];
+ /* Access the grid_array */
+ grid_type *c_ptr = &grid_array[y][x];
if ((c_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level)
{
else
{
/* Access the item location */
- grid_type *c_ptr = &cave[o_ptr->iy][o_ptr->ix];
+ grid_type *c_ptr = &grid_array[o_ptr->iy][o_ptr->ix];
/* Build a stack */
o_ptr->next_o_idx = c_ptr->o_idx;
/* Access grid */
- c_ptr = &cave[m_ptr->fy][m_ptr->fx];
+ c_ptr = &grid_array[m_ptr->fy][m_ptr->fx];
/* Mark the location */
c_ptr->m_idx = m_idx;
MONSTER_IDX m_idx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = cave[target_row][target_col].m_idx;
+ m_idx = grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
GAME_TEXT m_name[MAX_NLEN];
if (!target_set(TARGET_KILL)) return FALSE;
- if (!cave[target_row][target_col].m_idx) break;
+ if (!grid_array[target_row][target_col].m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
- m_ptr = &m_list[cave[target_row][target_col].m_idx];
+ m_ptr = &m_list[grid_array[target_row][target_col].m_idx];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(m_name, m_ptr, 0);
if (r_ptr->flagsr & RFR_RES_TELE)
}
msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
- teleport_monster_to(cave[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
+ teleport_monster_to(grid_array[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
break;
}
case MS_TELE_AWAY:
int num = 0, bonus, chance, vir;
HIT_POINT k;
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
monster_type *m_ptr = &m_list[c_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (do_quake)
{
earthquake(p_ptr->y, p_ptr->x, 10);
- if (!cave[y][x].m_idx) *mdeath = TRUE;
+ if (!grid_array[y][x].m_idx) *mdeath = TRUE;
}
}
bool mdeath = FALSE;
bool stormbringer = FALSE;
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
monster_type *m_ptr = &m_list[c_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
GAME_TEXT m_name[MAX_NLEN];
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK);
}
- if (is_mirror_grid(&cave[p_ptr->y][p_ptr->x]))
+ if (is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x]))
{
teleport_player(10, 0L);
}
MONSTER_IDX m_idx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = cave[target_row][target_col].m_idx;
+ m_idx = grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
int val = 0;
for (x = 0; x < cur_wid; x++) {
for (y = 0; y < cur_hgt; y++) {
- if (is_mirror_grid(&cave[y][x])) val++;
+ if (is_mirror_grid(&grid_array[y][x])) val++;
}
}
return val;
{
/* mirror of seeing */
case 0:
- tmp = is_mirror_grid(&cave[p_ptr->y][p_ptr->x]) ? 4 : 0;
+ tmp = is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x]) ? 4 : 0;
if (plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
if (plev + tmp > 18)detect_monsters_invis(DETECT_RAD_DEFAULT);
if (plev + tmp > 28)set_tim_esp((TIME_EFFECT)plev, FALSE);
break;
case 2:
if (!get_aim_dir(&dir)) return FALSE;
- if (plev > 9 && is_mirror_grid(&cave[p_ptr->y][p_ptr->x])) {
+ if (plev > 9 && is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x])) {
fire_beam(GF_LITE, dir, damroll(3 + ((plev - 1) / 5), 4));
}
else {
case 9:
for (x = 0; x < cur_wid; x++) {
for (y = 0; y < cur_hgt; y++) {
- if (is_mirror_grid(&cave[y][x])) {
+ if (is_mirror_grid(&grid_array[y][x])) {
project(0, 2, y, x, (HIT_POINT)plev, GF_OLD_SLEEP, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
}
}
break;
/* illusion light */
case 14:
- tmp = is_mirror_grid(&cave[p_ptr->y][p_ptr->x]) ? 4 : 3;
+ tmp = is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x]) ? 4 : 3;
slow_monsters(plev);
stun_monsters(plev*tmp);
confuse_monsters(plev*tmp);
break;
/* mirror shift */
case 15:
- if (!is_mirror_grid(&cave[p_ptr->y][p_ptr->x])) {
+ if (!is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x])) {
msg_print(_("鏡の国の場所がわからない!", "You cannot find out where is the world of mirror!"));
break;
}
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (!cave[y][x].m_idx)
+ if (!grid_array[y][x].m_idx)
{
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
return FALSE;
py_attack(y, x, 0);
- if (!player_can_enter(cave[y][x].feat, 0) || is_trap(cave[y][x].feat))
+ if (!player_can_enter(grid_array[y][x].feat, 0) || is_trap(grid_array[y][x].feat))
break;
y += ddy[dir];
x += ddx[dir];
- if (player_can_enter(cave[y][x].feat, 0) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
+ if (player_can_enter(grid_array[y][x].feat, 0) && !is_trap(grid_array[y][x].feat) && !grid_array[y][x].m_idx)
{
msg_print(NULL);
(void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
POSITION ty, tx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = cave[target_row][target_col].m_idx;
+ m_idx = grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (m_idx == p_ptr->riding) break;
if (!player_has_los_bold(target_row, target_col)) break;
{
POSITION ny = GRID_Y(path_g[i]);
POSITION nx = GRID_X(path_g[i]);
- grid_type *c_ptr = &cave[ny][nx];
+ grid_type *c_ptr = &grid_array[ny][nx];
if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
!(c_ptr->info & CAVE_OBJECT) &&
}
}
/* Update the old location */
- cave[target_row][target_col].m_idx = 0;
+ grid_array[target_row][target_col].m_idx = 0;
/* Update the new location */
- cave[ty][tx].m_idx = (s16b)m_idx;
+ grid_array[ty][tx].m_idx = (s16b)m_idx;
/* Move the monster */
m_ptr->fy = (byte_hack)ty;
break;
case MIND_MIRROR_MASTER:
/* Cast the spell */
- if( is_mirror_grid(&cave[p_ptr->y][p_ptr->x]) )on_mirror = TRUE;
+ if( is_mirror_grid(&grid_array[p_ptr->y][p_ptr->x]) )on_mirror = TRUE;
cast = cast_mirror_spell(n);
break;
case MIND_NINJUTSU:
if (projectable(y1, x1, p_ptr->y, p_ptr->x)) return (FALSE);
/* Set current grid cost */
- now_cost = cave[y1][x1].cost;
+ now_cost = grid_array[y1][x1].cost;
if (now_cost == 0) now_cost = 999;
/* Can monster bash or open doors? */
/* Simply move to player */
if (player_bold(y, x)) return (FALSE);
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
cost = c_ptr->cost;
if (player_has_los_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)) return (FALSE);
/* Monster grid */
- c_ptr = &cave[y1][x1];
+ c_ptr = &grid_array[y1][x1];
/* If we can hear noises, advance towards them */
if (c_ptr->cost)
else if (c_ptr->when)
{
/* Too old smell */
- if (cave[p_ptr->y][p_ptr->x].when - c_ptr->when > 127) return (FALSE);
+ if (grid_array[p_ptr->y][p_ptr->x].when - c_ptr->when > 127) return (FALSE);
use_scent = TRUE;
best = 0;
/* Ignore locations off of edge */
if (!in_bounds2(y, x)) continue;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* We're following a scent trail */
if (use_scent)
if (!in_bounds2(y, x)) continue;
/* Don't move toward player */
- /* if (cave[y][x].dist < 3) continue; */ /* Hmm.. Need it? */
+ /* if (grid_array[y][x].dist < 3) continue; */ /* Hmm.. Need it? */
/* Calculate distance of this grid from our destination */
dis = distance(y, x, y1, x1);
/* Score this grid */
- s = 5000 / (dis + 3) - 500 / (cave[y][x].dist + 1);
+ s = 5000 / (dis + 3) - 500 / (grid_array[y][x].dist + 1);
/* No negative scores */
if (s < 0) s = 0;
/* Skip illegal locations */
if (!in_bounds(y, x)) continue;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Skip locations in a wall */
if (!monster_can_cross_terrain(c_ptr->feat, &r_info[m_ptr->r_idx], (m_idx == p_ptr->riding) ? CEM_RIDING : 0)) continue;
if (c_ptr->dist == 0) continue;
/* Ignore too-distant grids */
- if (c_ptr->dist > cave[fy][fx].dist + 2 * d) continue;
+ if (c_ptr->dist > grid_array[fy][fx].dist + 2 * d) continue;
}
/* Check for absence of shot (more or less) */
bool done = FALSE;
bool will_run = mon_will_run(m_idx);
grid_type *c_ptr;
- bool no_flow = ((m_ptr->mflag2 & MFLAG2_NOFLOW) && (cave[m_ptr->fy][m_ptr->fx].cost > 2));
+ bool no_flow = ((m_ptr->mflag2 & MFLAG2_NOFLOW) && (grid_array[m_ptr->fy][m_ptr->fx].cost > 2));
bool can_pass_wall = ((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != p_ptr->riding) || p_ptr->pass_wall));
/* Counter attack to an enemy monster */
if (!will_run && m_ptr->target_y)
{
- int t_m_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
+ int t_m_idx = grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
/* The monster must be an enemy, and in LOS */
if (t_m_idx &&
if (!done && !will_run && is_hostile(m_ptr) &&
(r_ptr->flags1 & RF1_FRIENDS) &&
((los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x) && projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) ||
- (cave[m_ptr->fy][m_ptr->fx].dist < MAX_SIGHT / 2)))
+ (grid_array[m_ptr->fy][m_ptr->fx].dist < MAX_SIGHT / 2)))
{
/*
* Animal packs try to get the player out of corridors
if (!in_bounds2(yy, xx)) continue;
- c_ptr = &cave[yy][xx];
+ c_ptr = &grid_array[yy][xx];
/* Check grid */
if (monster_can_cross_terrain(c_ptr->feat, r_ptr, 0))
room++;
}
}
- if (cave[p_ptr->y][p_ptr->x].info & CAVE_ROOM) room -= 2;
+ if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_ROOM) room -= 2;
if (!r_ptr->flags4 && !r_ptr->a_ability_flags1 && !r_ptr->a_ability_flags2) room -= 2;
/* Not in a room and strong player */
}
/* Monster groups try to surround the player */
- if (!done && (cave[m_ptr->fy][m_ptr->fx].dist < 3))
+ if (!done && (grid_array[m_ptr->fy][m_ptr->fx].dist < 3))
{
int i;
{
/* Ignore locations off of edge */
if (!in_bounds2(y, x)) continue;
- if (cave[y][x].m_idx) k++;
+ if (grid_array[y][x].m_idx) k++;
}
}
/* Give priority to counter attack? */
if (m_ptr->target_y)
{
- MONSTER_IDX t_m_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
+ MONSTER_IDX t_m_idx = grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
/* The monster must be an enemy, and projectable */
if (t_m_idx && are_enemies(m_ptr, &m_list[t_m_idx]) &&
/* Ignore locations off of edge */
if (!in_bounds2(ny, nx)) continue;
- /* Access that cave grid */
- c_ptr = &cave[ny][nx];
+ /* Access that grid */
+ c_ptr = &grid_array[ny][nx];
f_ptr = &f_info[c_ptr->feat];
can_cross = monster_can_cross_terrain(c_ptr->feat, r_ptr, is_riding_mon ? CEM_RIDING : 0);
- /* Access that cave grid's contents */
+ /* Access that grid's contents */
y_ptr = &m_list[c_ptr->m_idx];
/* Hack -- player 'in' wall */
else if ((r_ptr->flags2 & RF2_MOVE_BODY) && !(r_ptr->flags1 & RF1_NEVER_MOVE) &&
(r_ptr->mexp > z_ptr->mexp) &&
can_cross && (c_ptr->m_idx != p_ptr->riding) &&
- monster_can_cross_terrain(cave[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0))
+ monster_can_cross_terrain(grid_array[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0))
{
/* Allow movement */
do_move = TRUE;
if (!is_riding_mon)
{
/* Hack -- Update the old location */
- cave[oy][ox].m_idx = c_ptr->m_idx;
+ grid_array[oy][ox].m_idx = c_ptr->m_idx;
/* Mega-Hack -- move the old monster, if any */
if (c_ptr->m_idx)
test = TRUE;
}
-#if 0 /* (cave[p_ptr->y][p_ptr->x].when == cave[fy][fx].when) is always FALSE... */
+#if 0 /* (grid_array[p_ptr->y][p_ptr->x].when == grid_array[fy][fx].when) is always FALSE... */
/* Hack -- Monsters can "smell" the player from far away */
/* Note that most monsters have "aaf" of "20" or so */
else if (!(m_ptr->mflag2 & MFLAG2_NOFLOW) &&
cave_have_flag_bold(p_ptr->y, p_ptr->x, FF_MOVE) &&
- (cave[p_ptr->y][p_ptr->x].when == cave[fy][fx].when) &&
- (cave[fy][fx].dist < MONSTER_FLOW_DEPTH) &&
- (cave[fy][fx].dist < r_ptr->aaf))
+ (grid_array[p_ptr->y][p_ptr->x].when == grid_array[fy][fx].when) &&
+ (grid_array[fy][fx].dist < MONSTER_FLOW_DEPTH) &&
+ (grid_array[fy][fx].dist < r_ptr->aaf))
{
/* We can "smell" the player */
test = TRUE;
*/
monsterrace_hook_type get_monster_hook2(POSITION y, POSITION x)
{
- feature_type *f_ptr = &f_info[cave[y][x].feat];
+ feature_type *f_ptr = &f_info[grid_array[y][x].feat];
/* Set the monster list */
*/
bool monster_can_enter(POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
/* Player or other monster */
if (player_bold(y, x)) return FALSE;
if (p_ptr->riding == i) p_ptr->riding = 0;
/* Monster is gone */
- cave[y][x].m_idx = 0;
+ grid_array[y][x].m_idx = 0;
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
if (!in_bounds(y, x)) return;
/* Check the grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Delete the monster (if any) */
if (c_ptr->m_idx) delete_monster_idx(c_ptr->m_idx);
x = m_ptr->fx;
/* Cave grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
- /* Update the cave */
+ /* Update the grid_array */
c_ptr->m_idx = i2;
/* Repair objects being carried by monster */
if (!m_ptr->r_idx) continue;
/* Monster is gone */
- cave[m_ptr->fy][m_ptr->fx].m_idx = 0;
+ grid_array[m_ptr->fy][m_ptr->fx].m_idx = 0;
/* Wipe the Monster */
(void)WIPE(m_ptr, monster_type);
if ((r_ptr->blow[0].method == RBM_EXPLODE) || (r_ptr->blow[1].method == RBM_EXPLODE) || (r_ptr->blow[2].method == RBM_EXPLODE) || (r_ptr->blow[3].method == RBM_EXPLODE))
return FALSE;
- if (!monster_can_cross_terrain(cave[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
+ if (!monster_can_cross_terrain(grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
/* Not born */
if (!(old_r_ptr->flags7 & RF7_CHAMELEON))
if ((r_ptr->blow[0].method == RBM_EXPLODE) || (r_ptr->blow[1].method == RBM_EXPLODE) || (r_ptr->blow[2].method == RBM_EXPLODE) || (r_ptr->blow[3].method == RBM_EXPLODE))
return FALSE;
- if (!monster_can_cross_terrain(cave[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
+ if (!monster_can_cross_terrain(grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
/* Not born */
if (!(old_r_ptr->flags7 & RF7_CHAMELEON))
static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
{
/* Access the location */
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
monster_type *m_ptr;
monster_race *r_ptr = &r_info[r_idx];
concptr name = (r_name + r_ptr->name);
/* Count all quest monsters */
for (i2 = 0; i2 < cur_wid; ++i2)
for (j2 = 0; j2 < cur_hgt; j2++)
- if (cave[j2][i2].m_idx > 0)
- if (m_list[cave[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
+ if (grid_array[j2][i2].m_idx > 0)
+ if (m_list[grid_array[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
number_mon++;
if(number_mon + quest[hoge].cur_num >= quest[hoge].max_num)
return FALSE;
if (attempts < 1) return FALSE;
- m_idx = cave[y][x].m_idx;
+ m_idx = grid_array[y][x].m_idx;
if (m_list[m_idx].mflag2 & MFLAG2_CHAMELEON) r_ptr = &r_info[m_list[m_idx].r_idx];
ox = randint1(cur_wid - 4) + 2;
/* Is it a good spot ? */
- if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(cave[oy][ox].feat, &r_info[guardian], 0))
+ if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(grid_array[oy][ox].feat, &r_info[guardian], 0))
{
/* Place the guardian */
if (place_monster_aux(0, oy, ox, guardian, (PM_ALLOW_GROUP | PM_NO_KAGE | PM_NO_PET))) return TRUE;
bool player_place(POSITION y, POSITION x)
{
/* Paranoia XXX XXX */
- if (cave[y][x].m_idx != 0) return FALSE;
+ if (grid_array[y][x].m_idx != 0) return FALSE;
/* Save player location */
p_ptr->y = y;
if (!los(y, x, yy, xx)) continue;
if (!projectable(y, x, yy, xx)) continue;
- c_ptr = &cave[yy][xx];
+ c_ptr = &grid_array[yy][xx];
/* Scan the pile of objects */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
y = GRID_Y(grid_g[i]);
x = GRID_X(grid_g[i]);
- if ((cave[y][x].m_idx > 0) && !((y == y2) && (x == x2)))
+ if ((grid_array[y][x].m_idx > 0) && !((y == y2) && (x == x2)))
{
- monster_type *m_ptr = &m_list[cave[y][x].m_idx];
+ monster_type *m_ptr = &m_list[grid_array[y][x].m_idx];
if (is_friend == is_pet(m_ptr))
{
return (FALSE);
grid_type *c_ptr;
/* Access the next grid */
- c_ptr = &cave[next_y][next_x];
+ c_ptr = &grid_array[next_y][next_x];
/* Skip this feature */
if (!cave_have_flag_grid(c_ptr, f_flag)) continue;
if (los(m_ptr->fy, m_ptr->fx, y_br_lite, x_br_lite))
{
- feature_type *f_ptr = &f_info[cave[y_br_lite][x_br_lite].feat];
+ feature_type *f_ptr = &f_info[grid_array[y_br_lite][x_br_lite].feat];
if (!have_flag(f_ptr->flags, FF_LOS))
{
/* Check path */
if (projectable(m_ptr->fy, m_ptr->fx, y, x))
{
- feature_type *f_ptr = &f_info[cave[y][x].feat];
+ feature_type *f_ptr = &f_info[grid_array[y][x].feat];
if (!have_flag(f_ptr->flags, FF_PROJECT))
{
if (y == y2 && x == x2)
hit2 = TRUE;
- else if (is_friend && cave[y][x].m_idx > 0 &&
- !are_enemies(m_ptr, &m_list[cave[y][x].m_idx]))
+ else if (is_friend && grid_array[y][x].m_idx > 0 &&
+ !are_enemies(m_ptr, &m_list[grid_array[y][x].m_idx]))
{
/* Friends don't shoot friends */
return FALSE;
/* Is there counter attack target? */
if (!target_idx && m_ptr->target_y)
{
- target_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
+ target_idx = grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
if (target_idx)
{
MONSTER_IDX m_idx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = cave[target_row][target_col].m_idx;
+ m_idx = grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
GAME_TEXT m_name[MAX_NLEN];
if (!target_set(TARGET_KILL)) return FALSE;
- if (!cave[target_row][target_col].m_idx) break;
+ if (!grid_array[target_row][target_col].m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
- m_ptr = &m_list[cave[target_row][target_col].m_idx];
+ m_ptr = &m_list[grid_array[target_row][target_col].m_idx];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(m_name, m_ptr, 0);
if (r_ptr->flagsr & RFR_RES_TELE)
}
}
msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
- teleport_monster_to(cave[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
+ teleport_monster_to(grid_array[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
break;
}
case MS_TELE_AWAY:
if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx))
return -1;
- delete_monster_idx(cave[m_ptr->fy][m_ptr->fx].m_idx);
+ delete_monster_idx(grid_array[m_ptr->fy][m_ptr->fx].m_idx);
summon_named_creature(0, dummy_y, dummy_x, MON_BANOR, mode);
m_list[hack_m_idx_ii].hp = dummy_hp;
m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
if (!c_ptr->m_idx)
{
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
if (!c_ptr->m_idx)
{
msg_print(_("あなたは何もない場所で手を振った。", "You wave your hands in the air."));
if (floor)
{
/* Scan all objects in the grid */
- for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
o_ptr = &o_list[this_o_idx];
if (allow_floor)
{
/* Scan all objects in the grid */
- for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
o_ptr = &o_list[this_o_idx];
* @param mode オプションフラグ
* @return 対象のマスに落ちているアイテム数
* @details
- * Return a list of o_list[] indexes of items at the given cave
+ * Return a list of o_list[] indexes of items at the given grid_array
* location. Valid flags are:
*
* mode & 0x01 -- Item tester
if (!in_bounds(y, x)) return 0;
/* Scan all objects in the grid */
- for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = grid_array[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
o_ptr = &o_list[this_o_idx];
{
int i;
OBJECT_IDX o_idx;
- grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+ grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x];
if (command_wrk != (USE_FLOOR)) break;
int can_pickup = 0;
/* Scan the pile of objects */
- for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
/* Access the object */
o_ptr = &o_list[this_o_idx];
POSITION y = j_ptr->iy;
POSITION x = j_ptr->ix;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Scan all objects in the grid */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
/* Refuse "illegal" locations */
if (!in_bounds(y, x)) return;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Scan all objects in the grid */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
x = o_ptr->ix;
/* Acquire grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Repair grid */
if (c_ptr->o_idx == i1)
POSITION x = o_ptr->ix;
/* Access grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Hack -- see above */
c_ptr->o_idx = 0;
OBJECT_IDX o_idx;
/* Acquire grid */
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
object_type forge;
object_type *q_ptr;
OBJECT_IDX o_idx;
/* Acquire grid */
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
object_type forge;
object_type *q_ptr;
if (!projectable(y, x, ty, tx)) continue;
/* Obtain grid */
- c_ptr = &cave[ty][tx];
+ c_ptr = &grid_array[ty][tx];
/* Require floor space */
if (!cave_drop_bold(ty, tx)) continue;
}
- c_ptr = &cave[by][bx];
+ c_ptr = &grid_array[by][bx];
/* Scan objects in that grid for combination */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
if (!in_bounds(my, mx) || (distance(my, mx, yy, xx) > WARNING_AWARE_RANGE)) continue;
- c_ptr = &cave[my][mx];
+ c_ptr = &grid_array[my][mx];
if (!c_ptr->m_idx) continue;
}
else old_damage = old_damage / 2;
- c_ptr = &cave[yy][xx];
+ c_ptr = &grid_array[yy][xx];
if (((!easy_disarm && is_trap(c_ptr->feat))
|| (c_ptr->mimic && is_trap(c_ptr->feat))) && !one_in_(13))
{
{
OBJECT_IDX this_o_idx, next_o_idx = 0;
grid_type *c_ptr;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Invisible trap */
if (c_ptr->mimic && is_trap(c_ptr->feat))
*/
void carry(bool pickup)
{
- grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+ grid_type *c_ptr = &grid_array[p_ptr->y][p_ptr->x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
*/
bool pattern_seq(POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x)
{
- feature_type *cur_f_ptr = &f_info[cave[c_y][c_x].feat];
- feature_type *new_f_ptr = &f_info[cave[n_y][n_x].feat];
+ feature_type *cur_f_ptr = &f_info[grid_array[c_y][c_x].feat];
+ feature_type *new_f_ptr = &f_info[grid_array[n_y][n_x].feat];
bool is_pattern_tile_cur = have_flag(cur_f_ptr->flags, FF_PATTERN);
bool is_pattern_tile_new = have_flag(new_f_ptr->flags, FF_PATTERN);
int pattern_type_cur, pattern_type_new;
{
POSITION oy = p_ptr->y;
POSITION ox = p_ptr->x;
- grid_type *c_ptr = &cave[ny][nx];
- grid_type *oc_ptr = &cave[oy][ox];
+ grid_type *c_ptr = &grid_array[ny][nx];
+ grid_type *oc_ptr = &grid_array[oy][ox];
feature_type *f_ptr = &f_info[c_ptr->feat];
feature_type *of_ptr = &f_info[oc_ptr->feat];
POSITION x = p_ptr->x + ddx[dir];
/* Examine the destination */
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
py_attack(y, x, 0);
oktomove = FALSE;
}
- else if (monster_can_cross_terrain(cave[p_ptr->y][p_ptr->x].feat, r_ptr, 0))
+ else if (monster_can_cross_terrain(grid_array[p_ptr->y][p_ptr->x].feat, r_ptr, 0))
{
do_past = TRUE;
}
}
else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
{
- msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name);
+ msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(&grid_array[p_ptr->y][p_ptr->x])].name);
free_turn(p_ptr);
oktomove = FALSE;
disturb(FALSE, TRUE);
if (!in_bounds2(y, x)) return (FALSE);
/* Access grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Must be known to the player */
if (c_ptr->info & (CAVE_MARK))
if (!in_bounds2(y, x)) return (TRUE);
/* Memorized grids are always known */
- if (cave[y][x].info & (CAVE_MARK)) return (FALSE);
+ if (grid_array[y][x].info & (CAVE_MARK)) return (FALSE);
/* Viewable door/wall grids are known */
if (player_can_see_bold(y, x)) return (FALSE);
/* break run when leaving trap detected region */
if ((disturb_trap_detect || alert_trap_detect)
- && p_ptr->dtrap && !(cave[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
+ && p_ptr->dtrap && !(grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
{
/* No duplicate warning */
p_ptr->dtrap = FALSE;
/* You are just on the edge */
- if (!(cave[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
+ if (!(grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
{
if (alert_trap_detect)
{
col = p_ptr->x + ddx[new_dir];
/* Access grid */
- c_ptr = &cave[row][col];
+ c_ptr = &grid_array[row][col];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(c_ptr);
/* break run when leaving trap detected region */
if ((disturb_trap_detect || alert_trap_detect)
- && p_ptr->dtrap && !(cave[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
+ && p_ptr->dtrap && !(grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
{
/* No duplicate warning */
p_ptr->dtrap = FALSE;
/* You are just on the edge */
- if (!(cave[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
+ if (!(grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
{
if (alert_trap_detect)
{
POSITION col = p_ptr->x + ddx[dir];
/* Access grid */
- c_ptr = &cave[row][col];
+ c_ptr = &grid_array[row][col];
/* Visible monsters abort running */
if (c_ptr->m_idx)
if (!new_dir) return (0);
/* Access newly move grid */
- c_ptr = &cave[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
+ c_ptr = &grid_array[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
/* Close door abort traveling */
if (!easy_open && is_closed_door(c_ptr->feat)) return (0);
bool old_mighty_throw = p_ptr->mighty_throw;
/* Current feature under player. */
- feature_type *f_ptr = &f_info[cave[p_ptr->y][p_ptr->x].feat];
+ feature_type *f_ptr = &f_info[grid_array[p_ptr->y][p_ptr->x].feat];
/* Save the old armor class */
ARMOUR_CLASS old_dis_ac = p_ptr->dis_ac;
if ((inventory[i].tval == TV_CRAFT_BOOK) && (inventory[i].sval == 2)) have_kabe = TRUE;
}
- for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
o_ptr = &o_list[this_o_idx];
}
/* max radius is 14 (was 5) without rewriting other code -- */
- /* see cave.c:update_lite() and defines.h:LITE_MAX */
+ /* see grid_array.c:update_lite() and defines.h:LITE_MAX */
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS && p_ptr->cur_lite > 1)
p_ptr->cur_lite = 1;
if (o_ptr->k_idx && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
}
- for (i = cave[p_ptr->y][p_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
+ for (i = grid_array[p_ptr->y][p_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
{
o_ptr = &o_list[i];
if (o_ptr->k_idx && (o_ptr->marked & OM_FOUND) && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
if (flg & (PROJECT_STOP))
{
if ((n > 0) &&
- (player_bold(y, x) || cave[y][x].m_idx != 0))
+ (player_bold(y, x) || grid_array[y][x].m_idx != 0))
break;
}
if (flg & (PROJECT_STOP))
{
if ((n > 0) &&
- (player_bold(y, x) || cave[y][x].m_idx != 0))
+ (player_bold(y, x) || grid_array[y][x].m_idx != 0))
break;
}
if (flg & (PROJECT_STOP))
{
if ((n > 0) &&
- (player_bold(y, x) || cave[y][x].m_idx != 0))
+ (player_bold(y, x) || grid_array[y][x].m_idx != 0))
break;
}
POSITION ny, nx;
/* Stagger around */
- while (cave_perma_bold(y, x) || cave[y][x].o_idx || (cave[y][x].info & CAVE_OBJECT))
+ while (cave_perma_bold(y, x) || grid_array[y][x].o_idx || (grid_array[y][x].info & CAVE_OBJECT))
{
/* Pick a location */
scatter(&ny, &nx, y, x, 1, 0);
int dy = y + ddy_ddd[dir];
int dx = x + ddx_ddd[dir];
if (dir == 5) continue;
- if (cave[dy][dx].m_idx) flag = TRUE;
+ if (grid_array[dy][dx].m_idx) flag = TRUE;
}
- if (!cave_empty_bold(y, x) || (cave[y][x].info & CAVE_ICKY) ||
+ if (!cave_empty_bold(y, x) || (grid_array[y][x].info & CAVE_ICKY) ||
(distance(y, x, p_ptr->y, p_ptr->x) > plev + 2))
{
msg_print(_("そこには移動できない。", "Can not teleport to there."));
y = p_ptr->y + ddy_cdd[cdir];
x = p_ptr->x + ddx_cdd[cdir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, 0);
else
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = p_ptr->y + ddy_cdd[(cdir + 7) % 8];
x = p_ptr->x + ddx_cdd[(cdir + 7) % 8];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, 0);
else
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = p_ptr->y + ddy_cdd[(cdir + 1) % 8];
x = p_ptr->x + ddx_cdd[(cdir + 1) % 8];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, 0);
else
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_FIRE);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_MINEUCHI);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (!cave[y][x].m_idx)
+ if (!grid_array[y][x].m_idx)
{
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
return NULL;
py_attack(y, x, 0);
- if (!player_can_enter(cave[y][x].feat, 0) || is_trap(cave[y][x].feat))
+ if (!player_can_enter(grid_array[y][x].feat, 0) || is_trap(grid_array[y][x].feat))
break;
y += ddy[dir];
x += ddx[dir];
- if (player_can_enter(cave[y][x].feat, 0) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
+ if (player_can_enter(grid_array[y][x].feat, 0) && !is_trap(grid_array[y][x].feat) && !grid_array[y][x].m_idx)
{
msg_print(NULL);
(void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_POISON);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_ZANMA);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, 0);
else
{
{
return "";
}
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
{
int i;
POSITION ty = y, tx = x;
POSITION oy = y, ox = x;
- MONSTER_IDX m_idx = cave[y][x].m_idx;
+ MONSTER_IDX m_idx = grid_array[y][x].m_idx;
monster_type *m_ptr = &m_list[m_idx];
GAME_TEXT m_name[MAX_NLEN];
if ((ty != oy) || (tx != ox))
{
msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
- cave[oy][ox].m_idx = 0;
- cave[ty][tx].m_idx = m_idx;
+ grid_array[oy][ox].m_idx = 0;
+ grid_array[ty][tx].m_idx = m_idx;
m_ptr->fy = ty;
m_ptr->fx = tx;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_HAGAN);
if (!cave_have_flag_bold(y, x, FF_HURT_ROCK)) break;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_COLD);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_KYUSHO);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_MAJIN);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_SUTEMI);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_ELEC);
else
{
{
y = p_ptr->y + ddy_ddd[dir];
x = p_ptr->x + ddx_ddd[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
m_ptr = &m_list[c_ptr->m_idx];
/* Hack -- attack monsters */
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_QUAKE);
else
earthquake(p_ptr->y, p_ptr->x, 10);
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
if (c_ptr->m_idx)
py_attack(y, x, HISSATSU_3DAN);
}
c_ptr->m_idx = 0;
- cave[ny][nx].m_idx = m_idx;
+ grid_array[ny][nx].m_idx = m_idx;
m_ptr->fy = ny;
m_ptr->fx = nx;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_DRAIN);
else
{
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
{
py_attack(y, x, 0);
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
{
handle_stuff();
py_attack(y, x, 0);
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
py_attack(y, x, HISSATSU_UNDEAD);
else
{
* Town logic flow for generation of new town\n
* Originally from Vanilla 3.0.3\n
*\n
-* We start with a fully wiped cave of normal floors.\n
+* We start with a fully wiped grid_array of normal floors.\n
*\n
* Note that town_gen_hack() plays games with the R.N.G.\n
*\n
{
for (x = 0; x < cur_wid; x++)
{
- if (cave[y][x].feat == FF_STORE)
+ if (grid_array[y][x].feat == FF_STORE)
{
- prevent_bm = (f_info[cave[y][x].feat].subtype == STORE_BLACK);
+ prevent_bm = (f_info[grid_array[y][x].feat].subtype == STORE_BLACK);
break;
}
}
#include "rooms-normal.h"
/*!
-* @brief タイプ9の部屋…フラクタルカーブによる洞窟生成 / Type 9 -- Driver routine to create fractal cave system
+* @brief タイプ9の部屋…フラクタルカーブによる洞窟生成 / Type 9 -- Driver routine to create fractal grid_array system
* @return なし
*/
bool build_type9(void)
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
c_ptr->info |= (CAVE_ROOM);
if (light) c_ptr->info |= (CAVE_GLOW);
/* Walls around the room */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
+ c_ptr = &grid_array[y][x1 - 1];
place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
+ c_ptr = &grid_array[y][x2 + 1];
place_outer_grid(c_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
+ c_ptr = &grid_array[y1 - 1][x];
place_outer_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
+ c_ptr = &grid_array[y2 + 1][x];
place_outer_grid(c_ptr);
}
{
for (y = y1; y <= y2; y++)
{
- c_ptr = &cave[y][x1];
+ c_ptr = &grid_array[y][x1];
c_ptr->feat = feat_door[DOOR_CURTAIN].closed;
c_ptr->info &= ~(CAVE_MASK);
- c_ptr = &cave[y][x2];
+ c_ptr = &grid_array[y][x2];
c_ptr->feat = feat_door[DOOR_CURTAIN].closed;
c_ptr->info &= ~(CAVE_MASK);
}
for (x = x1; x <= x2; x++)
{
- c_ptr = &cave[y1][x];
+ c_ptr = &grid_array[y1][x];
c_ptr->feat = feat_door[DOOR_CURTAIN].closed;
c_ptr->info &= ~(CAVE_MASK);
- c_ptr = &cave[y2][x];
+ c_ptr = &grid_array[y2][x];
c_ptr->feat = feat_door[DOOR_CURTAIN].closed;
c_ptr->info &= ~(CAVE_MASK);
}
{
for (x = x1; x <= x2; x += 2)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_inner_grid(c_ptr);
}
}
{
if ((y1 + 4 < y2) && (x1 + 4 < x2))
{
- c_ptr = &cave[y1 + 1][x1 + 1];
+ c_ptr = &grid_array[y1 + 1][x1 + 1];
place_inner_grid(c_ptr);
- c_ptr = &cave[y1 + 1][x2 - 1];
+ c_ptr = &grid_array[y1 + 1][x2 - 1];
place_inner_grid(c_ptr);
- c_ptr = &cave[y2 - 1][x1 + 1];
+ c_ptr = &grid_array[y2 - 1][x1 + 1];
place_inner_grid(c_ptr);
- c_ptr = &cave[y2 - 1][x2 - 1];
+ c_ptr = &grid_array[y2 - 1][x2 - 1];
place_inner_grid(c_ptr);
}
}
{
for (y = y1 + 2; y <= y2 - 2; y += 2)
{
- c_ptr = &cave[y][x1];
+ c_ptr = &grid_array[y][x1];
place_inner_grid(c_ptr);
- c_ptr = &cave[y][x2];
+ c_ptr = &grid_array[y][x2];
place_inner_grid(c_ptr);
}
for (x = x1 + 2; x <= x2 - 2; x += 2)
{
- c_ptr = &cave[y1][x];
+ c_ptr = &grid_array[y1][x];
place_inner_grid(c_ptr);
- c_ptr = &cave[y2][x];
+ c_ptr = &grid_array[y2][x];
place_inner_grid(c_ptr);
}
}
for (x = x1; x <= x2; x++)
{
place_inner_bold(yval, x);
- if (curtain2) cave[yval][x].feat = feat_door[DOOR_CURTAIN].closed;
+ if (curtain2) grid_array[yval][x].feat = feat_door[DOOR_CURTAIN].closed;
}
/* Prevent edge of wall from being tunneled */
for (y = y1; y <= y2; y++)
{
place_inner_bold(y, xval);
- if (curtain2) cave[y][xval].feat = feat_door[DOOR_CURTAIN].closed;
+ if (curtain2) grid_array[y][xval].feat = feat_door[DOOR_CURTAIN].closed;
}
/* Prevent edge of wall from being tunneled */
}
place_random_door(yval, xval, TRUE);
- if (curtain2) cave[yval][xval].feat = feat_door[DOOR_CURTAIN].closed;
+ if (curtain2) grid_array[yval][xval].feat = feat_door[DOOR_CURTAIN].closed;
}
return TRUE;
{
for (x = x1a - 1; x <= x2a + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
c_ptr->info |= (CAVE_ROOM);
if (light) c_ptr->info |= (CAVE_GLOW);
{
for (x = x1b - 1; x <= x2b + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
c_ptr->info |= (CAVE_ROOM);
if (light) c_ptr->info |= (CAVE_GLOW);
/* Place the walls around room "a" */
for (y = y1a - 1; y <= y2a + 1; y++)
{
- c_ptr = &cave[y][x1a - 1];
+ c_ptr = &grid_array[y][x1a - 1];
place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2a + 1];
+ c_ptr = &grid_array[y][x2a + 1];
place_outer_grid(c_ptr);
}
for (x = x1a - 1; x <= x2a + 1; x++)
{
- c_ptr = &cave[y1a - 1][x];
+ c_ptr = &grid_array[y1a - 1][x];
place_outer_grid(c_ptr);
- c_ptr = &cave[y2a + 1][x];
+ c_ptr = &grid_array[y2a + 1][x];
place_outer_grid(c_ptr);
}
/* Place the walls around room "b" */
for (y = y1b - 1; y <= y2b + 1; y++)
{
- c_ptr = &cave[y][x1b - 1];
+ c_ptr = &grid_array[y][x1b - 1];
place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2b + 1];
+ c_ptr = &grid_array[y][x2b + 1];
place_outer_grid(c_ptr);
}
for (x = x1b - 1; x <= x2b + 1; x++)
{
- c_ptr = &cave[y1b - 1][x];
+ c_ptr = &grid_array[y1b - 1][x];
place_outer_grid(c_ptr);
- c_ptr = &cave[y2b + 1][x];
+ c_ptr = &grid_array[y2b + 1][x];
place_outer_grid(c_ptr);
}
{
for (x = x1a; x <= x2a; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
}
}
{
for (x = x1b; x <= x2b; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
}
}
{
for (x = x1a - 1; x <= x2a + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
c_ptr->info |= (CAVE_ROOM);
if (light) c_ptr->info |= (CAVE_GLOW);
{
for (x = x1b - 1; x <= x2b + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
c_ptr->info |= (CAVE_ROOM);
if (light) c_ptr->info |= (CAVE_GLOW);
/* Place the walls around room "a" */
for (y = y1a - 1; y <= y2a + 1; y++)
{
- c_ptr = &cave[y][x1a - 1];
+ c_ptr = &grid_array[y][x1a - 1];
place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2a + 1];
+ c_ptr = &grid_array[y][x2a + 1];
place_outer_grid(c_ptr);
}
for (x = x1a - 1; x <= x2a + 1; x++)
{
- c_ptr = &cave[y1a - 1][x];
+ c_ptr = &grid_array[y1a - 1][x];
place_outer_grid(c_ptr);
- c_ptr = &cave[y2a + 1][x];
+ c_ptr = &grid_array[y2a + 1][x];
place_outer_grid(c_ptr);
}
/* Place the walls around room "b" */
for (y = y1b - 1; y <= y2b + 1; y++)
{
- c_ptr = &cave[y][x1b - 1];
+ c_ptr = &grid_array[y][x1b - 1];
place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2b + 1];
+ c_ptr = &grid_array[y][x2b + 1];
place_outer_grid(c_ptr);
}
for (x = x1b - 1; x <= x2b + 1; x++)
{
- c_ptr = &cave[y1b - 1][x];
+ c_ptr = &grid_array[y1b - 1][x];
place_outer_grid(c_ptr);
- c_ptr = &cave[y2b + 1][x];
+ c_ptr = &grid_array[y2b + 1][x];
place_outer_grid(c_ptr);
}
{
for (x = x1a; x <= x2a; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
}
}
{
for (x = x1b; x <= x2b; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
}
}
{
for (x = x1a; x <= x2a; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_inner_grid(c_ptr);
}
}
/* Build the vault */
for (y = y1b; y <= y2b; y++)
{
- c_ptr = &cave[y][x1a];
+ c_ptr = &grid_array[y][x1a];
place_inner_grid(c_ptr);
- c_ptr = &cave[y][x2a];
+ c_ptr = &grid_array[y][x2a];
place_inner_grid(c_ptr);
}
for (x = x1a; x <= x2a; x++)
{
- c_ptr = &cave[y1b][x];
+ c_ptr = &grid_array[y1b][x];
place_inner_grid(c_ptr);
- c_ptr = &cave[y2b][x];
+ c_ptr = &grid_array[y2b][x];
place_inner_grid(c_ptr);
}
for (y = y1b; y <= y2b; y++)
{
if (y == yval) continue;
- c_ptr = &cave[y][x1a - 1];
+ c_ptr = &grid_array[y][x1a - 1];
place_inner_grid(c_ptr);
- c_ptr = &cave[y][x2a + 1];
+ c_ptr = &grid_array[y][x2a + 1];
place_inner_grid(c_ptr);
}
for (x = x1a; x <= x2a; x++)
{
if (x == xval) continue;
- c_ptr = &cave[y1b - 1][x];
+ c_ptr = &grid_array[y1b - 1][x];
place_inner_grid(c_ptr);
- c_ptr = &cave[y2b + 1][x];
+ c_ptr = &grid_array[y2b + 1][x];
place_inner_grid(c_ptr);
}
/* Occasionally put a "plus" in the center */
else if (one_in_(3))
{
- c_ptr = &cave[yval][xval];
+ c_ptr = &grid_array[yval][xval];
place_inner_grid(c_ptr);
- c_ptr = &cave[y1b][xval];
+ c_ptr = &grid_array[y1b][xval];
place_inner_grid(c_ptr);
- c_ptr = &cave[y2b][xval];
+ c_ptr = &grid_array[y2b][xval];
place_inner_grid(c_ptr);
- c_ptr = &cave[yval][x1a];
+ c_ptr = &grid_array[yval][x1a];
place_inner_grid(c_ptr);
- c_ptr = &cave[yval][x2a];
+ c_ptr = &grid_array[yval][x2a];
place_inner_grid(c_ptr);
}
/* Occasionally put a pillar in the center */
else if (one_in_(3))
{
- c_ptr = &cave[yval][xval];
+ c_ptr = &grid_array[yval][xval];
place_inner_grid(c_ptr);
}
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
c_ptr->info |= (CAVE_ROOM);
if (light) c_ptr->info |= (CAVE_GLOW);
/* Outer Walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
+ c_ptr = &grid_array[y][x1 - 1];
place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
+ c_ptr = &grid_array[y][x2 + 1];
place_outer_grid(c_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
+ c_ptr = &grid_array[y1 - 1][x];
place_outer_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
+ c_ptr = &grid_array[y2 + 1][x];
place_outer_grid(c_ptr);
}
/* The inner walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
+ c_ptr = &grid_array[y][x1 - 1];
place_inner_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
+ c_ptr = &grid_array[y][x2 + 1];
place_inner_grid(c_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
+ c_ptr = &grid_array[y1 - 1][x];
place_inner_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
+ c_ptr = &grid_array[y2 + 1][x];
place_inner_grid(c_ptr);
}
for (x = xval - 1; x <= xval + 1; x++)
{
if ((x == xval) && (y == yval)) continue;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_inner_grid(c_ptr);
}
}
{
for (x = xval - 1; x <= xval + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_inner_grid(c_ptr);
}
}
{
for (x = xval - 5 - tmp; x <= xval - 3 - tmp; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_inner_grid(c_ptr);
}
for (x = xval + 3 + tmp; x <= xval + 5 + tmp; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_inner_grid(c_ptr);
}
}
/* Long horizontal walls */
for (x = xval - 5; x <= xval + 5; x++)
{
- c_ptr = &cave[yval - 1][x];
+ c_ptr = &grid_array[yval - 1][x];
place_inner_grid(c_ptr);
- c_ptr = &cave[yval + 1][x];
+ c_ptr = &grid_array[yval + 1][x];
place_inner_grid(c_ptr);
}
/* Close off the left/right edges */
- c_ptr = &cave[yval][xval - 5];
+ c_ptr = &grid_array[yval][xval - 5];
place_inner_grid(c_ptr);
- c_ptr = &cave[yval][xval + 5];
+ c_ptr = &grid_array[yval][xval + 5];
place_inner_grid(c_ptr);
/* Secret doors (random top/bottom) */
{
if (0x1 & (x + y))
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_inner_grid(c_ptr);
}
}
/* Inner "cross" */
for (y = y1; y <= y2; y++)
{
- c_ptr = &cave[y][xval];
+ c_ptr = &grid_array[y][xval];
place_inner_grid(c_ptr);
}
for (x = x1; x <= x2; x++)
{
- c_ptr = &cave[yval][x];
+ c_ptr = &grid_array[yval][x];
place_inner_grid(c_ptr);
}
for (y = y0 - rad; y <= y0 + rad; y++)
{
/* clear room flag */
- cave[y][x].info &= ~(CAVE_ROOM);
+ grid_array[y][x].info &= ~(CAVE_ROOM);
if (dist2(y0, x0, y, x, h1, h2, h3, h4) <= rad - 1)
{
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
c_ptr->info |= (CAVE_ROOM);
}
/* Place the outer walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
+ c_ptr = &grid_array[y][x1 - 1];
place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
+ c_ptr = &grid_array[y][x2 + 1];
place_outer_grid(c_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
+ c_ptr = &grid_array[y1 - 1][x];
place_outer_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
+ c_ptr = &grid_array[y2 + 1][x];
place_outer_grid(c_ptr);
}
/* The inner walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
+ c_ptr = &grid_array[y][x1 - 1];
place_inner_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
+ c_ptr = &grid_array[y][x2 + 1];
place_inner_grid(c_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
+ c_ptr = &grid_array[y1 - 1][x];
place_inner_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
+ c_ptr = &grid_array[y2 + 1][x];
place_inner_grid(c_ptr);
}
for (y = y1; y <= y2; y++)
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
c_ptr->info |= (CAVE_ROOM);
}
/* Place the outer walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
+ c_ptr = &grid_array[y][x1 - 1];
place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
+ c_ptr = &grid_array[y][x2 + 1];
place_outer_grid(c_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
+ c_ptr = &grid_array[y1 - 1][x];
place_outer_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
+ c_ptr = &grid_array[y2 + 1][x];
place_outer_grid(c_ptr);
}
/* The inner walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
+ c_ptr = &grid_array[y][x1 - 1];
place_inner_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
+ c_ptr = &grid_array[y][x2 + 1];
place_inner_grid(c_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
+ c_ptr = &grid_array[y1 - 1][x];
place_inner_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
+ c_ptr = &grid_array[y2 + 1][x];
place_inner_grid(c_ptr);
}
for (y = y1; y <= y2; y++)
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_inner_grid(c_ptr);
c_ptr->info |= (CAVE_ROOM);
}
/* Place the floor area 1 */
for (x = x1 + 3; x <= x2 - 3; x++)
{
- c_ptr = &cave[yval - 2][x];
+ c_ptr = &grid_array[yval - 2][x];
place_floor_grid(c_ptr);
add_cave_info(yval - 2, x, CAVE_ICKY);
- c_ptr = &cave[yval + 2][x];
+ c_ptr = &grid_array[yval + 2][x];
place_floor_grid(c_ptr);
add_cave_info(yval + 2, x, CAVE_ICKY);
}
/* Place the floor area 2 */
for (x = x1 + 5; x <= x2 - 5; x++)
{
- c_ptr = &cave[yval - 3][x];
+ c_ptr = &grid_array[yval - 3][x];
place_floor_grid(c_ptr);
add_cave_info(yval - 3, x, CAVE_ICKY);
- c_ptr = &cave[yval + 3][x];
+ c_ptr = &grid_array[yval + 3][x];
place_floor_grid(c_ptr);
add_cave_info(yval + 3, x, CAVE_ICKY);
}
/* Corridor */
for (x = x1; x <= x2; x++)
{
- c_ptr = &cave[yval][x];
+ c_ptr = &grid_array[yval][x];
place_floor_grid(c_ptr);
- c_ptr = &cave[y1][x];
+ c_ptr = &grid_array[y1][x];
place_floor_grid(c_ptr);
- c_ptr = &cave[y2][x];
+ c_ptr = &grid_array[y2][x];
place_floor_grid(c_ptr);
}
/* Place the outer walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
+ c_ptr = &grid_array[y][x1 - 1];
place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
+ c_ptr = &grid_array[y][x2 + 1];
place_outer_grid(c_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
+ c_ptr = &grid_array[y1 - 1][x];
place_outer_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
+ c_ptr = &grid_array[y2 + 1][x];
place_outer_grid(c_ptr);
}
}
/* Place the wall open trap */
- cave[yval][xval].mimic = cave[yval][xval].feat;
- cave[yval][xval].feat = feat_trap_open;
+ grid_array[yval][xval].mimic = grid_array[yval][xval].feat;
+ grid_array[yval][xval].feat = feat_trap_open;
/* Sort the entries */
for (i = 0; i < 16 - 1; i++)
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
c_ptr->feat = feat_glass_floor;
c_ptr->info |= (CAVE_ROOM);
/* Walls around the room */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
+ c_ptr = &grid_array[y][x1 - 1];
place_outer_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
- c_ptr = &cave[y][x2 + 1];
+ c_ptr = &grid_array[y][x2 + 1];
place_outer_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
+ c_ptr = &grid_array[y1 - 1][x];
place_outer_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
- c_ptr = &cave[y2 + 1][x];
+ c_ptr = &grid_array[y2 + 1][x];
place_outer_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
}
/* Walls around the breather */
for (dir2 = 0; dir2 < 8; dir2++)
{
- c_ptr = &cave[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]];
+ c_ptr = &grid_array[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]];
place_inner_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
}
{
y = yval + 2 * ddy_ddd[dir1];
x = xval + 2 * ddx_ddd[dir1];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_inner_perm_grid(c_ptr);
c_ptr->feat = feat_permanent_glass_wall;
- cave[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]].info |= (CAVE_ICKY);
+ grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]].info |= (CAVE_ICKY);
}
/* Glass door */
y = yval + 2 * ddy_ddd[dir1];
x = xval + 2 * ddx_ddd[dir1];
place_secret_door(y, x, DOOR_GLASS_DOOR);
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
if (is_closed_door(c_ptr->feat)) c_ptr->mimic = feat_glass_wall;
/* Place a potion */
get_obj_num_hook = kind_is_potion;
place_object(yval, xval, AM_NO_FIXED_ART);
- cave[yval][xval].info |= (CAVE_ICKY);
+ grid_array[yval][xval].info |= (CAVE_ICKY);
}
break;
DIRECTION dir1;
/* Pillars */
- c_ptr = &cave[y1 + 1][x1 + 1];
+ c_ptr = &grid_array[y1 + 1][x1 + 1];
place_inner_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
- c_ptr = &cave[y1 + 1][x2 - 1];
+ c_ptr = &grid_array[y1 + 1][x2 - 1];
place_inner_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
- c_ptr = &cave[y2 - 1][x1 + 1];
+ c_ptr = &grid_array[y2 - 1][x1 + 1];
place_inner_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
- c_ptr = &cave[y2 - 1][x2 - 1];
+ c_ptr = &grid_array[y2 - 1][x2 - 1];
place_inner_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
get_mon_num_prep(vault_aux_lite, NULL);
/* Walls around the breather */
for (dir1 = 0; dir1 < 8; dir1++)
{
- c_ptr = &cave[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]];
+ c_ptr = &grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]];
place_inner_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
}
/* Place an object */
place_object(yval, xval, AM_NO_FIXED_ART);
- cave[yval][xval].info |= (CAVE_ICKY);
+ grid_array[yval][xval].info |= (CAVE_ICKY);
}
break;
/* Walls around the potion */
for (y = yval - 2; y <= yval + 2; y++)
{
- c_ptr = &cave[y][xval - 3];
+ c_ptr = &grid_array[y][xval - 3];
place_inner_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
- c_ptr = &cave[y][xval + 3];
+ c_ptr = &grid_array[y][xval + 3];
place_inner_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
}
for (x = xval - 2; x <= xval + 2; x++)
{
- c_ptr = &cave[yval - 3][x];
+ c_ptr = &grid_array[yval - 3][x];
place_inner_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
- c_ptr = &cave[yval + 3][x];
+ c_ptr = &grid_array[yval + 3][x];
place_inner_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
}
for (dir1 = 4; dir1 < 8; dir1++)
{
- c_ptr = &cave[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]];
+ c_ptr = &grid_array[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]];
place_inner_grid(c_ptr);
c_ptr->feat = feat_glass_wall;
}
for (y = yval - 2; y <= yval + 2; y++)
for (x = xval - 2; x <= xval + 2; x++)
- cave[y][x].info |= (CAVE_ICKY);
+ grid_array[y][x].info |= (CAVE_ICKY);
}
break;
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
c_ptr->info |= (CAVE_ROOM);
if (light) c_ptr->info |= (CAVE_GLOW);
/* Walls around the room */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
+ c_ptr = &grid_array[y][x1 - 1];
place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
+ c_ptr = &grid_array[y][x2 + 1];
place_outer_grid(c_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
+ c_ptr = &grid_array[y1 - 1][x];
place_outer_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
+ c_ptr = &grid_array[y2 + 1][x];
place_outer_grid(c_ptr);
}
trap = feat_trap_armageddon;
/* Place a special trap */
- c_ptr = &cave[rand_spread(yval, ysize / 4)][rand_spread(xval, xsize / 4)];
+ c_ptr = &grid_array[rand_spread(yval, ysize / 4)][rand_spread(xval, xsize / 4)];
c_ptr->mimic = c_ptr->feat;
c_ptr->feat = trap;
int side_x = x0 - xhsize + i;
place_outer_noperm_bold(y0 - yhsize + 0, side_x);
- cave[y0 - yhsize + 0][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[y0 - yhsize + 0][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y0 - yhsize + ysize - 1, side_x);
- cave[y0 - yhsize + ysize - 1][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[y0 - yhsize + ysize - 1][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
}
/* Left and right boundaries */
int side_y = y0 - yhsize + i;
place_outer_noperm_bold(side_y, x0 - xhsize + 0);
- cave[side_y][x0 - xhsize + 0].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[side_y][x0 - xhsize + 0].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(side_y, x0 - xhsize + xsize - 1);
- cave[side_y][x0 - xhsize + xsize - 1].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[side_y][x0 - xhsize + xsize - 1].info |= (CAVE_ROOM | CAVE_ICKY);
}
/* Fill in middle with bubbles */
}
/* clean up rest of flags */
- cave[y0 - yhsize + y][x0 - xhsize + x].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= (CAVE_ROOM | CAVE_ICKY);
}
}
POSITION y = y0 - yhsize + y1;
place_extra_bold(y, x);
- cave[y][x].info &= (~CAVE_ICKY);
+ grid_array[y][x].info &= (~CAVE_ICKY);
}
}
}
-/* Create a random vault out of a fractal cave */
+/* Create a random vault out of a fractal grid_array */
static void build_cave_vault(POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz)
{
int grd, roug, cutoff;
{
for (y = 0; y <= ysize; y++)
{
- cave[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
+ grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
}
}
/* Hack -- skip "non-grids" */
if (*t == ' ') continue;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Lay down a floor */
place_floor_grid(c_ptr);
for (y = y0 - rad; y <= y0 + rad; y++)
{
/* clear room flag */
- cave[y][x].info &= ~(CAVE_ROOM);
+ grid_array[y][x].info &= ~(CAVE_ROOM);
/* Vault - so is "icky" */
- cave[y][x].info |= CAVE_ICKY;
+ grid_array[y][x].info |= CAVE_ICKY;
if (dist2(y0, x0, y, x, h1, h2, h3, h4) <= rad - 1)
{
{
for (y = 0; y <= ysize; y++)
{
- cave[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
+ grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
}
}
{
if (!in_bounds(y1 - 2, x)) break;
- cave[y1 - 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[y1 - 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y1 - 2, x);
}
{
if (!in_bounds(y2 + 2, x)) break;
- cave[y2 + 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[y2 + 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y2 + 2, x);
}
{
if (!in_bounds(y, x1 - 2)) break;
- cave[y][x1 - 2].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[y][x1 - 2].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y, x1 - 2);
}
{
if (!in_bounds(y, x2 + 2)) break;
- cave[y][x2 + 2].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[y][x2 + 2].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y, x2 + 2);
}
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
c_ptr->info |= (CAVE_ROOM | CAVE_ICKY);
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- cave[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
/* Make everything a floor */
place_floor_bold(y, x);
}
}
/* Clear mimic type */
- cave[y0][x0].mimic = 0;
+ grid_array[y0][x0].mimic = 0;
/* Add inner open space */
place_floor_bold(y0, x0);
/*!
* @brief
* 指定範囲に通路が通っていることを確認した上で床で埋める
- * This function tunnels around a room if it will cut off part of a cave system.
+ * This function tunnels around a room if it will cut off part of a grid_array system.
* @param x1 範囲の左端
* @param y1 範囲の上端
* @param x2 範囲の右端
static fill_data_type fill_data;
-/* Store routine for the fractal cave generator */
+/* Store routine for the fractal grid_array generator */
/* this routine probably should be an inline function or a macro. */
static void store_height(POSITION x, POSITION y, FEAT_IDX val)
{
(val <= fill_data.c1)) val = fill_data.c1 + 1;
/* store the value in height-map format */
- cave[y][x].feat = val;
+ grid_array[y][x].feat = val;
return;
}
*
* How fractal caves are made:
*
-* When the map is complete, a cut-off value is used to create a cave.
+* When the map is complete, a cut-off value is used to create a grid_array.
* Heights below this value are "floor", and heights above are "wall".
* This also can be used to create lakes, by adding more height levels
* representing shallow and deep water/ lava etc.
* The grd variable affects the width of passages.
* The roug variable affects the roughness of those passages
*
-* The tricky part is making sure the created cave is connected. This
+* The tricky part is making sure the created grid_array is connected. This
* is done by 'filling' from the inside and only keeping the 'filled'
* floor. Walls bounding the 'filled' floor are also kept. Everything
* else is converted to the normal _extra_.
/*
- * Note that this uses the cave.feat array in a very hackish way
+ * Note that this uses the grid_array.feat array in a very hackish way
* the values are first set to zero, and then each array location
* is used as a "heightmap"
* The heightmap then needs to be converted back into the "feat" format.
* grd=level at which fractal turns on. smaller gives more mazelike caves
* roug=roughness level. 16=normal. higher values make things more convoluted
* small values are good for smooth walls.
- * size=length of the side of the square cave system.
+ * size=length of the side of the square grid_array system.
*/
void generate_hmap(POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff)
{
for (j = 0; j <= ysize; j++)
{
/* -1 is a flag for "not done yet" */
- cave[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].feat = -1;
- /* Clear icky flag because may be redoing the cave */
- cave[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].info &= ~(CAVE_ICKY);
+ grid_array[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].feat = -1;
+ /* Clear icky flag because may be redoing the grid_array */
+ grid_array[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].info &= ~(CAVE_ICKY);
}
}
/* Boundaries are walls */
- cave[fill_data.ymin][fill_data.xmin].feat = (s16b)maxsize;
- cave[fill_data.ymax][fill_data.xmin].feat = (s16b)maxsize;
- cave[fill_data.ymin][fill_data.xmax].feat = (s16b)maxsize;
- cave[fill_data.ymax][fill_data.xmax].feat = (s16b)maxsize;
+ grid_array[fill_data.ymin][fill_data.xmin].feat = (s16b)maxsize;
+ grid_array[fill_data.ymax][fill_data.xmin].feat = (s16b)maxsize;
+ grid_array[fill_data.ymin][fill_data.xmax].feat = (s16b)maxsize;
+ grid_array[fill_data.ymax][fill_data.xmax].feat = (s16b)maxsize;
/* Set the middle square to be an open area. */
- cave[y0][x0].feat = 0;
+ grid_array[y0][x0].feat = 0;
/* Initialize the step sizes */
xstep = xhstep = xsize * 256;
jj = j / 256 + fill_data.ymin;
/* Test square */
- if (cave[jj][ii].feat == -1)
+ if (grid_array[jj][ii].feat == -1)
{
if (xhstep2 > grd)
{
{
/* Average of left and right points +random bit */
store_height(ii, jj,
- (cave[jj][fill_data.xmin + (i - xhstep) / 256].feat
- + cave[jj][fill_data.xmin + (i + xhstep) / 256].feat) / 2
+ (grid_array[jj][fill_data.xmin + (i - xhstep) / 256].feat
+ + grid_array[jj][fill_data.xmin + (i + xhstep) / 256].feat) / 2
+ (randint1(xstep2) - xhstep2) * roug / 16);
}
}
jj = j / 256 + fill_data.ymin;
/* Test square */
- if (cave[jj][ii].feat == -1)
+ if (grid_array[jj][ii].feat == -1)
{
if (xhstep2 > grd)
{
{
/* Average of up and down points +random bit */
store_height(ii, jj,
- (cave[fill_data.ymin + (j - yhstep) / 256][ii].feat
- + cave[fill_data.ymin + (j + yhstep) / 256][ii].feat) / 2
+ (grid_array[fill_data.ymin + (j - yhstep) / 256][ii].feat
+ + grid_array[fill_data.ymin + (j + yhstep) / 256][ii].feat) / 2
+ (randint1(ystep2) - yhstep2) * roug / 16);
}
}
jj = j / 256 + fill_data.ymin;
/* Test square */
- if (cave[jj][ii].feat == -1)
+ if (grid_array[jj][ii].feat == -1)
{
if (xhstep2 > grd)
{
* reduce the effect of the square grid on the shape of the fractal
*/
store_height(ii, jj,
- (cave[ym][xm].feat + cave[yp][xm].feat
- + cave[ym][xp].feat + cave[yp][xp].feat) / 4
+ (grid_array[ym][xm].feat + grid_array[yp][xm].feat
+ + grid_array[ym][xp].feat + grid_array[yp][xp].feat) / 4
+ (randint1(xstep2) - xhstep2) * (diagsize / 16) / 256 * roug);
}
}
{
/*
* function used to convert from height-map back to the
- * normal angband cave format
+ * normal angband grid_array format
*/
- if (cave[y][x].info & CAVE_ICKY)
+ if (grid_array[y][x].info & CAVE_ICKY)
{
/* already done */
return FALSE;
else
{
/* Show that have looked at this square */
- cave[y][x].info|= (CAVE_ICKY);
+ grid_array[y][x].info|= (CAVE_ICKY);
/* Use cutoffs c1-c3 to allocate regions of floor /water/ lava etc. */
- if (cave[y][x].feat <= c1)
+ if (grid_array[y][x].feat <= c1)
{
/* 25% of the time use the other tile : it looks better this way */
if (randint1(100) < 75)
{
- cave[y][x].feat = feat1;
- cave[y][x].info &= ~(CAVE_MASK);
- cave[y][x].info |= info1;
+ grid_array[y][x].feat = feat1;
+ grid_array[y][x].info &= ~(CAVE_MASK);
+ grid_array[y][x].info |= info1;
return TRUE;
}
else
{
- cave[y][x].feat = feat2;
- cave[y][x].info &= ~(CAVE_MASK);
- cave[y][x].info |= info2;
+ grid_array[y][x].feat = feat2;
+ grid_array[y][x].info &= ~(CAVE_MASK);
+ grid_array[y][x].info |= info2;
return TRUE;
}
}
- else if (cave[y][x].feat <= c2)
+ else if (grid_array[y][x].feat <= c2)
{
/* 25% of the time use the other tile : it looks better this way */
if (randint1(100) < 75)
{
- cave[y][x].feat = feat2;
- cave[y][x].info &= ~(CAVE_MASK);
- cave[y][x].info |= info2;
+ grid_array[y][x].feat = feat2;
+ grid_array[y][x].info &= ~(CAVE_MASK);
+ grid_array[y][x].info |= info2;
return TRUE;
}
else
{
- cave[y][x].feat = feat1;
- cave[y][x].info &= ~(CAVE_MASK);
- cave[y][x].info |= info1;
+ grid_array[y][x].feat = feat1;
+ grid_array[y][x].info &= ~(CAVE_MASK);
+ grid_array[y][x].info |= info1;
return TRUE;
}
}
- else if (cave[y][x].feat <= c3)
+ else if (grid_array[y][x].feat <= c3)
{
- cave[y][x].feat = feat3;
- cave[y][x].info &= ~(CAVE_MASK);
- cave[y][x].info |= info3;
+ grid_array[y][x].feat = feat3;
+ grid_array[y][x].info &= ~(CAVE_MASK);
+ grid_array[y][x].info |= info3;
return TRUE;
}
/* if greater than cutoff then is a wall */
/*
* Quick and nasty fill routine used to find the connected region
- * of floor in the middle of the cave
+ * of floor in the middle of the grid_array
*/
static void cave_fill(POSITION y, POSITION x)
{
j = ty + ddy_ddd[d];
i = tx + ddx_ddd[d];
- /* Paranoia Don't leave the cave */
+ /* Paranoia Don't leave the grid_array */
if (!in_bounds(j, i))
{
/* affect boundary */
- cave[j][i].info |= CAVE_ICKY;
+ grid_array[j][i].info |= CAVE_ICKY;
/* return; */
}
}
else
{
- /* keep tally of size of cave system */
+ /* keep tally of size of grid_array system */
(fill_data.amount)++;
}
}
else
{
/* affect boundary */
- cave[j][i].info |= CAVE_ICKY;
+ grid_array[j][i].info |= CAVE_ICKY;
}
}
}
/*
- * select region connected to center of cave system
+ * select region connected to center of grid_array system
* this gets rid of alot of isolated one-sqaures that
* can make teleport traps instadeaths...
*/
for (y = 0; y <= ysize; ++y)
{
place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
- cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
+ grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
}
}
return FALSE;
for (i = 0; i <= xsize; ++i)
{
/* top boundary */
- if ((cave[0 + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
+ if ((grid_array[0 + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
{
/* Next to a 'filled' region? - set to be room walls */
place_outer_bold(y0 + 0 - yhsize, x0 + i - xhsize);
- if (light) cave[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_GLOW);
- cave[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_ROOM);
+ if (light) grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_GLOW);
+ grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_ROOM);
place_outer_bold(y0 + 0 - yhsize, x0 + i - xhsize);
}
else
}
/* bottom boundary */
- if ((cave[ysize + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
+ if ((grid_array[ysize + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
{
/* Next to a 'filled' region? - set to be room walls */
place_outer_bold(y0 + ysize - yhsize, x0 + i - xhsize);
- if (light) cave[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_GLOW);
- cave[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_ROOM);
+ if (light) grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_GLOW);
+ grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_ROOM);
place_outer_bold(y0 + ysize - yhsize, x0 + i - xhsize);
}
else
}
/* clear the icky flag-don't need it any more */
- cave[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
- cave[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+ grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+ grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
}
/* Do the left and right boundaries minus the corners (done above) */
for (i = 1; i < ysize; ++i)
{
/* left boundary */
- if ((cave[i + y0 - yhsize][0 + x0 - xhsize].info & CAVE_ICKY) && room)
+ if ((grid_array[i + y0 - yhsize][0 + x0 - xhsize].info & CAVE_ICKY) && room)
{
/* room boundary */
place_outer_bold(y0 + i - yhsize, x0 + 0 - xhsize);
- if (light) cave[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_GLOW);
- cave[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_ROOM);
+ if (light) grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_GLOW);
+ grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_ROOM);
place_outer_bold(y0 + i - yhsize, x0 + 0 - xhsize);
}
else
place_extra_bold(y0 + i - yhsize, x0 + 0 - xhsize);
}
/* right boundary */
- if ((cave[i + y0 - yhsize][xsize + x0 - xhsize].info & CAVE_ICKY) && room)
+ if ((grid_array[i + y0 - yhsize][xsize + x0 - xhsize].info & CAVE_ICKY) && room)
{
/* room boundary */
place_outer_bold(y0 + i - yhsize, x0 + xsize - xhsize);
- if (light) cave[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_GLOW);
- cave[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_ROOM);
+ if (light) grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_GLOW);
+ grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_ROOM);
place_outer_bold(y0 + i - yhsize, x0 + xsize - xhsize);
}
else
}
/* clear icky flag -done with it */
- cave[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
- cave[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
+ grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
+ grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
}
for (y = 1; y < ysize; ++y)
{
if (is_floor_bold(y0 + y - yhsize, x0 + x - xhsize) &&
- (cave[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
+ (grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
{
/* Clear the icky flag in the filled region */
- cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~CAVE_ICKY;
+ grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~CAVE_ICKY;
/* Set appropriate flags */
- if (light) cave[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
- if (room) cave[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
+ if (light) grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
+ if (room) grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
}
else if (is_outer_bold(y0 + y - yhsize, x0 + x - xhsize) &&
- (cave[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
+ (grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
{
/* Walls */
- cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
- if (light) cave[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
+ grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
+ if (light) grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
if (room)
{
- cave[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
+ grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
}
else
{
place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
- cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ROOM);
+ grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ROOM);
}
}
else
{
/* Clear the unconnected regions */
place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
- cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
+ grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
}
}
}
#ifdef ALLOW_CAVERNS_AND_LAKES
/*
- * Builds a cave system in the center of the dungeon.
+ * Builds a grid_array system in the center of the dungeon.
*/
void build_cavern(void)
{
light = done = FALSE;
if ((dun_level <= randint1(50)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
- /* Make a cave the size of the dungeon */
+ /* Make a grid_array the size of the dungeon */
xsize = cur_wid - 1;
ysize = cur_hgt - 1;
x0 = xsize / 2;
feat2 = feat_shallow_water;
feat3 = feat_ground_type[randint0(100)];
break;
- case LAKE_T_CAVE: /* Collapsed cave */
+ case LAKE_T_CAVE: /* Collapsed grid_array */
feat1 = feat_ground_type[randint0(100)];
feat2 = feat_ground_type[randint0(100)];
feat3 = feat_rubble;
}
/*
- * select region connected to center of cave system
+ * select region connected to center of grid_array system
* this gets rid of alot of isolated one-sqaures that
* can make teleport traps instadeaths...
*/
/* number of filled squares */
fill_data.amount = 0;
- /* select region connected to center of cave system
+ /* select region connected to center of grid_array system
* this gets rid of alot of isolated one-sqaures that
* can make teleport traps instadeaths... */
cave_fill((byte)y0, (byte)x0);
for (y = 0; y <= ysize; ++y)
{
place_floor_bold(y0 + y - yhsize, x0 + x - xhsize);
- cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
+ grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
}
}
return FALSE;
place_extra_bold(y0 + ysize - yhsize, x0 + i - xhsize);
/* clear the icky flag-don't need it any more */
- cave[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
- cave[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+ grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+ grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
}
/* Do the left and right boundaries minus the corners (done above) */
place_extra_bold(y0 + i - yhsize, x0 + xsize - xhsize);
/* clear icky flag -done with it */
- cave[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
- cave[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
+ grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
+ grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
}
for (y = 1; y < ysize; ++y)
{
/* Fill unconnected regions with granite */
- if ((!(cave[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY)) ||
+ if ((!(grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY)) ||
is_outer_bold(y0 + y - yhsize, x0 + x - xhsize))
place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
/* turn off icky flag (no longer needed.) */
- cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
+ grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
/* Light lava */
if (cave_have_flag_bold(y0 + y - yhsize, x0 + x - xhsize, FF_LAVA))
{
- if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) cave[y0 + y - yhsize][x0 + x - xhsize].info |= CAVE_GLOW;
+ if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= CAVE_GLOW;
}
}
}
/*
- * makes a lake/collapsed cave system in the center of the dungeon
+ * makes a lake/collapsed grid_array system in the center of the dungeon
*/
void build_lake(int type)
{
for (i = 0; i <= xsize; i++)
{
place_outer_noperm_bold(y1, x1 + i);
- cave[y1][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[y1][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y2, x1 + i);
- cave[y2][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[y2][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
}
/* Left and right boundaries */
for (i = 1; i < ysize; i++)
{
place_outer_noperm_bold(y1 + i, x1);
- cave[y1 + i][x1].info|=(CAVE_ROOM | CAVE_ICKY);
+ grid_array[y1 + i][x1].info|=(CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y1 + i, x2);
- cave[y1 + i][x2].info|=(CAVE_ROOM | CAVE_ICKY);
+ grid_array[y1 + i][x2].info|=(CAVE_ROOM | CAVE_ICKY);
}
/* Middle */
{
/* clear the untouched region */
place_floor_bold(y1 + y, x1 + x);
- cave[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
}
else
{
/* make it a room- but don't touch */
- cave[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
+ grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
}
}
}
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
c_ptr->info |= CAVE_ROOM;
if (is_vault) c_ptr->info |= CAVE_ICKY;
if ((x == x1 - 1) || (x == x2 + 1) || (y == y1 - 1) || (y == y2 + 1))
if (!in_bounds(y, x)) return;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* hack- check to see if square has been visited before
* if so, then exit (use room flag to do this) */
for (x = x1; x <= x2; x++)
{
/* Point to grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
place_floor_grid(c_ptr);
c_ptr->info |= (CAVE_ROOM);
if (light) c_ptr->info |= (CAVE_GLOW);
/* Limit number of rooms */
int dun_rooms = DUN_ROOMS_MAX * area_size / 100;
- /* Assume normal cave */
+ /* Assume normal grid_array */
room_info_type *room_info_ptr = room_info_normal;
/*
MOVE_PLIST(ROOM_T_INNER_FEAT, ROOM_T_OVAL);
}
- /*! @details ダンジョンにCAVEフラグがある場合、NORMALの生成枠がFRACAVEに与えられる。/ CAVE dungeon (Orc cave etc.) */
+ /*! @details ダンジョンにCAVEフラグがある場合、NORMALの生成枠がFRACAVEに与えられる。/ CAVE dungeon (Orc grid_array etc.) */
else if (d_info[p_ptr->dungeon_idx].flags1 & DF1_CAVE)
{
MOVE_PLIST(ROOM_T_FRACAVE, ROOM_T_NORMAL);
#define ROOM_T_PIT 5 /*!<部屋型ID:モンスターPIT / Monster pit (33x11) */
#define ROOM_T_LESSER_VAULT 6 /*!<部屋型ID:小型VAULT / Lesser vault (33x22) */
#define ROOM_T_GREATER_VAULT 7 /*!<部屋型ID:大型VAULT / Greater vault (66x44) */
-#define ROOM_T_FRACAVE 8 /*!<部屋型ID:フラクタル地形 / Fractal cave (42x24) */
+#define ROOM_T_FRACAVE 8 /*!<部屋型ID:フラクタル地形 / Fractal grid_array (42x24) */
#define ROOM_T_RANDOM_VAULT 9 /*!<部屋型ID:ランダムVAULT / Random vault (44x22) */
#define ROOM_T_OVAL 10 /*!<部屋型ID:円形部屋 / Circular rooms (22x22) */
#define ROOM_T_CRYPT 11 /*!<部屋型ID:聖堂 / Crypts (22x22) */
/*!
- * @brief フロア保存時のcave情報テンプレートをソートするための比較処理
- * @param u caveテンプレートの参照ポインタ
+ * @brief フロア保存時のgrid_array情報テンプレートをソートするための比較処理
+ * @param u grid_arrayテンプレートの参照ポインタ
* @param v 未使用
* @param a スワップするモンスター種族のID1
* @param b スワップするモンスター種族のID2
/*!
- * @brief フロア保存時のcave情報テンプレートをソートするためのスワップ処理 / Sorting hook -- Swap function
- * @param u caveテンプレートの参照ポインタ
+ * @brief フロア保存時のgrid_array情報テンプレートをソートするためのスワップ処理 / Sorting hook -- Swap function
+ * @param u grid_arrayテンプレートの参照ポインタ
* @param v 未使用
* @param a スワップするモンスター種族のID1
* @param b スワップするモンスター種族のID2
{
for (x = 0; x < cur_wid; x++)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
for (i = 0; i < num_temp; i++)
{
- /*** "Run-Length-Encoding" of cave ***/
+ /*** "Run-Length-Encoding" of grid_array ***/
/* Note that this will induce two wasted bytes */
count = 0;
prev_u16b = 0;
- /* Dump the cave */
+ /* Dump the grid_array */
for (y = 0; y < cur_hgt; y++)
{
for (x = 0; x < cur_wid; x++)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
for (i = 0; i < num_temp; i++)
{
/* Shatter Arrow */
if (snipe_type == SP_KILL_WALL)
{
- c_ptr = &cave[ny][nx];
+ c_ptr = &grid_array[ny][nx];
if (cave_have_flag_grid(c_ptr, FF_HURT_ROCK) && !c_ptr->m_idx)
{
}
/* Stopped by walls/doors */
- if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !cave[ny][nx].m_idx) break;
+ if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !grid_array[ny][nx].m_idx) break;
/* Advance the distance */
cur_dis++;
/* Sniper */
if (snipe_type == SP_LITE)
{
- cave[ny][nx].info |= (CAVE_GLOW);
+ grid_array[ny][nx].info |= (CAVE_GLOW);
note_spot(ny, nx);
lite_spot(ny, nx);
}
/* Sniper */
if (snipe_type == SP_EVILNESS)
{
- cave[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
+ grid_array[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
note_spot(ny, nx);
lite_spot(ny, nx);
}
y = ny;
/* Monster here, Try to hit it */
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
{
- grid_type *c_mon_ptr = &cave[y][x];
+ grid_type *c_mon_ptr = &grid_array[y][x];
monster_type *m_ptr = &m_list[c_mon_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Sniper */
if (snipe_type == SP_HOLYNESS)
{
- cave[ny][nx].info |= (CAVE_GLOW);
+ grid_array[ny][nx].info |= (CAVE_GLOW);
note_spot(ny, nx);
lite_spot(ny, nx);
}
if (!in_bounds2(ny, nx)) break;
/* Stopped by walls/doors */
- if (!player_can_enter(cave[ny][nx].feat, 0)) break;
+ if (!player_can_enter(grid_array[ny][nx].feat, 0)) break;
/* Stopped by monsters */
if (!cave_empty_bold(ny, nx)) break;
- cave[ny][nx].m_idx = m_idx;
- cave[oy][ox].m_idx = 0;
+ grid_array[ny][nx].m_idx = m_idx;
+ grid_array[oy][ox].m_idx = 0;
m_ptr->fx = nx;
m_ptr->fy = ny;
if (stick_to)
{
- MONSTER_IDX m_idx = cave[y][x].m_idx;
+ MONSTER_IDX m_idx = grid_array[y][x].m_idx;
monster_type *m_ptr = &m_list[m_idx];
OBJECT_IDX o_idx = o_pop();
if (!get_rep_dir(&dir, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_CAN_DIG))
{
{
for (y = 0; y < cur_hgt; y++)
{
- if (is_mirror_grid(&cave[y][x])) {
+ if (is_mirror_grid(&grid_array[y][x])) {
mirror_y[mirror_num] = y;
mirror_x[mirror_num] = x;
mirror_num++;
*/
static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
bool obvious = FALSE;
if (in_bounds2(by, bx))
{
- grid_type *cc_ptr = &cave[by][bx];
+ grid_type *cc_ptr = &grid_array[by][bx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
*/
static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
{
int tmp;
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
monster_type *m_ptr = &m_list[c_ptr->m_idx];
monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
x = m_ptr->fx;
/* Hack -- get new grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
}
/* Fear */
}
}
if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
- if (is_mirror_grid(&cave[y][x]))
+ if (is_mirror_grid(&grid_array[y][x]))
{
/* The target of monsterspell becomes tha mirror(broken) */
monster_target_y = y;
x = GRID_X(path_g[j]);
if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
if (!who && (project_m_n == 1) && !jump) {
- if (cave[project_m_y][project_m_x].m_idx > 0) {
- monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
+ if (grid_array[project_m_y][project_m_x].m_idx > 0) {
+ monster_type *m_ptr = &m_list[grid_array[project_m_y][project_m_x].m_idx];
if (m_ptr->ml)
{
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
/* Hack - auto-track */
- health_track(cave[project_m_y][project_m_x].m_idx);
+ health_track(grid_array[project_m_y][project_m_x].m_idx);
}
}
}
if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
notice = TRUE;
if (!who && (project_m_n == 1) && !jump) {
- if (cave[project_m_y][project_m_x].m_idx > 0)
+ if (grid_array[project_m_y][project_m_x].m_idx > 0)
{
- monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
+ monster_type *m_ptr = &m_list[grid_array[project_m_y][project_m_x].m_idx];
if (m_ptr->ml)
{
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
/* Hack - auto-track */
- health_track(cave[project_m_y][project_m_x].m_idx);
+ health_track(grid_array[project_m_y][project_m_x].m_idx);
}
}
}
if( second_step )continue;
break;
}
- if( is_mirror_grid(&cave[y][x]) && !second_step )
+ if( is_mirror_grid(&grid_array[y][x]) && !second_step )
{
/* The target of monsterspell becomes tha mirror(broken) */
monster_target_y=(s16b)y;
px = GRID_X(path_g[i]);
(void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
if(!who && (project_m_n == 1) && !jump){
- if(cave[project_m_y][project_m_x].m_idx >0 ){
- monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
+ if(grid_array[project_m_y][project_m_x].m_idx >0 ){
+ monster_type *m_ptr = &m_list[grid_array[project_m_y][project_m_x].m_idx];
if (m_ptr->ml)
{
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
/* Hack - auto-track */
- health_track(cave[project_m_y][project_m_x].m_idx);
+ health_track(grid_array[project_m_y][project_m_x].m_idx);
}
}
}
/* A single bolt may be reflected */
if (grids <= 1)
{
- monster_type *m_ptr = &m_list[cave[y][x].m_idx];
+ monster_type *m_ptr = &m_list[grid_array[y][x].m_idx];
monster_race *ref_ptr = &r_info[m_ptr->r_idx];
- if ((flg & PROJECT_REFLECTABLE) && cave[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
- ((cave[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
+ if ((flg & PROJECT_REFLECTABLE) && grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
+ ((grid_array[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
(!who || dist_hack > 1) && !one_in_(10))
{
POSITION t_y, t_x;
else flg |= PROJECT_PLAYER;
/* The bolt is reflected */
- project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
+ project(grid_array[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
/* Don't affect the monster any longer */
continue;
y = project_m_y;
/* Track if possible */
- if (cave[y][x].m_idx > 0)
+ if (grid_array[y][x].m_idx > 0)
{
- monster_type *m_ptr = &m_list[cave[y][x].m_idx];
+ monster_type *m_ptr = &m_list[grid_array[y][x].m_idx];
if (m_ptr->ml)
{
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
/* Hack - auto-track */
- if (m_ptr->ml) health_track(cave[y][x].m_idx);
+ if (m_ptr->ml) health_track(grid_array[y][x].m_idx);
}
}
}
{
for (y = 0; y < cur_hgt; y++)
{
- if (is_mirror_grid(&cave[y][x]) &&
+ if (is_mirror_grid(&grid_array[y][x]) &&
distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
player_has_los_bold(y, x) &&
{
for (y = 0; y < cur_hgt; y++)
{
- if (is_mirror_grid(&cave[y][x]))
+ if (is_mirror_grid(&grid_array[y][x]))
{
if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
(PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
{
- if (!cave[y][x].m_idx)
+ if (!grid_array[y][x].m_idx)
{
remove_mirror(y, x);
}
{
int dist = distance(p_ptr->y, p_ptr->x, y, x);
if (dist > range) continue;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Hack -- Safe */
if (flag == FF_TRAP)
/* Stay in the circle of death */
if (k > r) continue;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Lose room and vault */
c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
/* Stay in the circle of death */
if (k > r) continue;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
yy = y + ddy_ddd[i];
xx = x + ddx_ddd[i];
if (!in_bounds2(yy, xx)) continue;
- cc_ptr = &cave[yy][xx];
+ cc_ptr = &grid_array[yy][xx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
c_ptr->info |= CAVE_GLOW;
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
/* Skip distant grids */
if (distance(cy, cx, yy, xx) > r) continue;
- c_ptr = &cave[yy][xx];
+ c_ptr = &grid_array[yy][xx];
/* Lose room and vault / Lose light and knowledge */
c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
/* Important -- Skip "quake" grids */
if (map[16+y-cy][16+x-cx]) continue;
- if (cave[y][x].m_idx) continue;
+ if (grid_array[y][x].m_idx) continue;
/* Count "safe" grids */
sn++;
{
case 1:
{
- msg_print(_("ダンジョンの壁が崩れた!", "The cave ceiling collapses!"));
+ msg_print(_("ダンジョンの壁が崩れた!", "The grid_array ceiling collapses!"));
break;
}
case 2:
{
- msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The cave floor twists in an unnatural way!"));
+ msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The grid_array floor twists in an unnatural way!"));
break;
}
default:
{
- msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The cave quakes! You are pummeled with debris!"));
+ msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The grid_array quakes! You are pummeled with debris!"));
break;
}
}
/* Skip unaffected grids */
if (!map[16+yy-cy][16+xx-cx]) continue;
- c_ptr = &cave[yy][xx];
+ c_ptr = &grid_array[yy][xx];
if (c_ptr->m_idx == p_ptr->riding) continue;
if (!cave_empty_bold(y, x)) continue;
/* Hack -- no safety on glyph of warding */
- if (is_glyph_grid(&cave[y][x])) continue;
- if (is_explosive_rune_grid(&cave[y][x])) continue;
+ if (is_glyph_grid(&grid_array[y][x])) continue;
+ if (is_explosive_rune_grid(&grid_array[y][x])) continue;
/* ... nor on the Pattern */
if (pattern_tile(y, x)) continue;
/* Important -- Skip "quake" grids */
if (map[16+y-cy][16+x-cx]) continue;
- if (cave[y][x].m_idx) continue;
+ if (grid_array[y][x].m_idx) continue;
if (player_bold(y, x)) continue;
/* Count "safe" grids */
/* Hack -- Escape from the rock */
if (sn)
{
- IDX m_idx_aux = cave[yy][xx].m_idx;
+ IDX m_idx_aux = grid_array[yy][xx].m_idx;
/* Update the old location */
- cave[yy][xx].m_idx = 0;
+ grid_array[yy][xx].m_idx = 0;
/* Update the new location */
- cave[sy][sx].m_idx = m_idx_aux;
+ grid_array[sy][sx].m_idx = m_idx_aux;
/* Move the monster */
m_ptr->fy = sy;
/* Skip unaffected grids */
if (!map[16+yy-cy][16+xx-cx]) continue;
- c_ptr = &cave[yy][xx];
+ c_ptr = &grid_array[yy][xx];
/* Paranoia -- never affect player */
/* if (player_bold(yy, xx)) continue; */
/* Skip distant grids */
if (distance(cy, cx, yy, xx) > r) continue;
- c_ptr = &cave[yy][xx];
+ c_ptr = &grid_array[yy][xx];
if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
yyy = yy + ddy_ddd[ii];
xxx = xx + ddx_ddd[ii];
if (!in_bounds2(yyy, xxx)) continue;
- cc_ptr = &cave[yyy][xxx];
+ cc_ptr = &grid_array[yyy][xxx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
c_ptr->info |= CAVE_GLOW;
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
/* Success */
POSITION y = temp_y[i];
POSITION x = temp_x[i];
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
/* No longer in the array */
c_ptr->info &= ~(CAVE_TEMP);
POSITION x = temp_x[i];
int j;
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
bool do_dark = !is_mirror_grid(c_ptr);
/* No longer in the array */
if (in_bounds2(by, bx))
{
- grid_type *cc_ptr = &cave[by][bx];
+ grid_type *cc_ptr = &grid_array[by][bx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
grid_type *c_ptr;
/* Get the grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Avoid infinite recursion */
if (c_ptr->info & (CAVE_TEMP)) return;
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+ if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
}
}
tx = p_ptr->x + ddx[dir];
ty = p_ptr->y + ddy[dir];
}
- c_ptr = &cave[ty][tx];
+ c_ptr = &grid_array[ty][tx];
if (p_ptr->anti_tele)
{
ty = target_row;
}
- if (in_bounds(ty, tx)) tm_idx = cave[ty][tx].m_idx;
+ if (in_bounds(ty, tx)) tm_idx = grid_array[ty][tx].m_idx;
path_n = project_path(path_g, project_length, p_ptr->y, p_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL);
project_length = 0;
int ny = GRID_Y(path_g[i]);
int nx = GRID_X(path_g[i]);
- if (cave_empty_bold(ny, nx) && player_can_enter(cave[ny][nx].feat, 0))
+ if (cave_empty_bold(ny, nx) && player_can_enter(grid_array[ny][nx].feat, 0))
{
ty = ny;
tx = nx;
continue;
}
- if (!cave[ny][nx].m_idx)
+ if (!grid_array[ny][nx].m_idx)
{
if (tm_idx)
{
/* Move player before updating the monster */
if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
- update_monster(cave[ny][nx].m_idx, TRUE);
+ update_monster(grid_array[ny][nx].m_idx, TRUE);
/* Found a monster */
- m_ptr = &m_list[cave[ny][nx].m_idx];
+ m_ptr = &m_list[grid_array[ny][nx].m_idx];
- if (tm_idx != cave[ny][nx].m_idx)
+ if (tm_idx != grid_array[ny][nx].m_idx)
{
#ifdef JP
msg_format("%s%sが立ちふさがっている!", tm_idx ? "別の" : "", m_ptr->ml ? "モンスター" : "何か");
{
for (y = 0; y < cur_hgt; y++)
{
- if (is_mirror_grid(&cave[y][x]))
+ if (is_mirror_grid(&grid_array[y][x]))
{
remove_mirror(y, x);
if (explode)
if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
/* Stopped by monsters */
- if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
+ if ((dir != 5) && grid_array[ny][nx].m_idx != 0) break;
/* Save the new location */
x = nx;
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
stop_mouth();
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
{
py_attack(y, x, 0);
if (randint0(p_ptr->skill_dis) < 7)
}
else
{
- grid_type *c_ptr = &cave[creature_ptr->y][creature_ptr->x];
+ grid_type *c_ptr = &grid_array[creature_ptr->y][creature_ptr->x];
feature_type *f_ptr = &f_info[c_ptr->feat];
if (!have_flag(f_ptr->flags, FF_PROJECT) ||
if (!get_rep_dir(&dir, FALSE)) return FALSE;
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
{
if (one_in_(3))
msg_print(_("あーたたたたたたたたたたたたたたたたたたたたたた!!!",
"Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
py_attack(y, x, 0);
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
{
handle_stuff();
py_attack(y, x, 0);
msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
return FALSE;
}
- if (is_mirror_grid(&cave[creature_ptr->y][creature_ptr->x]))
+ if (is_mirror_grid(&grid_array[creature_ptr->y][creature_ptr->x]))
{
msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
dir = randint0(8);
y = creature_ptr->y + ddy_ddd[dir];
x = creature_ptr->x + ddx_ddd[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Hack -- attack monsters */
if (c_ptr->m_idx)
/* No teleporting into vaults and such */
if (!(p_ptr->inside_quest || p_ptr->inside_arena))
- if (cave[ny][nx].info & CAVE_ICKY) continue;
+ if (grid_array[ny][nx].info & CAVE_ICKY) continue;
/* This grid looks good */
look = FALSE;
sound(SOUND_TPOTHER);
/* Update the old location */
- cave[oy][ox].m_idx = 0;
+ grid_array[oy][ox].m_idx = 0;
/* Update the new location */
- cave[ny][nx].m_idx = m_idx;
+ grid_array[ny][nx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ny;
if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
/* No teleporting into vaults and such */
- /* if (cave[ny][nx].info & (CAVE_ICKY)) continue; */
+ /* if (grid_array[ny][nx].info & (CAVE_ICKY)) continue; */
/* This grid looks good */
look = FALSE;
sound(SOUND_TPOTHER);
/* Update the old location */
- cave[oy][ox].m_idx = 0;
+ grid_array[oy][ox].m_idx = 0;
/* Update the new location */
- cave[ny][nx].m_idx = m_idx;
+ grid_array[ny][nx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ny;
{
for (yy = -1; yy < 2; yy++)
{
- MONSTER_IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+ MONSTER_IDX tmp_m_idx = grid_array[oy+yy][ox+xx].m_idx;
/* A monster except your mount may follow */
if (tmp_m_idx && (p_ptr->riding != tmp_m_idx))
{
for (yy = -1; yy < 2; yy++)
{
- MONSTER_IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+ MONSTER_IDX tmp_m_idx = grid_array[oy+yy][ox+xx].m_idx;
/* A monster except your mount or caster may follow */
if (tmp_m_idx && (p_ptr->riding != tmp_m_idx) && (m_idx != tmp_m_idx))
}
/* Accept any grid when wizard mode */
- if (p_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!cave[y][x].m_idx || (cave[y][x].m_idx == p_ptr->riding))) break;
+ if (p_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!grid_array[y][x].m_idx || (grid_array[y][x].m_idx == p_ptr->riding))) break;
/* Accept teleportable floor grids */
if (cave_player_teleportable_bold(y, x, mode)) break;
GAME_TEXT m_name[MAX_NLEN];
if (!target_set(TARGET_KILL)) return FALSE;
- target_m_idx = cave[target_row][target_col].m_idx;
+ target_m_idx = grid_array[target_row][target_col].m_idx;
if (!target_m_idx) return TRUE;
if (!player_has_los_bold(target_row, target_col)) return TRUE;
if (!projectable(creature_ptr->y, creature_ptr->x, target_row, target_col)) return TRUE;
{
for (x = 1; x < cur_wid - 1; x++)
{
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Seeing true feature code (ignore mimic) */
f_ptr = &f_info[c_ptr->feat];
/* Special boundary walls -- Top and bottom */
for (x = 0; x < cur_wid; x++)
{
- c_ptr = &cave[0][x];
+ c_ptr = &grid_array[0][x];
f_ptr = &f_info[c_ptr->mimic];
/* Lose room and vault */
if (!have_flag(f_info[c_ptr->mimic].flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK);
}
- c_ptr = &cave[cur_hgt - 1][x];
+ c_ptr = &grid_array[cur_hgt - 1][x];
f_ptr = &f_info[c_ptr->mimic];
/* Lose room and vault */
/* Special boundary walls -- Left and right */
for (y = 1; y < (cur_hgt - 1); y++)
{
- c_ptr = &cave[y][0];
+ c_ptr = &grid_array[y][0];
f_ptr = &f_info[c_ptr->mimic];
/* Lose room and vault */
if (!have_flag(f_info[c_ptr->mimic].flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK);
}
- c_ptr = &cave[y][cur_wid - 1];
+ c_ptr = &grid_array[y][cur_wid - 1];
f_ptr = &f_info[c_ptr->mimic];
/* Lose room and vault */
for (i = 0; i < 9; i++)
{
- c_ptr = &cave[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
+ c_ptr = &grid_array[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
if (!cave_have_flag_grid(c_ptr, FF_PROJECT))
{
GAME_TEXT o_name[MAX_NLEN];
/* Check to see if an object is already there */
- if (cave[p_ptr->y][p_ptr->x].o_idx)
+ if (grid_array[p_ptr->y][p_ptr->x].o_idx)
{
msg_print(_("自分の足の下にある物は取れません。", "You can't fetch when you're already standing on something."));
return;
return;
}
- c_ptr = &cave[ty][tx];
+ c_ptr = &grid_array[ty][tx];
/* We need an item to fetch */
if (!c_ptr->o_idx)
{
ty += ddy[dir];
tx += ddx[dir];
- c_ptr = &cave[ty][tx];
+ c_ptr = &grid_array[ty][tx];
if ((distance(p_ptr->y, p_ptr->x, ty, tx) > MAX_RANGE) ||
!cave_have_flag_bold(ty, tx, FF_PROJECT)) return;
i = c_ptr->o_idx;
c_ptr->o_idx = o_ptr->next_o_idx;
- cave[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
+ grid_array[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
o_ptr->next_o_idx = 0;
o_ptr->iy = p_ptr->y;
}
/* Create a glyph */
- cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
- cave[p_ptr->y][p_ptr->x].mimic = feat_glyph;
+ grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+ grid_array[p_ptr->y][p_ptr->x].mimic = feat_glyph;
note_spot(p_ptr->y, p_ptr->x);
lite_spot(p_ptr->y, p_ptr->x);
}
/* Create a mirror */
- cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
- cave[p_ptr->y][p_ptr->x].mimic = feat_mirror;
+ grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+ grid_array[p_ptr->y][p_ptr->x].mimic = feat_mirror;
/* Turn on the light */
- cave[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
+ grid_array[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
note_spot(p_ptr->y, p_ptr->x);
lite_spot(p_ptr->y, p_ptr->x);
}
/* Create a glyph */
- cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
- cave[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
+ grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+ grid_array[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
note_spot(p_ptr->y, p_ptr->x);
lite_spot(p_ptr->y, p_ptr->x);
*/
bool polymorph_monster(POSITION y, POSITION x)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
monster_type *m_ptr = &m_list[c_ptr->m_idx];
bool polymorphed = FALSE;
MONRACE_IDX new_r_idx;
{
y = p_ptr->y + ddy_ddd[dir];
x = p_ptr->x + ddx_ddd[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
m_ptr = &m_list[c_ptr->m_idx];
/* Hack -- attack monsters */
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
f_ptr = &f_info[c_ptr->feat];
mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
x = p_ptr->x + ddx[dir];
dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
fire_beam(GF_MISSILE, dir, dam);
- if (cave[y][x].m_idx)
+ if (grid_array[y][x].m_idx)
{
int i;
POSITION ty = y, tx = x;
POSITION oy = y, ox = x;
- MONSTER_IDX m_idx = cave[y][x].m_idx;
+ MONSTER_IDX m_idx = grid_array[y][x].m_idx;
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
GAME_TEXT m_name[MAX_NLEN];
if ((ty != oy) || (tx != ox))
{
msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
- cave[oy][ox].m_idx = 0;
- cave[ty][tx].m_idx = m_idx;
+ grid_array[oy][ox].m_idx = 0;
+ grid_array[ty][tx].m_idx = m_idx;
m_ptr->fy = ty;
m_ptr->fx = tx;
store_bottom = MIN_STOCK + xtra_stock;
/* Access the player grid */
- c_ptr = &cave[p_ptr->y][p_ptr->x];
+ c_ptr = &grid_array[p_ptr->y][p_ptr->x];
/* Verify a store */
if (!cave_have_flag_grid(c_ptr, FF_STORE))
*/
void disclose_grid(POSITION y, POSITION x)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
if (cave_have_flag_grid(c_ptr, FF_SECRET))
{
*/
void place_trap(POSITION y, POSITION x)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
/* Paranoia -- verify location */
if (!in_bounds(y, x)) return;
int i, num, dam;
POSITION x = p_ptr->x, y = p_ptr->y;
- /* Get the cave grid */
- grid_type *c_ptr = &cave[y][x];
+ /* Get the grid */
+ grid_type *c_ptr = &grid_array[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
int trap_feat_type = have_flag(f_ptr->flags, FF_TRAP) ? f_ptr->subtype : NOT_TRAP;
concptr name = _("トラップ", "a trap");
/*
* A single "grid" in a Cave
*
- * Note that several aspects of the code restrict the actual cave
+ * Note that several aspects of the code restrict the actual grid_array
* to a max size of 256 by 256. In partcular, locations are often
* saved as bytes, limiting each coordinate to the 0-255 range.
*
* The "o_idx" and "m_idx" fields are very interesting. There are
* many places in the code where we need quick access to the actual
- * monster or object(s) in a given cave grid. The easiest way to
+ * monster or object(s) in a given grid. The easiest way to
* do this is to simply keep the index of the monster and object
* (if any) with the grid, but this takes 198*66*4 bytes of memory.
* Several other methods come to mind, which require only half this
struct grid_type
{
- BIT_FLAGS info; /* Hack -- cave flags */
+ BIT_FLAGS info; /* Hack -- grid_array flags */
FEAT_IDX feat; /* Hack -- feature type */
OBJECT_IDX o_idx; /* Object in this grid */
MONSTER_IDX m_idx; /* Monster in this grid */
- /*! 地形の特別な情報を保存する / Special cave info
+ /*! 地形の特別な情報を保存する / Special grid_array info
* 具体的な使用一覧はクエスト行き階段の移行先クエストID、
* 各ダンジョン入口の移行先ダンジョンID、
*
* Note that "object flags" must now be derived from the object kind,
* the artifact and ego-item indexes, and the two "xtra" fields.
*
- * Each cave grid points to one (or zero) objects via the "o_idx"
+ * Each grid points to one (or zero) objects via the "o_idx"
* field (above). Each object then points to one (or zero) objects
* via the "next_o_idx" field, forming a singly linked list, which
* in game terms, represents a "stack" of objects in the same grid.
char savefile[1024];
char savefile_base[40];
-POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "cave.c")
+POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "grid_array.c")
POSITION lite_y[LITE_MAX];
POSITION lite_x[LITE_MAX];
-POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "cave.c")
+POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "grid_array.c")
POSITION mon_lite_y[MON_LITE_MAX];
POSITION mon_lite_x[MON_LITE_MAX];
-POSITION_IDX view_n; //!< Array of grids viewable to the player (see "cave.c")
+POSITION_IDX view_n; //!< Array of grids viewable to the player (see "grid_array.c")
POSITION view_y[VIEW_MAX];
POSITION view_x[VIEW_MAX];
-POSITION_IDX temp_n; //!< Array of grids for use by various functions (see "cave.c")
+POSITION_IDX temp_n; //!< Array of grids for use by various functions (see "grid_array.c")
POSITION temp_y[TEMP_MAX];
POSITION temp_x[TEMP_MAX];
-POSITION_IDX redraw_n = 0; //!< Array of grids for delayed visual updating (see "cave.c")
+POSITION_IDX redraw_n = 0; //!< Array of grids for delayed visual updating (see "grid_array.c")
POSITION redraw_y[REDRAW_MAX];
POSITION redraw_x[REDRAW_MAX];
/*
- * The array of "cave grids" [MAX_WID][MAX_HGT].
+ * The array of "grid_array grids" [MAX_WID][MAX_HGT].
* Not completely allocated, that would be inefficient
* Not completely hardcoded, that would overflow memory
*/
-grid_type *cave[MAX_HGT];
+grid_type *grid_array[MAX_HGT];
/*
int i;
for(i=0;i<temp_n;i++){
- grid_type* c_ptr = &cave[temp_y[i]][temp_x[i]];
+ grid_type* c_ptr = &grid_array[temp_y[i]][temp_x[i]];
if(!c_ptr->m_idx || !m_list[c_ptr->m_idx].ml)continue;//no mons or cannot look
m_ptr = &m_list[c_ptr->m_idx];
if(is_pet(m_ptr))continue;//pet
if (avg > depth_max) avg = depth_max;
/* Set the new value. */
- cave[ymid][xmid].feat = (FEAT_IDX)avg;
+ grid_array[ymid][xmid].feat = (FEAT_IDX)avg;
}
if (avg > depth_max) avg = depth_max;
/* Set the new value. */
- cave[ymid][xmid].feat = (FEAT_IDX)avg;
+ grid_array[ymid][xmid].feat = (FEAT_IDX)avg;
}
/* Are we done? */
if (x1 + 1 == x2) return;
- perturb_point_mid(cave[y1][x1].feat, cave[y2][x1].feat, cave[y1][x2].feat,
- cave[y2][x2].feat, xmid, ymid, rough, depth_max);
+ perturb_point_mid(grid_array[y1][x1].feat, grid_array[y2][x1].feat, grid_array[y1][x2].feat,
+ grid_array[y2][x2].feat, xmid, ymid, rough, depth_max);
- perturb_point_end(cave[y1][x1].feat, cave[y1][x2].feat, cave[ymid][xmid].feat,
+ perturb_point_end(grid_array[y1][x1].feat, grid_array[y1][x2].feat, grid_array[ymid][xmid].feat,
xmid, y1, rough, depth_max);
- perturb_point_end(cave[y1][x2].feat, cave[y2][x2].feat, cave[ymid][xmid].feat,
+ perturb_point_end(grid_array[y1][x2].feat, grid_array[y2][x2].feat, grid_array[ymid][xmid].feat,
x2, ymid, rough, depth_max);
- perturb_point_end(cave[y2][x2].feat, cave[y2][x1].feat, cave[ymid][xmid].feat,
+ perturb_point_end(grid_array[y2][x2].feat, grid_array[y2][x1].feat, grid_array[ymid][xmid].feat,
xmid, y2, rough, depth_max);
- perturb_point_end(cave[y2][x1].feat, cave[y1][x1].feat, cave[ymid][xmid].feat,
+ perturb_point_end(grid_array[y2][x1].feat, grid_array[y1][x1].feat, grid_array[ymid][xmid].feat,
x1, ymid, rough, depth_max);
{
for (x1 = 0; x1 < MAX_WID; x1++)
{
- cave[y1][x1].feat = feat_permanent;
+ grid_array[y1][x1].feat = feat_permanent;
}
}
{
for (x1 = 0; x1 < MAX_WID; x1++)
{
- cave[y1][x1].feat = table_size / 2;
+ grid_array[y1][x1].feat = table_size / 2;
}
}
}
* ToDo: calculate the medium height of the adjacent
* terrains for every corner.
*/
- cave[1][1].feat = (s16b)randint0(table_size);
- cave[MAX_HGT-2][1].feat = (s16b)randint0(table_size);
- cave[1][MAX_WID-2].feat = (s16b)randint0(table_size);
- cave[MAX_HGT-2][MAX_WID-2].feat = (s16b)randint0(table_size);
+ grid_array[1][1].feat = (s16b)randint0(table_size);
+ grid_array[MAX_HGT-2][1].feat = (s16b)randint0(table_size);
+ grid_array[1][MAX_WID-2].feat = (s16b)randint0(table_size);
+ grid_array[MAX_HGT-2][MAX_WID-2].feat = (s16b)randint0(table_size);
if (!corner)
{
/* Hack -- preserve four corners */
- s16b north_west = cave[1][1].feat;
- s16b south_west = cave[MAX_HGT - 2][1].feat;
- s16b north_east = cave[1][MAX_WID - 2].feat;
- s16b south_east = cave[MAX_HGT - 2][MAX_WID - 2].feat;
+ s16b north_west = grid_array[1][1].feat;
+ s16b south_west = grid_array[MAX_HGT - 2][1].feat;
+ s16b north_east = grid_array[1][MAX_WID - 2].feat;
+ s16b south_east = grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
/* x1, y1, x2, y2, num_depths, roughness */
plasma_recursive(1, 1, MAX_WID-2, MAX_HGT-2, table_size-1, roughness);
/* Hack -- copyback four corners */
- cave[1][1].feat = north_west;
- cave[MAX_HGT - 2][1].feat = south_west;
- cave[1][MAX_WID - 2].feat = north_east;
- cave[MAX_HGT - 2][MAX_WID - 2].feat = south_east;
+ grid_array[1][1].feat = north_west;
+ grid_array[MAX_HGT - 2][1].feat = south_west;
+ grid_array[1][MAX_WID - 2].feat = north_east;
+ grid_array[MAX_HGT - 2][MAX_WID - 2].feat = south_east;
for (y1 = 1; y1 < MAX_HGT - 1; y1++)
{
for (x1 = 1; x1 < MAX_WID - 1; x1++)
{
- cave[y1][x1].feat = terrain_table[terrain][cave[y1][x1].feat];
+ grid_array[y1][x1].feat = terrain_table[terrain][grid_array[y1][x1].feat];
}
}
}
else /* Hack -- only four corners */
{
- cave[1][1].feat = terrain_table[terrain][cave[1][1].feat];
- cave[MAX_HGT - 2][1].feat = terrain_table[terrain][cave[MAX_HGT - 2][1].feat];
- cave[1][MAX_WID - 2].feat = terrain_table[terrain][cave[1][MAX_WID - 2].feat];
- cave[MAX_HGT - 2][MAX_WID - 2].feat = terrain_table[terrain][cave[MAX_HGT - 2][MAX_WID - 2].feat];
+ grid_array[1][1].feat = terrain_table[terrain][grid_array[1][1].feat];
+ grid_array[MAX_HGT - 2][1].feat = terrain_table[terrain][grid_array[MAX_HGT - 2][1].feat];
+ grid_array[1][MAX_WID - 2].feat = terrain_table[terrain][grid_array[1][MAX_WID - 2].feat];
+ grid_array[MAX_HGT - 2][MAX_WID - 2].feat = terrain_table[terrain][grid_array[MAX_HGT - 2][MAX_WID - 2].feat];
}
/* Hack -- Restore the RNG state */
*/
if (wilderness[y][x].road)
{
- cave[MAX_HGT/2][MAX_WID/2].feat = feat_floor;
+ grid_array[MAX_HGT/2][MAX_WID/2].feat = feat_floor;
if (wilderness[y-1][x].road)
{
for (y1 = 1; y1 < MAX_HGT/2; y1++)
{
x1 = MAX_WID/2;
- cave[y1][x1].feat = feat_floor;
+ grid_array[y1][x1].feat = feat_floor;
}
}
for (y1 = MAX_HGT/2; y1 < MAX_HGT - 1; y1++)
{
x1 = MAX_WID/2;
- cave[y1][x1].feat = feat_floor;
+ grid_array[y1][x1].feat = feat_floor;
}
}
for (x1 = MAX_WID/2; x1 < MAX_WID - 1; x1++)
{
y1 = MAX_HGT/2;
- cave[y1][x1].feat = feat_floor;
+ grid_array[y1][x1].feat = feat_floor;
}
}
for (x1 = 1; x1 < MAX_WID/2; x1++)
{
y1 = MAX_HGT/2;
- cave[y1][x1].feat = feat_floor;
+ grid_array[y1][x1].feat = feat_floor;
}
}
}
dy = rand_range(6, cur_hgt - 6);
dx = rand_range(6, cur_wid - 6);
- cave[dy][dx].feat = feat_entrance;
- cave[dy][dx].special = wilderness[y][x].entrance;
+ grid_array[dy][dx].feat = feat_entrance;
+ grid_array[dy][dx].special = wilderness[y][x].entrance;
/* Hack -- Restore the RNG state */
Rand_state_restore(state_backup);
for (i = 1; i < MAX_WID - 1; i++)
{
- border.north[i] = cave[MAX_HGT - 2][i].feat;
+ border.north[i] = grid_array[MAX_HGT - 2][i].feat;
}
/* South border */
for (i = 1; i < MAX_WID - 1; i++)
{
- border.south[i] = cave[1][i].feat;
+ border.south[i] = grid_array[1][i].feat;
}
/* West border */
for (i = 1; i < MAX_HGT - 1; i++)
{
- border.west[i] = cave[i][MAX_WID - 2].feat;
+ border.west[i] = grid_array[i][MAX_WID - 2].feat;
}
/* East border */
for (i = 1; i < MAX_HGT - 1; i++)
{
- border.east[i] = cave[i][1].feat;
+ border.east[i] = grid_array[i][1].feat;
}
/* North west corner */
generate_area(y - 1, x - 1, FALSE, TRUE);
- border.north_west = cave[MAX_HGT - 2][MAX_WID - 2].feat;
+ border.north_west = grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
/* North east corner */
generate_area(y - 1, x + 1, FALSE, TRUE);
- border.north_east = cave[MAX_HGT - 2][1].feat;
+ border.north_east = grid_array[MAX_HGT - 2][1].feat;
/* South west corner */
generate_area(y + 1, x - 1, FALSE, TRUE);
- border.south_west = cave[1][MAX_WID - 2].feat;
+ border.south_west = grid_array[1][MAX_WID - 2].feat;
/* South east corner */
generate_area(y + 1, x + 1, FALSE, TRUE);
- border.south_east = cave[1][1].feat;
+ border.south_east = grid_array[1][1].feat;
/* Create terrain of the current area */
/* Special boundary walls -- North */
for (i = 0; i < MAX_WID; i++)
{
- cave[0][i].feat = feat_permanent;
- cave[0][i].mimic = border.north[i];
+ grid_array[0][i].feat = feat_permanent;
+ grid_array[0][i].mimic = border.north[i];
}
/* Special boundary walls -- South */
for (i = 0; i < MAX_WID; i++)
{
- cave[MAX_HGT - 1][i].feat = feat_permanent;
- cave[MAX_HGT - 1][i].mimic = border.south[i];
+ grid_array[MAX_HGT - 1][i].feat = feat_permanent;
+ grid_array[MAX_HGT - 1][i].mimic = border.south[i];
}
/* Special boundary walls -- West */
for (i = 0; i < MAX_HGT; i++)
{
- cave[i][0].feat = feat_permanent;
- cave[i][0].mimic = border.west[i];
+ grid_array[i][0].feat = feat_permanent;
+ grid_array[i][0].mimic = border.west[i];
}
/* Special boundary walls -- East */
for (i = 0; i < MAX_HGT; i++)
{
- cave[i][MAX_WID - 1].feat = feat_permanent;
- cave[i][MAX_WID - 1].mimic = border.east[i];
+ grid_array[i][MAX_WID - 1].feat = feat_permanent;
+ grid_array[i][MAX_WID - 1].mimic = border.east[i];
}
/* North west corner */
- cave[0][0].mimic = border.north_west;
+ grid_array[0][0].mimic = border.north_west;
/* North east corner */
- cave[0][MAX_WID - 1].mimic = border.north_east;
+ grid_array[0][MAX_WID - 1].mimic = border.north_east;
/* South west corner */
- cave[MAX_HGT - 1][0].mimic = border.south_west;
+ grid_array[MAX_HGT - 1][0].mimic = border.south_west;
/* South east corner */
- cave[MAX_HGT - 1][MAX_WID - 1].mimic = border.south_east;
+ grid_array[MAX_HGT - 1][MAX_WID - 1].mimic = border.south_east;
/* Light up or darken the area */
for (y = 0; y < cur_hgt; y++)
{
for (x = 0; x < cur_wid; x++)
{
- /* Get the cave grid */
- c_ptr = &cave[y][x];
+ /* Get the grid */
+ c_ptr = &grid_array[y][x];
if (is_daytime())
{
{
for (x = 0; x < cur_wid; x++)
{
- /* Get the cave grid */
- c_ptr = &cave[y][x];
+ /* Get the grid */
+ c_ptr = &grid_array[y][x];
/* Seeing true feature code (ignore mimic) */
f_ptr = &f_info[c_ptr->feat];
{
for (x = 0; x < cur_wid; x++)
{
- /* Get the cave grid */
- c_ptr = &cave[y][x];
+ /* Get the grid */
+ c_ptr = &grid_array[y][x];
if (cave_have_flag_grid(c_ptr, FF_ENTRANCE))
{
for (i = 0; i < MAX_WID; i++)
for (j = 0; j < MAX_HGT; j++)
{
- cave[j][i].feat = feat_permanent;
+ grid_array[j][i].feat = feat_permanent;
}
/* Init the wilderness */
{
if (wilderness[j][i].town && (wilderness[j][i].town != NO_TOWN))
{
- cave[j][i].feat = (s16b)feat_town;
- cave[j][i].special = (s16b)wilderness[j][i].town;
+ grid_array[j][i].feat = (s16b)feat_town;
+ grid_array[j][i].special = (s16b)wilderness[j][i].town;
}
- else if (wilderness[j][i].road) cave[j][i].feat = feat_floor;
+ else if (wilderness[j][i].road) grid_array[j][i].feat = feat_floor;
else if (wilderness[j][i].entrance && (p_ptr->total_winner || !(d_info[wilderness[j][i].entrance].flags1 & DF1_WINNER)))
{
- cave[j][i].feat = feat_entrance;
- cave[j][i].special = (byte)wilderness[j][i].entrance;
+ grid_array[j][i].feat = feat_entrance;
+ grid_array[j][i].special = (byte)wilderness[j][i].entrance;
}
- else cave[j][i].feat = conv_terrain2feat[wilderness[j][i].terrain];
+ else grid_array[j][i].feat = conv_terrain2feat[wilderness[j][i].terrain];
- cave[j][i].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[j][i].info |= (CAVE_GLOW | CAVE_MARK);
}
cur_hgt = (s16b) max_wild_y;
if (!tgt_pt(&x, &y)) return;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Default */
sprintf(tmp_val, "%d", prev_feat);
{
for (x = 0; x < cur_wid; x++)
{
- cave[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+ grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
}
wiz_lite(FALSE);
{
POSITION *x = (POSITION*)(u);
POSITION *y = (POSITION*)(v);
- grid_type *ca_ptr = &cave[y[a]][x[a]];
- grid_type *cb_ptr = &cave[y[b]][x[b]];
+ grid_type *ca_ptr = &grid_array[y[a]][x[a]];
+ grid_type *cb_ptr = &grid_array[y[b]][x[b]];
monster_type *ma_ptr = &m_list[ca_ptr->m_idx];
monster_type *mb_ptr = &m_list[cb_ptr->m_idx];
monster_race *ap_ra_ptr, *ap_rb_ptr;
}
/* An object get higher priority */
- if (cave[y[a]][x[a]].o_idx && !cave[y[b]][x[b]].o_idx) return TRUE;
- if (!cave[y[a]][x[a]].o_idx && cave[y[b]][x[b]].o_idx) return FALSE;
+ if (grid_array[y[a]][x[a]].o_idx && !grid_array[y[b]][x[b]].o_idx) return TRUE;
+ if (!grid_array[y[a]][x[a]].o_idx && grid_array[y[b]][x[b]].o_idx) return FALSE;
/* Priority from the terrain */
if (f_info[ca_ptr->feat].priority > f_info[cb_ptr->feat].priority) return TRUE;
if (p_ptr->image) return (FALSE);
/* Examine the grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Visible monsters */
if (c_ptr->m_idx)
/* Require "interesting" contents */
if (!target_set_accept(y, x)) continue;
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Require target_able monsters for "TARGET_KILL" */
if ((mode & (TARGET_KILL)) && !target_able(c_ptr->m_idx)) continue;
*/
static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info)
{
- grid_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
concptr s1 = "", s2 = "", s3 = "", x_info = "";
bool boring = TRUE;
if (!(mode & TARGET_LOOK)) prt_path(y, x);
/* Access */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Allow target */
if (target_able(c_ptr->m_idx))
if (!(mode & TARGET_LOOK)) prt_path(y, x);
/* Access */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Default prompt */
strcpy(info, _("q止 t決 p自 m近 +次 -前", "q,t,p,m,+,-,<dir>"));
if (p_ptr->image) return (FALSE);
/* Examine the grid */
- c_ptr = &cave[y][x];
+ c_ptr = &grid_array[y][x];
/* Interesting memorized features */
if (c_ptr->info & (CAVE_MARK))
/* Skip stairs which have defferent distance */
for (; n < temp_n; ++ n)
{
- grid_type *c_ptr = &cave[temp_y[n]][temp_x[n]];
+ grid_type *c_ptr = &grid_array[temp_y[n]][temp_x[n]];
if (cave_have_flag_grid(c_ptr, FF_STAIRS) &&
cave_have_flag_grid(c_ptr, ch == '>' ? FF_MORE : FF_LESS))