/*
* Automatically pickup/destroy items in this grid.
*/
-void autopick_pickup_items(cave_type *c_ptr)
+void autopick_pickup_items(grid_type *c_ptr)
{
OBJECT_IDX this_o_idx, next_o_idx = 0;
* @param c_ptr マス構造体の参照ポインタ
* @return 看破済みの罠があるならTRUEを返す。
*/
-bool is_known_trap(cave_type *c_ptr)
+bool is_known_trap(grid_type *c_ptr)
{
if (!c_ptr->mimic && !cave_have_flag_grid(c_ptr, FF_SECRET) &&
is_trap(c_ptr->feat)) return TRUE;
* @param c_ptr マス構造体の参照ポインタ
* @return 隠されたドアがあるならTRUEを返す。
*/
-bool is_hidden_door(cave_type *c_ptr)
+bool is_hidden_door(grid_type *c_ptr)
{
if ((c_ptr->mimic || cave_have_flag_grid(c_ptr, FF_SECRET)) &&
is_closed_door(c_ptr->feat))
*/
bool player_can_see_bold(POSITION y, POSITION x)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Blind players see nothing */
if (p_ptr->blind) return FALSE;
*/
bool cave_valid_bold(POSITION y, POSITION x)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Forbid perma-grids */
void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp)
{
/* Get the cave */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
*/
void note_spot(POSITION y, POSITION x)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[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]);
- cave_type *c_ptr = &cave[ny][nx];
+ grid_type *c_ptr = &cave[ny][nx];
if (panel_contains(ny, nx))
{
{
int i, x, y, min_x, max_x, min_y, max_y;
int p = p_ptr->cur_lite;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/*** Special case ***/
*/
static void mon_lite_hack(POSITION y, POSITION x)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
int dpf, d;
POSITION midpoint;
*/
static void mon_dark_hack(POSITION y, POSITION x)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
int midpoint, dpf, d;
/* We trust this grid is in bounds */
void update_mon_lite(void)
{
int i, rad;
- cave_type *c_ptr;
+ grid_type *c_ptr;
POSITION fx, fy;
void (*add_mon_lite)(POSITION, POSITION);
void clear_mon_lite(void)
{
int i;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Clear all monster lit squares */
for (i = 0; i < mon_lite_n; i++)
{
int i;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* None to forget */
if (!view_n) return;
{
bool f1, f2, v1, v2, z1, z2, wall;
- cave_type *c_ptr;
+ grid_type *c_ptr;
- cave_type *g1_c_ptr;
- cave_type *g2_c_ptr;
+ grid_type *g1_c_ptr;
+ grid_type *g2_c_ptr;
/* Access the grids */
g1_c_ptr = &cave[y1][x1];
POSITION y_max = cur_hgt - 1;
POSITION x_max = cur_wid - 1;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/*** Initialize ***/
void delayed_visual_update(void)
{
int i, y, x;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Update needed grids */
for (i = 0; i < redraw_n; i++)
int old_head = flow_head;
byte_hack m = cave[ty][tx].cost + 1;
byte_hack n = cave[ty][tx].dist + 1;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Child location */
y = ty + ddy_ddd[d];
{
for (j = 0; j < 5; j++)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Translate table to map grids */
y = i + p_ptr->y - 2;
{
int i;
POSITION x, y;
- cave_type *c_ptr;
+ grid_type *c_ptr;
FEAT_IDX feat;
feature_type *f_ptr;
/* Scan all normal grids */
for (x = 1; x < cur_wid - 1; x++)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Memorize terrain of the grid */
c_ptr->info |= (CAVE_KNOWN);
{
for (x = 1; x < cur_wid - 1; x++)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Process the grid */
c_ptr->info &= ~(CAVE_MARK | CAVE_IN_DETECT | CAVE_KNOWN);
*/
void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[feat];
bool old_los, old_mirror;
{
DIRECTION i;
POSITION yy, xx;
- cave_type *cc_ptr;
+ grid_type *cc_ptr;
for (i = 0; i < 9; i++)
{
/* Remove a mirror */
void remove_mirror(POSITION y, POSITION x)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Remove the mirror */
c_ptr->info &= ~(CAVE_OBJECT);
/*
* Return TRUE if there is a mirror on the grid.
*/
-bool is_mirror_grid(cave_type *c_ptr)
+bool is_mirror_grid(grid_type *c_ptr)
{
if ((c_ptr->info & CAVE_OBJECT) && have_flag(f_info[c_ptr->mimic].flags, FF_MIRROR))
return TRUE;
/*
* Return TRUE if there is a mirror on the grid.
*/
-bool is_glyph_grid(cave_type *c_ptr)
+bool is_glyph_grid(grid_type *c_ptr)
{
if ((c_ptr->info & CAVE_OBJECT) && have_flag(f_info[c_ptr->mimic].flags, FF_GLYPH))
return TRUE;
/*
* Return TRUE if there is a mirror on the grid.
*/
-bool is_explosive_rune_grid(cave_type *c_ptr)
+bool is_explosive_rune_grid(grid_type *c_ptr)
{
if ((c_ptr->info & CAVE_OBJECT) && have_flag(f_info[c_ptr->mimic].flags, FF_MINOR_GLYPH))
return TRUE;
{
POSITION y, x, yy, xx;
DIRECTION i;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Not in the darkness dungeon */
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) return;
bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode)
{
monster_type *m_ptr = &m_list[m_idx];
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[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)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
/* Require "teleportable" space */
* @param now_riding TRUEなら下馬処理、FALSEならば騎乗処理
* @return 可能ならばTRUEを返す
*/
-bool player_can_ride_aux(cave_type *c_ptr, bool now_riding)
+bool player_can_ride_aux(grid_type *c_ptr, bool now_riding)
{
bool p_can_enter;
bool old_character_xtra = character_xtra;
{
POSITION x, y;
DIRECTION dir = 0;
- cave_type *c_ptr;
+ grid_type *c_ptr;
monster_type *m_ptr;
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
else
{
- cave_type *c_ptr = &cave[target_row][target_col];
+ grid_type *c_ptr = &cave[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;
/* Check around the player */
for (i = 0; i < 8; i++)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Access the location */
y = p_ptr->y + ddy_ddd[i];
extern int calculate_upkeep(void);
extern void do_cmd_pet_dismiss(void);
extern void do_cmd_pet(void);
-extern bool player_can_ride_aux(cave_type *c_ptr, bool now_riding);
+extern bool player_can_ride_aux(grid_type *c_ptr, bool now_riding);
extern bool rakuba(HIT_POINT dam, bool force);
bool go_up = FALSE;
/* Player grid */
- cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+ grid_type *c_ptr = &cave[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 */
- cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+ grid_type *c_ptr = &cave[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)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Scan all objects in the grid */
/* Check around (and under) the character */
for (d = 0; d < 9; d++)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
FEAT_IDX feat;
/* if not searching under player continue */
int i, j;
/* Get requested grid */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
bool more = FALSE;
if (get_rep_dir(&dir, TRUE))
{
FEAT_IDX feat;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Get requested location */
y = p_ptr->y + ddy[dir];
*/
static bool do_cmd_close_aux(POSITION y, POSITION x)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
FEAT_IDX old_feat = c_ptr->feat;
bool more = FALSE;
/* Get a "repeated" direction */
if (get_rep_dir(&dir, FALSE))
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
FEAT_IDX feat;
y = p_ptr->y + ddy[dir];
*/
static bool do_cmd_tunnel_test(POSITION y, POSITION x)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Must have knowledge */
if (!(c_ptr->info & CAVE_MARK))
*/
static bool do_cmd_tunnel_aux(POSITION y, POSITION x)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
feature_type *f_ptr, *mimic_f_ptr;
int power;
concptr name;
{
int y, x, dir;
- cave_type *c_ptr;
+ grid_type *c_ptr;
FEAT_IDX feat;
bool more = FALSE;
{
int i, j;
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[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)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Get feature */
feature_type *f_ptr = &f_info[c_ptr->feat];
/* Get a direction (or abort) */
if (get_rep_dir(&dir,TRUE))
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
FEAT_IDX feat;
y = p_ptr->y + ddy[dir];
static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir)
{
/* Get grid */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Get feature */
feature_type *f_ptr = &f_info[c_ptr->feat];
void do_cmd_bash(void)
{
int y, x, dir;
- cave_type *c_ptr;
+ grid_type *c_ptr;
bool more = FALSE;
if (p_ptr->wild_mode) return;
{
POSITION y, x;
DIRECTION dir;
- cave_type *c_ptr;
+ grid_type *c_ptr;
bool more = FALSE;
if (p_ptr->special_defense & KATA_MUSOU)
{
POSITION y, x;
INVENTORY_IDX item;
- cave_type *c_ptr;
+ grid_type *c_ptr;
FEAT_IDX feat;
y = p_ptr->y + ddy[dir];
/* Monster here, Try to hit it */
if (cave[y][x].m_idx)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
monster_type *m_ptr = &m_list[c_ptr->m_idx];
/* Check the visibility */
*/
static void travel_flow_aux(POSITION y, POSITION x, int n, bool wall)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
int old_head = flow_head;
int add_cost = 1;
{
for (x = 0; x < cur_wid; x++)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
for (i2 = 0; i2 < cur_wid; ++i2)
for (j2 = 0; j2 < cur_hgt; j2++)
{
- cave_type *c_ptr = &cave[j2][i2];
+ grid_type *c_ptr = &cave[j2][i2];
if ((c_ptr->m_idx > 0) && (c_ptr->m_idx != p_ptr->riding))
{
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 cave_type *cave[MAX_HGT];
+extern grid_type *cave[MAX_HGT];
extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
extern FLOOR_IDX max_floor_id;
extern u32b saved_floor_file_sign;
extern int is_autopick(object_type *o_ptr);
extern void autopick_alter_item(INVENTORY_IDX item, bool destroy);
extern void autopick_delayed_alter(void);
-extern void autopick_pickup_items(cave_type *c_ptr);
+extern void autopick_pickup_items(grid_type *c_ptr);
extern bool autopick_autoregister(object_type *o_ptr);
extern void do_cmd_edit_autopick(void);
/* cave.c */
extern POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
extern bool is_trap(IDX feat);
-extern bool is_known_trap(cave_type *c_ptr);
+extern bool is_known_trap(grid_type *c_ptr);
extern bool is_closed_door(IDX feat);
-extern bool is_hidden_door(cave_type *c_ptr);
+extern bool is_hidden_door(grid_type *c_ptr);
extern bool los(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
extern void update_local_illumination(POSITION y, POSITION x);
extern bool player_can_see_bold(POSITION y, POSITION x);
extern FEAT_IDX feat_state(IDX feat, int action);
extern void cave_alter_feat(POSITION y, POSITION x, int action);
extern void remove_mirror(POSITION y, POSITION x);
-extern bool is_mirror_grid(cave_type *c_ptr);
-extern bool is_glyph_grid(cave_type *c_ptr);
-extern bool is_explosive_rune_grid(cave_type *c_ptr);
+extern bool is_mirror_grid(grid_type *c_ptr);
+extern bool is_glyph_grid(grid_type *c_ptr);
+extern bool is_explosive_rune_grid(grid_type *c_ptr);
extern void mmove2(POSITION *y, POSITION *x, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
extern bool projectable(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
extern void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
for (x = 0; x < cur_wid; x++)
{
/* Get the cave grid */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Assume lit */
c_ptr->info |= (CAVE_GLOW);
for (x = 0; x < cur_wid; x++)
{
/* Get the cave grid */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Feature code (applying "mimic" field) */
feature_type *f_ptr = &f_info[get_feat_mimic(c_ptr)];
*/
static bool alloc_stairs_aux(POSITION y, POSITION x, int walls)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Require "naked" floor grid */
if (!is_floor_grid(c_ptr)) return FALSE;
while (TRUE)
{
POSITION y, x = 0;
- cave_type *c_ptr;
+ grid_type *c_ptr;
int candidates = 0;
int pick;
POSITION y = 0, x = 0;
int k;
int dummy = 0;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* A small level has few objects. */
num = num * cur_hgt * cur_wid / (MAX_HGT*MAX_WID) +1;
/* Find an empty grid */
for (l = SAFE_MAX_ATTEMPTS; l > 0; l--)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
feature_type *f_ptr;
y = randint0(cur_hgt);
* @param c_ptr 永久壁を廃止したいマス構造体の参照ポインタ
* @return なし
*/
-static void set_bound_perm_wall(cave_type *c_ptr)
+static void set_bound_perm_wall(grid_type *c_ptr)
{
if (bound_walls_perm)
{
/* Turn the tunnel into corridor */
for (j = 0; j < dun->tunn_n; j++)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
feature_type *f_ptr;
y = dun->tunn[j].y;
x = dun->tunn[j].x;
/* Apply the piercings that we found */
for (j = 0; j < dun->wall_n; j++)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
y = dun->wall[j].y;
x = dun->wall[j].x;
c_ptr = &cave[y][x];
{
for (x = 0; x < MAX_WID; x++)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
c_ptr->info = 0;
c_ptr->feat = 0;
c_ptr->o_idx = 0;
bool door_flag = FALSE;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Save the starting location */
start_row = row1;
{
int i, j, dx, dy;
- cave_type *c_ptr = &cave[*y][*x];
+ grid_type *c_ptr = &cave[*y][*x];
if (!in_bounds(*y, *x)) return TRUE;
int length;
int i;
bool retval, firstsuccede;
- cave_type *c_ptr;
+ grid_type *c_ptr;
length = distance(x1, y1, x2, y2);
{
for (x = 0; x < cur_wid; x++)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
bool ok = FALSE;
*/
void leave_floor(void)
{
- cave_type *c_ptr = NULL;
+ grid_type *c_ptr = NULL;
feature_type *f_ptr;
saved_floor_type *sf_ptr;
MONRACE_IDX quest_r_idx = 0;
/* Forbid return stairs */
if (change_floor_mode & CFM_NO_RETURN)
{
- cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+ grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
if (!feat_uses_special(c_ptr->feat))
{
if (!(change_floor_mode & CFM_NO_RETURN))
{
/* Extract stair position */
- cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+ grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
/*** Create connected stairs ***/
{
for (x = 0; x < cur_wid; x++)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
if (!c_ptr->special) continue;
if (feat_uses_special(c_ptr->feat)) continue;
POSITION changex, changey;
POSITION ty, tx;
bool done;
- cave_type *c_ptr;
+ grid_type *c_ptr;
length = distance(x1, y1, x2, y2);
int y, x, dir;
int dummy = 0;
- cave_type *c_ptr;
+ grid_type *c_ptr;
feature_type *f_ptr;
feature_type *streamer_ptr = &f_info[feat];
void place_trees(POSITION x, POSITION y)
{
int i, j;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* place trees/ rubble in ovalish distribution */
for (i = x - 3; i < x + 4; i++)
POSITION y = 0, x = 0;
int max_attempts = 10000;
- cave_type *c_ptr;
+ grid_type *c_ptr;
feature_type *f_ptr;
/* Place the player */
{
bool up_stairs = TRUE;
bool down_stairs = TRUE;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Paranoia */
c_ptr = &cave[y][x];
{
int tmp, type;
FEAT_IDX feat = feat_none;
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Initialize mimic info */
c_ptr->mimic = 0;
}
else
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
if (type == DOOR_DEFAULT)
{
int i, k = 0;
POSITION y, x;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Scan adjacent grids */
for (i = 0; i < 4; i++)
int dummy = 0;
int i = 0, j = y, k = x;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Attempt to place 'num' objects */
int count = 0, y1 = y, x1 = x;
int dummy = 0;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Place traps */
for (count = 0; count <= 5; count++)
{
int k, i;
POSITION y, x;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Try to summon "num" monsters "near" the given location */
for (k = 0; k < num; k++)
*/
static void drop_here(object_type *j_ptr, POSITION y, POSITION x)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
object_type *o_ptr;
OBJECT_IDX o_idx = o_pop();
for (*x = xmin, i = 0; ((*x < xmax) && (i < len)); (*x)++, s++, i++)
{
- cave_type *c_ptr = &cave[*y][*x];
+ grid_type *c_ptr = &cave[*y][*x];
int idx = s[0];
for (i = 0; i < MAX_HGT; i++)
{
/* Allocate one row of the cave */
- C_MAKE(cave[i], MAX_WID, cave_type);
+ C_MAKE(cave[i], MAX_WID, grid_type);
}
byte tmp8u;
s16b tmp16s;
u16b limit;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/*** Basic info ***/
* この関数は、セーブデータの互換性を保つために多くのデータ改変処理を備えている。
* 現在確認している処理は以下の通り、
* <ul>
- * <li>1.7.0.2で8bitだったcave_typeのfeat,mimicのID値を16bitに拡張する処理。</li>
+ * <li>1.7.0.2で8bitだったgrid_typeのfeat,mimicのID値を16bitに拡張する処理。</li>
* <li>1.7.0.8までに廃止、IDなどを差し替えたクエスト番号を置換する処理。</li>
* </ul>
* The monsters/objects must be loaded in the same order
- /*** Read template for cave_type ***/
+ /*** Read template for grid_type ***/
/* Read the template count */
rd_u16b(&limit);
for (i = count; i > 0; i--)
{
/* Access the cave */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Extract cave data */
c_ptr->info = templates[id].info;
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
/* Access the cave */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
if ((c_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level)
{
else
{
/* Access the item location */
- cave_type *c_ptr = &cave[o_ptr->iy][o_ptr->ix];
+ grid_type *c_ptr = &cave[o_ptr->iy][o_ptr->ix];
/* Build a stack */
o_ptr->next_o_idx = c_ptr->o_idx;
/* Read the monsters */
for (i = 1; i < limit; i++)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
MONSTER_IDX m_idx;
monster_type *m_ptr;
int num = 0, bonus, chance, vir;
HIT_POINT k;
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
monster_type *m_ptr = &m_list[c_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
bool mdeath = FALSE;
bool stormbringer = FALSE;
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[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];
{
POSITION ny = GRID_Y(path_g[i]);
POSITION nx = GRID_X(path_g[i]);
- cave_type *c_ptr = &cave[ny][nx];
+ grid_type *c_ptr = &cave[ny][nx];
if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
!(c_ptr->info & CAVE_OBJECT) &&
int i, best = 999;
POSITION y, x, y1, x1;
- cave_type *c_ptr;
+ grid_type *c_ptr;
bool can_open_door = FALSE;
int now_cost;
int i, best;
POSITION y, x, y1, x1;
- cave_type *c_ptr;
+ grid_type *c_ptr;
bool use_scent = FALSE;
monster_type *m_ptr = &m_list[m_idx];
POSITION *y_offsets;
POSITION *x_offsets;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Start with adjacent locations, spread further */
for (d = 1; d < 10; d++)
POSITION x2 = p_ptr->x;
bool done = FALSE;
bool will_run = mon_will_run(m_idx);
- cave_type *c_ptr;
+ grid_type *c_ptr;
bool no_flow = ((m_ptr->mflag2 & MFLAG2_NOFLOW) && (cave[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));
DIRECTION mm[8];
- cave_type *c_ptr;
+ grid_type *c_ptr;
feature_type *f_ptr;
monster_type *y_ptr;
*/
bool monster_can_enter(POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Player or other monster */
if (player_bold(y, x)) return FALSE;
*/
void delete_monster(POSITION y, POSITION x)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Paranoia */
if (!in_bounds(y, x)) return;
{
POSITION y, x;
int i;
- cave_type *c_ptr;
+ grid_type *c_ptr;
monster_type *m_ptr;
OBJECT_IDX this_o_idx, next_o_idx = 0;
static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
{
/* Access the location */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
monster_type *m_ptr;
monster_race *r_ptr = &r_info[r_idx];
concptr name = (r_name + r_ptr->name);
POSITION y = m_ptr->fy;
POSITION x = m_ptr->fx;
OBJECT_IDX this_o_idx, next_o_idx = 0;
- cave_type *c_ptr;
+ grid_type *c_ptr;
for (xx = x - 5; xx <= x + 5; xx++)
{
{
int next_x = *xp + tonari_x[tonari][i];
int next_y = *yp + tonari_y[tonari][i];
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Access the next grid */
c_ptr = &cave[next_y][next_x];
case MUT1_BANISH:
{
POSITION x, y;
- cave_type *c_ptr;
+ grid_type *c_ptr;
monster_type *m_ptr;
monster_race *r_ptr;
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
case MUT1_COLD_TOUCH:
{
POSITION x, y;
- cave_type *c_ptr;
+ grid_type *c_ptr;
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
{
int i;
OBJECT_IDX o_idx;
- cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+ grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
if (command_wrk != (USE_FLOOR)) break;
/* Dungeon */
else
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
POSITION y = j_ptr->iy;
POSITION x = j_ptr->ix;
*/
void delete_object(POSITION y, POSITION x)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Refuse "illegal" locations */
static void compact_objects_aux(OBJECT_IDX i1, OBJECT_IDX i2)
{
OBJECT_IDX i;
- cave_type *c_ptr;
+ grid_type *c_ptr;
object_type *o_ptr;
/* Do nothing */
/* Dungeon */
else
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Access location */
POSITION y = o_ptr->iy;
OBJECT_IDX o_idx;
/* Acquire grid */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
object_type forge;
object_type *q_ptr;
OBJECT_IDX o_idx;
/* Acquire grid */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
object_type forge;
object_type *q_ptr;
OBJECT_IDX o_idx = 0;
OBJECT_IDX this_o_idx, next_o_idx = 0;
- cave_type *c_ptr;
+ grid_type *c_ptr;
GAME_TEXT o_name[MAX_NLEN];
bool process_warning(POSITION xx, POSITION yy)
{
POSITION mx, my;
- cave_type *c_ptr;
+ grid_type *c_ptr;
GAME_TEXT o_name[MAX_NLEN];
#define WARNING_AWARE_RANGE 12
static void discover_hidden_things(POSITION y, POSITION x)
{
OBJECT_IDX this_o_idx, next_o_idx = 0;
- cave_type *c_ptr;
+ grid_type *c_ptr;
c_ptr = &cave[y][x];
/* Invisible trap */
*/
void carry(bool pickup)
{
- cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+ grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
{
POSITION oy = p_ptr->y;
POSITION ox = p_ptr->x;
- cave_type *c_ptr = &cave[ny][nx];
- cave_type *oc_ptr = &cave[oy][ox];
+ grid_type *c_ptr = &cave[ny][nx];
+ grid_type *oc_ptr = &cave[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 */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
*/
static bool see_wall(DIRECTION dir, POSITION y, POSITION x)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Get the new location */
y += ddy[dir];
int row, col;
int i, max, inv;
int option = 0, option2 = 0;
- cave_type *c_ptr;
+ grid_type *c_ptr;
FEAT_IDX feat;
feature_type *f_ptr;
{
DIRECTION new_dir = 0;
int i, max;
- const cave_type *c_ptr;
+ const grid_type *c_ptr;
int cost;
/* Cannot travel when blind */
{
POSITION y = 0, x = 0;
- cave_type *c_ptr;
+ grid_type *c_ptr;
monster_type *m_ptr;
if (p_ptr->cut < 300)
POSITION y, x;
POSITION ny, nx;
MONSTER_IDX m_idx;
- cave_type *c_ptr;
+ grid_type *c_ptr;
monster_type *m_ptr;
y = p_ptr->y + ddy[dir];
bool light;
- cave_type *c_ptr;
+ grid_type *c_ptr;
bool curtain = (d_info[p_ptr->dungeon_idx].flags1 & DF1_CURTAIN) &&
one_in_((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 48 : 512);
POSITION y1a, x1a, y2a, x2a;
POSITION y1b, x1b, y2b, x2b;
bool light;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Find and reserve some space in the dungeon. Get center of room. */
if (!find_space(&yval, &xval, 11, 25)) return FALSE;
POSITION y1b, x1b, y2b, x2b;
POSITION yval, xval;
bool light;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Find and reserve some space in the dungeon. Get center of room. */
POSITION y, x, y1, x1;
POSITION y2, x2, tmp, yval, xval;
bool light;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Find and reserve some space in the dungeon. Get center of room. */
monster_type align;
- cave_type *c_ptr;
+ grid_type *c_ptr;
int cur_nest_type = pick_vault_type(nest_types, d_info[p_ptr->dungeon_idx].nest);
vault_aux_type *n_ptr;
monster_type align;
- cave_type *c_ptr;
+ grid_type *c_ptr;
int cur_pit_type = pick_vault_type(pit_types, d_info[p_ptr->dungeon_idx].pit);
vault_aux_type *n_ptr;
monster_type align;
- cave_type *c_ptr;
+ grid_type *c_ptr;
int cur_pit_type = pick_vault_type(pit_types, d_info[p_ptr->dungeon_idx].pit);
vault_aux_type *n_ptr;
POSITION y1, x1, xsize, ysize;
bool light;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Pick a room size */
xsize = rand_range(9, 13);
bool light;
- cave_type *c_ptr;
+ grid_type *c_ptr;
s16b trap;
/* Pick a room size */
{
POSITION dx, dy, x, y, i, j;
concptr t;
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Place dungeon features and objects */
for (t = data, dy = 0; dy < ymax; dy++)
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
c_ptr->info |= (CAVE_ROOM | CAVE_ICKY);
POSITION y1, x1, y2, x2;
int m, n, num_vertices, *visited;
bool light;
- cave_type *c_ptr;
+ grid_type *c_ptr;
msg_print_wizard(CHEAT_DUNGEON, _("迷路ランダムVaultを生成しました。", "Maze Vault."));
*/
void add_outer_wall(POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
feature_type *f_ptr;
int i, j;
{
POSITION y, x;
- cave_type *c_ptr;
+ grid_type *c_ptr;
for (y = y1; y <= y2; y++)
{
- /*********** Make template for cave_type **********/
+ /*********** Make template for grid_type **********/
/*
* Usually number of templates are fewer than 255. Even if
{
for (x = 0; x < cur_wid; x++)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
for (i = 0; i < num_temp; i++)
{
{
for (x = 0; x < cur_wid; x++)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
for (i = 0; i < num_temp; i++)
{
/* Travel until stopped */
for (cur_dis = 0; cur_dis <= tdis; )
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Hack -- Stop at the target */
if ((y == ty) && (x == tx)) break;
/* Monster here, Try to hit it */
if (cave[y][x].m_idx)
{
- cave_type *c_mon_ptr = &cave[y][x];
+ grid_type *c_mon_ptr = &cave[y][x];
monster_type *m_ptr = &m_list[c_mon_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
{
POSITION x, y;
DIRECTION dir;
- cave_type *c_ptr;
+ grid_type *c_ptr;
if (!get_rep_dir(&dir, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
*/
static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
bool obvious = FALSE;
if (in_bounds2(by, bx))
{
- cave_type *cc_ptr = &cave[by][bx];
+ grid_type *cc_ptr = &cave[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)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
{
int tmp;
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
monster_type *m_ptr = &m_list[c_ptr->m_idx];
monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
{
POSITION x, y;
bool detect = FALSE;
- cave_type *c_ptr;
+ grid_type *c_ptr;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
{
POSITION y, x;
int k, t;
- cave_type *c_ptr;
+ grid_type *c_ptr;
bool flag = FALSE;
/* Prevent destruction of quest levels and town */
{
DIRECTION i;
POSITION yy, xx;
- cave_type *cc_ptr;
+ grid_type *cc_ptr;
for (i = 0; i < 9; i++)
{
int sn = 0;
POSITION sy = 0, sx = 0;
bool hurt = FALSE;
- cave_type *c_ptr;
+ grid_type *c_ptr;
bool map[32][32];
/* Prevent destruction of quest levels and town */
{
DIRECTION ii;
POSITION yyy, xxx;
- cave_type *cc_ptr;
+ grid_type *cc_ptr;
for (ii = 0; ii < 9; ii++)
{
POSITION y = temp_y[i];
POSITION x = temp_x[i];
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* No longer in the array */
c_ptr->info &= ~(CAVE_TEMP);
POSITION x = temp_x[i];
int j;
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
bool do_dark = !is_mirror_grid(c_ptr);
/* No longer in the array */
if (in_bounds2(by, bx))
{
- cave_type *cc_ptr = &cave[by][bx];
+ grid_type *cc_ptr = &cave[by][bx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
*/
static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION))
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Get the grid */
c_ptr = &cave[y][x];
bool teleport_swap(DIRECTION dir)
{
POSITION tx, ty;
- cave_type* c_ptr;
+ grid_type* c_ptr;
monster_type* m_ptr;
monster_race* r_ptr;
DIRECTION dir;
POSITION x, y;
int dummy;
- cave_type *c_ptr;
+ grid_type *c_ptr;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
{
}
else
{
- cave_type *c_ptr = &cave[creature_ptr->y][creature_ptr->x];
+ grid_type *c_ptr = &cave[creature_ptr->y][creature_ptr->x];
feature_type *f_ptr = &f_info[c_ptr->feat];
if (!have_flag(f_ptr->flags, FF_PROJECT) ||
DIRECTION dir;
POSITION y = 0, x = 0;
int i;
- cave_type *c_ptr;
+ grid_type *c_ptr;
for (i = 0; i < 6; i++)
{
static bool vanish_dungeon(void)
{
POSITION y, x;
- cave_type *c_ptr;
+ grid_type *c_ptr;
feature_type *f_ptr;
monster_type *m_ptr;
GAME_TEXT m_name[MAX_NLEN];
void call_the_(void)
{
int i;
- cave_type *c_ptr;
+ grid_type *c_ptr;
bool do_call = TRUE;
for (i = 0; i < 9; i++)
{
POSITION ty, tx;
OBJECT_IDX i;
- cave_type *c_ptr;
+ grid_type *c_ptr;
object_type *o_ptr;
GAME_TEXT o_name[MAX_NLEN];
*/
bool polymorph_monster(POSITION y, POSITION x)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
monster_type *m_ptr = &m_list[c_ptr->m_idx];
bool polymorphed = FALSE;
MONRACE_IDX new_r_idx;
void massacre(void)
{
POSITION x, y;
- cave_type *c_ptr;
+ grid_type *c_ptr;
monster_type *m_ptr;
DIRECTION dir;
bool eat_lock(void)
{
POSITION x, y;
- cave_type *c_ptr;
+ grid_type *c_ptr;
feature_type *f_ptr, *mimic_f_ptr;
DIRECTION dir;
int which;
int maintain_num;
int i;
- cave_type *c_ptr;
+ grid_type *c_ptr;
bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
TERM_LEN w, h;
*/
void disclose_grid(POSITION y, POSITION x)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
if (cave_have_flag_grid(c_ptr, FF_SECRET))
{
*/
void place_trap(POSITION y, POSITION x)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
/* Paranoia -- verify location */
if (!in_bounds(y, x)) return;
POSITION x = p_ptr->x, y = p_ptr->y;
/* Get the cave grid */
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[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");
*
* Certain data is saved in multiple places for efficient access, currently,
* this includes the tval/sval/weight fields in "object_type", various fields
- * in "header_type", and the "m_idx" and "o_idx" fields in "cave_type". All
+ * in "header_type", and the "m_idx" and "o_idx" fields in "grid_type". All
* of these could be removed, but this would, in general, slow down the game
* and increase the complexity of the code.
* </pre>
* Note the special fields for the "MONSTER_FLOW" code.
*/
-typedef struct cave_type cave_type;
+typedef struct grid_type grid_type;
-struct cave_type
+struct grid_type
{
BIT_FLAGS info; /* Hack -- cave flags */
* Not completely allocated, that would be inefficient
* Not completely hardcoded, that would overflow memory
*/
-cave_type *cave[MAX_HGT];
+grid_type *cave[MAX_HGT];
/*
int i;
for(i=0;i<temp_n;i++){
- cave_type* c_ptr = &cave[temp_y[i]][temp_x[i]];
+ grid_type* c_ptr = &cave[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
void wilderness_gen(void)
{
int i, y, x, lim;
- cave_type *c_ptr;
+ grid_type *c_ptr;
feature_type *f_ptr;
/* Big town */
{
static int prev_feat = 0;
static int prev_mimic = 0;
- cave_type *c_ptr;
+ grid_type *c_ptr;
feature_type *f_ptr;
char tmp_val[160];
IDX tmp_feat, tmp_mimic;
{
POSITION *x = (POSITION*)(u);
POSITION *y = (POSITION*)(v);
- cave_type *ca_ptr = &cave[y[a]][x[a]];
- cave_type *cb_ptr = &cave[y[b]][x[b]];
+ grid_type *ca_ptr = &cave[y[a]][x[a]];
+ grid_type *cb_ptr = &cave[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;
*/
static bool target_set_accept(POSITION y, POSITION x)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Bounds */
{
for (x = min_wid; x <= max_wid; x++)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Require "interesting" contents */
if (!target_set_accept(y, x)) continue;
*/
static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *c_ptr = &cave[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
concptr s1 = "", s2 = "", s3 = "", x_info = "";
bool boring = TRUE;
char query;
char info[80];
char same_key;
- cave_type *c_ptr;
+ grid_type *c_ptr;
TERM_LEN wid, hgt;
get_screen_size(&wid, &hgt);
*/
static bool tgt_pt_accept(POSITION y, POSITION x)
{
- cave_type *c_ptr;
+ grid_type *c_ptr;
/* Bounds */
if (!(in_bounds(y, x))) return (FALSE);
/* Skip stairs which have defferent distance */
for (; n < temp_n; ++ n)
{
- cave_type *c_ptr = &cave[temp_y[n]][temp_x[n]];
+ grid_type *c_ptr = &cave[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))