OSDN Git Service

[Refactor] #38997 delete_monster_idx() にplayer_type * 引数を追加 / Added player_type ...
authorHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 10:12:03 +0000 (19:12 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 14:01:53 +0000 (23:01 +0900)
34 files changed:
src/cmd/cmd-pet.c
src/combat/melee1.c
src/dungeon-file.c
src/floor-generate.c
src/floor-generate.h
src/floor-save.c
src/floor-streams.c
src/floor.c
src/floor.h
src/grid.c
src/grid.h
src/monster-process.c
src/monster-status.c
src/monster.h
src/monster2.c
src/mspells4.c
src/mutation.c
src/rooms-city.c
src/rooms-fractal.c
src/rooms-normal.c
src/rooms-normal.h
src/rooms-pitnest.c
src/rooms-special.c
src/rooms-trap.c
src/rooms-trap.h
src/rooms-vault.c
src/rooms.c
src/rooms.h
src/spells-floor.c
src/spells1.c
src/spells2.c
src/spells3.c
src/wild.c
src/wizard2.c

index d610b7c..6464dfd 100644 (file)
@@ -242,7 +242,7 @@ void do_cmd_pet_dismiss(player_type *creature_ptr)
                        creature_ptr->update |= (PU_BONUS);
                        creature_ptr->window |= (PW_MESSAGE);
 
-                       delete_monster_idx(pet_ctr);
+                       delete_monster_idx(creature_ptr, pet_ctr);
                        Dismissed++;
                }
        }
index afc255b..2a394d2 100644 (file)
@@ -4846,7 +4846,7 @@ void mon_take_hit_mon(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam,
 
                        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;
index 831a872..7659cf7 100644 (file)
@@ -4047,7 +4047,7 @@ static errr process_dungeon_file_aux(player_type *player_ptr, char *buf, int ymi
                                        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]);
index a99fcb8..422b53c 100644 (file)
@@ -499,7 +499,7 @@ static void gen_caverns_and_lakes(dungeon_type *dungeon_ptr, player_type *owner_
                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 */
@@ -551,7 +551,7 @@ static void gen_caverns_and_lakes(dungeon_type *dungeon_ptr, player_type *owner_
                if (dun->laketype)
                {
                        msg_print_wizard(CHEAT_DUNGEON, _("湖を生成します。", "Lake on the level."));
-                       build_lake(floor_ptr, dun->laketype);
+                       build_lake(owner_ptr, dun->laketype);
                }
        }
 
@@ -564,7 +564,7 @@ static void gen_caverns_and_lakes(dungeon_type *dungeon_ptr, player_type *owner_
                /* 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 */
 
@@ -642,22 +642,22 @@ static bool cave_gen(player_type *player_ptr)
                {
                        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
@@ -667,7 +667,7 @@ static bool cave_gen(player_type *player_ptr)
                {
                        for (x = 0; x < floor_ptr->width; x++)
                        {
-                               place_extra_bold(floor_ptr, y, x);
+                               place_extra_bold(player_ptr, y, x);
                        }
                }
        }
@@ -807,12 +807,12 @@ static bool cave_gen(player_type *player_ptr)
                        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;
@@ -833,7 +833,7 @@ static bool cave_gen(player_type *player_ptr)
                                        /* Clear mimic type */
                                        g_ptr->mimic = 0;
 
-                                       place_grid(g_ptr, floor);
+                                       place_grid(player_ptr, g_ptr, floor);
                                }
                        }
 
@@ -849,7 +849,7 @@ static bool cave_gen(player_type *player_ptr)
                                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))
@@ -909,15 +909,15 @@ static bool cave_gen(player_type *player_ptr)
        /* 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 */
@@ -1001,9 +1001,10 @@ static bool cave_gen(player_type *player_ptr)
 
 /*!
  * @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;
@@ -1015,38 +1016,39 @@ static void build_arena(floor_type *floor_ptr, POSITION *start_y, POSITION *star
        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;
@@ -1059,13 +1061,14 @@ static void build_arena(floor_type *floor_ptr, POSITION *start_y, POSITION *star
  * @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;
 
@@ -1075,7 +1078,7 @@ static void generate_challenge_arena(floor_type *floor_ptr, player_type *challan
                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);
@@ -1092,7 +1095,7 @@ static void generate_challenge_arena(floor_type *floor_ptr, player_type *challan
                }
        }
 
-       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)))
@@ -1106,9 +1109,10 @@ static void generate_challenge_arena(floor_type *floor_ptr, player_type *challan
 
 /*!
  * @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;
@@ -1120,38 +1124,39 @@ static void build_battle(floor_type *floor_ptr, POSITION *y, POSITION *x)
        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++)
@@ -1187,7 +1192,7 @@ static void generate_gambling_arena(player_type *creature_ptr)
                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);
@@ -1204,7 +1209,7 @@ static void generate_gambling_arena(player_type *creature_ptr)
                }
        }
 
-       build_battle(floor_ptr, &y, &x);
+       build_battle(creature_ptr, &y, &x);
 
        player_place(creature_ptr, y, x);
 
@@ -1239,7 +1244,7 @@ static void generate_fixed_floor(player_type *player_ptr)
        {
                for (x = 0; x < floor_ptr->width; x++)
                {
-                       place_solid_perm_bold(floor_ptr, y, x);
+                       place_solid_perm_bold(player_ptr, y, x);
                }
        }
 
@@ -1446,7 +1451,7 @@ void generate_floor(player_type *player_ptr)
 
                if (floor_ptr->inside_arena)
                {
-                       generate_challenge_arena(floor_ptr, player_ptr);
+                       generate_challenge_arena(player_ptr);
                }
 
                else if (player_ptr->phase_out)
@@ -1549,6 +1554,7 @@ static void correct_dir(POSITION *rdir, POSITION *cdir, POSITION y1, POSITION x1
 
 /*!
 * @brief 部屋間のトンネルを生成する / Constructs a tunnel between two points
+* @param player_ptr プレーヤーへの参照ポインタ
 * @param row1 始点Y座標
 * @param col1 始点X座標
 * @param row2 終点Y座標
@@ -1582,7 +1588,7 @@ static void correct_dir(POSITION *rdir, POSITION *cdir, POSITION y1, POSITION x1
 *   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;
@@ -1602,6 +1608,7 @@ bool build_tunnel(floor_type *floor_ptr, POSITION row1, POSITION col1, POSITION
        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 */
