}
/* Check the dungeon */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
* Determines if a map location is fully inside the outer walls
*/
#define in_bounds(Y,X) \
- (((Y) > 0) && ((X) > 0) && ((Y) < cur_hgt-1) && ((X) < cur_wid-1))
+ (((Y) > 0) && ((X) > 0) && ((Y) < current_floor_ptr->height-1) && ((X) < current_floor_ptr->width-1))
/*
* Determines if a map location is on or inside the outer walls
*/
#define in_bounds2(Y,X) \
- (((Y) >= 0) && ((X) >= 0) && ((Y) < cur_hgt) && ((X) < cur_wid))
+ (((Y) >= 0) && ((X) >= 0) && ((Y) < current_floor_ptr->height) && ((X) < current_floor_ptr->width))
/*
* Determines if a map location is on or inside the outer walls
* (unsigned version)
*/
#define in_bounds2u(Y,X) \
- (((Y) < cur_hgt) && ((X) < cur_wid))
+ (((Y) < current_floor_ptr->height) && ((X) < current_floor_ptr->width))
/*
* Determines if a map location is currently "on screen" -RAK-
int number_mon = 0;
/* Count all hostile monsters */
- for (i2 = 0; i2 < cur_wid; ++i2)
- for (j2 = 0; j2 < cur_hgt; j2++)
+ for (i2 = 0; i2 < current_floor_ptr->width; ++i2)
+ for (j2 = 0; j2 < current_floor_ptr->height; j2++)
{
grid_type *g_ptr = ¤t_floor_ptr->grid_array[j2][i2];
record_o_name[0] = '\0';
/* Reset map panel */
- panel_row_min = cur_hgt;
- panel_col_min = cur_wid;
+ panel_row_min = current_floor_ptr->height;
+ panel_col_min = current_floor_ptr->width;
/* Sexy gal gets bonus to maximum weapon skill of whip */
if (p_ptr->pseikaku == SEIKAKU_SEXY)
extern bool msg_flag;
extern s16b running;
extern GAME_TURN resting;
-extern POSITION cur_hgt;
-extern POSITION cur_wid;
extern MONSTER_NUMBER num_repro;
extern DEPTH object_level;
extern DEPTH monster_level;
if (!p_ptr->wild_mode)
{
/* Hack -- Scan the town */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
if (!p_ptr->wild_mode)
{
/* Hack -- Scan the town */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
POSITION x, y;
MONSTER_NUMBER number_mon = 0;
- for (x = 0; x < cur_wid; ++x)
+ for (x = 0; x < current_floor_ptr->width; ++x)
{
- for (y = 0; y < cur_hgt; ++y)
+ for (y = 0; y < current_floor_ptr->height; ++y)
{
MONSTER_IDX m_idx = current_floor_ptr->grid_array[y][x].m_idx;
int candidates = 0;
int pick;
- for (y = 1; y < cur_hgt - 1; y++)
+ for (y = 1; y < current_floor_ptr->height - 1; y++)
{
- for (x = 1; x < cur_wid - 1; x++)
+ for (x = 1; x < current_floor_ptr->width - 1; x++)
{
if (alloc_stairs_aux(y, x, walls))
{
/* Choose a random one */
pick = randint1(candidates);
- for (y = 1; y < cur_hgt - 1; y++)
+ for (y = 1; y < current_floor_ptr->height - 1; y++)
{
- for (x = 1; x < cur_wid - 1; x++)
+ for (x = 1; x < current_floor_ptr->width - 1; x++)
{
if (alloc_stairs_aux(y, x, walls))
{
grid_type *g_ptr;
/* A small level has few objects. */
- num = num * cur_hgt * cur_wid / (MAX_HGT*MAX_WID) +1;
+ num = num * current_floor_ptr->height * current_floor_ptr->width / (MAX_HGT*MAX_WID) +1;
/* Place some objects */
for (k = 0; k < num; k++)
dummy++;
- y = randint0(cur_hgt);
- x = randint0(cur_wid);
+ y = randint0(current_floor_ptr->height);
+ x = randint0(current_floor_ptr->width);
g_ptr = ¤t_floor_ptr->grid_array[y][x];
grid_type *g_ptr;
feature_type *f_ptr;
- y = randint0(cur_hgt);
- x = randint0(cur_wid);
+ y = randint0(current_floor_ptr->height);
+ x = randint0(current_floor_ptr->width);
g_ptr = ¤t_floor_ptr->grid_array[y][x];
f_ptr = &f_info[g_ptr->feat];
dun_tun_jct = rand_range(DUN_TUN_JCT_MIN, DUN_TUN_JCT_MAX);
/* Actual maximum number of rooms on this level */
- dun->row_rooms = cur_hgt / BLOCK_HGT;
- dun->col_rooms = cur_wid / BLOCK_WID;
+ dun->row_rooms = current_floor_ptr->height / BLOCK_HGT;
+ dun->col_rooms = current_floor_ptr->width / BLOCK_WID;
/* Initialize the room table */
for (y = 0; y < dun->row_rooms; y++)
if (dun->empty_level)
{
/* Start with floors */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
place_floor_bold(y, x);
}
}
/* Special boundary walls -- Top and bottom */
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
place_extra_bold(0, x);
- place_extra_bold(cur_hgt - 1, x);
+ place_extra_bold(current_floor_ptr->height - 1, x);
}
/* Special boundary walls -- Left and right */
- for (y = 1; y < (cur_hgt - 1); y++)
+ for (y = 1; y < (current_floor_ptr->height - 1); y++)
{
place_extra_bold(y, 0);
- place_extra_bold(y, cur_wid - 1);
+ place_extra_bold(y, current_floor_ptr->width - 1);
}
}
else
{
/* Start with walls */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
place_extra_bold(y, x);
}
/* Build maze */
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_MAZE)
{
- build_maze_vault(cur_wid/2-1, cur_hgt/2-1, cur_wid-4, cur_hgt-4, FALSE);
+ build_maze_vault(current_floor_ptr->width/2-1, current_floor_ptr->height/2-1, current_floor_ptr->width-4, current_floor_ptr->height-4, FALSE);
/* Place 3 or 4 down stairs near some walls */
if (!alloc_stairs(feat_down_stair, rand_range(2, 3), 3)) return FALSE;
{
while (one_in_(DUN_MOS_DEN))
{
- place_trees(randint1(cur_wid - 2), randint1(cur_hgt - 2));
+ place_trees(randint1(current_floor_ptr->width - 2), randint1(current_floor_ptr->height - 2));
}
}
}
/* Special boundary walls -- Top and bottom */
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
place_bound_perm_wall(¤t_floor_ptr->grid_array[0][x]);
- place_bound_perm_wall(¤t_floor_ptr->grid_array[cur_hgt - 1][x]);
+ place_bound_perm_wall(¤t_floor_ptr->grid_array[current_floor_ptr->height - 1][x]);
}
/* Special boundary walls -- Left and right */
- for (y = 1; y < (cur_hgt - 1); y++)
+ for (y = 1; y < (current_floor_ptr->height - 1); y++)
{
place_bound_perm_wall(¤t_floor_ptr->grid_array[y][0]);
- place_bound_perm_wall(¤t_floor_ptr->grid_array[y][cur_wid - 1]);
+ place_bound_perm_wall(¤t_floor_ptr->grid_array[y][current_floor_ptr->width - 1]);
}
/* Determine the character location */
i = d_info[p_ptr->dungeon_idx].min_m_alloc_level;
/* To make small levels a bit more playable */
- if (cur_hgt < MAX_HGT || cur_wid < MAX_WID)
+ if (current_floor_ptr->height < MAX_HGT || current_floor_ptr->width < MAX_WID)
{
int small_tester = i;
- i = (i * cur_hgt) / MAX_HGT;
- i = (i * cur_wid) / MAX_WID;
+ i = (i * current_floor_ptr->height) / MAX_HGT;
+ i = (i * current_floor_ptr->width) / MAX_WID;
i += 1;
if (i > small_tester) i = small_tester;
if (dun->empty_level && (!one_in_(DARK_EMPTY) || (randint1(100) > current_floor_ptr->dun_level)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
{
/* Lite the current_floor_ptr->grid_array */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
current_floor_ptr->grid_array[y][x].info |= (CAVE_GLOW);
}
POSITION qx = 0;
/* Smallest area */
- cur_hgt = SCREEN_HGT;
- cur_wid = SCREEN_WID;
+ current_floor_ptr->height = SCREEN_HGT;
+ current_floor_ptr->width = SCREEN_WID;
/* Start with solid walls */
for (y = 0; y < MAX_HGT; y++)
POSITION x, y;
/* Start with perm walls */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
place_solid_perm_bold(y, x);
}
while ((level_height == MAX_HGT/SCREEN_HGT) && (level_width == MAX_WID/SCREEN_WID));
}
- cur_hgt = level_height * SCREEN_HGT;
- cur_wid = level_width * SCREEN_WID;
+ current_floor_ptr->height = level_height * SCREEN_HGT;
+ current_floor_ptr->width = level_width * SCREEN_WID;
/* Assume illegal panel */
- panel_row_min = cur_hgt;
- panel_col_min = cur_wid;
+ panel_row_min = current_floor_ptr->height;
+ panel_col_min = current_floor_ptr->width;
msg_format_wizard(CHEAT_DUNGEON,
_("小さなフロア: X:%d, Y:%d", "A 'small' dungeon level: X:%d, Y:%d."),
- cur_wid, cur_hgt);
+ current_floor_ptr->width, current_floor_ptr->height);
}
else
{
/* Big dungeon */
- cur_hgt = MAX_HGT;
- cur_wid = MAX_WID;
+ current_floor_ptr->height = MAX_HGT;
+ current_floor_ptr->width = MAX_WID;
/* Assume illegal panel */
- panel_row_min = cur_hgt;
- panel_col_min = cur_wid;
+ panel_row_min = current_floor_ptr->height;
+ panel_col_min = current_floor_ptr->width;
}
/* Make a dungeon */
{
POSITION x, y;
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
/* Wipe unused flags */
current_floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
if (current_floor_ptr->dun_level)
{
- for (y = 1; y < cur_hgt - 1; y++)
+ for (y = 1; y < current_floor_ptr->height - 1; y++)
{
- for (x = 1; x < cur_wid - 1; x++)
+ for (x = 1; x < current_floor_ptr->width - 1; x++)
{
/* There might be trap */
current_floor_ptr->grid_array[y][x].info |= CAVE_UNSAFE;
set_floor_and_wall(0);
/* Smallest area */
- cur_hgt = SCREEN_HGT;
- cur_wid = SCREEN_WID;
+ current_floor_ptr->height = SCREEN_HGT;
+ current_floor_ptr->width = SCREEN_WID;
/* Filled with permanent walls */
for (y = 0; y < MAX_HGT; y++)
}
/* Place at center of the floor */
- p_ptr->y = cur_hgt / 2;
- p_ptr->x = cur_wid / 2;
+ p_ptr->y = current_floor_ptr->height / 2;
+ p_ptr->x = current_floor_ptr->width / 2;
/* Give one square */
place_floor_bold(p_ptr->y, p_ptr->x);
int i;
/* Search usable stairs */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
{
POSITION x, y;
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Hack -- Choose starting point */
- y2 = randint1(cur_hgt / 2 - 2) + cur_hgt / 2;
- x2 = randint1(cur_wid / 2 - 2) + cur_wid / 2;
+ y2 = randint1(current_floor_ptr->height / 2 - 2) + current_floor_ptr->height / 2;
+ x2 = randint1(current_floor_ptr->width / 2 - 2) + current_floor_ptr->width / 2;
/* Hack -- Choose ending point somewhere on boundary */
switch(randint1(4))
case 1:
{
/* top boundary */
- x1 = randint1(cur_wid-2)+1;
+ x1 = randint1(current_floor_ptr->width-2)+1;
y1 = 1;
break;
}
{
/* left boundary */
x1 = 1;
- y1 = randint1(cur_hgt-2)+1;
+ y1 = randint1(current_floor_ptr->height-2)+1;
break;
}
case 3:
{
/* right boundary */
- x1 = cur_wid-1;
- y1 = randint1(cur_hgt-2)+1;
+ x1 = current_floor_ptr->width-1;
+ y1 = randint1(current_floor_ptr->height-2)+1;
break;
}
case 4:
{
/* bottom boundary */
- x1 = randint1(cur_wid-2)+1;
- y1 = cur_hgt-1;
+ x1 = randint1(current_floor_ptr->width-2)+1;
+ y1 = current_floor_ptr->height-1;
break;
}
}
bool streamer_may_have_gold = have_flag(streamer_ptr->flags, FF_MAY_HAVE_GOLD);
/* Hack -- Choose starting point */
- y = rand_spread(cur_hgt / 2, cur_hgt / 6);
- x = rand_spread(cur_wid / 2, cur_wid / 6);
+ y = rand_spread(current_floor_ptr->height / 2, current_floor_ptr->height / 6);
+ x = rand_spread(current_floor_ptr->width / 2, current_floor_ptr->width / 6);
/* Choose a random compass direction */
dir = randint0(8);
for (n = 0; n < randint1(5); n++)
{
/* Pick an epi-center */
- x1 = rand_range(5, cur_wid - 1 - 5);
- y1 = rand_range(5, cur_hgt - 1 - 5);
+ x1 = rand_range(5, current_floor_ptr->width - 1 - 5);
+ y1 = rand_range(5, current_floor_ptr->height - 1 - 5);
(void)destroy_area(y1, x1, 15, TRUE);
}
while (max_attempts--)
{
/* Pick a legal spot */
- y = (POSITION)rand_range(1, cur_hgt - 2);
- x = (POSITION)rand_range(1, cur_wid - 2);
+ y = (POSITION)rand_range(1, current_floor_ptr->height - 2);
+ x = (POSITION)rand_range(1, current_floor_ptr->width - 2);
g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Get bounds */
xmin = (0 < panel_col_min) ? panel_col_min : 0;
- xmax = (cur_wid - 1 > panel_col_max) ? panel_col_max : cur_wid - 1;
+ xmax = (current_floor_ptr->width - 1 > panel_col_max) ? panel_col_max : current_floor_ptr->width - 1;
ymin = (0 < panel_row_min) ? panel_row_min : 0;
- ymax = (cur_hgt - 1 > panel_row_max) ? panel_row_max : cur_hgt - 1;
+ ymax = (current_floor_ptr->height - 1 > panel_row_max) ? panel_row_max : current_floor_ptr->height - 1;
/* Bottom section of screen */
for (y = 1; y <= ymin - panel_row_prt; y++)
wid -= 14;
if (use_bigtile) wid /= 2;
- yrat = (cur_hgt + hgt - 1) / hgt;
- xrat = (cur_wid + wid - 1) / wid;
+ yrat = (current_floor_ptr->height + hgt - 1) / hgt;
+ xrat = (current_floor_ptr->width + wid - 1) / wid;
/* Disable lighting effects */
view_special_lite = FALSE;
}
/* Allocate the maps */
- C_MAKE(bigma, (cur_hgt + 2), TERM_COLOR *);
- C_MAKE(bigmc, (cur_hgt + 2), char_ptr);
- C_MAKE(bigmp, (cur_hgt + 2), byte_ptr);
+ C_MAKE(bigma, (current_floor_ptr->height + 2), TERM_COLOR *);
+ C_MAKE(bigmc, (current_floor_ptr->height + 2), char_ptr);
+ C_MAKE(bigmp, (current_floor_ptr->height + 2), byte_ptr);
/* Allocate and wipe each line map */
- for (y = 0; y < (cur_hgt + 2); y++)
+ for (y = 0; y < (current_floor_ptr->height + 2); y++)
{
/* Allocate one row each array */
- C_MAKE(bigma[y], (cur_wid + 2), TERM_COLOR);
- C_MAKE(bigmc[y], (cur_wid + 2), char);
- C_MAKE(bigmp[y], (cur_wid + 2), byte);
+ C_MAKE(bigma[y], (current_floor_ptr->width + 2), TERM_COLOR);
+ C_MAKE(bigmc[y], (current_floor_ptr->width + 2), char);
+ C_MAKE(bigmp[y], (current_floor_ptr->width + 2), byte);
- for (x = 0; x < cur_wid + 2; ++x)
+ for (x = 0; x < current_floor_ptr->width + 2; ++x)
{
/* Nothing here */
bigma[y][x] = TERM_WHITE;
}
/* Fill in the map */
- for (i = 0; i < cur_wid; ++i)
+ for (i = 0; i < current_floor_ptr->width; ++i)
{
- for (j = 0; j < cur_hgt; ++j)
+ for (j = 0; j < current_floor_ptr->height; ++j)
{
x = i / xrat + 1;
y = j / yrat + 1;
}
}
- for (j = 0; j < cur_hgt; ++j)
+ for (j = 0; j < current_floor_ptr->height; ++j)
{
- for (i = 0; i < cur_wid; ++i)
+ for (i = 0; i < current_floor_ptr->width; ++i)
{
x = i / xrat + 1;
y = j / yrat + 1;
C_KILL(object_autopick_yx, (hgt + 2), object_type **);
/* Free each line map */
- for (y = 0; y < (cur_hgt + 2); y++)
+ for (y = 0; y < (current_floor_ptr->height + 2); y++)
{
/* Free one row each array */
- C_KILL(bigma[y], (cur_wid + 2), TERM_COLOR);
- C_KILL(bigmc[y], (cur_wid + 2), SYMBOL_CODE);
- C_KILL(bigmp[y], (cur_wid + 2), byte);
+ C_KILL(bigma[y], (current_floor_ptr->width + 2), TERM_COLOR);
+ C_KILL(bigmc[y], (current_floor_ptr->width + 2), SYMBOL_CODE);
+ C_KILL(bigmp[y], (current_floor_ptr->width + 2), byte);
}
/* Free each line map */
- C_KILL(bigma, (cur_hgt + 2), TERM_COLOR *);
- C_KILL(bigmc, (cur_hgt + 2), char_ptr);
- C_KILL(bigmp, (cur_hgt + 2), byte_ptr);
+ C_KILL(bigma, (current_floor_ptr->height + 2), TERM_COLOR *);
+ C_KILL(bigmc, (current_floor_ptr->height + 2), char_ptr);
+ C_KILL(bigmp, (current_floor_ptr->height + 2), byte_ptr);
}
/* Maximal south */
max_y = p_ptr->y + p;
- if (max_y > cur_hgt - 1) max_y = cur_hgt - 1;
+ if (max_y > current_floor_ptr->height - 1) max_y = current_floor_ptr->height - 1;
/* Maximal west */
min_x = p_ptr->x - p;
/* Maximal east */
max_x = p_ptr->x + p;
- if (max_x > cur_wid - 1) max_x = cur_wid - 1;
+ if (max_x > current_floor_ptr->width - 1) max_x = current_floor_ptr->width - 1;
/* Scan the maximal box */
for (y = min_y; y <= max_y; y++)
int full, over;
- POSITION y_max = cur_hgt - 1;
- POSITION x_max = cur_wid - 1;
+ POSITION y_max = current_floor_ptr->height - 1;
+ POSITION x_max = current_floor_ptr->width - 1;
grid_type *g_ptr;
POSITION x, y;
/* Check the entire dungeon */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
/* Forget the old data */
current_floor_ptr->grid_array[y][x].dist = 0;
}
/* Erase all of the current flow information */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
current_floor_ptr->grid_array[y][x].cost = 0;
current_floor_ptr->grid_array[y][x].dist = 0;
if (++scent_when == 254)
{
/* Scan the entire dungeon */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
int w = current_floor_ptr->grid_array[y][x].when;
current_floor_ptr->grid_array[y][x].when = (w > 128) ? (w - 128) : 0;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
/* Scan that area */
- for (y = 1; y < cur_hgt - 1; y++)
+ for (y = 1; y < current_floor_ptr->height - 1; y++)
{
- for (x = 1; x < cur_wid - 1; x++)
+ for (x = 1; x < current_floor_ptr->width - 1; x++)
{
if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
/* Not in the darkness dungeon */
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) return;
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Hack - Set the dungeon size */
panels_y = (*y / SCREEN_HGT);
if (*y % SCREEN_HGT) panels_y++;
- cur_hgt = panels_y * SCREEN_HGT;
+ current_floor_ptr->height = panels_y * SCREEN_HGT;
panels_x = (*x / SCREEN_WID);
if (*x % SCREEN_WID) panels_x++;
- cur_wid = panels_x * SCREEN_WID;
+ current_floor_ptr->width = panels_x * SCREEN_WID;
/* Assume illegal panel */
- panel_row_min = cur_hgt;
- panel_col_min = cur_wid;
+ panel_row_min = current_floor_ptr->height;
+ panel_col_min = current_floor_ptr->width;
/* Place player in a quest level */
if (p_ptr->inside_quest)
p_ptr->x = (POSITION)tmp16s;
if (z_older_than(10, 3, 13) && !current_floor_ptr->dun_level && !p_ptr->inside_arena) {p_ptr->y = 33;p_ptr->x = 131;}
rd_s16b(&tmp16s);
- cur_hgt = (POSITION)tmp16s;
+ current_floor_ptr->height = (POSITION)tmp16s;
rd_s16b(&tmp16s);
- cur_wid = (POSITION)tmp16s;
+ current_floor_ptr->width = (POSITION)tmp16s;
rd_s16b(&tmp16s); /* max_panel_rows */
rd_s16b(&tmp16s); /* max_panel_cols */
#endif
/* Maximal size */
- ymax = cur_hgt;
- xmax = cur_wid;
+ ymax = current_floor_ptr->height;
+ xmax = current_floor_ptr->width;
/*** Run length decoding ***/
p_ptr->x = (POSITION)tmp16u;
rd_s16b(&tmp16s);
- cur_hgt = (POSITION)tmp16s;
+ current_floor_ptr->height = (POSITION)tmp16s;
rd_s16b(&tmp16s);
- cur_wid = (POSITION)tmp16s;
+ current_floor_ptr->width = (POSITION)tmp16s;
rd_byte(&p_ptr->feeling);
}
/* Maximal size */
- ymax = cur_hgt;
- xmax = cur_wid;
+ ymax = current_floor_ptr->height;
+ xmax = current_floor_ptr->width;
/*** Run length decoding ***/
{
min_x = 0;
min_y = 0;
- max_x = cur_wid;
- max_y = cur_hgt;
+ max_x = current_floor_ptr->width;
+ max_y = current_floor_ptr->height;
}
/* Draw the map */
{
POSITION x, y;
int val = 0;
- for (x = 0; x < cur_wid; x++) {
- for (y = 0; y < cur_hgt; y++) {
+ for (x = 0; x < current_floor_ptr->width; x++) {
+ for (y = 0; y < current_floor_ptr->height; y++) {
if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x])) val++;
}
}
break;
/* mirror sleeping */
case 9:
- for (x = 0; x < cur_wid; x++) {
- for (y = 0; y < cur_hgt; y++) {
+ for (x = 0; x < current_floor_ptr->width; x++) {
+ for (y = 0; y < current_floor_ptr->height; y++) {
if (is_mirror_grid(¤t_floor_ptr->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);
}
number_mon = 0;
/* Count all quest monsters */
- for (i2 = 0; i2 < cur_wid; ++i2)
- for (j2 = 0; j2 < cur_hgt; j2++)
+ for (i2 = 0; i2 < current_floor_ptr->width; ++i2)
+ for (j2 = 0; j2 < current_floor_ptr->height; j2++)
if (current_floor_ptr->grid_array[j2][i2].m_idx > 0)
if (m_list[current_floor_ptr->grid_array[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
number_mon++;
while (try_count)
{
/* Get a random spot */
- oy = randint1(cur_hgt - 4) + 2;
- ox = randint1(cur_wid - 4) + 2;
+ oy = randint1(current_floor_ptr->height - 4) + 2;
+ ox = randint1(current_floor_ptr->width - 4) + 2;
/* Is it a good spot ? */
if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(current_floor_ptr->grid_array[oy][ox].feat, &r_info[guardian], 0))
while (attempts_left--)
{
/* Pick a location */
- y = randint0(cur_hgt);
- x = randint0(cur_wid);
+ y = randint0(current_floor_ptr->height);
+ x = randint0(current_floor_ptr->width);
/* Require empty floor grid (was "naked") */
if (current_floor_ptr->dun_level)
{
int candidates = 0, pick;
- for (ty = 1; ty < cur_hgt - 1; ty++)
+ for (ty = 1; ty < current_floor_ptr->height - 1; ty++)
{
- for (tx = 1; tx < cur_wid - 1; tx++)
+ for (tx = 1; tx < current_floor_ptr->width - 1; tx++)
{
/* A valid space found */
if (cave_drop_bold(ty, tx)) candidates++;
/* Choose a random one */
pick = randint1(candidates);
- for (ty = 1; ty < cur_hgt - 1; ty++)
+ for (ty = 1; ty < current_floor_ptr->height - 1; ty++)
{
- for (tx = 1; tx < cur_wid - 1; tx++)
+ for (tx = 1; tx < current_floor_ptr->width - 1; tx++)
{
if (cave_drop_bold(ty, tx))
{
{
p_ptr->wilderness_y--;
p_ptr->wilderness_x--;
- p_ptr->oldpy = cur_hgt - 2;
- p_ptr->oldpx = cur_wid - 2;
+ p_ptr->oldpy = current_floor_ptr->height - 2;
+ p_ptr->oldpx = current_floor_ptr->width - 2;
ambush_flag = FALSE;
}
{
p_ptr->wilderness_y--;
p_ptr->wilderness_x++;
- p_ptr->oldpy = cur_hgt - 2;
+ p_ptr->oldpy = current_floor_ptr->height - 2;
p_ptr->oldpx = 1;
ambush_flag = FALSE;
}
p_ptr->wilderness_y++;
p_ptr->wilderness_x--;
p_ptr->oldpy = 1;
- p_ptr->oldpx = cur_wid - 2;
+ p_ptr->oldpx = current_floor_ptr->width - 2;
ambush_flag = FALSE;
}
else if (y == 0)
{
p_ptr->wilderness_y--;
- p_ptr->oldpy = cur_hgt - 2;
+ p_ptr->oldpy = current_floor_ptr->height - 2;
p_ptr->oldpx = x;
ambush_flag = FALSE;
}
else if (x == 0)
{
p_ptr->wilderness_x--;
- p_ptr->oldpx = cur_wid - 2;
+ p_ptr->oldpx = current_floor_ptr->width - 2;
p_ptr->oldpy = y;
ambush_flag = FALSE;
}
{
POSITION x, y;
/* Check the entire dungeon / Forget the old data */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
travel.cost[y][x] = MAX_SHORT;
bool prevent_bm = FALSE;
/* Hack -- If already exist black market, prevent building */
- for (y = 0; (y < cur_hgt) && !prevent_bm; y++)
+ for (y = 0; (y < current_floor_ptr->height) && !prevent_bm; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
if (current_floor_ptr->grid_array[y][x].feat == FF_STORE)
{
y = v_ptr->hgt;
/* Some huge vault cannot be ratated to fit in the dungeon */
- if (x + 2 > cur_hgt - 2)
+ if (x + 2 > current_floor_ptr->height - 2)
{
/* Forbid 90 or 270 degree ratation */
transno &= ~1;
y = v_ptr->hgt;
/* Some huge vault cannot be ratated to fit in the dungeon */
- if (x + 2 > cur_hgt - 2)
+ if (x + 2 > current_floor_ptr->height - 2)
{
/* Forbid 90 or 270 degree ratation */
transno &= ~1;
y = v_ptr->hgt;
/* Some huge vault cannot be ratated to fit in the dungeon */
- if (x + 2 > cur_hgt - 2)
+ if (x + 2 > current_floor_ptr->height - 2)
{
/* Forbid 90 or 270 degree ratation */
transno &= ~1;
if ((current_floor_ptr->dun_level <= randint1(50)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
/* Make a current_floor_ptr->grid_array the size of the dungeon */
- xsize = cur_wid - 1;
- ysize = cur_hgt - 1;
+ xsize = current_floor_ptr->width - 1;
+ ysize = current_floor_ptr->height - 1;
x0 = xsize / 2;
y0 = ysize / 2;
}
/* Make the size of the dungeon */
- xsize = cur_wid - 1;
- ysize = cur_hgt - 1;
+ xsize = current_floor_ptr->width - 1;
+ ysize = current_floor_ptr->height - 1;
x0 = xsize / 2;
y0 = ysize / 2;
int total_prob;
int prob_list[ROOM_T_MAX];
int rooms_built = 0;
- int area_size = 100 * (cur_hgt*cur_wid) / (MAX_HGT*MAX_WID);
+ int area_size = 100 * (current_floor_ptr->height*current_floor_ptr->width) / (MAX_HGT*MAX_WID);
int level_index = MIN(10, div_round(current_floor_ptr->dun_level, 10));
/* Number of each type of room on this level */
wr_u16b((s16b)num_repro);
wr_u16b((u16b)p_ptr->y);
wr_u16b((u16b)p_ptr->x);
- wr_u16b((u16b)cur_hgt);
- wr_u16b((u16b)cur_wid);
+ wr_u16b((u16b)current_floor_ptr->height);
+ wr_u16b((u16b)current_floor_ptr->width);
wr_byte(p_ptr->feeling);
C_MAKE(templates, max_num_temp, cave_template_type);
/* Extract template array */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
prev_u16b = 0;
/* Dump the current_floor_ptr->grid_array */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
}
/* Scan all normal grids */
- for (y = 1; y < cur_hgt - 1; y++)
+ for (y = 1; y < current_floor_ptr->height - 1; y++)
{
/* Scan all normal grids */
- for (x = 1; x < cur_wid - 1; x++)
+ for (x = 1; x < current_floor_ptr->width - 1; x++)
{
grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
POSITION y, x;
/* Forget every grid */
- for (y = 1; y < cur_hgt - 1; y++)
+ for (y = 1; y < current_floor_ptr->height - 1; y++)
{
- for (x = 1; x < cur_wid - 1; x++)
+ for (x = 1; x < current_floor_ptr->width - 1; x++)
{
grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
}
/* Forget every grid on horizontal edge */
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
current_floor_ptr->grid_array[0][x].info &= ~(CAVE_MARK);
- current_floor_ptr->grid_array[cur_hgt - 1][x].info &= ~(CAVE_MARK);
+ current_floor_ptr->grid_array[current_floor_ptr->height - 1][x].info &= ~(CAVE_MARK);
}
/* Forget every grid on vertical edge */
- for (y = 1; y < (cur_hgt - 1); y++)
+ for (y = 1; y < (current_floor_ptr->height - 1); y++)
{
current_floor_ptr->grid_array[y][0].info &= ~(CAVE_MARK);
- current_floor_ptr->grid_array[y][cur_wid - 1].info &= ~(CAVE_MARK);
+ current_floor_ptr->grid_array[y][current_floor_ptr->width - 1].info &= ~(CAVE_MARK);
}
/* Forget all objects */
POSITION x, y;
int num;
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x])) {
mirror_y[mirror_num] = y;
monster_target_y = p_ptr->y;
monster_target_x = p_ptr->x;
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]) &&
distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
{
POSITION x, y;
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
{
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
/* Scan the current panel */
- for (y = 1; y < cur_hgt - 1; y++)
+ for (y = 1; y < current_floor_ptr->height - 1; y++)
{
- for (x = 1; x <= cur_wid - 1; x++)
+ for (x = 1; x <= current_floor_ptr->width - 1; x++)
{
int dist = distance(p_ptr->y, p_ptr->x, y, x);
if (dist > range) continue;
{
POSITION x, y;
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
{
int min, pick, i;
int left = MAX(1, p_ptr->x - dis);
- int right = MIN(cur_wid - 2, p_ptr->x + dis);
+ int right = MIN(current_floor_ptr->width - 2, p_ptr->x + dis);
int top = MAX(1, p_ptr->y - dis);
- int bottom = MIN(cur_hgt - 2, p_ptr->y + dis);
+ int bottom = MIN(current_floor_ptr->height - 2, p_ptr->y + dis);
if (p_ptr->wild_mode) return FALSE;
}
/* Scan all normal grids */
- for (y = 1; y < cur_hgt - 1; y++)
+ for (y = 1; y < current_floor_ptr->height - 1; y++)
{
- for (x = 1; x < cur_wid - 1; x++)
+ for (x = 1; x < current_floor_ptr->width - 1; x++)
{
g_ptr = ¤t_floor_ptr->grid_array[y][x];
}
/* Special boundary walls -- Top and bottom */
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
g_ptr = ¤t_floor_ptr->grid_array[0][x];
f_ptr = &f_info[g_ptr->mimic];
if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
}
- g_ptr = ¤t_floor_ptr->grid_array[cur_hgt - 1][x];
+ g_ptr = ¤t_floor_ptr->grid_array[current_floor_ptr->height - 1][x];
f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
}
/* Special boundary walls -- Left and right */
- for (y = 1; y < (cur_hgt - 1); y++)
+ for (y = 1; y < (current_floor_ptr->height - 1); y++)
{
g_ptr = ¤t_floor_ptr->grid_array[y][0];
f_ptr = &f_info[g_ptr->mimic];
if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
}
- g_ptr = ¤t_floor_ptr->grid_array[y][cur_wid - 1];
+ g_ptr = ¤t_floor_ptr->grid_array[y][current_floor_ptr->width - 1];
f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
grid_type *grid_array[MAX_HGT];
DEPTH dun_level; /*!< 現在の実ダンジョン階層base_levelの参照元となる / Current dungeon level */
DEPTH base_level;
+ POSITION width; /* Current dungeon width */
+ POSITION height; /* Current dungeon height */
} floor_type;
\ No newline at end of file
s16b running; /* Current counter for running, if any */
GAME_TURN resting; /* Current counter for resting, if any */
-POSITION cur_hgt; /* Current dungeon height */
-POSITION cur_wid; /* Current dungeon width */
MONSTER_NUMBER num_repro; /*!< Current reproducer count */
DEPTH object_level; /*!< アイテムの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current object creation level */
DEPTH monster_level; /*!< モンスターの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
panel_col_max = 0;
/* Reset the panels */
- panel_row_min = cur_hgt;
- panel_col_min = cur_wid;
+ panel_row_min = current_floor_ptr->height;
+ panel_col_min = current_floor_ptr->width;
verify_panel();
x = panel_col_min + dx * wid / 2;
/* Verify the row */
- if (y > cur_hgt - hgt) y = cur_hgt - hgt;
+ if (y > current_floor_ptr->height - hgt) y = current_floor_ptr->height - hgt;
if (y < 0) y = 0;
/* Verify the col */
- if (x > cur_wid - wid) x = cur_wid - wid;
+ if (x > current_floor_ptr->width - wid) x = current_floor_ptr->width - wid;
if (x < 0) x = 0;
/* Handle "changes" */
/* Hack -- Induce consistant flavors */
Rand_state_set(wilderness[y][x].seed);
- dy = rand_range(6, cur_hgt - 6);
- dx = rand_range(6, cur_wid - 6);
+ dy = rand_range(6, current_floor_ptr->height - 6);
+ dx = rand_range(6, current_floor_ptr->width - 6);
current_floor_ptr->grid_array[dy][dx].feat = feat_entrance;
current_floor_ptr->grid_array[dy][dx].special = wilderness[y][x].entrance;
feature_type *f_ptr;
/* Big town */
- cur_hgt = MAX_HGT;
- cur_wid = MAX_WID;
+ current_floor_ptr->height = MAX_HGT;
+ current_floor_ptr->width = MAX_WID;
/* Assume illegal panel */
- panel_row_min = cur_hgt;
- panel_col_min = cur_wid;
+ panel_row_min = current_floor_ptr->height;
+ panel_col_min = current_floor_ptr->width;
/* Init the wilderness */
current_floor_ptr->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 (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
g_ptr = ¤t_floor_ptr->grid_array[y][x];
if (p_ptr->teleport_town)
{
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
g_ptr = ¤t_floor_ptr->grid_array[y][x];
else if (p_ptr->leaving_dungeon)
{
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
g_ptr = ¤t_floor_ptr->grid_array[y][x];
current_floor_ptr->grid_array[j][i].info |= (CAVE_GLOW | CAVE_MARK);
}
- cur_hgt = (s16b) max_wild_y;
- cur_wid = (s16b) max_wild_x;
+ current_floor_ptr->height = (s16b) max_wild_y;
+ current_floor_ptr->width = (s16b) max_wild_x;
- if (cur_hgt > MAX_HGT) cur_hgt = MAX_HGT;
- if (cur_wid > MAX_WID) cur_wid = MAX_WID;
+ if (current_floor_ptr->height > MAX_HGT) current_floor_ptr->height = MAX_HGT;
+ if (current_floor_ptr->width > MAX_WID) current_floor_ptr->width = MAX_WID;
/* Assume illegal panel */
- panel_row_min = cur_hgt;
- panel_col_min = cur_wid;
+ panel_row_min = current_floor_ptr->height;
+ panel_col_min = current_floor_ptr->width;
/* Place the player */
p_ptr->x = p_ptr->wilderness_x;
/* Make every dungeon square "known" to test streamers -KMW- */
case 'u':
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
current_floor_ptr->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
get_screen_size(&wid, &hgt);
- max_prow_min = cur_hgt - hgt;
- max_pcol_min = cur_wid - wid;
+ max_prow_min = current_floor_ptr->height - hgt;
+ max_pcol_min = current_floor_ptr->width - wid;
/* Bounds checking */
if (max_prow_min < 0) max_prow_min = 0;
{
/* Inner range */
min_hgt = MAX((p_ptr->y - MAX_RANGE), 0);
- max_hgt = MIN((p_ptr->y + MAX_RANGE), cur_hgt - 1);
+ max_hgt = MIN((p_ptr->y + MAX_RANGE), current_floor_ptr->height - 1);
min_wid = MAX((p_ptr->x - MAX_RANGE), 0);
- max_wid = MIN((p_ptr->x + MAX_RANGE), cur_wid - 1);
+ max_wid = MIN((p_ptr->x + MAX_RANGE), current_floor_ptr->width - 1);
}
else /* not targetting */
{
}
/* Slide into legality */
- if (x >= cur_wid-1) x = cur_wid - 2;
+ if (x >= current_floor_ptr->width-1) x = current_floor_ptr->width - 2;
else if (x <= 0) x = 1;
/* Slide into legality */
- if (y >= cur_hgt-1) y = cur_hgt- 2;
+ if (y >= current_floor_ptr->height-1) y = current_floor_ptr->height- 2;
else if (y <= 0) y = 1;
}
}
}
/* Slide into legality */
- if (x >= cur_wid-1) x = cur_wid - 2;
+ if (x >= current_floor_ptr->width-1) x = current_floor_ptr->width - 2;
else if (x <= 0) x = 1;
/* Slide into legality */
- if (y >= cur_hgt-1) y = cur_hgt- 2;
+ if (y >= current_floor_ptr->height-1) y = current_floor_ptr->height- 2;
else if (y <= 0) y = 1;
}
}
if (!expand_list) return;
/* Scan the current panel */
- for (y = 1; y < cur_hgt; y++)
+ for (y = 1; y < current_floor_ptr->height; y++)
{
- for (x = 1; x < cur_wid; x++)
+ for (x = 1; x < current_floor_ptr->width; x++)
{
/* Require "interesting" contents */
if (!tgt_pt_accept(y, x)) continue;
}
/* Slide into legality */
- if (x >= cur_wid-1) x = cur_wid - 2;
+ if (x >= current_floor_ptr->width-1) x = current_floor_ptr->width - 2;
else if (x <= 0) x = 1;
/* Slide into legality */
- if (y >= cur_hgt-1) y = cur_hgt- 2;
+ if (y >= current_floor_ptr->height-1) y = current_floor_ptr->height- 2;
else if (y <= 0) y = 1;
}