* 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);