@@ -1680,7 +1687,7 @@ bool build_tunnel(floor_type *floor_ptr, POSITION row1, POSITION col1, POSITION
                                        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);
                                        }
                                }
                        }
@@ -1760,6 +1767,7 @@ bool build_tunnel(floor_type *floor_ptr, POSITION row1, POSITION col1, POSITION
 
 /*!
 * @brief トンネル生成のための基準点を指定する。
+* @param player_ptr プレーヤーへの参照ポインタ
 * @param x 基準点を指定するX座標の参照ポインタ、適時値が修正される。
 * @param y 基準点を指定するY座標の参照ポインタ、適時値が修正される。
 * @param affectwall (調査中)
@@ -1776,10 +1784,11 @@ bool build_tunnel(floor_type *floor_ptr, POSITION row1, POSITION col1, POSITION
 * 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;
@@ -1829,7 +1838,7 @@ static bool set_tunnel(floor_type *floor_ptr, POSITION *x, POSITION *y, bool aff
                                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);
                                }
                        }
                }
@@ -1837,7 +1846,7 @@ static bool set_tunnel(floor_type *floor_ptr, POSITION *x, POSITION *y, bool aff
                /* 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;
        }
@@ -1869,7 +1878,7 @@ static bool set_tunnel(floor_type *floor_ptr, POSITION *x, POSITION *y, bool aff
                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;
                }
@@ -1887,6 +1896,7 @@ static bool set_tunnel(floor_type *floor_ptr, POSITION *x, POSITION *y, bool aff
 
 /*!
 * @brief 外壁を削って「カタコンベ状」の通路を作成する / This routine creates the catacomb-like tunnels by removing extra rock.
+* @param player_ptr プレーヤーへの参照ポインタ
 * @param x 基準点のX座標
 * @param y 基準点のY座標
 * @return なし
@@ -1894,31 +1904,32 @@ static bool set_tunnel(floor_type *floor_ptr, POSITION *x, POSITION *y, bool aff
 * 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
@@ -1939,7 +1950,7 @@ static void create_cata_tunnel(floor_type *floor_ptr, POSITION x, POSITION y)
 * 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;
@@ -1959,7 +1970,7 @@ static void short_seg_hack(floor_type *floor_ptr, POSITION x1, POSITION y1, POSI
                {
                        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)
                                {
@@ -1969,8 +1980,8 @@ static void short_seg_hack(floor_type *floor_ptr, POSITION x1, POSITION y1, POSI
                                }
 
                                /* 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);
                        }
                }
        }
@@ -1982,15 +1993,15 @@ static void short_seg_hack(floor_type *floor_ptr, POSITION x1, POSITION y1, POSI
                        {
                                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);
                                }
                        }
                }
@@ -2000,15 +2011,15 @@ static void short_seg_hack(floor_type *floor_ptr, POSITION x1, POSITION y1, POSI
                        {
                                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);
                                }
                        }
 
@@ -2019,15 +2030,15 @@ static void short_seg_hack(floor_type *floor_ptr, POSITION x1, POSITION y1, POSI
                        {
                                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);
                                }
                        }
                }
@@ -2037,15 +2048,15 @@ static void short_seg_hack(floor_type *floor_ptr, POSITION x1, POSITION y1, POSI
                        {
                                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);
                                }
                        }
                }
@@ -2067,7 +2078,7 @@ static void short_seg_hack(floor_type *floor_ptr, POSITION x1, POSITION y1, POSI
 * 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;
@@ -2077,7 +2088,7 @@ bool build_tunnel2(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2,
        grid_type *g_ptr;
 
        length = distance(x1, y1, x2, y2);
-
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        if (length > cutoff)
        {
                /*
@@ -2125,7 +2136,7 @@ bool build_tunnel2(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2,
                        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;
                        }
@@ -2136,12 +2147,12 @@ bool build_tunnel2(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2,
 
                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
                                {
@@ -2169,9 +2180,9 @@ bool build_tunnel2(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2,
                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
@@ -2184,7 +2195,7 @@ bool build_tunnel2(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2,
                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;
@@ -2193,7 +2204,7 @@ bool build_tunnel2(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2,
        {
                /* 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;
index 1aabb18..6fe995a 100644 (file)
@@ -105,5 +105,5 @@ extern void wipe_generate_random_floor_flags(floor_type *floor_ptr);
 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);
index ffaef61..2152e93 100644 (file)
@@ -373,7 +373,7 @@ static void build_dead_end(player_type *creature_ptr)
                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);
                }
        }
 
@@ -382,7 +382,7 @@ static void build_dead_end(player_type *creature_ptr)
        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);
 }
@@ -420,7 +420,7 @@ static void preserve_pet(player_type *master_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);
                }
        }
 
@@ -473,7 +473,7 @@ static void preserve_pet(player_type *master_ptr)
                        num++;
 
                        /* Delete from this floor */
-                       delete_monster_idx(i);
+                       delete_monster_idx(master_ptr, i);
                }
        }
 
