if (!n_ptr->name) break;
/* Ignore excessive depth */
- if (n_ptr->level > dun_level) continue;
+ if (n_ptr->level > current_floor_ptr->dun_level) continue;
/* Not matched with pit/nest flag */
if (!(allow_flag_mask & (1L << count))) continue;
/* Count this possibility */
- total += n_ptr->chance * MAX_DEPTH / (MIN(dun_level, MAX_DEPTH - 1) - n_ptr->level + 5);
+ total += n_ptr->chance * MAX_DEPTH / (MIN(current_floor_ptr->dun_level, MAX_DEPTH - 1) - n_ptr->level + 5);
}
/* Pick a random type */
if (!n_ptr->name) break;
/* Ignore excessive depth */
- if (n_ptr->level > dun_level) continue;
+ if (n_ptr->level > current_floor_ptr->dun_level) continue;
/* Not matched with pit/nest flag */
if (!(allow_flag_mask & (1L << count))) continue;
/* Count this possibility */
- total += n_ptr->chance * MAX_DEPTH / (MIN(dun_level, MAX_DEPTH - 1) - n_ptr->level + 5);
+ total += n_ptr->chance * MAX_DEPTH / (MIN(current_floor_ptr->dun_level, MAX_DEPTH - 1) - n_ptr->level + 5);
/* Found the type */
if (tmp < total) break;
* @param v 未使用
* @param a 比較対象参照ID1
* @param b 比較対象参照ID2
+* TODO: to sort.c
*/
static bool ang_sort_comp_nest_mon_info(vptr u, vptr v, int a, int b)
{
* @param v 未使用
* @param a スワップ対象参照ID1
* @param b スワップ対象参照ID2
+* TODO: to sort.c
*/
static void ang_sort_swap_nest_mon_info(vptr u, vptr v, int a, int b)
{
monster_type align;
- cave_type *c_ptr;
+ grid_type *g_ptr;
int cur_nest_type = pick_vault_type(nest_types, d_info[p_ptr->dungeon_idx].nest);
vault_aux_type *n_ptr;
while (attempts--)
{
/* Get a (hard) monster type */
- r_idx = get_mon_num(dun_level + 11);
+ r_idx = get_mon_num(current_floor_ptr->dun_level + 11);
r_ptr = &r_info[r_idx];
/* Decline incorrect alignment */
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y][x];
- place_floor_grid(c_ptr);
- c_ptr->info |= (CAVE_ROOM);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ place_floor_grid(g_ptr);
+ g_ptr->info |= (CAVE_ROOM);
}
}
/* Place the outer walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
- place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
- place_outer_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x1 - 1];
+ place_outer_grid(g_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x2 + 1];
+ place_outer_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
- place_outer_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
- place_outer_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y1 - 1][x];
+ place_outer_grid(g_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y2 + 1][x];
+ place_outer_grid(g_ptr);
}
/* The inner walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
- place_inner_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
- place_inner_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x1 - 1];
+ place_inner_grid(g_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x2 + 1];
+ place_inner_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
- place_inner_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
- place_inner_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y1 - 1][x];
+ place_inner_grid(g_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y2 + 1][x];
+ place_inner_grid(g_ptr);
}
for (y = y1; y <= y2; y++)
{
if (cheat_room)
{
- ang_sort_comp = ang_sort_comp_nest_mon_info;
- ang_sort_swap = ang_sort_swap_nest_mon_info;
- ang_sort(nest_mon_info, NULL, NUM_NEST_MON_TYPE);
+ ang_sort(nest_mon_info, NULL, NUM_NEST_MON_TYPE, ang_sort_comp_nest_mon_info, ang_sort_swap_nest_mon_info);
/* Dump the entries (prevent multi-printing) */
for (i = 0; i < NUM_NEST_MON_TYPE; i++)
monster_type align;
- cave_type *c_ptr;
+ grid_type *g_ptr;
int cur_pit_type = pick_vault_type(pit_types, d_info[p_ptr->dungeon_idx].pit);
vault_aux_type *n_ptr;
while (attempts--)
{
/* Get a (hard) monster type */
- r_idx = get_mon_num(dun_level + 11);
+ r_idx = get_mon_num(current_floor_ptr->dun_level + 11);
r_ptr = &r_info[r_idx];
/* Decline incorrect alignment */
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y][x];
- place_floor_grid(c_ptr);
- c_ptr->info |= (CAVE_ROOM);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ place_floor_grid(g_ptr);
+ g_ptr->info |= (CAVE_ROOM);
}
}
/* Place the outer walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
- place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
- place_outer_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x1 - 1];
+ place_outer_grid(g_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x2 + 1];
+ place_outer_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
- place_outer_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
- place_outer_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y1 - 1][x];
+ place_outer_grid(g_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y2 + 1][x];
+ place_outer_grid(g_ptr);
}
/* Advance to the center room */
/* The inner walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
- place_inner_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
- place_inner_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x1 - 1];
+ place_inner_grid(g_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x2 + 1];
+ place_inner_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
- place_inner_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
- place_inner_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y1 - 1][x];
+ place_inner_grid(g_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y2 + 1][x];
+ place_inner_grid(g_ptr);
}
for (y = y1; y <= y2; y++)
{
monster_type align;
- cave_type *c_ptr;
+ grid_type *g_ptr;
int cur_pit_type = pick_vault_type(pit_types, d_info[p_ptr->dungeon_idx].pit);
vault_aux_type *n_ptr;
while (attempts--)
{
/* Get a (hard) monster type */
- r_idx = get_mon_num(dun_level + 0);
+ r_idx = get_mon_num(current_floor_ptr->dun_level + 0);
r_ptr = &r_info[r_idx];
/* Decline incorrect alignment */
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y][x];
- place_inner_grid(c_ptr);
- c_ptr->info |= (CAVE_ROOM);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ place_inner_grid(g_ptr);
+ g_ptr->info |= (CAVE_ROOM);
}
}
/* Place the floor area 1 */
for (x = x1 + 3; x <= x2 - 3; x++)
{
- c_ptr = &cave[yval - 2][x];
- place_floor_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[yval - 2][x];
+ place_floor_grid(g_ptr);
add_cave_info(yval - 2, x, CAVE_ICKY);
- c_ptr = &cave[yval + 2][x];
- place_floor_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[yval + 2][x];
+ place_floor_grid(g_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];
- place_floor_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[yval - 3][x];
+ place_floor_grid(g_ptr);
add_cave_info(yval - 3, x, CAVE_ICKY);
- c_ptr = &cave[yval + 3][x];
- place_floor_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[yval + 3][x];
+ place_floor_grid(g_ptr);
add_cave_info(yval + 3, x, CAVE_ICKY);
}
/* Corridor */
for (x = x1; x <= x2; x++)
{
- c_ptr = &cave[yval][x];
- place_floor_grid(c_ptr);
- c_ptr = &cave[y1][x];
- place_floor_grid(c_ptr);
- c_ptr = &cave[y2][x];
- place_floor_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[yval][x];
+ place_floor_grid(g_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y1][x];
+ place_floor_grid(g_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y2][x];
+ place_floor_grid(g_ptr);
}
/* Place the outer walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- c_ptr = &cave[y][x1 - 1];
- place_outer_grid(c_ptr);
- c_ptr = &cave[y][x2 + 1];
- place_outer_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x1 - 1];
+ place_outer_grid(g_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x2 + 1];
+ place_outer_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- c_ptr = &cave[y1 - 1][x];
- place_outer_grid(c_ptr);
- c_ptr = &cave[y2 + 1][x];
- place_outer_grid(c_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y1 - 1][x];
+ place_outer_grid(g_ptr);
+ g_ptr = ¤t_floor_ptr->grid_array[y2 + 1][x];
+ place_outer_grid(g_ptr);
}
/* Random corridor */
}
/* Place the wall open trap */
- cave[yval][xval].mimic = cave[yval][xval].feat;
- cave[yval][xval].feat = feat_trap_open;
+ current_floor_ptr->grid_array[yval][xval].mimic = current_floor_ptr->grid_array[yval][xval].feat;
+ current_floor_ptr->grid_array[yval][xval].feat = feat_trap_open;
/* Sort the entries */
for (i = 0; i < 16 - 1; i++)