*/
static bool alloc_stairs_aux(POSITION y, POSITION x, int walls)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Require "naked" floor grid */
if (!is_floor_grid(g_ptr)) return FALSE;
if (have_flag(f_ptr->flags, FF_LESS))
{
/* No up stairs in town or in ironman mode */
- if (ironman_downward || !dun_level) return TRUE;
+ if (ironman_downward || !current_floor_ptr->dun_level) return TRUE;
- if (dun_level > d_info[p_ptr->dungeon_idx].mindepth)
+ if (current_floor_ptr->dun_level > d_info[p_ptr->dungeon_idx].mindepth)
shaft_num = (randint1(num+1))/2;
}
else if (have_flag(f_ptr->flags, FF_MORE))
{
- QUEST_IDX q_idx = quest_number(dun_level);
+ QUEST_IDX q_idx = quest_number(current_floor_ptr->dun_level);
/* No downstairs on quest levels */
- if (dun_level > 1 && q_idx)
+ if (current_floor_ptr->dun_level > 1 && q_idx)
{
monster_race *r_ptr = &r_info[quest[q_idx].r_idx];
}
/* No downstairs at the bottom */
- if (dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) return TRUE;
+ if (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) return TRUE;
- if ((dun_level < d_info[p_ptr->dungeon_idx].maxdepth-1) && !quest_number(dun_level+1))
+ if ((current_floor_ptr->dun_level < d_info[p_ptr->dungeon_idx].maxdepth-1) && !quest_number(current_floor_ptr->dun_level+1))
shaft_num = (randint1(num)+1)/2;
}
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))
{
if (!pick) break;
}
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Clear possible garbage of hidden trap */
g_ptr->mimic = 0;
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 = &grid_array[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Require "naked" floor grid */
if (!is_floor_grid(g_ptr) || g_ptr->o_idx || g_ptr->m_idx) continue;
if (player_bold(y, x)) continue;
/* Check for "room" */
- room = (grid_array[y][x].info & CAVE_ROOM) ? TRUE : FALSE;
+ room = (current_floor_ptr->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);
- grid_array[y][x].info &= ~(CAVE_FLOOR);
+ current_floor_ptr->grid_array[y][x].info &= ~(CAVE_FLOOR);
break;
}
case ALLOC_TYP_TRAP:
{
place_trap(y, x);
- grid_array[y][x].info &= ~(CAVE_FLOOR);
+ current_floor_ptr->grid_array[y][x].info &= ~(CAVE_FLOOR);
break;
}
if (quest[i].status != QUEST_STATUS_TAKEN ||
(quest[i].type != QUEST_TYPE_KILL_LEVEL &&
quest[i].type != QUEST_TYPE_RANDOM) ||
- quest[i].level != dun_level ||
+ quest[i].level != current_floor_ptr->dun_level ||
p_ptr->dungeon_idx != quest[i].dungeon ||
(quest[i].flags & QUEST_FLAG_PRESET))
{
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 = &grid_array[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
f_ptr = &f_info[g_ptr->feat];
if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) continue;
return TRUE;
}
-
-/*!
- * @brief マスにフロア端用の永久壁を配置する / Set boundary mimic and add "solid" perma-wall
- * @param g_ptr 永久壁を廃止したいマス構造体の参照ポインタ
- * @return なし
- */
-static void set_bound_perm_wall(grid_type *g_ptr)
-{
- if (bound_walls_perm)
- {
- /* Clear boundary mimic */
- g_ptr->mimic = 0;
- }
- else
- {
- feature_type *f_ptr = &f_info[g_ptr->feat];
-
- /* Hack -- Decline boundary walls with known treasure */
- if ((have_flag(f_ptr->flags, FF_HAS_GOLD) || have_flag(f_ptr->flags, FF_HAS_ITEM)) &&
- !have_flag(f_ptr->flags, FF_SECRET))
- g_ptr->feat = feat_state(g_ptr->feat, FF_ENSECRET);
-
- /* Set boundary mimic */
- g_ptr->mimic = g_ptr->feat;
- }
-
- /* Add "solid" perma-wall */
- place_solid_perm_grid(g_ptr);
-}
-
/*!
* @brief フロアに洞窟や湖を配置する / Generate various caverns and lakes
* @details There were moved from cave_gen().
{
#ifdef ALLOW_CAVERNS_AND_LAKES
/* Possible "destroyed" level */
- if ((dun_level > 30) && one_in_(DUN_DEST*2) && (small_levels) && (d_info[p_ptr->dungeon_idx].flags1 & DF1_DESTROY))
+ if ((current_floor_ptr->dun_level > 30) && one_in_(DUN_DEST*2) && (small_levels) && (d_info[p_ptr->dungeon_idx].flags1 & DF1_DESTROY))
{
dun->destroyed = TRUE;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_LAKE_LAVA)
{
/* Lake of Lava */
- if ((dun_level > 80) && (randint0(count) < 2)) dun->laketype = LAKE_T_LAVA;
+ if ((current_floor_ptr->dun_level > 80) && (randint0(count) < 2)) dun->laketype = LAKE_T_LAVA;
count -= 2;
/* Lake of Lava2 */
- if (!dun->laketype && (dun_level > 80) && one_in_(count)) dun->laketype = LAKE_T_FIRE_VAULT;
+ if (!dun->laketype && (current_floor_ptr->dun_level > 80) && one_in_(count)) dun->laketype = LAKE_T_FIRE_VAULT;
count--;
}
if ((d_info[p_ptr->dungeon_idx].flags1 & DF1_LAKE_WATER) && !dun->laketype)
{
/* Lake of Water */
- if ((dun_level > 50) && randint0(count) < 2) dun->laketype = LAKE_T_WATER;
+ if ((current_floor_ptr->dun_level > 50) && randint0(count) < 2) dun->laketype = LAKE_T_WATER;
count -= 2;
/* Lake of Water2 */
- if (!dun->laketype && (dun_level > 50) && one_in_(count)) dun->laketype = LAKE_T_WATER_VAULT;
+ if (!dun->laketype && (current_floor_ptr->dun_level > 50) && one_in_(count)) dun->laketype = LAKE_T_WATER_VAULT;
count--;
}
if ((d_info[p_ptr->dungeon_idx].flags1 & DF1_LAKE_RUBBLE) && !dun->laketype)
{
/* Lake of rubble */
- if ((dun_level > 35) && (randint0(count) < 2)) dun->laketype = LAKE_T_CAVE;
+ if ((current_floor_ptr->dun_level > 35) && (randint0(count) < 2)) dun->laketype = LAKE_T_CAVE;
count -= 2;
/* Lake of rubble2 */
- if (!dun->laketype && (dun_level > 35) && one_in_(count)) dun->laketype = LAKE_T_EARTH_VAULT;
+ if (!dun->laketype && (current_floor_ptr->dun_level > 35) && one_in_(count)) dun->laketype = LAKE_T_EARTH_VAULT;
count--;
}
/* Lake of tree */
- if ((dun_level > 5) && (d_info[p_ptr->dungeon_idx].flags1 & DF1_LAKE_TREE) && !dun->laketype) dun->laketype = LAKE_T_AIR_VAULT;
+ if ((current_floor_ptr->dun_level > 5) && (d_info[p_ptr->dungeon_idx].flags1 & DF1_LAKE_TREE) && !dun->laketype) dun->laketype = LAKE_T_AIR_VAULT;
if (dun->laketype)
{
}
}
- if ((dun_level > DUN_CAVERN) && !dun->empty_level &&
+ if ((current_floor_ptr->dun_level > DUN_CAVERN) && !dun->empty_level &&
(d_info[p_ptr->dungeon_idx].flags1 & DF1_CAVERN) &&
- !dun->laketype && !dun->destroyed && (randint1(1000) < dun_level))
+ !dun->laketype && !dun->destroyed && (randint1(1000) < current_floor_ptr->dun_level))
{
dun->cavern = TRUE;
- /* make a large fractal grid_array in the middle of the dungeon */
+ /* make a large fractal current_floor_ptr->grid_array in the middle of the dungeon */
msg_print_wizard(CHEAT_DUNGEON, _("洞窟を生成。", "Cavern on level."));
build_cavern();
#endif /* ALLOW_CAVERNS_AND_LAKES */
/* Hack -- No destroyed "quest" levels */
- if (quest_number(dun_level)) dun->destroyed = FALSE;
+ if (quest_number(current_floor_ptr->dun_level)) dun->destroyed = FALSE;
}
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;
/* Make a hole in the dungeon roof sometimes at level 1 */
- if (dun_level == 1)
+ if (current_floor_ptr->dun_level == 1)
{
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));
}
}
if (dun->destroyed) destroy_level();
/* Hack -- Add some rivers */
- if (one_in_(3) && (randint1(dun_level) > 5))
+ if (one_in_(3) && (randint1(current_floor_ptr->dun_level) > 5))
{
FEAT_IDX feat1 = 0, feat2 = 0;
/* Choose water mainly */
- if ((randint1(MAX_DEPTH * 2) - 1 > dun_level) && (d_info[p_ptr->dungeon_idx].flags1 & DF1_WATER_RIVER))
+ if ((randint1(MAX_DEPTH * 2) - 1 > current_floor_ptr->dun_level) && (d_info[p_ptr->dungeon_idx].flags1 & DF1_WATER_RIVER))
{
feat1 = feat_deep_water;
feat2 = feat_shallow_water;
dun->wall_n = 0;
/* Connect the room to the previous room */
- if (randint1(dun_level) > d_info[p_ptr->dungeon_idx].tunnel_percent)
+ if (randint1(current_floor_ptr->dun_level) > d_info[p_ptr->dungeon_idx].tunnel_percent)
{
/* make cavelike tunnel */
(void)build_tunnel2(dun->cent[i].x, dun->cent[i].y, x, y, 2, 2);
feature_type *f_ptr;
y = dun->tunn[j].y;
x = dun->tunn[j].x;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
f_ptr = &f_info[g_ptr->feat];
/* Clear previous contents (if not a lake), add a floor */
grid_type *g_ptr;
y = dun->wall[j].y;
x = dun->wall[j].x;
- g_ptr = &grid_array[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Clear mimic type */
g_ptr->mimic = 0;
}
/* Special boundary walls -- Top and bottom */
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
- set_bound_perm_wall(&grid_array[0][x]);
- set_bound_perm_wall(&grid_array[cur_hgt - 1][x]);
+ place_bound_perm_wall(¤t_floor_ptr->grid_array[0][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++)
{
- set_bound_perm_wall(&grid_array[y][0]);
- set_bound_perm_wall(&grid_array[y][cur_wid - 1]);
+ place_bound_perm_wall(¤t_floor_ptr->grid_array[y][0]);
+ place_bound_perm_wall(¤t_floor_ptr->grid_array[y][current_floor_ptr->width - 1]);
}
/* Determine the character location */
if (!place_quest_monsters()) return FALSE;
/* Basic "amount" */
- k = (dun_level / 3);
+ k = (current_floor_ptr->dun_level / 3);
if (k > 10) k = 10;
if (k < 2) k = 2;
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 (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE)) alloc_object(ALLOC_SET_CORR, ALLOC_TYP_RUBBLE, randint1(k));
/* Mega Hack -- No object at first level of deeper dungeon */
- if (p_ptr->enter_dungeon && dun_level > 1)
+ if (p_ptr->enter_dungeon && current_floor_ptr->dun_level > 1)
{
/* No stair scum! */
object_level = 1;
alloc_object(ALLOC_SET_BOTH, ALLOC_TYP_GOLD, randnor(DUN_AMT_GOLD, 3));
/* Set back to default */
- object_level = base_level;
+ object_level = current_floor_ptr->base_level;
/* Put the Guardian */
if (!alloc_guardian(TRUE)) return FALSE;
- if (dun->empty_level && (!one_in_(DARK_EMPTY) || (randint1(100) > dun_level)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
+ 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 grid_array */
- for (y = 0; y < cur_hgt; y++)
+ /* Lite the current_floor_ptr->grid_array */
+ 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_array[y][x].info |= (CAVE_GLOW);
+ current_floor_ptr->grid_array[y][x].info |= (CAVE_GLOW);
}
}
}
for (j = x_left; j <= x_right; j++)
{
place_extra_perm_bold(i, j);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->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);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->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);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->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);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
place_extra_perm_bold(y_height+6, x_left+18);
- grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_depth-6, x_left+18);
- grid_array[y_depth-6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[y_depth-6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_height+6, x_right-18);
- grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_depth-6, x_right-18);
- grid_array[y_depth-6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[y_depth-6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
i = y_height + 5;
j = xval;
- grid_array[i][j].feat = f_tag_to_index("ARENA_GATE");
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[i][j].feat = f_tag_to_index("ARENA_GATE");
+ current_floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
player_place(i, j);
}
/*!
- * @brief 闘技場への入場処理 / Town logic flow for generation of arena -KMW-
+ * @brief 挑戦時闘技場への入場処理 / Town logic flow for generation of arena -KMW-
* @return なし
*/
-static void arena_gen(void)
+static void generate_challenge_arena(void)
{
POSITION y, x;
POSITION qy = 0;
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++)
place_solid_perm_bold(y, x);
/* Illuminate and memorize the walls */
- grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
}
for (x = qx + 1; x < qx + SCREEN_WID - 1; x++)
{
/* Create empty floor */
- grid_array[y][x].feat = feat_floor;
+ current_floor_ptr->grid_array[y][x].feat = feat_floor;
}
}
for (j = x_left; j <= x_right; j++)
{
place_extra_perm_bold(i, j);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->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);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->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);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->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);
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
place_extra_perm_bold(y_height+6, x_left+18);
- grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_depth-4, x_left+18);
- grid_array[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_height+6, x_right-18);
- grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
place_extra_perm_bold(y_depth-4, x_right-18);
- grid_array[y_depth-4][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->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++)
{
- grid_array[i][j].feat = feat_permanent_glass_wall;
+ current_floor_ptr->grid_array[i][j].feat = feat_permanent_glass_wall;
}
i = y_height + 1;
j = xval;
- grid_array[i][j].feat = f_tag_to_index("BUILDING_3");
- grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[i][j].feat = f_tag_to_index("BUILDING_3");
+ current_floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
player_place(i, j);
}
* @brief モンスター闘技場への導入処理 / Town logic flow for generation of arena -KMW-
* @return なし
*/
-static void battle_gen(void)
+static void generate_gambling_arena(void)
{
POSITION y, x;
MONSTER_IDX i;
place_solid_perm_bold(y, x);
/* Illuminate and memorize the walls */
- grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
}
for (x = qx + 1; x < qx + SCREEN_WID - 1; x++)
{
/* Create empty floor */
- grid_array[y][x].feat = feat_floor;
+ current_floor_ptr->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[grid_array[p_ptr->y+8+(i/2)*4][p_ptr->x-2+(i%2)*4].m_idx]);
+ set_friendly(&m_list[current_floor_ptr->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 固定マップクエストのフロア生成 / Generate a quest level
* @return なし
*/
-static void quest_gen(void)
+static void generate_fixed_floor(void)
{
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);
}
}
/* Set the quest level */
- base_level = quest[p_ptr->inside_quest].level;
- dun_level = base_level;
- object_level = base_level;
- monster_level = base_level;
+ current_floor_ptr->base_level = quest[p_ptr->inside_quest].level;
+ current_floor_ptr->dun_level = current_floor_ptr->base_level;
+ object_level = current_floor_ptr->base_level;
+ monster_level = current_floor_ptr->base_level;
if (record_stair) do_cmd_write_nikki(NIKKI_TO_QUEST, p_ptr->inside_quest, NULL);
get_mon_num_prep(get_monster_hook(), NULL);
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 */
}
/*!
- * @brief フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after grid_array generation
+ * @brief フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after current_floor_ptr->grid_array generation
* @return なし
*/
-void wipe_generate_cave_flags(void)
+void wipe_generate_random_floor_flags(void)
{
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 */
- grid_array[y][x].info &= ~(CAVE_MASK);
+ current_floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
}
}
- if (dun_level)
+ 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 */
- grid_array[y][x].info |= CAVE_UNSAFE;
+ current_floor_ptr->grid_array[y][x].info |= CAVE_UNSAFE;
}
}
}
}
/*!
- * @brief フロアの全情報を初期化する / Clear and empty the grid_array
+ * @brief フロアの全情報を初期化する / Clear and empty the current_floor_ptr->grid_array
* @return なし
*/
void clear_cave(void)
precalc_cur_num_of_pet();
- /* Start with a blank grid_array */
+ /* Start with a blank current_floor_ptr->grid_array */
for (y = 0; y < MAX_HGT; y++)
{
for (x = 0; x < MAX_WID; x++)
{
- grid_type *g_ptr = &grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
g_ptr->info = 0;
g_ptr->feat = 0;
g_ptr->o_idx = 0;
p_ptr->x = p_ptr->y = 0;
/* Set the base level */
- base_level = dun_level;
+ current_floor_ptr->base_level = current_floor_ptr->dun_level;
/* Reset the monster generation level */
- monster_level = base_level;
+ monster_level = current_floor_ptr->base_level;
/* Reset the object generation level */
- object_level = base_level;
+ object_level = current_floor_ptr->base_level;
}
* @return なし
* @note Hack -- regenerate any "overflow" levels
*/
-void generate_cave(void)
+void generate_random_floor(void)
{
int num;
concptr why = NULL;
- /* Clear and empty the grid_array */
+ /* Clear and empty the current_floor_ptr->grid_array */
clear_cave();
/* Build the arena -KMW- */
if (p_ptr->inside_arena)
{
/* Small arena */
- arena_gen();
+ generate_challenge_arena();
}
/* Build the battle -KMW- */
else if (p_ptr->inside_battle)
{
/* Small arena */
- battle_gen();
+ generate_gambling_arena();
}
else if (p_ptr->inside_quest)
{
- quest_gen();
+ generate_fixed_floor();
}
/* Build the town */
- else if (!dun_level)
+ else if (!current_floor_ptr->dun_level)
{
/* Make the wilderness */
if (p_ptr->wild_mode) wilderness_gen_small();
/* Reset flag */
p_ptr->enter_dungeon = FALSE;
- wipe_generate_cave_flags();
+ wipe_generate_random_floor_flags();
}
/*!
/* Access the location */
- g_ptr = &grid_array[tmp_row][tmp_col];
+ g_ptr = ¤t_floor_ptr->grid_array[tmp_row][tmp_col];
/* Avoid "solid" walls */
if (is_solid_grid(g_ptr)) continue;
if (is_solid_bold(y, x)) continue;
/* Accept this location */
- row1 = (POSITION)tmp_row;
- col1 = (POSITION)tmp_col;
+ row1 = tmp_row;
+ col1 = tmp_col;
/* Save the wall location */
if (dun->wall_n < WALL_MAX)
{
int i, j, dx, dy;
- grid_type *g_ptr = &grid_array[*y][*x];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[*y][*x];
if (!in_bounds(*y, *x)) return TRUE;
}
/* Clear mimic type */
- grid_array[*y][*x].mimic = 0;
+ current_floor_ptr->grid_array[*y][*x].mimic = 0;
place_floor_bold(*y, *x);
y3 = (y1 + y2) / 2;
}
/* cache g_ptr */
- g_ptr = &grid_array[y3][x3];
+ g_ptr = ¤t_floor_ptr->grid_array[y3][x3];
if (is_solid_grid(g_ptr))
{
/* move midpoint a bit to avoid problem. */
}
y3 += dy;
x3 += dx;
- g_ptr = &grid_array[y3][x3];
+ g_ptr = ¤t_floor_ptr->grid_array[y3][x3];
}
if (is_floor_grid(g_ptr))
{
if (build_tunnel2(x1, y1, x3, y3, type, cutoff))
{
- if ((grid_array[y3][x3].info & CAVE_ROOM) || (randint1(100) > 95))
+ if ((current_floor_ptr->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);
/* Save the door location */
if (dun->door_n < DOOR_MAX)
{
- dun->door[dun->door_n].y = (POSITION)y3;
- dun->door[dun->door_n].x = (POSITION)x3;
+ dun->door[dun->door_n].y = y3;
+ dun->door[dun->door_n].x = x3;
dun->door_n++;
}
else return FALSE;
else
{
/* tunnel through walls */
- if (build_tunnel2(x1, y1, (POSITION)x3, (POSITION)y3, type, cutoff))
+ if (build_tunnel2(x1, y1, x3, y3, type, cutoff))
{
- retval = build_tunnel2((POSITION)x3, (POSITION)y3, x2, y2, type, cutoff);
+ retval = build_tunnel2(x3, y3, x2, y2, type, cutoff);
firstsuccede = TRUE;
}
else