@@ -512,7 +512,7 @@ static void preserve_pet(player_type *master_ptr)
                                msg_format(_("%sは消え去った!", "%^s disappears!"), m_name);
                        }
 
-                       delete_monster_idx(i);
+                       delete_monster_idx(master_ptr, i);
                }
        }
 }
@@ -933,7 +933,7 @@ void leave_floor(player_type *creature_ptr)
                    (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 */
@@ -1254,7 +1254,7 @@ void change_floor(player_type *creature_ptr)
                                if (r_ptr->floor_id != new_floor_id)
                                {
                                        /* Disapper from here */
-                                       delete_monster_idx(i);
+                                       delete_monster_idx(creature_ptr, i);
                                }
                        }
 
index 8cf7aae..90c496b 100644 (file)
@@ -297,7 +297,7 @@ void build_streamer(player_type *player_ptr, FEAT_IDX feat, int chance)
                        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))
index c183430..7d22785 100644 (file)
@@ -39,13 +39,13 @@ void place_locked_door(player_type *player_ptr, POSITION y, POSITION 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;
        }
 
        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);
 }
 
 
@@ -62,7 +62,7 @@ void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type
        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;
        }
 
@@ -95,7 +95,7 @@ void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type
        }
 
        g_ptr->info &= ~(CAVE_FLOOR);
-       delete_monster(floor_ptr, y, x);
+       delete_monster(player_ptr, y, x);
 }
 
 static int scent_when = 0;
@@ -224,8 +224,8 @@ void add_door(player_type *player_ptr, POSITION x, POSITION y)
                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:
@@ -243,8 +243,8 @@ void add_door(player_type *player_ptr, POSITION x, POSITION y)
                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);
        }
 }
 
@@ -740,7 +740,7 @@ void place_random_door(player_type *player_ptr, POSITION y, POSITION x, bool roo
 
        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;
        }
 
@@ -794,7 +794,7 @@ void place_random_door(player_type *player_ptr, POSITION y, POSITION x, bool roo
 
        if (tmp >= 400)
        {
-               delete_monster(floor_ptr, y, x);
+               delete_monster(player_ptr, y, x);
                return;
        }
 
@@ -804,10 +804,10 @@ void place_random_door(player_type *player_ptr, POSITION y, POSITION x, bool roo
        }
        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);
 }
 
 
@@ -887,7 +887,7 @@ void place_closed_door(player_type *player_ptr, POSITION y, POSITION x, int type
        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;
        }
 
@@ -918,7 +918,7 @@ void place_closed_door(player_type *player_ptr, POSITION y, POSITION x, int type
 
        if (feat == feat_none)
        {
-               place_floor_bold(floor_ptr, y, x);
+               place_floor_bold(player_ptr, y, x);
                return;
        }
 
@@ -1512,12 +1512,14 @@ sint project_path(player_type *player_ptr, u16b *gp, POSITION range, POSITION y1
 
 /*!
  * @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 */
@@ -1532,7 +1534,7 @@ void set_floor(floor_type *floor_ptr, POSITION x, POSITION y)
 
        /* 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);
 }
 
 
@@ -1662,20 +1664,22 @@ void place_gold(floor_type *floor_ptr, POSITION y, POSITION 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);
 }
 
 
index 43ca47f..bbd5c36 100644 (file)
@@ -421,10 +421,10 @@ extern void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int n
 #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);
index b7730f7..b4b1649 100644 (file)
 
 #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 */
@@ -236,7 +236,7 @@ bool new_player_spot(player_type *creature_ptr)
  * @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)
        {
@@ -257,7 +257,7 @@ void place_bound_perm_wall(grid_type *g_ptr)
        }
 
        /* Add "solid" perma-wall */
-       place_grid(g_ptr, solid_perm);
+       place_grid(player_ptr, g_ptr, solid_perm);
 }
 
 /*!
@@ -840,11 +840,11 @@ void lite_spot(POSITION y, POSITION x)
  * 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;
 
@@ -1208,7 +1208,7 @@ bool player_can_enter(player_type *creature_ptr, FEAT_IDX feature, BIT_FLAGS16 m
 }
 
 
-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)
        {
@@ -1268,7 +1268,7 @@ void place_grid(grid_type *g_ptr, place_grid_type 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);
 }
 
 
@@ -1283,3 +1283,108 @@ bool darkened_grid(player_type *player_ptr, grid_type *g_ptr)
        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);
+}
index 0a83122..305d2ca 100644 (file)
@@ -117,111 +117,6 @@ typedef struct
 #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
  */
