creature_ptr->update |= (PU_BONUS);
creature_ptr->window |= (PW_MESSAGE);
- delete_monster_idx(pet_ctr);
+ delete_monster_idx(creature_ptr, pet_ctr);
Dismissed++;
}
}
monster_gain_exp(player_ptr, who, m_ptr->r_idx);
monster_death(player_ptr, m_idx, FALSE);
- delete_monster_idx(m_idx);
+ delete_monster_idx(player_ptr, m_idx);
/* Not afraid */
(*fear) = FALSE;
POSITION py, px;
/* Delete the monster (if any) */
- delete_monster(player_ptr->current_floor_ptr, player_ptr->y, player_ptr->x);
+ delete_monster(player_ptr, player_ptr->y, player_ptr->x);
py = atoi(zz[0]);
px = atoi(zz[1]);
dun->destroyed = TRUE;
/* extra rubble around the place looks cool */
- build_lake(floor_ptr, one_in_(2) ? LAKE_T_CAVE : LAKE_T_EARTH_VAULT);
+ build_lake(owner_ptr, one_in_(2) ? LAKE_T_CAVE : LAKE_T_EARTH_VAULT);
}
/* Make a lake some of the time */
if (dun->laketype)
{
msg_print_wizard(CHEAT_DUNGEON, _("湖を生成します。", "Lake on the level."));
- build_lake(floor_ptr, dun->laketype);
+ build_lake(owner_ptr, dun->laketype);
}
}
/* make a large fractal floor_ptr->grid_array in the middle of the dungeon */
msg_print_wizard(CHEAT_DUNGEON, _("洞窟を生成。", "Cavern on level."));
- build_cavern(floor_ptr);
+ build_cavern(owner_ptr);
}
#endif /* ALLOW_CAVERNS_AND_LAKES */
{
for (x = 0; x < floor_ptr->width; x++)
{
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
}
}
/* Special boundary walls -- Top and bottom */
for (x = 0; x < floor_ptr->width; x++)
{
- place_extra_bold(floor_ptr, 0, x);
- place_extra_bold(floor_ptr, floor_ptr->height - 1, x);
+ place_extra_bold(player_ptr, 0, x);
+ place_extra_bold(player_ptr, floor_ptr->height - 1, x);
}
/* Special boundary walls -- Left and right */
for (y = 1; y < (floor_ptr->height - 1); y++)
{
- place_extra_bold(floor_ptr, y, 0);
- place_extra_bold(floor_ptr, y, floor_ptr->width - 1);
+ place_extra_bold(player_ptr, y, 0);
+ place_extra_bold(player_ptr, y, floor_ptr->width - 1);
}
}
else
{
for (x = 0; x < floor_ptr->width; x++)
{
- place_extra_bold(floor_ptr, y, x);
+ place_extra_bold(player_ptr, y, x);
}
}
}
if (randint1(floor_ptr->dun_level) > dungeon_ptr->tunnel_percent)
{
/* make cavelike tunnel */
- (void)build_tunnel2(floor_ptr, dun->cent[i].x, dun->cent[i].y, x, y, 2, 2);
+ (void)build_tunnel2(player_ptr, dun->cent[i].x, dun->cent[i].y, x, y, 2, 2);
}
else
{
/* make normal tunnel */
- if (!build_tunnel(floor_ptr, dun->cent[i].y, dun->cent[i].x, y, x)) tunnel_fail_count++;
+ if (!build_tunnel(player_ptr, dun->cent[i].y, dun->cent[i].x, y, x)) tunnel_fail_count++;
}
if (tunnel_fail_count >= 2) return FALSE;
/* Clear mimic type */
g_ptr->mimic = 0;
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
}
}
g_ptr->mimic = 0;
/* Clear previous contents, add up floor */
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
/* Occasional doorway */
if ((randint0(100) < dun_tun_pen) && !(dungeon_ptr->flags1 & DF1_NO_DOORS))
/* Special boundary walls -- Top and bottom */
for (x = 0; x < floor_ptr->width; x++)
{
- place_bound_perm_wall(&floor_ptr->grid_array[0][x]);
- place_bound_perm_wall(&floor_ptr->grid_array[floor_ptr->height - 1][x]);
+ place_bound_perm_wall(player_ptr, &floor_ptr->grid_array[0][x]);
+ place_bound_perm_wall(player_ptr, &floor_ptr->grid_array[floor_ptr->height - 1][x]);
}
/* Special boundary walls -- Left and right */
for (y = 1; y < (floor_ptr->height - 1); y++)
{
- place_bound_perm_wall(&floor_ptr->grid_array[y][0]);
- place_bound_perm_wall(&floor_ptr->grid_array[y][floor_ptr->width - 1]);
+ place_bound_perm_wall(player_ptr, &floor_ptr->grid_array[y][0]);
+ place_bound_perm_wall(player_ptr, &floor_ptr->grid_array[y][floor_ptr->width - 1]);
}
/* Determine the character location */
/*!
* @brief 闘技場用のアリーナ地形を作成する / Builds the arena after it is entered -KMW-
+ * @param player_ptr プレーヤーへの参照ポインタ
* @return なし
*/
-static void build_arena(floor_type *floor_ptr, POSITION *start_y, POSITION *start_x)
+static void build_arena(player_type *player_ptr, POSITION *start_y, POSITION *start_x)
{
POSITION yval, y_height, y_depth, xval, x_left, x_right;
POSITION i, j;
x_left = xval - 32;
x_right = xval + 32;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (i = y_height; i <= y_height + 5; i++)
for (j = x_left; j <= x_right; j++)
{
- place_extra_perm_bold(floor_ptr, i, j);
+ place_extra_perm_bold(player_ptr, i, j);
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(floor_ptr, i, j);
+ place_extra_perm_bold(player_ptr, i, j);
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(floor_ptr, i, j);
+ place_extra_perm_bold(player_ptr, i, j);
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(floor_ptr, i, j);
+ place_extra_perm_bold(player_ptr, i, j);
floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
- place_extra_perm_bold(floor_ptr, y_height + 6, x_left + 18);
+ place_extra_perm_bold(player_ptr, y_height + 6, x_left + 18);
floor_ptr->grid_array[y_height + 6][x_left + 18].info |= (CAVE_GLOW | CAVE_MARK);
- place_extra_perm_bold(floor_ptr, y_depth - 6, x_left + 18);
+ place_extra_perm_bold(player_ptr, y_depth - 6, x_left + 18);
floor_ptr->grid_array[y_depth - 6][x_left + 18].info |= (CAVE_GLOW | CAVE_MARK);
- place_extra_perm_bold(floor_ptr, y_height + 6, x_right - 18);
+ place_extra_perm_bold(player_ptr, y_height + 6, x_right - 18);
floor_ptr->grid_array[y_height + 6][x_right - 18].info |= (CAVE_GLOW | CAVE_MARK);
- place_extra_perm_bold(floor_ptr, y_depth - 6, x_right - 18);
+ place_extra_perm_bold(player_ptr, y_depth - 6, x_right - 18);
floor_ptr->grid_array[y_depth - 6][x_right - 18].info |= (CAVE_GLOW | CAVE_MARK);
*start_y = y_height + 5;
* @brief 挑戦時闘技場への入場処理 / Town logic flow for generation of arena -KMW-
* @return なし
*/
-static void generate_challenge_arena(floor_type *floor_ptr, player_type *challanger_ptr)
+static void generate_challenge_arena(player_type *challanger_ptr)
{
POSITION y, x;
POSITION qy = 0;
POSITION qx = 0;
/* Smallest area */
+ floor_type *floor_ptr = challanger_ptr->current_floor_ptr;
floor_ptr->height = SCREEN_HGT;
floor_ptr->width = SCREEN_WID;
for (x = 0; x < MAX_WID; x++)
{
/* Create "solid" perma-wall */
- place_solid_perm_bold(floor_ptr, y, x);
+ place_solid_perm_bold(challanger_ptr, y, x);
/* Illuminate and memorize the walls */
floor_ptr->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
}
- build_arena(floor_ptr, &y, &x);
+ build_arena(challanger_ptr, &y, &x);
player_place(challanger_ptr, y, x);
if(!place_monster_aux(challanger_ptr, 0, challanger_ptr->y + 5, challanger_ptr->x, arena_info[challanger_ptr->arena_number].r_idx, (PM_NO_KAGE | PM_NO_PET)))
/*!
* @brief モンスター闘技場のフロア生成 / Builds the arena after it is entered -KMW-
+ * @param player_ptr プレーヤーへの参照ポインタ
* @return なし
*/
-static void build_battle(floor_type *floor_ptr, POSITION *y, POSITION *x)
+static void build_battle(player_type *player_ptr, POSITION *y, POSITION *x)
{
POSITION yval, y_height, y_depth, xval, x_left, x_right;
register int i, j;
x_left = xval - 32;
x_right = xval + 32;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (i = y_height; i <= y_height + 5; i++)
for (j = x_left; j <= x_right; j++)
{
- place_extra_perm_bold(floor_ptr, i, j);
+ place_extra_perm_bold(player_ptr, i, j);
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(floor_ptr, i, j);
+ place_extra_perm_bold(player_ptr, i, j);
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(floor_ptr, i, j);
+ place_extra_perm_bold(player_ptr, i, j);
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(floor_ptr, i, j);
+ place_extra_perm_bold(player_ptr, i, j);
floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK);
}
- place_extra_perm_bold(floor_ptr, y_height+6, x_left+18);
+ place_extra_perm_bold(player_ptr, y_height+6, x_left+18);
floor_ptr->grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
- place_extra_perm_bold(floor_ptr, y_depth-4, x_left+18);
+ place_extra_perm_bold(player_ptr, y_depth-4, x_left+18);
floor_ptr->grid_array[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
- place_extra_perm_bold(floor_ptr, y_height+6, x_right-18);
+ place_extra_perm_bold(player_ptr, y_height+6, x_right-18);
floor_ptr->grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
- place_extra_perm_bold(floor_ptr, y_depth-4, x_right-18);
+ place_extra_perm_bold(player_ptr, y_depth-4, x_right-18);
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(floor_ptr, y, x);
+ place_solid_perm_bold(creature_ptr, y, x);
/* Illuminate and memorize the walls */
floor_ptr->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
}
- build_battle(floor_ptr, &y, &x);
+ build_battle(creature_ptr, &y, &x);
player_place(creature_ptr, y, x);
{
for (x = 0; x < floor_ptr->width; x++)
{
- place_solid_perm_bold(floor_ptr, y, x);
+ place_solid_perm_bold(player_ptr, y, x);
}
}
if (floor_ptr->inside_arena)
{
- generate_challenge_arena(floor_ptr, player_ptr);
+ generate_challenge_arena(player_ptr);
}
else if (player_ptr->phase_out)
/*!
* @brief 部屋間のトンネルを生成する / Constructs a tunnel between two points
+* @param player_ptr プレーヤーへの参照ポインタ
* @param row1 始点Y座標
* @param col1 始点X座標
* @param row2 終点Y座標
* outer -- outer room walls\n
* solid -- solid room walls\n
*/
-bool build_tunnel(floor_type *floor_ptr, POSITION row1, POSITION col1, POSITION row2, POSITION col2)
+bool build_tunnel(player_type *player_ptr, POSITION row1, POSITION col1, POSITION row2, POSITION col2)
{
POSITION y, x;
POSITION tmp_row, tmp_col;
correct_dir(&row_dir, &col_dir, row1, col1, row2, col2);
/* Keep going until done (or bored) */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
while ((row1 != row2) || (col1 != col2))
{
/* Mega-Hack -- Paranoia -- prevent infinite loops */
if (is_outer_bold(floor_ptr, y, x))
{
/* Change the wall to a "solid" wall */
- place_solid_noperm_bold(floor_ptr, y, x);
+ place_solid_noperm_bold(player_ptr, y, x);
}
}
}
/*!
* @brief トンネル生成のための基準点を指定する。
+* @param player_ptr プレーヤーへの参照ポインタ
* @param x 基準点を指定するX座標の参照ポインタ、適時値が修正される。
* @param y 基準点を指定するY座標の参照ポインタ、適時値が修正される。
* @param affectwall (調査中)
* routine.\n
* @todo 特に詳細な処理の意味を調査すべし
*/
-static bool set_tunnel(floor_type *floor_ptr, POSITION *x, POSITION *y, bool affectwall)
+static bool set_tunnel(player_type *player_ptr, POSITION *x, POSITION *y, bool affectwall)
{
int i, j, dx, dy;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
grid_type *g_ptr = &floor_ptr->grid_array[*y][*x];
if (!in_bounds(floor_ptr, *y, *x)) return TRUE;
if (is_outer_bold(floor_ptr, j, i))
{
/* Change the wall to a "solid" wall */
- place_solid_noperm_bold(floor_ptr, j, i);
+ place_solid_noperm_bold(player_ptr, j, i);
}
}
}
/* Clear mimic type */
floor_ptr->grid_array[*y][*x].mimic = 0;
- place_floor_bold(floor_ptr, *y, *x);
+ place_floor_bold(player_ptr, *y, *x);
return TRUE;
}
if (i == 0)
{
/* Failed for some reason: hack - ignore the solidness */
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
dx = 0;
dy = 0;
}
/*!
* @brief 外壁を削って「カタコンベ状」の通路を作成する / This routine creates the catacomb-like tunnels by removing extra rock.
+* @param player_ptr プレーヤーへの参照ポインタ
* @param x 基準点のX座標
* @param y 基準点のY座標
* @return なし
* Note that this routine is only called on "even" squares - so it gives
* a natural checkerboard pattern.
*/
-static void create_cata_tunnel(floor_type *floor_ptr, POSITION x, POSITION y)
+static void create_cata_tunnel(player_type *player_ptr, POSITION x, POSITION y)
{
POSITION x1, y1;
/* Build tunnel */
x1 = x - 1;
y1 = y;
- set_tunnel(floor_ptr, &x1, &y1, FALSE);
+ set_tunnel(player_ptr, &x1, &y1, FALSE);
x1 = x + 1;
y1 = y;
- set_tunnel(floor_ptr, &x1, &y1, FALSE);
+ set_tunnel(player_ptr, &x1, &y1, FALSE);
x1 = x;
y1 = y - 1;
- set_tunnel(floor_ptr, &x1, &y1, FALSE);
+ set_tunnel(player_ptr, &x1, &y1, FALSE);
x1 = x;
y1 = y + 1;
- set_tunnel(floor_ptr, &x1, &y1, FALSE);
+ set_tunnel(player_ptr, &x1, &y1, FALSE);
}
/*!
* @brief トンネル生成処理(詳細調査中)/ This routine does the bulk of the work in creating the new types of tunnels.
+* @param player_ptr プレーヤーへの参照ポインタ
* @return なし
* @todo 詳細用調査
* @details
* This, when used with longer line segments gives the "catacomb-like" tunnels seen near\n
* the surface.\n
*/
-static void short_seg_hack(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int count, bool *fail)
+static void short_seg_hack(player_type *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int count, bool *fail)
{
int i;
POSITION x, y;
{
x = x1 + i * (x2 - x1) / length;
y = y1 + i * (y2 - y1) / length;
- if (!set_tunnel(floor_ptr, &x, &y, TRUE))
+ if (!set_tunnel(player_ptr, &x, &y, TRUE))
{
if (count > 50)
{
}
/* solid wall - so try to go around */
- short_seg_hack(floor_ptr, x, y, x1 + (i - 1) * (x2 - x1) / length, y1 + (i - 1) * (y2 - y1) / length, 1, count, fail);
- short_seg_hack(floor_ptr, x, y, x1 + (i + 1) * (x2 - x1) / length, y1 + (i + 1) * (y2 - y1) / length, 1, count, fail);
+ short_seg_hack(player_ptr, x, y, x1 + (i - 1) * (x2 - x1) / length, y1 + (i - 1) * (y2 - y1) / length, 1, count, fail);
+ short_seg_hack(player_ptr, x, y, x1 + (i + 1) * (x2 - x1) / length, y1 + (i + 1) * (y2 - y1) / length, 1, count, fail);
}
}
}
{
x = i;
y = y1;
- if (!set_tunnel(floor_ptr, &x, &y, TRUE))
+ if (!set_tunnel(player_ptr, &x, &y, TRUE))
{
/* solid wall - so try to go around */
- short_seg_hack(floor_ptr, x, y, i - 1, y1, 1, count, fail);
- short_seg_hack(floor_ptr, x, y, i + 1, y1, 1, count, fail);
+ short_seg_hack(player_ptr, x, y, i - 1, y1, 1, count, fail);
+ short_seg_hack(player_ptr, x, y, i + 1, y1, 1, count, fail);
}
if ((type == 3) && ((x + y) % 2))
{
- create_cata_tunnel(floor_ptr, i, y1);
+ create_cata_tunnel(player_ptr, i, y1);
}
}
}
{
x = i;
y = y1;
- if (!set_tunnel(floor_ptr, &x, &y, TRUE))
+ if (!set_tunnel(player_ptr, &x, &y, TRUE))
{
/* solid wall - so try to go around */
- short_seg_hack(floor_ptr, x, y, i - 1, y1, 1, count, fail);
- short_seg_hack(floor_ptr, x, y, i + 1, y1, 1, count, fail);
+ short_seg_hack(player_ptr, x, y, i - 1, y1, 1, count, fail);
+ short_seg_hack(player_ptr, x, y, i + 1, y1, 1, count, fail);
}
if ((type == 3) && ((x + y) % 2))
{
- create_cata_tunnel(floor_ptr, i, y1);
+ create_cata_tunnel(player_ptr, i, y1);
}
}
{
x = x2;
y = i;
- if (!set_tunnel(floor_ptr, &x, &y, TRUE))
+ if (!set_tunnel(player_ptr, &x, &y, TRUE))
{
/* solid wall - so try to go around */
- short_seg_hack(floor_ptr, x, y, x2, i - 1, 1, count, fail);
- short_seg_hack(floor_ptr, x, y, x2, i + 1, 1, count, fail);
+ short_seg_hack(player_ptr, x, y, x2, i - 1, 1, count, fail);
+ short_seg_hack(player_ptr, x, y, x2, i + 1, 1, count, fail);
}
if ((type == 3) && ((x + y) % 2))
{
- create_cata_tunnel(floor_ptr, x2, i);
+ create_cata_tunnel(player_ptr, x2, i);
}
}
}
{
x = x2;
y = i;
- if (!set_tunnel(floor_ptr, &x, &y, TRUE))
+ if (!set_tunnel(player_ptr, &x, &y, TRUE))
{
/* solid wall - so try to go around */
- short_seg_hack(floor_ptr, x, y, x2, i - 1, 1, count, fail);
- short_seg_hack(floor_ptr, x, y, x2, i + 1, 1, count, fail);
+ short_seg_hack(player_ptr, x, y, x2, i - 1, 1, count, fail);
+ short_seg_hack(player_ptr, x, y, x2, i + 1, 1, count, fail);
}
if ((type == 3) && ((x + y) % 2))
{
- create_cata_tunnel(floor_ptr, x2, i);
+ create_cata_tunnel(player_ptr, x2, i);
}
}
}
* Note it is VERY important that the "stop if hit another passage" logic\n
* stays as is. Without this the dungeon turns into Swiss Cheese...\n
*/
-bool build_tunnel2(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff)
+bool build_tunnel2(player_type *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff)
{
POSITION x3, y3, dx, dy;
POSITION changex, changey;
grid_type *g_ptr;
length = distance(x1, y1, x2, y2);
-
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (length > cutoff)
{
/*
if (i == 0)
{
/* Failed for some reason: hack - ignore the solidness */
- place_outer_bold(floor_ptr, y3, x3);
+ place_outer_bold(player_ptr, y3, x3);
dx = 0;
dy = 0;
}
if (is_floor_grid(g_ptr))
{
- if (build_tunnel2(floor_ptr, x1, y1, x3, y3, type, cutoff))
+ if (build_tunnel2(player_ptr, x1, y1, x3, y3, type, cutoff))
{
if ((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(floor_ptr, x3, y3, x2, y2, type, cutoff);
+ retval = build_tunnel2(player_ptr, x3, y3, x2, y2, type, cutoff);
}
else
{
else
{
/* tunnel through walls */
- if (build_tunnel2(floor_ptr, x1, y1, x3, y3, type, cutoff))
+ if (build_tunnel2(player_ptr, x1, y1, x3, y3, type, cutoff))
{
- retval = build_tunnel2(floor_ptr, x3, y3, x2, y2, type, cutoff);
+ retval = build_tunnel2(player_ptr, x3, y3, x2, y2, type, cutoff);
firstsuccede = TRUE;
}
else
if (firstsuccede)
{
/* only do this if the first half has worked */
- set_tunnel(floor_ptr, &x3, &y3, TRUE);
+ set_tunnel(player_ptr, &x3, &y3, TRUE);
}
/* return value calculated above */
return retval;
{
/* Do a short segment */
retval = TRUE;
- short_seg_hack(floor_ptr, x1, y1, x2, y2, type, 0, &retval);
+ short_seg_hack(player_ptr, x1, y1, x2, y2, type, 0, &retval);
/* Hack - ignore return value so avoid infinite loops */
return TRUE;
extern void clear_cave(player_type *player_ptr);
extern void generate_floor(player_type *player_ptr);
-extern bool build_tunnel(floor_type *floor_ptr, POSITION row1, POSITION col1, POSITION row2, POSITION col2);
-extern bool build_tunnel2(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff);
+extern bool build_tunnel(player_type *player_ptr, POSITION row1, POSITION col1, POSITION row2, POSITION col2);
+extern bool build_tunnel2(player_type *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff);
for (x = 0; x < MAX_WID; x++)
{
/* Create "solid" perma-wall */
- place_solid_perm_bold(creature_ptr->current_floor_ptr, y, x);
+ place_solid_perm_bold(creature_ptr, y, x);
}
}
creature_ptr->x = creature_ptr->current_floor_ptr->width / 2;
/* Give one square */
- place_floor_bold(creature_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x);
+ place_floor_bold(creature_ptr, creature_ptr->y, creature_ptr->x);
wipe_generate_random_floor_flags(creature_ptr->current_floor_ptr);
}
(void)COPY(&party_mon[0], m_ptr, monster_type);
/* Delete from this floor */
- delete_monster_idx(master_ptr->riding);
+ delete_monster_idx(master_ptr, master_ptr->riding);
}
}
num++;
/* Delete from this floor */
- delete_monster_idx(i);
+ delete_monster_idx(master_ptr, i);
}
}
msg_format(_("%sは消え去った!", "%^s disappears!"), m_name);
}
- delete_monster_idx(i);
+ delete_monster_idx(master_ptr, i);
}
}
}
(r_ptr->flags7 & RF7_NAZGUL)) continue;
/* Delete non-unique quest monsters */
- delete_monster_idx(i);
+ delete_monster_idx(creature_ptr, i);
}
/* Check if there is a same item */
if (r_ptr->floor_id != new_floor_id)
{
/* Disapper from here */
- delete_monster_idx(i);
+ delete_monster_idx(creature_ptr, i);
}
}
if (g_ptr->m_idx && !(have_flag(streamer_ptr->flags, FF_PLACE) && monster_can_cross_terrain(feat, &r_info[floor_ptr->m_list[g_ptr->m_idx].r_idx], 0)))
{
/* Delete the monster (if any) */
- delete_monster(floor_ptr, ty, tx);
+ delete_monster(player_ptr, ty, tx);
}
if (g_ptr->o_idx && !have_flag(streamer_ptr->flags, FF_DROP))
floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_DOORS)
{
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
return;
}
set_cave_feat(floor_ptr, y, x, feat_locked_door_random((d_info[player_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR));
floor_ptr->grid_array[y][x].info &= ~(CAVE_FLOOR);
- delete_monster(floor_ptr, y, x);
+ delete_monster(player_ptr, y, x);
}
floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_DOORS)
{
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
return;
}
}
g_ptr->info &= ~(CAVE_FLOOR);
- delete_monster(floor_ptr, y, x);
+ delete_monster(player_ptr, y, x);
}
static int scent_when = 0;
place_secret_door(player_ptr, y, x, DOOR_DEFAULT);
/* set boundarys so don't get wide doors */
- place_solid_bold(floor_ptr, y, x - 1);
- place_solid_bold(floor_ptr, y, x + 1);
+ place_solid_bold(player_ptr, y, x - 1);
+ place_solid_bold(player_ptr, y, x + 1);
}
/* look at:
place_secret_door(player_ptr, y, x, DOOR_DEFAULT);
/* set boundarys so don't get wide doors */
- place_solid_bold(floor_ptr, y - 1, x);
- place_solid_bold(floor_ptr, y + 1, x);
+ place_solid_bold(player_ptr, y - 1, x);
+ place_solid_bold(player_ptr, y + 1, x);
}
}
if (d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_DOORS)
{
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
return;
}
if (tmp >= 400)
{
- delete_monster(floor_ptr, y, x);
+ delete_monster(player_ptr, y, x);
return;
}
}
else
{
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
}
- delete_monster(floor_ptr, y, x);
+ delete_monster(player_ptr, y, x);
}
floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_DOORS)
{
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
return;
}
if (feat == feat_none)
{
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
return;
}
/*!
* @brief 指定のマスを床地形に変える / Set a square to be floor. (Includes range checking.)
+ * @param player_ptr プレーヤーへの参照ポインタ
* @param x 地形を変えたいマスのX座標
* @param y 地形を変えたいマスのY座標
* @return なし
*/
-void set_floor(floor_type *floor_ptr, POSITION x, POSITION y)
+void set_floor(player_type *player_ptr, POSITION x, POSITION y)
{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (!in_bounds(floor_ptr, y, x))
{
/* Out of bounds */
/* Set to be floor if is a wall (don't touch lakes). */
if (is_extra_bold(floor_ptr, y, x))
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
}
/*!
* @brief 指定位置に存在するモンスターを削除する / Delete the monster, if any, at a given location
+ * @param player_ptr プレーヤーへの参照ポインタ
* @param x 削除位置x座標
* @param y 削除位置y座標
* @return なし
*/
-void delete_monster(floor_type *floor_ptr, POSITION y, POSITION x)
+void delete_monster(player_type *player_ptr, POSITION y, POSITION x)
{
grid_type *g_ptr;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (!in_bounds(floor_ptr, y, x)) return;
/* Check the grid */
g_ptr = &floor_ptr->grid_array[y][x];
/* Delete the monster (if any) */
- if (g_ptr->m_idx) delete_monster_idx(g_ptr->m_idx);
+ if (g_ptr->m_idx) delete_monster_idx(player_ptr, g_ptr->m_idx);
}
#define PROJECT_LOS 0x8000 /*!< 遠隔攻撃特性: / */
extern sint project_path(player_type *player_ptr, u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg);
-extern void set_floor(floor_type *floor_ptr, POSITION x, POSITION y);
+extern void set_floor(player_type *player_ptr, POSITION x, POSITION y);
extern void place_object(player_type *owner_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
extern void place_gold(floor_type *floor_ptr, POSITION y, POSITION x);
-extern void delete_monster(floor_type *floor_ptr, POSITION y, POSITION x);
+extern void delete_monster(player_type *player_ptr, POSITION y, POSITION x);
extern void compact_objects(player_type *owner_ptr, int size);
extern void vault_traps(player_type *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd, int num);
extern void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
#define MONSTER_FLOW_DEPTH 32 /*!< 敵のプレイヤーに対する移動道のりの最大値(この値以上は処理を打ち切る) / OPTION: Maximum flow depth when using "MONSTER_FLOW" */
-/*
- * Feature action flags
- */
+ /*
+ * Feature action flags
+ */
#define FAF_DESTROY 0x01
#define FAF_NO_DROP 0x02
#define FAF_CRASH_GLASS 0x04
-/*!
- * @brief 地形状態フラグテーブル /
- * The table of features' actions
- */
+ /*!
+ * @brief 地形状態フラグテーブル /
+ * The table of features' actions
+ */
static const byte feature_action_flags[FF_FLAG_MAX] =
{
0, /* LOS */
* @param g_ptr 永久壁を配置したいマス構造体の参照ポインタ
* @return なし
*/
-void place_bound_perm_wall(grid_type *g_ptr)
+void place_bound_perm_wall(player_type *player_ptr, grid_type *g_ptr)
{
if (bound_walls_perm)
{
}
/* Add "solid" perma-wall */
- place_grid(g_ptr, solid_perm);
+ place_grid(player_ptr, g_ptr, solid_perm);
}
/*!
* Oh, and outside of the "torch radius", only "lite" grids need to be scanned.
*/
-/*
- * Hack - speed up the update_flow algorithm by only doing
- * it everytime the player moves out of LOS of the last
- * "way-point".
- */
+ /*
+ * Hack - speed up the update_flow algorithm by only doing
+ * it everytime the player moves out of LOS of the last
+ * "way-point".
+ */
static POSITION flow_x = 0;
static POSITION flow_y = 0;
}
-void place_grid(grid_type *g_ptr, place_grid_type pg_type)
+void place_grid(player_type *player_ptr, grid_type *g_ptr, place_grid_type pg_type)
{
switch (pg_type)
{
}
g_ptr->info &= ~(CAVE_MASK);
- if (g_ptr->m_idx > 0) delete_monster_idx(g_ptr->m_idx);
+ if (g_ptr->m_idx > 0) delete_monster_idx(player_ptr, g_ptr->m_idx);
}
return ((g_ptr->info & (CAVE_VIEW | CAVE_LITE | CAVE_MNLT | CAVE_MNDK)) == (CAVE_VIEW | CAVE_MNDK)) &&
!player_ptr->see_nocto;
}
+
+
+void place_floor_bold(player_type *player_ptr, POSITION y, POSITION x)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ set_cave_feat(floor_ptr, y, x, feat_ground_type[randint0(100)]);
+ floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
+ add_cave_info(floor_ptr, y, x, CAVE_FLOOR);
+ delete_monster(player_ptr, y, x);
+}
+
+
+void place_extra_bold(player_type *player_ptr, POSITION y, POSITION x)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ set_cave_feat(floor_ptr, y, x, feat_wall_type[randint0(100)]);
+ floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
+ add_cave_info(floor_ptr, y, x, CAVE_EXTRA);
+ delete_monster(player_ptr, y, x);
+}
+
+
+void place_extra_perm_bold(player_type *player_ptr, POSITION y, POSITION x)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ set_cave_feat(floor_ptr, y, x, feat_permanent);
+ floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
+ add_cave_info(floor_ptr, y, x, CAVE_EXTRA);
+ delete_monster(player_ptr, y, x);
+}
+
+
+void place_inner_bold(player_type *player_ptr, POSITION y, POSITION x)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ set_cave_feat(floor_ptr, y, x, feat_wall_inner);
+ floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
+ add_cave_info(floor_ptr, y, x, CAVE_INNER);
+ delete_monster(player_ptr, y, x);
+}
+
+
+void place_inner_perm_bold(player_type *player_ptr, POSITION y, POSITION x)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ set_cave_feat(floor_ptr, y, x, feat_permanent);
+ floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
+ add_cave_info(floor_ptr, y, x, CAVE_INNER);
+ delete_monster(player_ptr, y, x);
+}
+
+
+void place_outer_bold(player_type *player_ptr, POSITION y, POSITION x)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ set_cave_feat(floor_ptr, y, x, feat_wall_outer);
+ floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
+ add_cave_info(floor_ptr, y, x, CAVE_OUTER);
+ delete_monster(player_ptr, y, x);
+}
+
+
+void place_outer_noperm_bold(player_type *player_ptr, POSITION y, POSITION x)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ feature_type *_f_ptr = &f_info[feat_wall_outer];
+ if (permanent_wall(_f_ptr)) set_cave_feat(floor_ptr, y, x, (s16b)feat_state(feat_wall_outer, FF_UNPERM));
+ else set_cave_feat(floor_ptr, y, x, feat_wall_outer);
+ floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
+ add_cave_info(floor_ptr, y, x, (CAVE_OUTER | CAVE_VAULT));
+ delete_monster(player_ptr, y, x);
+}
+
+
+void place_solid_bold(player_type *player_ptr, POSITION y, POSITION x)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ set_cave_feat(floor_ptr, y, x, feat_wall_solid);
+ floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
+ add_cave_info(floor_ptr, y, x, CAVE_SOLID);
+ delete_monster(player_ptr, y, x);
+}
+
+
+void place_solid_perm_bold(player_type *player_ptr, POSITION y, POSITION x)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ set_cave_feat(floor_ptr, y, x, feat_permanent);
+ floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
+ add_cave_info(floor_ptr, y, x, CAVE_SOLID);
+ delete_monster(player_ptr, y, x);
+}
+
+
+void place_solid_noperm_bold(player_type *player_ptr, POSITION y, POSITION x)
+{
+ feature_type *_f_ptr = &f_info[feat_wall_solid];
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ if ((floor_ptr->grid_array[y][x].info & CAVE_VAULT) && permanent_wall(_f_ptr))
+ set_cave_feat(floor_ptr, y, x, feat_state(feat_wall_solid, FF_UNPERM));
+ else set_cave_feat(floor_ptr, y, x, feat_wall_solid);
+ floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
+ add_cave_info(floor_ptr, y, x, CAVE_SOLID);
+ delete_monster(player_ptr, y, x);
+}
#define is_outer_grid(C) ((C)->info & CAVE_OUTER)
#define is_solid_grid(C) ((C)->info & CAVE_SOLID)
-#define place_floor_bold(F, Y, X) \
-{ \
- set_cave_feat((F), Y,X,feat_ground_type[randint0(100)]); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y,X,CAVE_FLOOR); \
- delete_monster(F, Y, X); \
-}
-
-#define place_extra_bold(F, Y, X) \
-{ \
- set_cave_feat((F), Y,X,feat_wall_type[randint0(100)]); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y,X,CAVE_EXTRA); \
- delete_monster(F, Y, X); \
-}
-
-#define place_extra_perm_bold(F, Y, X) \
-{ \
- set_cave_feat(F, Y, X,feat_permanent); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info(F, Y, X, CAVE_EXTRA); \
- delete_monster(F, Y, X); \
-}
-
-#define place_extra_noperm_bold(F, Y, X) \
-{ \
- feature_type *_f_ptr; \
- set_cave_feat((F), Y,X,feat_wall_type[randint0(100)]); \
- _f_ptr = &f_info[(F)->grid_array[Y][X].feat]; \
- if (permanent_wall(_f_ptr)) (F)->grid_array[Y][X].feat = feat_state((F)->grid_array[Y][X].feat, FF_UNPERM); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y, X, CAVE_EXTRA); \
- delete_monster(Y, X); \
-}
-
-#define place_inner_bold(F, Y, X) \
-{ \
- set_cave_feat((F), Y, X, feat_wall_inner); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y, X, CAVE_INNER); \
- delete_monster(F, Y, X); \
-}
-
-#define place_inner_perm_bold(F, Y, X) \
-{ \
- set_cave_feat(F, Y,X,feat_permanent); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y,X,CAVE_INNER); \
- delete_monster(F, Y, X); \
-}
-
-#define place_outer_bold(F, Y, X) \
-{ \
- set_cave_feat((F), Y, X, feat_wall_outer); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y,X,CAVE_OUTER); \
- delete_monster(F, Y, X); \
-}
-
-#define place_outer_perm_bold(F, Y, X) \
-{ \
- set_cave_feat(F, Y, X, feat_permanent); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y,X,CAVE_OUTER); \
- delete_monster(F, Y, X); \
-}
-
-#define place_outer_noperm_bold(F, Y, X) \
-{ \
- feature_type *_f_ptr = &f_info[feat_wall_outer]; \
- if (permanent_wall(_f_ptr)) set_cave_feat((F), Y, X, (s16b)feat_state(feat_wall_outer, FF_UNPERM)); \
- else set_cave_feat((F), Y,X,feat_wall_outer); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y,X,(CAVE_OUTER | CAVE_VAULT)); \
- delete_monster(F, Y, X); \
-}
-
-#define place_solid_bold(F, Y, X) \
-{ \
- set_cave_feat(F,Y,X,feat_wall_solid); \
- F->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info(F,Y,X,CAVE_SOLID); \
- delete_monster(F, Y, X); \
-}
-
-#define place_solid_perm_bold(F, Y, X) \
-{ \
- set_cave_feat(F, Y, X, feat_permanent); \
- F->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info(F, Y, X, CAVE_SOLID); \
- delete_monster(F, Y, X); \
-}
-
-#define place_solid_noperm_bold(F, Y, X) \
-{ \
- feature_type *_f_ptr = &f_info[feat_wall_solid]; \
- if ((F->grid_array[Y][X].info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
- set_cave_feat(F, Y, X, feat_state(feat_wall_solid, FF_UNPERM)); \
- else set_cave_feat(F, Y, X, feat_wall_solid); \
- F->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info(F, Y, X, CAVE_SOLID); \
- delete_monster(F, Y, X); \
-}
-
-
/*
* 特殊なマス状態フラグ / Special grid flags
*/
#define MAX_DOOR_TYPES 3
-extern void place_bound_perm_wall(grid_type *g_ptr);
+extern void place_bound_perm_wall(player_type *player_ptr, grid_type *g_ptr);
extern bool is_known_trap(grid_type *g_ptr);
extern bool is_hidden_door(grid_type *g_ptr);
solid_perm
} place_grid_type;
-extern void place_grid(grid_type *g_ptr, place_grid_type pg_type);
+extern void place_grid(player_type *player_ptr, grid_type *g_ptr, place_grid_type pg_type);
extern bool darkened_grid(player_type *player_ptr, grid_type *g_ptr);
+extern void delete_monster(player_type *player_ptr, POSITION y, POSITION x);
+void place_floor_bold(player_type *player_ptr, POSITION y, POSITION x);
+void place_extra_bold(player_type *player_ptr, POSITION y, POSITION x);
+void place_extra_perm_bold(player_type *player_ptr, POSITION y, POSITION x);
+void place_inner_bold(player_type *player_ptr, POSITION y, POSITION x);
+void place_inner_perm_bold(player_type *player_ptr, POSITION y, POSITION x);
+void place_outer_bold(player_type *player_ptr, POSITION y, POSITION x);
+void place_outer_noperm_bold(player_type *player_ptr, POSITION y, POSITION x);
+void place_solid_bold(player_type *player_ptr, POSITION y, POSITION x);
+void place_solid_perm_bold(player_type *player_ptr, POSITION y, POSITION x);
+void place_solid_noperm_bold(player_type *player_ptr, POSITION y, POSITION x);
/*
* Get feature mimic from f_info[] (applying "mimic" field)
exe_write_diary(target_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_LOSE_PARENT, m_name);
}
- delete_monster_idx(m_idx);
+ delete_monster_idx(target_ptr, m_idx);
return;
}
/* Generate treasure, etc */
monster_death(target_ptr, m_idx, FALSE);
- delete_monster_idx(m_idx);
+ delete_monster_idx(target_ptr, m_idx);
if (sad)
{
msg_print(_("少しの間悲しい気分になった。", "You feel sad for a moment."));
}
check_quest_completion(target_ptr, m_ptr);
- delete_monster_idx(m_idx);
+ delete_monster_idx(target_ptr, m_idx);
return;
}
}
POSITION dummy_x = m_ptr->fx;
BIT_FLAGS mode = 0L;
if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
- delete_monster_idx(m_idx);
+ delete_monster_idx(target_ptr, m_idx);
if (summon_named_creature(target_ptr, 0, dummy_y, dummy_x, MON_BIKETAL, mode))
{
msg_print(_("「ハァッハッハッハ!!私がバイケタルだ!!」", "Uwa-hahaha! *I* am Biketal!"));
}
else
{
- delete_monster_idx(m_idx);
+ delete_monster_idx(target_ptr, m_idx);
}
get_exp_from_mon(target_ptr, (long)exp_mon.max_maxhp * 2, &exp_mon);
extern void reset_target(monster_type *m_ptr);
extern monster_race *real_r_ptr(monster_type *m_ptr);
extern MONRACE_IDX real_r_idx(monster_type *m_ptr);
-extern void delete_monster_idx(MONSTER_IDX i);
+extern void delete_monster_idx(player_type *player_ptr, MONSTER_IDX i);
extern void compact_monsters(player_type *player_ptr, int size);
extern void wipe_monsters_list(player_type *player_ptr);
extern MONSTER_IDX m_pop(player_type *player_ptr);
* モンスターを削除するとそのモンスターが拾っていたアイテムも同時に削除される。 /
* When a monster is deleted, all of its objects are deleted.
*/
-void delete_monster_idx(MONSTER_IDX i)
+void delete_monster_idx(player_type *player_ptr, MONSTER_IDX i)
{
- floor_type *floor_ptr = p_ptr->current_floor_ptr;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
monster_type *m_ptr = &floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Hack -- count the number of "reproducers" */
if (r_ptr->flags2 & (RF2_MULTIPLY)) floor_ptr->num_repro--;
- if (MON_CSLEEP(m_ptr)) (void)set_monster_csleep(p_ptr, i, 0);
- if (MON_FAST(m_ptr)) (void)set_monster_fast(p_ptr, i, 0);
- if (MON_SLOW(m_ptr)) (void)set_monster_slow(p_ptr, i, 0);
- if (MON_STUNNED(m_ptr)) (void)set_monster_stunned(p_ptr, i, 0);
- if (MON_CONFUSED(m_ptr)) (void)set_monster_confused(p_ptr, i, 0);
- if (MON_MONFEAR(m_ptr)) (void)set_monster_monfear(p_ptr, i, 0);
- if (MON_INVULNER(m_ptr)) (void)set_monster_invulner(p_ptr, i, 0, FALSE);
+ if (MON_CSLEEP(m_ptr)) (void)set_monster_csleep(player_ptr, i, 0);
+ if (MON_FAST(m_ptr)) (void)set_monster_fast(player_ptr, i, 0);
+ if (MON_SLOW(m_ptr)) (void)set_monster_slow(player_ptr, i, 0);
+ if (MON_STUNNED(m_ptr)) (void)set_monster_stunned(player_ptr, i, 0);
+ if (MON_CONFUSED(m_ptr)) (void)set_monster_confused(player_ptr, i, 0);
+ if (MON_MONFEAR(m_ptr)) (void)set_monster_monfear(player_ptr, i, 0);
+ if (MON_INVULNER(m_ptr)) (void)set_monster_invulner(player_ptr, i, 0, FALSE);
/* Hack -- remove target monster */
if (i == target_who) target_who = 0;
/* Hack -- remove tracked monster */
- if (i == p_ptr->health_who) health_track(p_ptr, 0);
+ if (i == player_ptr->health_who) health_track(player_ptr, 0);
- if (p_ptr->pet_t_m_idx == i) p_ptr->pet_t_m_idx = 0;
- if (p_ptr->riding_t_m_idx == i) p_ptr->riding_t_m_idx = 0;
- if (p_ptr->riding == i) p_ptr->riding = 0;
+ if (player_ptr->pet_t_m_idx == i) player_ptr->pet_t_m_idx = 0;
+ if (player_ptr->riding_t_m_idx == i) player_ptr->riding_t_m_idx = 0;
+ if (player_ptr->riding == i) player_ptr->riding = 0;
/* Monster is gone */
floor_ptr->grid_array[y][x].m_idx = 0;
lite_spot(y, x);
if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
{
- p_ptr->update |= (PU_MON_LITE);
+ player_ptr->update |= (PU_MON_LITE);
}
}
exe_write_diary(player_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_COMPACT, m_name);
}
- delete_monster_idx(i);
+ delete_monster_idx(player_ptr, i);
num++;
}
}
if (floor_ptr->inside_arena || target_ptr->phase_out || !summon_possible(target_ptr, m_ptr->fy, m_ptr->fx))
return -1;
- delete_monster_idx(floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].m_idx);
+ delete_monster_idx(target_ptr, floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].m_idx);
summon_named_creature(target_ptr, 0, dummy_y, dummy_x, MON_BANOR, mode);
floor_ptr->m_list[hack_m_idx_ii].hp = dummy_hp;
floor_ptr->m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
dummy_y = floor_ptr->m_list[k].fy;
dummy_x = floor_ptr->m_list[k].fx;
}
- delete_monster_idx(k);
+ delete_monster_idx(target_ptr, k);
}
}
summon_named_creature(target_ptr, 0, dummy_y, dummy_x, MON_BANORLUPART, mode);
exe_write_diary(creature_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name);
}
/* Delete the monster, rather than killing it. */
- delete_monster_idx(g_ptr->m_idx);
+ delete_monster_idx(creature_ptr, g_ptr->m_idx);
msg_print(_("その邪悪なモンスターは硫黄臭い煙とともに消え去った!", "The evil creature vanishes in a puff of sulfurous smoke!"));
}
FEAT_IDX j;
ugbldg_type *cur_ugbldg;
- floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (i = 0; i < n; i++)
{
cur_ugbldg = &ugbldg[i];
/* Generate new room */
- generate_room_floor(floor_ptr,
+ generate_room_floor(player_ptr,
ltcy + cur_ugbldg->y0 - 2, ltcx + cur_ugbldg->x0 - 2,
ltcy + cur_ugbldg->y1 + 2, ltcx + cur_ugbldg->x1 + 2,
FALSE);
cur_ugbldg = &ugbldg[i];
/* Build an invulnerable rectangular building */
- generate_fill_perm_bold(floor_ptr,
+ generate_fill_perm_bold(player_ptr,
ltcy + cur_ugbldg->y0, ltcx + cur_ugbldg->x0,
ltcy + cur_ugbldg->y1, ltcx + cur_ugbldg->x1);
}
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &yval, &xval, town_hgt + 4, town_wid + 4))
+ if (!find_space(player_ptr, &yval, &xval, town_hgt + 4, town_wid + 4))
{
/* Free buildings array */
C_KILL(ugbldg, n, ugbldg_type);
x1 = xval - (town_wid / 2);
/* Generate new room */
- generate_room_floor(floor_ptr,
+ generate_room_floor(player_ptr,
y1 + town_hgt / 3, x1 + town_wid / 3,
y1 + town_hgt * 2 / 3, x1 + town_wid * 2 / 3, FALSE);
return TRUE;
}
-
/* Find and reserve some space in the dungeon. Get center of room. */
floor_type *floor_ptr = player_ptr->current_floor_ptr;
- if (!find_space(floor_ptr, &y0, &x0, ysize + 1, xsize + 1))
+ if (!find_space(player_ptr, &y0, &x0, ysize + 1, xsize + 1))
{
/* Limit to the minimum room size, and retry */
xsize = 8;
ysize = 8;
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &y0, &x0, ysize + 1, xsize + 1))
+ if (!find_space(player_ptr, &y0, &x0, ysize + 1, xsize + 1))
{
/*
* Still no space?!
generate_hmap(floor_ptr, y0, x0, xsize, ysize, grd, roug, cutoff);
/* Convert to normal format + clean up */
- done = generate_fracave(floor_ptr, y0, x0, xsize, ysize, cutoff, light, room);
+ done = generate_fracave(player_ptr, y0, x0, xsize, ysize, cutoff, light, room);
}
return TRUE;
ysize = y1 + y2 + 1;
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &yval, &xval, ysize + 2, xsize + 2))
+ if (!find_space(player_ptr, &yval, &xval, ysize + 2, xsize + 2))
{
/* Limit to the minimum room size, and retry */
y1 = 1;
ysize = y1 + y2 + 1;
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &yval, &xval, ysize + 2, xsize + 2)) return FALSE;
+ if (!find_space(player_ptr, &yval, &xval, ysize + 2, xsize + 2)) return FALSE;
}
/* Choose lite or dark */
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
}
for (y = y1 - 1; y <= y2 + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1 - 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y][x2 + 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1 - 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y2 + 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1; x <= x2; x += 2)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
}
}
if ((y1 + 4 < y2) && (x1 + 4 < x2))
{
g_ptr = &floor_ptr->grid_array[y1 + 1][x1 + 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y1 + 1][x2 - 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y2 - 1][x1 + 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y2 - 1][x2 - 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
}
for (y = y1 + 2; y <= y2 - 2; y += 2)
{
g_ptr = &floor_ptr->grid_array[y][x1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y][x2];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
for (x = x1 + 2; x <= x2 - 2; x += 2)
{
g_ptr = &floor_ptr->grid_array[y1][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y2][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
}
/* Hack -- Occasional divided room */
/* Horizontal wall */
for (x = x1; x <= x2; x++)
{
- place_inner_bold(floor_ptr, yval, x);
+ place_inner_bold(player_ptr, yval, x);
if (curtain2) floor_ptr->grid_array[yval][x].feat = feat_door[DOOR_CURTAIN].closed;
}
/* Prevent edge of wall from being tunneled */
- place_solid_bold(floor_ptr, yval, x1 - 1);
- place_solid_bold(floor_ptr, yval, x2 + 1);
+ place_solid_bold(player_ptr, yval, x1 - 1);
+ place_solid_bold(player_ptr, yval, x2 + 1);
}
else
{
/* Vertical wall */
for (y = y1; y <= y2; y++)
{
- place_inner_bold(floor_ptr, y, xval);
+ place_inner_bold(player_ptr, y, xval);
if (curtain2) floor_ptr->grid_array[y][xval].feat = feat_door[DOOR_CURTAIN].closed;
}
/* Prevent edge of wall from being tunneled */
- place_solid_bold(floor_ptr, y1 - 1, xval);
- place_solid_bold(floor_ptr, y2 + 1, xval);
+ place_solid_bold(player_ptr, y1 - 1, xval);
+ place_solid_bold(player_ptr, y2 + 1, xval);
}
place_random_door(player_ptr, yval, xval, TRUE);
/*!
* @brief タイプ2の部屋…二重長方形の部屋を生成する / Type 2 -- Overlapping rectangular rooms
+* @param player_ptr プレーヤーへの参照ポインタ
* @return なし
*/
-bool build_type2(floor_type *floor_ptr)
+bool build_type2(player_type *player_ptr)
{
POSITION y, x, xval, yval;
POSITION y1a, x1a, y2a, x2a;
grid_type *g_ptr;
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &yval, &xval, 11, 25)) return FALSE;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ if (!find_space(player_ptr, &yval, &xval, 11, 25)) return FALSE;
/* Choose lite or dark */
light = ((floor_ptr->dun_level <= randint1(25)) && !(d_info[floor_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
for (x = x1a - 1; x <= x2a + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
}
for (x = x1b - 1; x <= x2b + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
}
for (y = y1a - 1; y <= y2a + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1a - 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y][x2a + 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1a - 1; x <= x2a + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1a - 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y2a + 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
/* Place the walls around room "b" */
for (y = y1b - 1; y <= y2b + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1b - 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y][x2b + 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1b - 1; x <= x2b + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1b - 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y2b + 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1a; x <= x2a; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
}
}
for (x = x1b; x <= x2b; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
}
}
/* Find and reserve some space in the dungeon. Get center of room. */
floor_type *floor_ptr = player_ptr->current_floor_ptr;
- if (!find_space(floor_ptr, &yval, &xval, 11, 25)) return FALSE;
+ if (!find_space(player_ptr, &yval, &xval, 11, 25)) return FALSE;
/* Choose lite or dark */
for (x = x1a - 1; x <= x2a + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
}
for (x = x1b - 1; x <= x2b + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
}
for (y = y1a - 1; y <= y2a + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1a - 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y][x2a + 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1a - 1; x <= x2a + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1a - 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y2a + 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
/* Place the walls around room "b" */
for (y = y1b - 1; y <= y2b + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1b - 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y][x2b + 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1b - 1; x <= x2b + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1b - 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y2b + 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1a; x <= x2a; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
}
}
for (x = x1b; x <= x2b; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
}
}
for (x = x1a; x <= x2a; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
}
break;
for (y = y1b; y <= y2b; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1a];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y][x2a];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
for (x = x1a; x <= x2a; x++)
{
g_ptr = &floor_ptr->grid_array[y1b][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y2b][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
/* Place a secret door on the inner room */
{
if (y == yval) continue;
g_ptr = &floor_ptr->grid_array[y][x1a - 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y][x2a + 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
/* Pinch the north/south sides */
{
if (x == xval) continue;
g_ptr = &floor_ptr->grid_array[y1b - 1][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y2b + 1][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
/* Sometimes shut using secret doors */
else if (one_in_(3))
{
g_ptr = &floor_ptr->grid_array[yval][xval];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y1b][xval];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y2b][xval];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[yval][x1a];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[yval][x2a];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
/* Occasionally put a pillar in the center */
else if (one_in_(3))
{
g_ptr = &floor_ptr->grid_array[yval][xval];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
break;
/* Find and reserve some space in the dungeon. Get center of room. */
floor_type *floor_ptr = player_ptr->current_floor_ptr;
- if (!find_space(floor_ptr, &yval, &xval, 11, 25)) return FALSE;
+ if (!find_space(player_ptr, &yval, &xval, 11, 25)) return FALSE;
/* Choose lite or dark */
light = ((floor_ptr->dun_level <= randint1(25)) && !(d_info[floor_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
}
for (y = y1 - 1; y <= y2 + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1 - 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y][x2 + 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1 - 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y2 + 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (y = y1 - 1; y <= y2 + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1 - 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y][x2 + 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1 - 1][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y2 + 1][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
{
if ((x == xval) && (y == yval)) continue;
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
}
for (x = xval - 1; x <= xval + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
}
for (x = xval - 5 - tmp; x <= xval - 3 - tmp; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
for (x = xval + 3 + tmp; x <= xval + 5 + tmp; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
}
}
for (x = xval - 5; x <= xval + 5; x++)
{
g_ptr = &floor_ptr->grid_array[yval - 1][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[yval + 1][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
/* Close off the left/right edges */
g_ptr = &floor_ptr->grid_array[yval][xval - 5];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[yval][xval + 5];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
/* Secret doors (random top/bottom) */
place_secret_door(player_ptr, yval - 3 + (randint1(2) * 2), xval - 3, door_type);
if (0x1 & (x + y))
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
}
}
for (y = y1; y <= y2; y++)
{
g_ptr = &floor_ptr->grid_array[y][xval];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
for (x = x1; x <= x2; x++)
{
g_ptr = &floor_ptr->grid_array[yval][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
/* Doors into the rooms */
/*!
* @brief タイプ11の部屋…円形部屋の生成 / Type 11 -- Build an vertical oval room.
+* @param player_ptr プレーヤーへの参照ポインタ
* @return なし
* @details
* For every grid in the possible square, check the distance.\n
*\n
* When done fill from the inside to find the walls,\n
*/
-bool build_type11(floor_type *floor_ptr)
+bool build_type11(player_type *player_ptr)
{
POSITION rad, x, y, x0, y0;
int light = FALSE;
/* Occasional light */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if ((randint1(floor_ptr->dun_level) <= 15) && !(d_info[floor_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
rad = randint0(9);
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &y0, &x0, rad * 2 + 1, rad * 2 + 1)) return FALSE;
+ if (!find_space(player_ptr, &y0, &x0, rad * 2 + 1, rad * 2 + 1)) return FALSE;
/* Make circular floor */
for (x = x0 - rad; x <= x0 + rad; x++)
if (distance(y0, x0, y, x) <= rad - 1)
{
/* inside- so is floor */
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
}
else if (distance(y0, x0, y, x) <= rad + 1)
{
/* make granite outside so arena works */
- place_extra_bold(floor_ptr, y, x);
+ place_extra_bold(player_ptr, y, x);
}
}
}
/* Find visible outer walls and set to be FEAT_OUTER */
- add_outer_wall(floor_ptr, x0, y0, light, x0 - rad, y0 - rad, x0 + rad, y0 + rad);
+ add_outer_wall(player_ptr, x0, y0, light, x0 - rad, y0 - rad, x0 + rad, y0 + rad);
return TRUE;
}
rad = randint1(9);
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &y0, &x0, rad * 2 + 3, rad * 2 + 3)) return FALSE;
+ if (!find_space(player_ptr, &y0, &x0, rad * 2 + 3, rad * 2 + 3)) return FALSE;
/* Make floor */
for (x = x0 - rad; x <= x0 + rad; x++)
if (dist2(y0, x0, y, x, h1, h2, h3, h4) <= rad - 1)
{
/* inside - so is floor */
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
}
else if (distance(y0, x0, y, x) < 3)
{
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
}
else
{
/* make granite outside so arena works */
- place_extra_bold(floor_ptr, y, x);
+ place_extra_bold(player_ptr, y, x);
}
/* proper boundary for arena */
if (((y + rad) == y0) || ((y - rad) == y0) ||
((x + rad) == x0) || ((x - rad) == x0))
{
- place_extra_bold(floor_ptr, y, x);
+ place_extra_bold(player_ptr, y, x);
}
}
}
/* Find visible outer walls and set to be FEAT_OUTER */
- add_outer_wall(floor_ptr, x0, y0, light, x0 - rad - 1, y0 - rad - 1, x0 + rad + 1, y0 + rad + 1);
+ add_outer_wall(player_ptr, x0, y0, light, x0 - rad - 1, y0 - rad - 1, x0 + rad + 1, y0 + rad + 1);
/* Check to see if there is room for an inner vault */
for (x = x0 - 2; x <= x0 + 2; x++)
extern bool build_type1(player_type *player_ptr);
-extern bool build_type2(floor_type *floor_ptr);
+extern bool build_type2(player_type *player_ptr);
extern bool build_type3(player_type *player_ptr);
extern bool build_type4(player_type *player_ptr);
-extern bool build_type11(floor_type *floor_ptr);
+extern bool build_type11(player_type *player_ptr);
extern bool build_type12(player_type *player_ptr);
}
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &yval, &xval, 11, 25)) return FALSE;
+ if (!find_space(player_ptr, &yval, &xval, 11, 25)) return FALSE;
/* Large room */
y1 = yval - 4;
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
g_ptr->info |= (CAVE_ROOM);
}
}
for (y = y1 - 1; y <= y2 + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1 - 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y][x2 + 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1 - 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y2 + 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (y = y1 - 1; y <= y2 + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1 - 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y][x2 + 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1 - 1][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y2 + 1][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
for (y = y1; y <= y2; y++)
{
}
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &yval, &xval, 11, 25)) return FALSE;
+ if (!find_space(player_ptr, &yval, &xval, 11, 25)) return FALSE;
/* Large room */
y1 = yval - 4;
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
g_ptr->info |= (CAVE_ROOM);
}
}
for (y = y1 - 1; y <= y2 + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1 - 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y][x2 + 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1 - 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y2 + 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
/* Advance to the center room */
for (y = y1 - 1; y <= y2 + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1 - 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y][x2 + 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1 - 1][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr = &floor_ptr->grid_array[y2 + 1][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
for (y = y1; y <= y2; y++)
{
}
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &yval, &xval, 13, 25)) return FALSE;
+ if (!find_space(player_ptr, &yval, &xval, 13, 25)) return FALSE;
/* Large room */
y1 = yval - 5;
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->info |= (CAVE_ROOM);
}
}
for (x = x1 + 3; x <= x2 - 3; x++)
{
g_ptr = &floor_ptr->grid_array[yval - 2][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
add_cave_info(floor_ptr, yval - 2, x, CAVE_ICKY);
g_ptr = &floor_ptr->grid_array[yval + 2][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
add_cave_info(floor_ptr, yval + 2, x, CAVE_ICKY);
}
for (x = x1 + 5; x <= x2 - 5; x++)
{
g_ptr = &floor_ptr->grid_array[yval - 3][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
add_cave_info(floor_ptr, yval - 3, x, CAVE_ICKY);
g_ptr = &floor_ptr->grid_array[yval + 3][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
add_cave_info(floor_ptr, yval + 3, x, CAVE_ICKY);
}
for (x = x1; x <= x2; x++)
{
g_ptr = &floor_ptr->grid_array[yval][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
g_ptr = &floor_ptr->grid_array[y1][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
g_ptr = &floor_ptr->grid_array[y2][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
}
/* Place the outer walls */
for (y = y1 - 1; y <= y2 + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1 - 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y][x2 + 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1 - 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y2 + 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
/* Random corridor */
{
for (y = y1; y <= yval; y++)
{
- place_floor_bold(floor_ptr, y, x2);
- place_solid_bold(floor_ptr, y, x1 - 1);
+ place_floor_bold(player_ptr, y, x2);
+ place_solid_bold(player_ptr, y, x1 - 1);
}
for (y = yval; y <= y2 + 1; y++)
{
- place_floor_bold(floor_ptr, y, x1);
- place_solid_bold(floor_ptr, y, x2 + 1);
+ place_floor_bold(player_ptr, y, x1);
+ place_solid_bold(player_ptr, y, x2 + 1);
}
}
else
{
for (y = yval; y <= y2 + 1; y++)
{
- place_floor_bold(floor_ptr, y, x1);
- place_solid_bold(floor_ptr, y, x2 + 1);
+ place_floor_bold(player_ptr, y, x1);
+ place_solid_bold(player_ptr, y, x2 + 1);
}
for (y = y1; y <= yval; y++)
{
- place_floor_bold(floor_ptr, y, x2);
- place_solid_bold(floor_ptr, y, x1 - 1);
+ place_floor_bold(player_ptr, y, x2);
+ place_solid_bold(player_ptr, y, x1 - 1);
}
}
/* Find and reserve some space in the dungeon. Get center of room. */
floor_type *floor_ptr = player_ptr->current_floor_ptr;
- if (!find_space(floor_ptr, &yval, &xval, ysize + 2, xsize + 2)) return FALSE;
+ if (!find_space(player_ptr, &yval, &xval, ysize + 2, xsize + 2)) return FALSE;
/* Choose lite or dark */
light = ((floor_ptr->dun_level <= randint1(25)) && !(d_info[floor_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
g_ptr->feat = feat_glass_floor;
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
for (y = y1 - 1; y <= y2 + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1 - 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr->feat = feat_glass_wall;
g_ptr = &floor_ptr->grid_array[y][x2 + 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr->feat = feat_glass_wall;
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1 - 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr->feat = feat_glass_wall;
g_ptr = &floor_ptr->grid_array[y2 + 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr->feat = feat_glass_wall;
}
for (dir2 = 0; dir2 < 8; dir2++)
{
g_ptr = &floor_ptr->grid_array[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->feat = feat_glass_wall;
}
}
y = yval + 2 * ddy_ddd[dir1];
x = xval + 2 * ddx_ddd[dir1];
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, inner_perm);
+ place_grid(player_ptr, g_ptr, inner_perm);
g_ptr->feat = feat_permanent_glass_wall;
floor_ptr->grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]].info |= (CAVE_ICKY);
}
/* Pillars */
g_ptr = &floor_ptr->grid_array[y1 + 1][x1 + 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->feat = feat_glass_wall;
g_ptr = &floor_ptr->grid_array[y1 + 1][x2 - 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->feat = feat_glass_wall;
g_ptr = &floor_ptr->grid_array[y2 - 1][x1 + 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->feat = feat_glass_wall;
g_ptr = &floor_ptr->grid_array[y2 - 1][x2 - 1];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->feat = feat_glass_wall;
get_mon_num_prep(player_ptr, vault_aux_lite, NULL);
for (dir1 = 0; dir1 < 8; dir1++)
{
g_ptr = &floor_ptr->grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->feat = feat_glass_wall;
}
for (y = yval - 2; y <= yval + 2; y++)
{
g_ptr = &floor_ptr->grid_array[y][xval - 3];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->feat = feat_glass_wall;
g_ptr = &floor_ptr->grid_array[y][xval + 3];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->feat = feat_glass_wall;
}
for (x = xval - 2; x <= xval + 2; x++)
{
g_ptr = &floor_ptr->grid_array[yval - 3][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->feat = feat_glass_wall;
g_ptr = &floor_ptr->grid_array[yval + 3][x];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->feat = feat_glass_wall;
}
for (dir1 = 4; dir1 < 8; dir1++)
{
g_ptr = &floor_ptr->grid_array[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]];
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->feat = feat_glass_wall;
}
/*!
* @brief タイプ14の部屋…特殊トラップ部屋の生成 / Type 14 -- trapped rooms
+* @param player_ptr プレーヤーへの参照ポインタ
* @return なし
* @details
* A special trap is placed at center of the room
*/
-bool build_type14(floor_type *floor_ptr)
+bool build_type14(player_type *player_ptr)
{
POSITION y, x, y2, x2, yval, xval;
POSITION y1, x1, xsize, ysize;
ysize = y1 + y2 + 1;
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &yval, &xval, ysize + 2, xsize + 2)) return FALSE;
+ if (!find_space(player_ptr, &yval, &xval, ysize + 2, xsize + 2)) return FALSE;
/* Choose lite or dark */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
light = ((floor_ptr->dun_level <= randint1(25)) && !(d_info[floor_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
}
for (y = y1 - 1; y <= y2 + 1; y++)
{
g_ptr = &floor_ptr->grid_array[y][x1 - 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y][x2 + 1];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
g_ptr = &floor_ptr->grid_array[y1 - 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
g_ptr = &floor_ptr->grid_array[y2 + 1][x];
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
if (floor_ptr->dun_level < 30 + randint1(30))
-extern bool build_type14(floor_type *floor_ptr);
+extern bool build_type14(player_type *player_ptr);
{
int side_x = x0 - xhsize + i;
- place_outer_noperm_bold(floor_ptr, y0 - yhsize + 0, side_x);
+ place_outer_noperm_bold(player_ptr, y0 - yhsize + 0, side_x);
floor_ptr->grid_array[y0 - yhsize + 0][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
- place_outer_noperm_bold(floor_ptr, y0 - yhsize + ysize - 1, side_x);
+ place_outer_noperm_bold(player_ptr, y0 - yhsize + ysize - 1, side_x);
floor_ptr->grid_array[y0 - yhsize + ysize - 1][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
}
{
int side_y = y0 - yhsize + i;
- place_outer_noperm_bold(floor_ptr, side_y, x0 - xhsize + 0);
+ place_outer_noperm_bold(player_ptr, side_y, x0 - xhsize + 0);
floor_ptr->grid_array[side_y][x0 - xhsize + 0].info |= (CAVE_ROOM | CAVE_ICKY);
- place_outer_noperm_bold(floor_ptr, side_y, x0 - xhsize + xsize - 1);
+ place_outer_noperm_bold(player_ptr, side_y, x0 - xhsize + xsize - 1);
floor_ptr->grid_array[side_y][x0 - xhsize + xsize - 1].info |= (CAVE_ROOM | CAVE_ICKY);
}
if (((min2 - min1) <= 2) && (!(min1 < 3)))
{
/* Boundary at midpoint+ not at inner region of bubble */
- place_outer_noperm_bold(floor_ptr, y0 - yhsize + y, x0 - xhsize + x);
+ place_outer_noperm_bold(player_ptr, y0 - yhsize + y, x0 - xhsize + x);
}
else
{
/* middle of a bubble */
- place_floor_bold(floor_ptr, y0 - yhsize + y, x0 - xhsize + x);
+ place_floor_bold(player_ptr, y0 - yhsize + y, x0 - xhsize + x);
}
/* clean up rest of flags */
{
POSITION y = y0 - yhsize + y1;
- place_extra_bold(floor_ptr, y, x);
+ place_extra_bold(player_ptr, y, x);
floor_ptr->grid_array[y][x].info &= (~CAVE_ICKY);
}
}
x2 = randint1(xhsize) * 2 + x0 - xhsize;
y1 = randint1(yhsize) * 2 + y0 - yhsize;
y2 = randint1(yhsize) * 2 + y0 - yhsize;
- build_room(floor_ptr, x1, x2, y1, y2);
+ build_room(player_ptr, x1, x2, y1, y2);
}
/* Add some random doors */
generate_hmap(floor_ptr, y0, x0, xsize, ysize, grd, roug, cutoff);
/* Convert to normal format+ clean up */
- done = generate_fracave(floor_ptr, y0, x0, xsize, ysize, cutoff, light, room);
+ done = generate_fracave(player_ptr, y0, x0, xsize, ysize, cutoff, light, room);
}
/* Set icky flag because is a vault */
g_ptr = &floor_ptr->grid_array[y][x];
/* Lay down a floor */
- place_grid(g_ptr, floor);
+ place_grid(player_ptr, g_ptr, floor);
/* Remove any mimic */
g_ptr->mimic = 0;
{
/* Granite wall (outer) */
case '%':
- place_grid(g_ptr, outer_noperm);
+ place_grid(player_ptr, g_ptr, outer_noperm);
break;
/* Granite wall (inner) */
case '#':
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
break;
/* Glass wall (inner) */
case '$':
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
g_ptr->feat = feat_glass_wall;
break;
/* Permanent wall (inner) */
case 'X':
- place_grid(g_ptr, inner_perm);
+ place_grid(player_ptr, g_ptr, inner_perm);
break;
/* Permanent glass wall (inner) */
case 'Y':
- place_grid(g_ptr, inner_perm);
+ place_grid(player_ptr, g_ptr, inner_perm);
g_ptr->feat = feat_permanent_glass_wall;
break;
}
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &yval, &xval, abs(y), abs(x))) return FALSE;
+ if (!find_space(player_ptr, &yval, &xval, abs(y), abs(x))) return FALSE;
#ifdef FORCE_V_IDX
v_ptr = &v_info[2];
* prevent generation of vaults with no-entrance.
*/
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &yval, &xval, (POSITION)(abs(y) + 2), (POSITION)(abs(x) + 2))) return FALSE;
+ if (!find_space(player_ptr, &yval, &xval, (POSITION)(abs(y) + 2), (POSITION)(abs(x) + 2))) return FALSE;
#ifdef FORCE_V_IDX
v_ptr = &v_info[76 + randint1(3)];
if (dist2(y0, x0, y, x, h1, h2, h3, h4) <= rad - 1)
{
/* inside- so is floor */
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
}
else
{
/* make granite outside so arena works */
- place_extra_bold(floor_ptr, y, x);
+ place_extra_bold(player_ptr, y, x);
}
/* proper boundary for arena */
if (((y + rad) == y0) || ((y - rad) == y0) ||
((x + rad) == x0) || ((x - rad) == x0))
{
- place_extra_bold(floor_ptr, y, x);
+ place_extra_bold(player_ptr, y, x);
}
}
}
/* Find visible outer walls and set to be FEAT_OUTER */
- add_outer_wall(floor_ptr, x0, y0, FALSE, x0 - rad - 1, y0 - rad - 1, x0 + rad + 1, y0 + rad + 1);
+ add_outer_wall(player_ptr, x0, y0, FALSE, x0 - rad - 1, y0 - rad - 1, x0 + rad + 1, y0 + rad + 1);
/* Add inner wall */
for (x = x0 - rad / 2; x <= x0 + rad / 2; x++)
if (dist2(y0, x0, y, x, h1, h2, h3, h4) == rad / 2)
{
/* Make an internal wall */
- place_inner_bold(floor_ptr, y, x);
+ place_inner_bold(player_ptr, y, x);
}
}
}
/* Add perpendicular walls */
for (x = x0 - rad; x <= x0 + rad; x++)
{
- place_inner_bold(floor_ptr, y0, x);
+ place_inner_bold(player_ptr, y0, x);
}
for (y = y0 - rad; y <= y0 + rad; y++)
{
- place_inner_bold(floor_ptr, y, x0);
+ place_inner_bold(player_ptr, y, x0);
}
/* Make inner vault */
for (y = y0 - 1; y <= y0 + 1; y++)
{
- place_inner_bold(floor_ptr, y, x0 - 1);
- place_inner_bold(floor_ptr, y, x0 + 1);
+ place_inner_bold(player_ptr, y, x0 - 1);
+ place_inner_bold(player_ptr, y, x0 + 1);
}
for (x = x0 - 1; x <= x0 + 1; x++)
{
- place_inner_bold(floor_ptr, y0 - 1, x);
- place_inner_bold(floor_ptr, y0 + 1, x);
+ place_inner_bold(player_ptr, y0 - 1, x);
+ place_inner_bold(player_ptr, y0 + 1, x);
}
- place_floor_bold(floor_ptr, y0, x0);
+ place_floor_bold(player_ptr, y0, x0);
/* Add doors to vault */
generate_hmap(floor_ptr, y0, x0, xsize, ysize, grd, roug, c3);
/* Convert to normal format+ clean up */
- done = generate_lake(floor_ptr, y0, x0, xsize, ysize, c1, c2, c3, type);
+ done = generate_lake(player_ptr, y0, x0, xsize, ysize, c1, c2, c3, type);
}
/* Set icky flag because is a vault */
floor_ptr->grid_array[y1 - 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
- place_outer_noperm_bold(floor_ptr, y1 - 2, x);
+ place_outer_noperm_bold(player_ptr, y1 - 2, x);
}
for (x = x1 - 2; x <= x2 + 2; x++)
floor_ptr->grid_array[y2 + 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
- place_outer_noperm_bold(floor_ptr, y2 + 2, x);
+ place_outer_noperm_bold(player_ptr, y2 + 2, x);
}
for (y = y1 - 2; y <= y2 + 2; y++)
floor_ptr->grid_array[y][x1 - 2].info |= (CAVE_ROOM | CAVE_ICKY);
- place_outer_noperm_bold(floor_ptr, y, x1 - 2);
+ place_outer_noperm_bold(player_ptr, y, x1 - 2);
}
for (y = y1 - 2; y <= y2 + 2; y++)
floor_ptr->grid_array[y][x2 + 2].info |= (CAVE_ROOM | CAVE_ICKY);
- place_outer_noperm_bold(floor_ptr, y, x2 + 2);
+ place_outer_noperm_bold(player_ptr, y, x2 + 2);
}
for (y = y1 - 1; y <= y2 + 1; y++)
g_ptr->info |= (CAVE_ROOM | CAVE_ICKY);
/* Permanent walls */
- place_grid(g_ptr, inner_perm);
+ place_grid(player_ptr, g_ptr, inner_perm);
}
}
C_MAKE(visited, num_vertices, int);
/* traverse the graph to create a spannng tree, pick a random root */
- r_visit(floor_ptr, y1, x1, y2, x2, randint0(num_vertices), 0, visited);
+ r_visit(player_ptr, y1, x1, y2, x2, randint0(num_vertices), 0, visited);
/* Make it look like a checker board vault */
for (x = x1; x <= x2; x++)
/* If total is odd- and is a floor then make a wall */
if ((total % 2 == 1) && is_floor_bold(floor_ptr, y, x))
{
- place_inner_bold(floor_ptr, y, x);
+ place_inner_bold(player_ptr, y, x);
}
}
}
{
/* left and right */
y = randint1(dy) + dy / 2;
- place_inner_bold(floor_ptr, y1 + y, x1 - 1);
- place_inner_bold(floor_ptr, y1 + y, x2 + 1);
+ place_inner_bold(player_ptr, y1 + y, x1 - 1);
+ place_inner_bold(player_ptr, y1 + y, x2 + 1);
}
else
{
/* top and bottom */
x = randint1(dx) + dx / 2;
- place_inner_bold(floor_ptr, y1 - 1, x1 + x);
- place_inner_bold(floor_ptr, y2 + 1, x1 + x);
+ place_inner_bold(player_ptr, y1 - 1, x1 + x);
+ place_inner_bold(player_ptr, y2 + 1, x1 + x);
}
/* Fill with monsters and treasure, highest difficulty */
{
floor_ptr->grid_array[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
/* Make everything a floor */
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
}
}
/* Make the castle */
- build_recursive_room(floor_ptr, x1, y1, x2, y2, randint1(5));
+ build_recursive_room(player_ptr, x1, y1, x2, y2, randint1(5));
/* Fill with monsters and treasure, low difficulty */
fill_treasure(player_ptr, x1, x2, y1, y2, randint1(3));
/* Find and reserve some space in the dungeon. Get center of room. */
floor_type *floor_ptr = player_ptr->current_floor_ptr;
- if (!find_space(floor_ptr, &y0, &x0, ysize + 1, xsize + 1)) return FALSE;
+ if (!find_space(player_ptr, &y0, &x0, ysize + 1, xsize + 1)) return FALSE;
/* Select type of vault */
#ifdef ALLOW_CAVERNS_AND_LAKES
}
/* Find and reserve some space in the dungeon. Get center of room. */
- if (!find_space(floor_ptr, &yval, &xval, abs(y), abs(x))) return FALSE;
+ if (!find_space(player_ptr, &yval, &xval, abs(y), abs(x))) return FALSE;
#ifdef FORCE_V_IDX
v_ptr = &v_info[2];
floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (y = y0 - 1; y <= y0 + 1; y++)
{
- place_inner_bold(floor_ptr, y, x0 - 1);
- place_inner_bold(floor_ptr, y, x0 + 1);
+ place_inner_bold(player_ptr, y, x0 - 1);
+ place_inner_bold(player_ptr, y, x0 + 1);
}
for (x = x0 - 1; x <= x0 + 1; x++)
{
- place_inner_bold(floor_ptr, y0 - 1, x);
- place_inner_bold(floor_ptr, y0 + 1, x);
+ place_inner_bold(player_ptr, y0 - 1, x);
+ place_inner_bold(player_ptr, y0 + 1, x);
}
/* Place a secret door on one side */
floor_ptr->grid_array[y0][x0].mimic = 0;
/* Add inner open space */
- place_floor_bold(floor_ptr, y0, x0);
+ place_floor_bold(player_ptr, y0, x0);
}
/*!
* @brief
* 指定範囲に通路が通っていることを確認した上で床で埋める
* This function tunnels around a room if it will cut off part of a grid system.
+ * @param player_ptr プレーヤーへの参照ポインタ
* @param x1 範囲の左端
* @param y1 範囲の上端
* @param x2 範囲の右端
* @param y2 範囲の下端
* @return なし
*/
-static void check_room_boundary(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2)
+static void check_room_boundary(player_type *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2)
{
int count;
POSITION x, y;
bool old_is_floor, new_is_floor;
count = 0;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
old_is_floor = get_is_floor(floor_ptr, x1 - 1, y1);
/*
{
for (x = x1; x <= x2; x++)
{
- set_floor(floor_ptr, x, y);
+ set_floor(player_ptr, x, y);
}
}
}
/*!
* @brief 部屋生成が可能なスペースを確保する / Find a good spot for the next room. -LM-
+ * @param player_ptr プレーヤーへの参照ポインタ
* @param y 部屋の生成が可能な中心Y座標を返す参照ポインタ
* @param x 部屋の生成が可能な中心X座標を返す参照ポインタ
* @param height 確保したい領域の高さ
* Return TRUE and values for the center of the room if all went well.\n
* Otherwise, return FALSE.\n
*/
-bool find_space(floor_type *floor_ptr, POSITION *y, POSITION *x, POSITION height, POSITION width)
+bool find_space(player_type *player_ptr, POSITION *y, POSITION *x, POSITION height, POSITION width)
{
int candidates, pick;
POSITION by, bx, by1, bx1, by2, bx2;
}
/* Normal dungeon */
- if (!(d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_CAVE))
+ if (!(d_info[player_ptr->current_floor_ptr->dungeon_idx].flags1 & DF1_NO_CAVE))
{
/* Choose a random one */
pick = randint1(candidates);
* If so, fix by tunneling outside the room in such a
* way as to connect the caves.
*/
- check_room_boundary(floor_ptr, *x - width / 2 - 1, *y - height / 2 - 1, *x + (width - 1) / 2 + 1, *y + (height - 1) / 2 + 1);
+ check_room_boundary(player_ptr, *x - width / 2 - 1, *y - height / 2 - 1, *x + (width - 1) / 2 + 1, *y + (height - 1) / 2 + 1);
/* Success. */
return TRUE;
}
-static bool hack_isnt_wall(floor_type *floor_ptr, POSITION y, POSITION x, int c1, int c2, int c3, FEAT_IDX feat1, FEAT_IDX feat2, FEAT_IDX feat3, BIT_FLAGS info1, BIT_FLAGS info2, BIT_FLAGS info3)
+static bool hack_isnt_wall(player_type *player_ptr, POSITION y, POSITION x, int c1, int c2, int c3, FEAT_IDX feat1, FEAT_IDX feat2, FEAT_IDX feat3, BIT_FLAGS info1, BIT_FLAGS info2, BIT_FLAGS info3)
{
/*
* function used to convert from height-map back to the
* normal angband floor_ptr->grid_array format
*/
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (floor_ptr->grid_array[y][x].info & CAVE_ICKY)
{
/* already done */
/* if greater than cutoff then is a wall */
else
{
- place_outer_bold(floor_ptr, y, x);
+ place_outer_bold(player_ptr, y, x);
return FALSE;
}
}
* Quick and nasty fill routine used to find the connected region
* of floor in the middle of the grids
*/
-static void cave_fill(floor_type *floor_ptr, POSITION y, POSITION x)
+static void cave_fill(player_type *player_ptr, POSITION y, POSITION x)
{
int i, j, d;
POSITION ty, tx;
tmp_pos.x[0] = x;
/* Now process the queue */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
while (flow_head != flow_tail)
{
/* Extract the next entry */
&& (j > fill_data.ymin) && (j < fill_data.ymax))
{
/* If not a wall or floor done before */
- if (hack_isnt_wall(floor_ptr, j, i,
+ if (hack_isnt_wall(player_ptr, j, i,
fill_data.c1, fill_data.c2, fill_data.c3,
fill_data.feat1, fill_data.feat2, fill_data.feat3,
fill_data.info1, fill_data.info2, fill_data.info3))
}
-bool generate_fracave(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room)
+bool generate_fracave(player_type *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room)
{
POSITION x, y, xhsize, yhsize;
int i;
/* number of filled squares */
fill_data.amount = 0;
- cave_fill(floor_ptr, (byte)y0, (byte)x0);
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ cave_fill(player_ptr, (byte)y0, (byte)x0);
/* if tally too small, try again */
if (fill_data.amount < 10)
{
for (y = 0; y <= ysize; ++y)
{
- place_extra_bold(floor_ptr, y0 + y - yhsize, x0 + x - xhsize);
+ place_extra_bold(player_ptr, y0 + y - yhsize, x0 + x - xhsize);
floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
}
}
if ((floor_ptr->grid_array[0 + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
{
/* Next to a 'filled' region? - set to be room walls */
- place_outer_bold(floor_ptr, y0 + 0 - yhsize, x0 + i - xhsize);
+ place_outer_bold(player_ptr, y0 + 0 - yhsize, x0 + i - xhsize);
if (light) floor_ptr->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_GLOW);
floor_ptr->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_ROOM);
- place_outer_bold(floor_ptr, y0 + 0 - yhsize, x0 + i - xhsize);
+ place_outer_bold(player_ptr, y0 + 0 - yhsize, x0 + i - xhsize);
}
else
{
/* set to be normal granite */
- place_extra_bold(floor_ptr, y0 + 0 - yhsize, x0 + i - xhsize);
+ place_extra_bold(player_ptr, y0 + 0 - yhsize, x0 + i - xhsize);
}
/* bottom boundary */
if ((floor_ptr->grid_array[ysize + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
{
/* Next to a 'filled' region? - set to be room walls */
- place_outer_bold(floor_ptr, y0 + ysize - yhsize, x0 + i - xhsize);
+ place_outer_bold(player_ptr, y0 + ysize - yhsize, x0 + i - xhsize);
if (light) floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info |= (CAVE_GLOW);
floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info |= (CAVE_ROOM);
- place_outer_bold(floor_ptr, y0 + ysize - yhsize, x0 + i - xhsize);
+ place_outer_bold(player_ptr, y0 + ysize - yhsize, x0 + i - xhsize);
}
else
{
/* set to be normal granite */
- place_extra_bold(floor_ptr, y0 + ysize - yhsize, x0 + i - xhsize);
+ place_extra_bold(player_ptr, y0 + ysize - yhsize, x0 + i - xhsize);
}
/* clear the icky flag-don't need it any more */
if ((floor_ptr->grid_array[i + y0 - yhsize][0 + x0 - xhsize].info & CAVE_ICKY) && room)
{
/* room boundary */
- place_outer_bold(floor_ptr, y0 + i - yhsize, x0 + 0 - xhsize);
+ place_outer_bold(player_ptr, y0 + i - yhsize, x0 + 0 - xhsize);
if (light) floor_ptr->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_GLOW);
floor_ptr->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_ROOM);
- place_outer_bold(floor_ptr, y0 + i - yhsize, x0 + 0 - xhsize);
+ place_outer_bold(player_ptr, y0 + i - yhsize, x0 + 0 - xhsize);
}
else
{
/* outside room */
- place_extra_bold(floor_ptr, y0 + i - yhsize, x0 + 0 - xhsize);
+ place_extra_bold(player_ptr, y0 + i - yhsize, x0 + 0 - xhsize);
}
/* right boundary */
if ((floor_ptr->grid_array[i + y0 - yhsize][xsize + x0 - xhsize].info & CAVE_ICKY) && room)
{
/* room boundary */
- place_outer_bold(floor_ptr, y0 + i - yhsize, x0 + xsize - xhsize);
+ place_outer_bold(player_ptr, y0 + i - yhsize, x0 + xsize - xhsize);
if (light) floor_ptr->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_GLOW);
floor_ptr->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_ROOM);
- place_outer_bold(floor_ptr, y0 + i - yhsize, x0 + xsize - xhsize);
+ place_outer_bold(player_ptr, y0 + i - yhsize, x0 + xsize - xhsize);
}
else
{
/* outside room */
- place_extra_bold(floor_ptr, y0 + i - yhsize, x0 + xsize - xhsize);
+ place_extra_bold(player_ptr, y0 + i - yhsize, x0 + xsize - xhsize);
}
/* clear icky flag -done with it */
else
{
- place_extra_bold(floor_ptr, y0 + y - yhsize, x0 + x - xhsize);
+ place_extra_bold(player_ptr, y0 + y - yhsize, x0 + x - xhsize);
floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ROOM);
}
}
else
{
/* Clear the unconnected regions */
- place_extra_bold(floor_ptr, y0 + y - yhsize, x0 + x - xhsize);
+ place_extra_bold(player_ptr, y0 + y - yhsize, x0 + x - xhsize);
floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
}
}
/*
* Builds a cave system in the center of the dungeon.
*/
-void build_cavern(floor_type *floor_ptr)
+void build_cavern(player_type *player_ptr)
{
int grd, roug, cutoff;
POSITION xsize, ysize, x0, y0;
bool done, light;
light = done = FALSE;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if ((floor_ptr->dun_level <= randint1(50)) && !(d_info[floor_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
/* Make a cave the size of the dungeon */
generate_hmap(floor_ptr, y0 + 1, x0 + 1, xsize, ysize, grd, roug, cutoff);
/* Convert to normal format+ clean up */
- done = generate_fracave(floor_ptr, y0 + 1, x0 + 1, xsize, ysize, cutoff, light, FALSE);
+ done = generate_fracave(player_ptr, y0 + 1, x0 + 1, xsize, ysize, cutoff, light, FALSE);
}
}
-bool generate_lake(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type)
+
+bool generate_lake(player_type *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type)
{
POSITION x, y, xhsize, yhsize;
int i;
/* select region connected to center of floor_ptr->grid_array system
* this gets rid of alot of isolated one-sqaures that
* can make teleport traps instadeaths... */
- cave_fill(floor_ptr, (byte)y0, (byte)x0);
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ cave_fill(player_ptr, (byte)y0, (byte)x0);
/* if tally too small, try again */
if (fill_data.amount < 10)
{
for (y = 0; y <= ysize; ++y)
{
- place_floor_bold(floor_ptr, y0 + y - yhsize, x0 + x - xhsize);
+ place_floor_bold(player_ptr, y0 + y - yhsize, x0 + x - xhsize);
floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
}
}
/* Do boundarys- set to normal granite */
for (i = 0; i <= xsize; ++i)
{
- place_extra_bold(floor_ptr, y0 + 0 - yhsize, x0 + i - xhsize);
- place_extra_bold(floor_ptr, y0 + ysize - yhsize, x0 + i - xhsize);
+ place_extra_bold(player_ptr, y0 + 0 - yhsize, x0 + i - xhsize);
+ place_extra_bold(player_ptr, y0 + ysize - yhsize, x0 + i - xhsize);
/* clear the icky flag-don't need it any more */
floor_ptr->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
for (i = 1; i < ysize; ++i)
{
- place_extra_bold(floor_ptr, y0 + i - yhsize, x0 + 0 - xhsize);
- place_extra_bold(floor_ptr, y0 + i - yhsize, x0 + xsize - xhsize);
+ place_extra_bold(player_ptr, y0 + i - yhsize, x0 + 0 - xhsize);
+ place_extra_bold(player_ptr, y0 + i - yhsize, x0 + xsize - xhsize);
/* clear icky flag -done with it */
floor_ptr->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
/* Fill unconnected regions with granite */
if ((!(floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY)) ||
is_outer_bold(floor_ptr, y0 + y - yhsize, x0 + x - xhsize))
- place_extra_bold(floor_ptr, y0 + y - yhsize, x0 + x - xhsize);
+ place_extra_bold(player_ptr, y0 + y - yhsize, x0 + x - xhsize);
/* turn off icky flag (no longer needed.) */
floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
/*
* makes a lake/collapsed floor in the center of the dungeon
*/
-void build_lake(floor_type *floor_ptr, int type)
+void build_lake(player_type *player_ptr, int type)
{
int grd, roug, xsize, ysize, x0, y0;
bool done = FALSE;
}
/* Make the size of the dungeon */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
xsize = floor_ptr->width - 1;
ysize = floor_ptr->height - 1;
x0 = xsize / 2;
generate_hmap(floor_ptr, y0 + 1, x0 + 1, xsize, ysize, grd, roug, c3);
/* Convert to normal format+ clean up */
- done = generate_lake(floor_ptr, y0 + 1, x0 + 1, xsize, ysize, c1, c2, c3, type);
+ done = generate_lake(player_ptr, y0 + 1, x0 + 1, xsize, ysize, c1, c2, c3, type);
}
}
#endif /* ALLOW_CAVERNS_AND_LAKES */
* The area inside the walls is not touched:
* only granite is removed- normal walls stay
*/
-void build_room(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2)
+void build_room(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2)
{
POSITION x, y, xsize, ysize;
int i, temp;
/* Top and bottom boundaries */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (i = 0; i <= xsize; i++)
{
- place_outer_noperm_bold(floor_ptr, y1, x1 + i);
+ place_outer_noperm_bold(player_ptr, y1, x1 + i);
floor_ptr->grid_array[y1][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
- place_outer_noperm_bold(floor_ptr, y2, x1 + i);
+ place_outer_noperm_bold(player_ptr, y2, x1 + i);
floor_ptr->grid_array[y2][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
}
/* Left and right boundaries */
for (i = 1; i < ysize; i++)
{
- place_outer_noperm_bold(floor_ptr, y1 + i, x1);
+ place_outer_noperm_bold(player_ptr, y1 + i, x1);
floor_ptr->grid_array[y1 + i][x1].info |= (CAVE_ROOM | CAVE_ICKY);
- place_outer_noperm_bold(floor_ptr, y1 + i, x2);
+ place_outer_noperm_bold(player_ptr, y1 + i, x2);
floor_ptr->grid_array[y1 + i][x2].info |= (CAVE_ROOM | CAVE_ICKY);
}
if (is_extra_bold(floor_ptr, y1 + y, x1 + x))
{
/* clear the untouched region */
- place_floor_bold(floor_ptr, y1 + y, x1 + x);
+ place_floor_bold(player_ptr, y1 + y, x1 + x);
floor_ptr->grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
}
else
* is the randint0(3) below; it governs the relative density of
* twists and turns in the labyrinth: smaller number, more twists.
*/
-void r_visit(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited)
+void r_visit(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited)
{
int i, j, m, n, temp, x, y, adj[4];
visited[node] = 1;
x = 2 * (node % m) + x1;
y = 2 * (node / m) + y1;
- place_floor_bold(floor_ptr, y, x);
+ place_floor_bold(player_ptr, y, x);
/* setup order of adjacent node visits */
if (one_in_(3))
/* (0,+) - check for bottom boundary */
if ((node / m < n - 1) && (visited[node + m] == 0))
{
- place_floor_bold(floor_ptr, y + 1, x);
- r_visit(floor_ptr, y1, x1, y2, x2, node + m, dir, visited);
+ place_floor_bold(player_ptr, y + 1, x);
+ r_visit(player_ptr, y1, x1, y2, x2, node + m, dir, visited);
}
break;
case 1:
/* (0,-) - check for top boundary */
if ((node / m > 0) && (visited[node - m] == 0))
{
- place_floor_bold(floor_ptr, y - 1, x);
- r_visit(floor_ptr, y1, x1, y2, x2, node - m, dir, visited);
+ place_floor_bold(player_ptr, y - 1, x);
+ r_visit(player_ptr, y1, x1, y2, x2, node - m, dir, visited);
}
break;
case 2:
/* (+,0) - check for right boundary */
if ((node % m < m - 1) && (visited[node + 1] == 0))
{
- place_floor_bold(floor_ptr, y, x + 1);
- r_visit(floor_ptr, y1, x1, y2, x2, node + 1, dir, visited);
+ place_floor_bold(player_ptr, y, x + 1);
+ r_visit(player_ptr, y1, x1, y2, x2, node + 1, dir, visited);
}
break;
case 3:
/* (-,0) - check for left boundary */
if ((node % m > 0) && (visited[node - 1] == 0))
{
- place_floor_bold(floor_ptr, y, x - 1);
- r_visit(floor_ptr, y1, x1, y2, x2, node - 1, dir, visited);
+ place_floor_bold(player_ptr, y, x - 1);
+ r_visit(player_ptr, y1, x1, y2, x2, node - 1, dir, visited);
}
} /* end switch */
}
if (is_vault) g_ptr->info |= CAVE_ICKY;
if ((x == x1 - 1) || (x == x2 + 1) || (y == y1 - 1) || (y == y2 + 1))
{
- place_grid(g_ptr, outer);
+ place_grid(player_ptr, g_ptr, outer);
}
else if (!is_vault)
{
- place_grid(g_ptr, extra);
+ place_grid(player_ptr, g_ptr, extra);
}
else
{
- place_grid(g_ptr, inner);
+ place_grid(player_ptr, g_ptr, inner);
}
if (light) g_ptr->info |= (CAVE_GLOW);
}
C_MAKE(visited, num_vertices, int);
/* traverse the graph to create a spaning tree, pick a random root */
- r_visit(floor_ptr, y1, x1, y2, x2, randint0(num_vertices), 0, visited);
+ r_visit(player_ptr, y1, x1, y2, x2, randint0(num_vertices), 0, visited);
/* Fill with monsters and treasure, low difficulty */
if (is_vault) fill_treasure(player_ptr, x1, x2, y1, y2, randint1(5));
* The power variable is a measure of how well defended a region is.
* This alters the possible choices.
*/
-void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power)
+void build_recursive_room(player_type *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power)
{
POSITION xsize, ysize;
POSITION x, y;
}
/* Based on the choice made above, do something */
-
switch (choice)
{
case 1:
/* top and bottom */
for (x = x1; x <= x2; x++)
{
- place_outer_bold(floor_ptr, y1, x);
- place_outer_bold(floor_ptr, y2, x);
+ place_outer_bold(player_ptr, y1, x);
+ place_outer_bold(player_ptr, y2, x);
}
/* left and right */
for (y = y1 + 1; y < y2; y++)
{
- place_outer_bold(floor_ptr, y, x1);
- place_outer_bold(floor_ptr, y, x2);
+ place_outer_bold(player_ptr, y, x1);
+ place_outer_bold(player_ptr, y, x2);
}
/* Make a couple of entrances */
{
/* left and right */
y = randint1(ysize) + y1;
- place_floor_bold(floor_ptr, y, x1);
- place_floor_bold(floor_ptr, y, x2);
+ place_floor_bold(player_ptr, y, x1);
+ place_floor_bold(player_ptr, y, x2);
}
else
{
/* top and bottom */
x = randint1(xsize) + x1;
- place_floor_bold(floor_ptr, y1, x);
- place_floor_bold(floor_ptr, y2, x);
+ place_floor_bold(player_ptr, y1, x);
+ place_floor_bold(player_ptr, y2, x);
}
/* Select size of keep */
/* Do outside areas */
/* Above and below keep */
- build_recursive_room(floor_ptr, x1 + 1, y1 + 1, x2 - 1, t1, power + 1);
- build_recursive_room(floor_ptr, x1 + 1, t2, x2 - 1, y2, power + 1);
+ build_recursive_room(player_ptr, x1 + 1, y1 + 1, x2 - 1, t1, power + 1);
+ build_recursive_room(player_ptr, x1 + 1, t2, x2 - 1, y2, power + 1);
/* Left and right of keep */
- build_recursive_room(floor_ptr, x1 + 1, t1 + 1, t3, t2 - 1, power + 3);
- build_recursive_room(floor_ptr, t4, t1 + 1, x2 - 1, t2 - 1, power + 3);
+ build_recursive_room(player_ptr, x1 + 1, t1 + 1, t3, t2 - 1, power + 3);
+ build_recursive_room(player_ptr, t4, t1 + 1, x2 - 1, t2 - 1, power + 3);
/* Make the keep itself: */
x1 = t3;
{
for (x = x1; x < x2; x++)
{
- place_inner_bold(floor_ptr, y, x);
+ place_inner_bold(player_ptr, y, x);
}
}
/* top and bottom */
for (x = x1 + 1; x <= x2 - 1; x++)
{
- place_inner_bold(floor_ptr, y1 + 1, x);
- place_inner_bold(floor_ptr, y2 - 1, x);
+ place_inner_bold(player_ptr, y1 + 1, x);
+ place_inner_bold(player_ptr, y2 - 1, x);
}
/* left and right */
for (y = y1 + 1; y <= y2 - 1; y++)
{
- place_inner_bold(floor_ptr, y, x1 + 1);
- place_inner_bold(floor_ptr, y, x2 - 1);
+ place_inner_bold(player_ptr, y, x1 + 1);
+ place_inner_bold(player_ptr, y, x2 - 1);
}
/* Make a door */
if (one_in_(2))
{
/* left */
- place_floor_bold(floor_ptr, y, x1 + 1);
+ place_floor_bold(player_ptr, y, x1 + 1);
}
else
{
/* right */
- place_floor_bold(floor_ptr, y, x2 - 1);
+ place_floor_bold(player_ptr, y, x2 - 1);
}
/* Build the room */
- build_recursive_room(floor_ptr, x1 + 2, y1 + 2, x2 - 2, y2 - 2, power + 3);
+ build_recursive_room(player_ptr, x1 + 2, y1 + 2, x2 - 2, y2 - 2, power + 3);
break;
}
case 2:
{
for (x = x1; x < x2; x++)
{
- place_inner_bold(floor_ptr, y, x);
+ place_inner_bold(player_ptr, y, x);
}
}
return;
}
t1 = randint1(xsize - 2) + x1 + 1;
- build_recursive_room(floor_ptr, x1, y1, t1, y2, power - 2);
- build_recursive_room(floor_ptr, t1 + 1, y1, x2, y2, power - 2);
+ build_recursive_room(player_ptr, x1, y1, t1, y2, power - 2);
+ build_recursive_room(player_ptr, t1 + 1, y1, x2, y2, power - 2);
break;
}
case 3:
{
for (x = x1; x < x2; x++)
{
- place_inner_bold(floor_ptr, y, x);
+ place_inner_bold(player_ptr, y, x);
}
}
return;
}
t1 = randint1(ysize - 2) + y1 + 1;
- build_recursive_room(floor_ptr, x1, y1, x2, t1, power - 2);
- build_recursive_room(floor_ptr, x1, t1 + 1, x2, y2, power - 2);
+ build_recursive_room(player_ptr, x1, y1, x2, t1, power - 2);
+ build_recursive_room(player_ptr, x1, t1 + 1, x2, y2, power - 2);
break;
}
}
* Note: no range checking is done so must be inside dungeon
* This routine also stomps on doors
*/
-void add_outer_wall(floor_type *floor_ptr, POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2)
+void add_outer_wall(player_type *player_ptr, POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2)
{
grid_type *g_ptr;
feature_type *f_ptr;
int i, j;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (!in_bounds(floor_ptr, y, x)) return;
g_ptr = &floor_ptr->grid_array[y][x];
{
if ((x + i >= x1) && (x + i <= x2) && (y + j >= y1) && (y + j <= y2))
{
- add_outer_wall(floor_ptr, x + i, y + j, light, x1, y1, x2, y2);
+ add_outer_wall(player_ptr, x + i, y + j, light, x1, y1, x2, y2);
if (light) g_ptr->info |= CAVE_GLOW;
}
}
else if (is_extra_bold(floor_ptr, y, x))
{
/* Set bounding walls */
- place_outer_bold(floor_ptr, y, x);
+ place_outer_bold(player_ptr, y, x);
if (light) g_ptr->info |= CAVE_GLOW;
}
else if (permanent_wall(f_ptr))
/* Create a new floor room with optional light */
-void generate_room_floor(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int light)
+void generate_room_floor(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int light)
{
POSITION y, x;
for (x = x1; x <= x2; x++)
{
/* Point to grid */
- g_ptr = &floor_ptr->grid_array[y][x];
- place_grid(g_ptr, floor);
+ g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
+ place_grid(player_ptr, g_ptr, floor);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
}
}
}
-void generate_fill_perm_bold(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
+void generate_fill_perm_bold(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
{
POSITION y, x;
for (x = x1; x <= x2; x++)
{
/* Point to grid */
- place_inner_perm_bold(floor_ptr, y, x);
+ place_inner_perm_bold(player_ptr, y, x);
}
}
}
*/
static bool room_build(player_type *player_ptr, EFFECT_ID typ)
{
- floor_type *floor_ptr = player_ptr->current_floor_ptr;
switch (typ)
{
/* Build an appropriate room */
case ROOM_T_NORMAL: return build_type1(player_ptr);
- case ROOM_T_OVERLAP: return build_type2(floor_ptr);
+ case ROOM_T_OVERLAP: return build_type2(player_ptr);
case ROOM_T_CROSS: return build_type3(player_ptr);
case ROOM_T_INNER_FEAT: return build_type4(player_ptr);
case ROOM_T_NEST: return build_type5(player_ptr);
case ROOM_T_GREATER_VAULT: return build_type8(player_ptr);
case ROOM_T_FRACAVE: return build_type9(player_ptr);
case ROOM_T_RANDOM_VAULT: return build_type10(player_ptr);
- case ROOM_T_OVAL: return build_type11(floor_ptr);
+ case ROOM_T_OVAL: return build_type11(player_ptr);
case ROOM_T_CRYPT: return build_type12(player_ptr);
case ROOM_T_TRAP_PIT: return build_type13(player_ptr);
- case ROOM_T_TRAP: return build_type14(floor_ptr);
+ case ROOM_T_TRAP: return build_type14(player_ptr);
case ROOM_T_GLASS: return build_type15(player_ptr);
case ROOM_T_ARCADE: return build_type16(player_ptr);
case ROOM_T_FIXED: return build_type17(player_ptr);
/* Externs */
#ifdef ALLOW_CAVERNS_AND_LAKES
-extern void build_lake(floor_type *floor_ptr, int type);
-extern void build_cavern(floor_type *floor_ptr);
+extern void build_lake(player_type *player_ptr, int type);
+extern void build_cavern(player_type *player_ptr);
#endif /* ALLOW_CAVERNS_AND_LAKES */
/* Maximum locked/jammed doors */
extern bool generate_rooms(player_type *player_ptr);
extern void build_maze_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault);
-extern bool find_space(floor_type *floor_ptr, POSITION *y, POSITION *x, POSITION height, POSITION width);
+extern bool find_space(player_type *player_ptr, POSITION *y, POSITION *x, POSITION height, POSITION width);
extern void build_small_room(player_type *player_ptr, POSITION x0, POSITION y0);
-extern void add_outer_wall(floor_type *floor_ptr, POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2);
+extern void add_outer_wall(player_type *player_ptr, POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2);
extern POSITION dist2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, POSITION h1, POSITION h2, POSITION h3, POSITION h4);
-extern void generate_room_floor(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int light);
-extern void generate_fill_perm_bold(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
+extern void generate_room_floor(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int light);
+extern void generate_fill_perm_bold(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
extern void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff);
-extern bool generate_fracave(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room);
+extern bool generate_fracave(player_type *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room);
extern void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty);
-extern bool generate_lake(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type);
-extern void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power);
-extern void build_room(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2);
-extern void r_visit(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited);
+extern bool generate_lake(player_type *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type);
+extern void build_recursive_room(player_type *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power);
+extern void build_room(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2);
+extern void r_visit(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited);
if (in_generate) /* In generation */
{
/* Delete the monster (if any) */
- delete_monster(floor_ptr, y, x);
+ delete_monster(caster_ptr, y, x);
}
else if (r_ptr->flags1 & RF1_QUESTOR)
{
}
/* Delete the monster (if any) */
- delete_monster(floor_ptr, y, x);
+ delete_monster(caster_ptr, y, x);
}
}
if (t < 20)
{
/* Create granite wall */
- place_grid(g_ptr, extra);
+ place_grid(caster_ptr, g_ptr, extra);
}
else if (t < 70)
{
else
{
/* Create floor */
- place_grid(g_ptr, floor);
+ place_grid(caster_ptr, g_ptr, floor);
}
/* Clear garbage of hidden trap or door */
}
}
- delete_monster(floor_ptr, yy, xx);
+ delete_monster(caster_ptr, yy, xx);
sn = 0;
}
}
}
- delete_monster_idx(g_ptr->m_idx);
+ delete_monster_idx(caster_ptr, g_ptr->m_idx);
return TRUE;
}
monster_death(caster_ptr, g_ptr->m_idx, FALSE);
- delete_monster_idx(g_ptr->m_idx);
+ delete_monster_idx(caster_ptr, g_ptr->m_idx);
if (sad)
{
exe_write_diary(caster_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
}
- delete_monster_idx(g_ptr->m_idx);
+ delete_monster_idx(caster_ptr, g_ptr->m_idx);
}
/* If the player did it, give him experience, check fear */
exe_write_diary(caster_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name);
}
- delete_monster_idx(m_idx);
+ delete_monster_idx(caster_ptr, m_idx);
}
if (resist && player_cast)
GAME_TEXT m_name[MAX_NLEN];
monster_desc(caster_ptr, m_name, m_ptr, 0x00);
msg_format(_("%sは爆破されるのを嫌がり、勝手に自分の世界へと帰った。", "%^s resists being blasted and runs away."), m_name);
- delete_monster_idx(i);
+ delete_monster_idx(caster_ptr, i);
continue;
}
exe_write_diary(caster_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name);
}
- delete_monster_idx(i);
+ delete_monster_idx(caster_ptr, i);
}
}
exe_write_diary(creature_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_TELE_LEVEL, m2_name);
}
- delete_monster_idx(m_idx);
+ delete_monster_idx(creature_ptr, m_idx);
sound(SOUND_TPLEVEL);
}
m_ptr->hold_o_idx = 0;
/* "Kill" the "old" monster */
- delete_monster_idx(g_ptr->m_idx);
+ delete_monster_idx(caster_ptr, g_ptr->m_idx);
/* Create a new monster (no groups) */
bool polymorphed = FALSE;
if (g_ptr->m_idx)
{
- delete_monster_idx(g_ptr->m_idx);
+ delete_monster_idx(creature_ptr, g_ptr->m_idx);
}
creature_ptr->oldpy = y;
if (g_ptr->m_idx)
{
- delete_monster_idx(g_ptr->m_idx);
+ delete_monster_idx(creature_ptr, g_ptr->m_idx);
}
creature_ptr->oldpy = y;
exe_write_diary(caster_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_WIZ_ZAP, m_name);
}
- delete_monster_idx(i);
+ delete_monster_idx(caster_ptr, i);
}
}
}
/* Delete this monster */
- delete_monster_idx(i);
+ delete_monster_idx(caster_ptr, i);
}
}