/*!
* @brief alloc_stairs()の補助として指定の位置に階段を生成できるかの判定を行う / Helper function for alloc_stairs(). Is this a good location for stairs?
+ * @param player_ptr プレーヤーへの参照ポインタ
* @param y 基準のy座標
* @param x 基準のx座標
* @param walls 最低減隣接させたい外壁の数
* @return 階段を生成して問題がないならばTRUEを返す。
*/
-static bool alloc_stairs_aux(floor_type *floor_ptr, POSITION y, POSITION x, int walls)
+static bool alloc_stairs_aux(player_type *player_ptr, POSITION y, POSITION x, int walls)
{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
grid_type *g_ptr = &floor_ptr->grid_array[y][x];
/* Require "naked" floor grid */
if (!is_floor_grid(g_ptr)) return FALSE;
- if (pattern_tile(y, x)) return FALSE;
+ if (pattern_tile(floor_ptr, y, x)) return FALSE;
if (g_ptr->o_idx || g_ptr->m_idx) return FALSE;
/* Require a certain number of adjacent walls */
{
for (x = 1; x < floor_ptr->width - 1; x++)
{
- if (alloc_stairs_aux(floor_ptr, y, x, walls))
+ if (alloc_stairs_aux(owner_ptr, y, x, walls))
{
/* A valid space found */
candidates++;
{
for (x = 1; x < floor_ptr->width - 1; x++)
{
- if (alloc_stairs_aux(floor_ptr, y, x, walls))
+ if (alloc_stairs_aux(owner_ptr, y, x, walls))
{
pick--;
g_ptr->mimic = 0;
/* Clear previous contents, add stairs */
- g_ptr->feat = (i < shaft_num) ? feat_state(feat, FF_SHAFT) : feat;
+ g_ptr->feat = (i < shaft_num) ? feat_state(owner_ptr, feat, FF_SHAFT) : feat;
/* No longer "FLOOR" */
g_ptr->info &= ~(CAVE_FLOOR);
case ALLOC_TYP_GOLD:
{
- place_gold(floor_ptr, y, x);
+ place_gold(owner_ptr, y, x);
break;
}
f_ptr = &f_info[g_ptr->feat];
if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) continue;
- if (!monster_can_enter(y, x, r_ptr, 0)) continue;
+ if (!monster_can_enter(creature_ptr, y, x, r_ptr, 0)) continue;
if (distance(y, x, creature_ptr->y, creature_ptr->x) < 10) continue;
if (g_ptr->info & CAVE_ICKY) continue;
else break;
{
for (x = 0; x < floor_ptr->width; x++)
{
- place_floor_bold(player_ptr, y, x);
+ place_bold(player_ptr, y, x, floor);
}
}
/* Special boundary walls -- Top and bottom */
for (x = 0; x < floor_ptr->width; x++)
{
- place_extra_bold(player_ptr, 0, x);
- place_extra_bold(player_ptr, floor_ptr->height - 1, x);
+ place_bold(player_ptr, 0, x, extra);
+ place_bold(player_ptr, floor_ptr->height - 1, x, extra);
}
/* Special boundary walls -- Left and right */
for (y = 1; y < (floor_ptr->height - 1); y++)
{
- place_extra_bold(player_ptr, y, 0);
- place_extra_bold(player_ptr, y, floor_ptr->width - 1);
+ place_bold(player_ptr, y, 0, extra);
+ place_bold(player_ptr, y, floor_ptr->width - 1, extra);
}
}
else
{
for (x = 0; x < floor_ptr->width; x++)
{
- place_extra_bold(player_ptr, y, x);
+ place_bold(player_ptr, y, x, extra);
}
}
}
for (i = y_height; i <= y_height + 5; i++)
for (j = x_left; j <= x_right; j++)
{
- place_extra_perm_bold(player_ptr, i, j);
+ place_bold(player_ptr, i, j, extra_perm);
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(player_ptr, i, j);
+ place_bold(player_ptr, i, j, extra_perm);
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(player_ptr, i, j);
+ place_bold(player_ptr, i, j, extra_perm);
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(player_ptr, i, j);
+ place_bold(player_ptr, i, j, extra_perm);
floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
- place_extra_perm_bold(player_ptr, y_height + 6, x_left + 18);
+ place_bold(player_ptr, y_height + 6, x_left + 18, extra_perm);
floor_ptr->grid_array[y_height + 6][x_left + 18].info |= (CAVE_GLOW | CAVE_MARK);
- place_extra_perm_bold(player_ptr, y_depth - 6, x_left + 18);
+ place_bold(player_ptr, y_depth - 6, x_left + 18, extra_perm);
floor_ptr->grid_array[y_depth - 6][x_left + 18].info |= (CAVE_GLOW | CAVE_MARK);
- place_extra_perm_bold(player_ptr, y_height + 6, x_right - 18);
+ place_bold(player_ptr, y_height + 6, x_right - 18, extra_perm);
floor_ptr->grid_array[y_height + 6][x_right - 18].info |= (CAVE_GLOW | CAVE_MARK);
- place_extra_perm_bold(player_ptr, y_depth - 6, x_right - 18);
+ place_bold(player_ptr, y_depth - 6, x_right - 18, extra_perm);
floor_ptr->grid_array[y_depth - 6][x_right - 18].info |= (CAVE_GLOW | CAVE_MARK);
*start_y = y_height + 5;
for (x = 0; x < MAX_WID; x++)
{
/* Create "solid" perma-wall */
- place_solid_perm_bold(challanger_ptr, y, x);
+ place_bold(challanger_ptr, y, x, solid_perm);
/* Illuminate and memorize the walls */
floor_ptr->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
for (i = y_height; i <= y_height + 5; i++)
for (j = x_left; j <= x_right; j++)
{
- place_extra_perm_bold(player_ptr, i, j);
+ place_bold(player_ptr, i, j, extra_perm);
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(player_ptr, i, j);
+ place_bold(player_ptr, i, j, extra_perm);
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(player_ptr, i, j);
+ place_bold(player_ptr, i, j, extra_perm);
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(player_ptr, i, j);
+ place_bold(player_ptr, i, j, extra_perm);
floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
- place_extra_perm_bold(player_ptr, y_height+6, x_left+18);
+ place_bold(player_ptr, y_height+6, x_left+18, extra_perm);
floor_ptr->grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
- place_extra_perm_bold(player_ptr, y_depth-4, x_left+18);
+ place_bold(player_ptr, y_depth-4, x_left+18, extra_perm);
floor_ptr->grid_array[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
- place_extra_perm_bold(player_ptr, y_height+6, x_right-18);
+ place_bold(player_ptr, y_height+6, x_right-18, extra_perm);
floor_ptr->grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
- place_extra_perm_bold(player_ptr, y_depth-4, x_right-18);
+ place_bold(player_ptr, y_depth-4, x_right-18, extra_perm);
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 (x = 0; x < MAX_WID; x++)
{
/* Create "solid" perma-wall */
- place_solid_perm_bold(creature_ptr, y, x);
+ place_bold(creature_ptr, y, x, solid_perm);
/* Illuminate and memorize the walls */
floor_ptr->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
{
for (x = 0; x < floor_ptr->width; x++)
{
- place_solid_perm_bold(player_ptr, y, x);
+ place_bold(player_ptr, y, x, solid_perm);
}
}
if (is_outer_bold(floor_ptr, y, x))
{
/* Change the wall to a "solid" wall */
- place_solid_noperm_bold(player_ptr, y, x);
+ place_bold(player_ptr, y, x, solid_noperm);
}
}
}
if (is_outer_bold(floor_ptr, j, i))
{
/* Change the wall to a "solid" wall */
- place_solid_noperm_bold(player_ptr, j, i);
+ place_bold(player_ptr, j, i, solid_noperm);
}
}
}
/* Clear mimic type */
floor_ptr->grid_array[*y][*x].mimic = 0;
- place_floor_bold(player_ptr, *y, *x);
+ place_bold(player_ptr, *y, *x, floor);
return TRUE;
}
if (i == 0)
{
/* Failed for some reason: hack - ignore the solidness */
- place_outer_bold(player_ptr, y3, x3);
+ place_bold(player_ptr, y3, x3, outer);
dx = 0;
dy = 0;
}