@@ -274,7 +169,7 @@ extern bool new_player_spot(player_type *creature_ptr);
 
 #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);
@@ -317,8 +212,19 @@ typedef enum place_grid_type
        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)
index 866a162..2d1cff2 100644 (file)
@@ -1304,7 +1304,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                        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;
        }
@@ -1333,7 +1333,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                        /* 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."));
@@ -1393,7 +1393,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                                }
 
                                check_quest_completion(target_ptr, m_ptr);
-                               delete_monster_idx(m_idx);
+                               delete_monster_idx(target_ptr, m_idx);
                                return;
                        }
                }
index f461a4d..d27d249 100644 (file)
@@ -1393,7 +1393,7 @@ bool mon_take_hit(player_type *target_ptr, MONSTER_IDX m_idx, HIT_POINT dam, boo
                        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!"));
@@ -1401,7 +1401,7 @@ bool mon_take_hit(player_type *target_ptr, MONSTER_IDX m_idx, HIT_POINT dam, boo
                }
                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);
index 6b1ba0f..d17bcf3 100644 (file)
@@ -468,7 +468,7 @@ extern void set_target(monster_type *m_ptr, POSITION y, POSITION x);
 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);
index f82d524..491e195 100644 (file)
@@ -111,9 +111,9 @@ MONRACE_IDX real_r_idx(monster_type *m_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];
 
@@ -126,23 +126,23 @@ void delete_monster_idx(MONSTER_IDX i)
        /* 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;
@@ -161,7 +161,7 @@ void delete_monster_idx(MONSTER_IDX i)
        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);
        }
 }
 
@@ -308,7 +308,7 @@ void compact_monsters(player_type *player_ptr, int size)
                                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++;
                }
        }
index be3b106..43fed0f 100644 (file)
@@ -2099,7 +2099,7 @@ HIT_POINT spell_RF6_SPECIAL_BANORLUPART(player_type *target_ptr, MONSTER_IDX m_i
                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;
@@ -2129,7 +2129,7 @@ HIT_POINT spell_RF6_SPECIAL_BANORLUPART(player_type *target_ptr, MONSTER_IDX m_i
                                        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);
index ab207c3..b60d0d6 100644 (file)
@@ -2323,7 +2323,7 @@ bool exe_mutation_power(player_type *creature_ptr, int power)
                                                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!"));
 
                                }
index 0dea40f..d36fad0 100644 (file)
@@ -110,13 +110,12 @@ static void build_stores(player_type *player_ptr, POSITION ltcy, POSITION ltcx,
        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);
@@ -127,7 +126,7 @@ static void build_stores(player_type *player_ptr, POSITION ltcy, POSITION ltcx,
                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);
 
@@ -237,7 +236,7 @@ bool build_type16(player_type *player_ptr)
        }
 
        /* 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);
@@ -249,7 +248,7 @@ bool build_type16(player_type *player_ptr)
        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);
 
@@ -263,4 +262,3 @@ bool build_type16(player_type *player_ptr)
 
        return TRUE;
 }
-
index 4b38881..f7de151 100644 (file)
@@ -23,14 +23,14 @@ bool build_type9(player_type *player_ptr)
 
        /* 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?!
@@ -64,7 +64,7 @@ bool build_type9(player_type *player_ptr)
                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;
index 4aaaf4c..f187388 100644 (file)
@@ -35,7 +35,7 @@ bool build_type1(player_type *player_ptr)
        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;
@@ -47,7 +47,7 @@ bool build_type1(player_type *player_ptr)
                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 */
@@ -67,7 +67,7 @@ bool build_type1(player_type *player_ptr)
                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);
                }
@@ -77,16 +77,16 @@ bool build_type1(player_type *player_ptr)
        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);
        }
 
 
@@ -122,7 +122,7 @@ bool build_type1(player_type *player_ptr)
                        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);
                        }
                }
        }
@@ -133,16 +133,16 @@ bool build_type1(player_type *player_ptr)
                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);
                }
        }
 
@@ -152,16 +152,16 @@ bool build_type1(player_type *player_ptr)
                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 */
@@ -175,26 +175,26 @@ bool build_type1(player_type *player_ptr)
                        /* 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);
@@ -206,9 +206,10 @@ bool build_type1(player_type *player_ptr)
 
 /*!
 * @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;
@@ -217,7 +218,8 @@ bool build_type2(floor_type *floor_ptr)
        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));
@@ -241,7 +243,7 @@ bool build_type2(floor_type *floor_ptr)
                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);
                }
@@ -253,7 +255,7 @@ bool build_type2(floor_type *floor_ptr)
                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);
                }
@@ -264,32 +266,32 @@ bool build_type2(floor_type *floor_ptr)
        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);
        }
 
 
@@ -300,7 +302,7 @@ bool build_type2(floor_type *floor_ptr)
                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);
                }
        }
 
@@ -310,7 +312,7 @@ bool build_type2(floor_type *floor_ptr)
                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);
                }
        }
 
@@ -342,7 +344,7 @@ bool build_type3(player_type *player_ptr)
 
        /* 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 */
@@ -377,7 +379,7 @@ bool build_type3(player_type *player_ptr)
                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);
                }
@@ -389,7 +391,7 @@ bool build_type3(player_type *player_ptr)
                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);
                }
@@ -400,32 +402,32 @@ bool build_type3(player_type *player_ptr)
        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);
        }
 
 
@@ -435,7 +437,7 @@ bool build_type3(player_type *player_ptr)
                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);
                }
        }
 
@@ -445,7 +447,7 @@ bool build_type3(player_type *player_ptr)
                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);
                }
        }
 
@@ -462,7 +464,7 @@ bool build_type3(player_type *player_ptr)
                        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;
@@ -475,16 +477,16 @@ bool build_type3(player_type *player_ptr)
                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 */
@@ -519,9 +521,9 @@ bool build_type3(player_type *player_ptr)
                        {
                                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 */
@@ -529,9 +531,9 @@ bool build_type3(player_type *player_ptr)
                        {
                                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 */
@@ -552,22 +554,22 @@ bool build_type3(player_type *player_ptr)
                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;
@@ -598,7 +600,7 @@ bool build_type4(player_type *player_ptr)
 
        /* 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));
@@ -615,7 +617,7 @@ bool build_type4(player_type *player_ptr)
                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);
                }
@@ -625,16 +627,16 @@ bool build_type4(player_type *player_ptr)
        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);
        }
 
 
@@ -648,16 +650,16 @@ bool build_type4(player_type *player_ptr)
        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);
        }
 
 
@@ -701,7 +703,7 @@ bool build_type4(player_type *player_ptr)
                                {
                                        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);
                                }
                        }
 
@@ -753,7 +755,7 @@ bool build_type4(player_type *player_ptr)
                                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);
                                }
                        }
 
@@ -766,12 +768,12 @@ bool build_type4(player_type *player_ptr)
                                        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);
                                        }
                                }
                        }
@@ -787,16 +789,16 @@ bool build_type4(player_type *player_ptr)
                                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);
@@ -834,7 +836,7 @@ bool build_type4(player_type *player_ptr)
                                        if (0x1 & (x + y))
                                        {
                                                g_ptr = &floor_ptr->grid_array[y][x];
-                                               place_grid(g_ptr, inner);
+                                               place_grid(player_ptr, g_ptr, inner);
                                        }
                                }
                        }
@@ -864,12 +866,12 @@ bool build_type4(player_type *player_ptr)
                        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 */
@@ -909,6 +911,7 @@ bool build_type4(player_type *player_ptr)
 
 /*!
 * @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
@@ -916,18 +919,19 @@ bool build_type4(player_type *player_ptr)
 *\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++)
@@ -937,18 +941,18 @@ bool build_type11(floor_type *floor_ptr)
                        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;
 }
@@ -984,7 +988,7 @@ bool build_type12(player_type *player_ptr)
        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++)
@@ -997,29 +1001,29 @@ bool build_type12(player_type *player_ptr)
                        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++)
index 1f88988..c7f9584 100644 (file)
@@ -1,6 +1,6 @@
 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);
index 6f4d43b..43833a0 100644 (file)
@@ -341,7 +341,7 @@ bool build_type5(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;
@@ -355,7 +355,7 @@ bool build_type5(player_type *player_ptr)
                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);
                }
        }
@@ -364,16 +364,16 @@ bool build_type5(player_type *player_ptr)
        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);
        }
 
 
@@ -387,17 +387,17 @@ bool build_type5(player_type *player_ptr)
        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++)
        {
@@ -550,7 +550,7 @@ bool build_type6(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;
@@ -564,7 +564,7 @@ bool build_type6(player_type *player_ptr)
                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);
                }
        }
@@ -573,16 +573,16 @@ bool build_type6(player_type *player_ptr)
        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 */
@@ -595,16 +595,16 @@ bool build_type6(player_type *player_ptr)
        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++)
        {
@@ -859,7 +859,7 @@ bool build_type13(player_type *player_ptr)
        }
 
        /* 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;
@@ -873,7 +873,7 @@ bool build_type13(player_type *player_ptr)
                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);
                }
        }
@@ -882,11 +882,11 @@ bool build_type13(player_type *player_ptr)
        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);
        }
 
@@ -894,11 +894,11 @@ bool build_type13(player_type *player_ptr)
        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);
        }
 
@@ -906,27 +906,27 @@ bool build_type13(player_type *player_ptr)
        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 */
@@ -934,26 +934,26 @@ bool build_type13(player_type *player_ptr)
        {
                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);
                }
        }
 
index 3185b83..7df5158 100644 (file)
@@ -31,7 +31,7 @@ bool build_type15(player_type *player_ptr)
 
        /* 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));
@@ -48,7 +48,7 @@ bool build_type15(player_type *player_ptr)
                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);
@@ -59,20 +59,20 @@ bool build_type15(player_type *player_ptr)
        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;
        }
 
@@ -96,7 +96,7 @@ bool build_type15(player_type *player_ptr)
                        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;
                        }
                }
@@ -107,7 +107,7 @@ bool build_type15(player_type *player_ptr)
                        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);
                }
@@ -134,19 +134,19 @@ bool build_type15(player_type *player_ptr)
 
                /* 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);
 
@@ -157,7 +157,7 @@ bool build_type15(player_type *player_ptr)
                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;
                }
 
@@ -188,27 +188,27 @@ bool build_type15(player_type *player_ptr)
                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;
                }
 
index a5ef787..1ec4b6c 100644 (file)
 
 /*!
 * @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;
@@ -34,9 +35,10 @@ bool build_type14(floor_type *floor_ptr)
        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));
 
 
@@ -53,7 +55,7 @@ bool build_type14(floor_type *floor_ptr)
                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);
                }
@@ -63,16 +65,16 @@ bool build_type14(floor_type *floor_ptr)
        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))
index a6ce1a1..92c7708 100644 (file)
@@ -1 +1 @@
-extern bool build_type14(floor_type *floor_ptr);
+extern bool build_type14(player_type *player_ptr);
index 23f5819..422f994 100644 (file)
@@ -88,9 +88,9 @@ static void build_bubble_vault(player_type *player_ptr, POSITION x0, POSITION y0
        {
                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);
        }
 
@@ -99,9 +99,9 @@ static void build_bubble_vault(player_type *player_ptr, POSITION x0, POSITION y0
        {
                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);
        }
 
@@ -143,12 +143,12 @@ static void build_bubble_vault(player_type *player_ptr, POSITION x0, POSITION y0
                        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 */
@@ -190,7 +190,7 @@ static void build_room_vault(player_type *player_ptr, POSITION x0, POSITION y0,
                {
                        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);
                }
        }
@@ -202,7 +202,7 @@ static void build_room_vault(player_type *player_ptr, POSITION x0, POSITION y0,
                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 */
@@ -253,7 +253,7 @@ static void build_cave_vault(player_type *player_ptr, POSITION x0, POSITION y0,
                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 */
@@ -364,7 +364,7 @@ static void build_vault(player_type *player_ptr, POSITION yval, POSITION xval, P
                        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;
@@ -377,28 +377,28 @@ static void build_vault(player_type *player_ptr, POSITION yval, POSITION xval, P
                        {
                                /* 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;
 
@@ -701,7 +701,7 @@ bool build_type7(player_type *player_ptr)
        }
 
        /* 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];
@@ -789,7 +789,7 @@ bool build_type8(player_type *player_ptr)
        * 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)];
@@ -848,25 +848,25 @@ static void build_target_vault(player_type *player_ptr, POSITION x0, POSITION y0
                        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++)
@@ -876,7 +876,7 @@ static void build_target_vault(player_type *player_ptr, POSITION x0, POSITION y0
                        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);
                        }
                }
        }
@@ -884,27 +884,27 @@ static void build_target_vault(player_type *player_ptr, POSITION x0, POSITION y0
        /* 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 */
@@ -995,7 +995,7 @@ static void build_elemental_vault(player_type *player_ptr, POSITION x0, POSITION
                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 */
@@ -1055,7 +1055,7 @@ static void build_mini_c_vault(player_type *player_ptr, POSITION x0, POSITION y0
 
                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++)
@@ -1064,7 +1064,7 @@ static void build_mini_c_vault(player_type *player_ptr, POSITION x0, POSITION y0
 
                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++)
@@ -1073,7 +1073,7 @@ static void build_mini_c_vault(player_type *player_ptr, POSITION x0, POSITION y0
 
                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++)
@@ -1082,7 +1082,7 @@ static void build_mini_c_vault(player_type *player_ptr, POSITION x0, POSITION y0
 
                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++)
@@ -1094,7 +1094,7 @@ static void build_mini_c_vault(player_type *player_ptr, POSITION x0, POSITION y0
                        g_ptr->info |= (CAVE_ROOM | CAVE_ICKY);
 
                        /* Permanent walls */
-                       place_grid(g_ptr, inner_perm);
+                       place_grid(player_ptr, g_ptr, inner_perm);
                }
        }
 
@@ -1108,7 +1108,7 @@ static void build_mini_c_vault(player_type *player_ptr, POSITION x0, POSITION y0
        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++)
@@ -1119,7 +1119,7 @@ static void build_mini_c_vault(player_type *player_ptr, POSITION x0, POSITION y0
                        /* 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);
                        }
                }
        }
@@ -1129,15 +1129,15 @@ static void build_mini_c_vault(player_type *player_ptr, POSITION x0, POSITION y0
        {
                /* 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 */
@@ -1177,12 +1177,12 @@ static void build_castle_vault(player_type *player_ptr, POSITION x0, POSITION y0
                {
                        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));
@@ -1204,7 +1204,7 @@ bool build_type10(player_type *player_ptr)
 
        /* 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
@@ -1308,7 +1308,7 @@ bool build_type17(player_type *player_ptr)
        }
 
        /* 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];
index 745ebfe..a03c45e 100644 (file)
@@ -139,14 +139,14 @@ void build_small_room(player_type *player_ptr, POSITION x0, POSITION y0)
        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 */
@@ -162,26 +162,28 @@ void build_small_room(player_type *player_ptr, POSITION x0, POSITION y0)
        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);
 
        /*
@@ -243,7 +245,7 @@ static void check_room_boundary(floor_type *floor_ptr, POSITION x1, POSITION y1,
        {
                for (x = x1; x <= x2; x++)
                {
-                       set_floor(floor_ptr, x, y);
+                       set_floor(player_ptr, x, y);
                }
        }
 }
@@ -332,6 +334,7 @@ static bool find_space_aux(POSITION blocks_high, POSITION blocks_wide, POSITION
 
 /*!
  * @brief 部屋生成が可能なスペースを確保する / Find a good spot for the next room.  -LM-
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param y 部屋の生成が可能な中心Y座標を返す参照ポインタ
  * @param x 部屋の生成が可能な中心X座標を返す参照ポインタ
  * @param height 確保したい領域の高さ
@@ -350,7 +353,7 @@ static bool find_space_aux(POSITION blocks_high, POSITION blocks_wide, POSITION
  * 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;
@@ -387,7 +390,7 @@ bool find_space(floor_type *floor_ptr, POSITION *y, POSITION *x, POSITION height
        }
 
        /* 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);
@@ -455,7 +458,7 @@ bool find_space(floor_type *floor_ptr, POSITION *y, POSITION *x, POSITION height
         * 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;
@@ -765,12 +768,13 @@ void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi
 }
 
 
-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 */
@@ -828,7 +832,7 @@ static bool hack_isnt_wall(floor_type *floor_ptr, POSITION y, POSITION x, int c1
                /* 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;
                }
        }
@@ -841,7 +845,7 @@ static bool hack_isnt_wall(floor_type *floor_ptr, POSITION y, POSITION x, int c1
  * 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;
@@ -857,6 +861,7 @@ static void cave_fill(floor_type *floor_ptr, POSITION y, POSITION x)
        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 */
@@ -888,7 +893,7 @@ static void cave_fill(floor_type *floor_ptr, POSITION y, POSITION x)
                                && (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))
@@ -922,7 +927,7 @@ static void cave_fill(floor_type *floor_ptr, POSITION y, POSITION x)
 }
 
 
-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;
@@ -955,7 +960,8 @@ bool generate_fracave(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION
        /* 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)
@@ -965,7 +971,7 @@ bool generate_fracave(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION
                {
                        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);
                        }
                }
@@ -983,30 +989,30 @@ bool generate_fracave(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION
                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 */
@@ -1021,29 +1027,29 @@ bool generate_fracave(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION
                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 */
@@ -1080,14 +1086,14 @@ bool generate_fracave(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION
                                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);
                        }
                }
@@ -1111,13 +1117,14 @@ bool generate_fracave(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION
 /*
  * 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 */
@@ -1145,11 +1152,12 @@ void build_cavern(floor_type *floor_ptr)
                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;
@@ -1226,7 +1234,8 @@ bool generate_lake(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi
        /* 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)
@@ -1236,7 +1245,7 @@ bool generate_lake(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi
                {
                        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);
                        }
                }
@@ -1246,8 +1255,8 @@ bool generate_lake(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi
        /* 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);
@@ -1258,8 +1267,8 @@ bool generate_lake(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi
 
        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);
@@ -1275,7 +1284,7 @@ bool generate_lake(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi
                        /* 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);
@@ -1295,7 +1304,7 @@ bool generate_lake(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi
 /*
  * 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;
@@ -1309,6 +1318,7 @@ void build_lake(floor_type *floor_ptr, int type)
        }
 
        /* 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;
@@ -1340,7 +1350,7 @@ void build_lake(floor_type *floor_ptr, int type)
                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 */
@@ -1488,7 +1498,7 @@ void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y
  * 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;
@@ -1518,20 +1528,21 @@ void build_room(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, PO
 
 
        /* 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);
        }
 
@@ -1543,7 +1554,7 @@ void build_room(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, PO
                        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
@@ -1575,7 +1586,7 @@ void build_room(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, PO
  * 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];
 
@@ -1587,7 +1598,7 @@ void r_visit(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSIT
        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))
@@ -1627,32 +1638,32 @@ void r_visit(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSIT
                        /* (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 */
        }
@@ -1692,15 +1703,15 @@ void build_maze_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITIO
                        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);
                }
@@ -1715,7 +1726,7 @@ void build_maze_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITIO
        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));
@@ -1731,7 +1742,7 @@ void build_maze_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITIO
  * 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;
@@ -1770,7 +1781,6 @@ void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSIT
        }
 
        /* Based on the choice made above, do something */
-
        switch (choice)
        {
        case 1:
@@ -1780,15 +1790,15 @@ void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSIT
                /* 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 */
@@ -1796,15 +1806,15 @@ void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSIT
                {
                        /* 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 */
@@ -1816,12 +1826,12 @@ void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSIT
                /* 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;
@@ -1843,7 +1853,7 @@ void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSIT
                        {
                                for (x = x1; x < x2; x++)
                                {
-                                       place_inner_bold(floor_ptr, y, x);
+                                       place_inner_bold(player_ptr, y, x);
                                }
                        }
 
@@ -1855,15 +1865,15 @@ void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSIT
                /* 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 */
@@ -1872,16 +1882,16 @@ void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSIT
                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:
@@ -1894,15 +1904,15 @@ void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSIT
                        {
                                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:
@@ -1915,15 +1925,15 @@ void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSIT
                        {
                                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;
        }
        }
@@ -1935,12 +1945,13 @@ void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSIT
  * 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];
@@ -1962,7 +1973,7 @@ void add_outer_wall(floor_type *floor_ptr, POSITION x, POSITION y, int light, PO
                        {
                                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;
                                }
                        }
@@ -1971,7 +1982,7 @@ void add_outer_wall(floor_type *floor_ptr, POSITION x, POSITION y, int light, PO
        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))
@@ -2011,7 +2022,7 @@ POSITION dist2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, POSITION h1,
 
 
 /* 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;
 
@@ -2022,15 +2033,15 @@ void generate_room_floor(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITI
                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;
 
@@ -2039,7 +2050,7 @@ void generate_fill_perm_bold(floor_type *floor_ptr, POSITION y1, POSITION x1, PO
                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);
                }
        }
 }
@@ -2054,12 +2065,11 @@ void generate_fill_perm_bold(floor_type *floor_ptr, POSITION y1, POSITION x1, PO
  */
 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);
@@ -2068,10 +2078,10 @@ static bool room_build(player_type *player_ptr, EFFECT_ID typ)
        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);
index 69f426a..38381dd 100644 (file)
@@ -65,8 +65,8 @@ struct room_info_type
 
 /* 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 */
@@ -90,16 +90,16 @@ door_type feat_door[MAX_DOOR_TYPES];
 
 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);
index 5001fca..a5ac2b2 100644 (file)
@@ -506,7 +506,7 @@ bool destroy_area(player_type *caster_ptr, POSITION y1, POSITION x1, POSITION r,
                                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)
                                {
@@ -527,7 +527,7 @@ bool destroy_area(player_type *caster_ptr, POSITION y1, POSITION x1, POSITION r,
                                        }
 
                                        /* Delete the monster (if any) */
-                                       delete_monster(floor_ptr, y, x);
+                                       delete_monster(caster_ptr, y, x);
                                }
                        }
 
@@ -601,7 +601,7 @@ bool destroy_area(player_type *caster_ptr, POSITION y1, POSITION x1, POSITION r,
                        if (t < 20)
                        {
                                /* Create granite wall */
-                               place_grid(g_ptr, extra);
+                               place_grid(caster_ptr, g_ptr, extra);
                        }
                        else if (t < 70)
                        {
@@ -616,7 +616,7 @@ bool destroy_area(player_type *caster_ptr, POSITION y1, POSITION x1, POSITION r,
                        else
                        {
                                /* Create floor */
-                               place_grid(g_ptr, floor);
+                               place_grid(caster_ptr, g_ptr, floor);
                        }
 
                        /* Clear garbage of hidden trap or door */
@@ -1002,7 +1002,7 @@ bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, M
                                        }
                                }
 
-                               delete_monster(floor_ptr, yy, xx);
+                               delete_monster(caster_ptr, yy, xx);
 
                                sn = 0;
                        }
index e06cfe5..a393f14 100644 (file)
@@ -3361,7 +3361,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                                        }
                                }
 
-                               delete_monster_idx(g_ptr->m_idx);
+                               delete_monster_idx(caster_ptr, g_ptr->m_idx);
 
                                return TRUE;
                        }
@@ -3816,7 +3816,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                        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)
                        {
@@ -3857,7 +3857,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                        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 */
index 30b39ff..0f6bdb5 100644 (file)
@@ -1085,7 +1085,7 @@ bool genocide_aux(player_type *caster_ptr, MONSTER_IDX m_idx, int power, bool pl
                        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)
@@ -1426,7 +1426,7 @@ void discharge_minion(player_type *caster_ptr)
                        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;
                }
 
@@ -1445,7 +1445,7 @@ void discharge_minion(player_type *caster_ptr)
                        exe_write_diary(caster_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name);
                }
 
-               delete_monster_idx(i);
+               delete_monster_idx(caster_ptr, i);
        }
 }
 
index 1fa32fa..bb3d6dd 100644 (file)
@@ -753,7 +753,7 @@ void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx)
                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);
 }
 
@@ -2757,7 +2757,7 @@ bool polymorph_monster(player_type *caster_ptr, POSITION y, POSITION x)
        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;
index d3ed0d7..726f7b1 100644 (file)
@@ -630,7 +630,7 @@ void wilderness_gen(player_type *creature_ptr)
 
                                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;
@@ -653,7 +653,7 @@ void wilderness_gen(player_type *creature_ptr)
 
                                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;
index 015af89..3ba025d 100644 (file)
@@ -1538,7 +1538,7 @@ static void do_cmd_wiz_zap(player_type *caster_ptr)
                        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);
        }
 }
 
@@ -1569,7 +1569,7 @@ static void do_cmd_wiz_zap_all(player_type *caster_ptr)
                }
 
                /* Delete this monster */
-               delete_monster_idx(i);
+               delete_monster_idx(caster_ptr, i);
        }
 }