OSDN Git Service

[Refactor] #38997 place_floor_bold() に floor_type * 引数を追加. / Add floor_type * argumen...
[hengband/hengband.git] / src / rooms-vault.c
index 60b2767..5c3267b 100644 (file)
@@ -148,7 +148,7 @@ static void build_bubble_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
                        else
                        {
                                /* middle of a bubble */
-                               place_floor_bold(y0 - yhsize + y, x0 - xhsize + x);
+                               place_floor_bold(floor_ptr, y0 - yhsize + y, x0 - xhsize + x);
                        }
 
                        /* clean up rest of flags */
@@ -161,7 +161,7 @@ static void build_bubble_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
        {
                x = randint1(xsize - 3) - xhsize + x0 + 1;
                y = randint1(ysize - 3) - yhsize + y0 + 1;
-               add_door(x, y);
+               add_door(floor_ptr, x, y);
        }
 
        /* Fill with monsters and treasure, low difficulty */
@@ -209,7 +209,7 @@ static void build_room_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, PO
        {
                x1 = randint1(xsize - 3) - xhsize + x0 + 1;
                y1 = randint1(ysize - 3) - yhsize + y0 + 1;
-               add_door(x1, y1);
+               add_door(floor_ptr, x1, y1);
        }
 
        /* Fill with monsters and treasure, high difficulty */
@@ -407,7 +407,7 @@ static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POS
                                }
                                else
                                {
-                                       place_trap(y, x);
+                                       place_trap(floor_ptr, y, x);
                                }
                                break;
 
@@ -423,23 +423,23 @@ static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POS
 
                                /* Secret doors */
                        case '+':
-                               place_secret_door(y, x, DOOR_DEFAULT);
+                               place_secret_door(floor_ptr, y, x, DOOR_DEFAULT);
                                break;
 
                                /* Secret glass doors */
                        case '-':
-                               place_secret_door(y, x, DOOR_GLASS_DOOR);
+                               place_secret_door(floor_ptr, y, x, DOOR_GLASS_DOOR);
                                if (is_closed_door(g_ptr->feat)) g_ptr->mimic = feat_glass_wall;
                                break;
 
                                /* Curtains */
                        case '\'':
-                               place_secret_door(y, x, DOOR_CURTAIN);
+                               place_secret_door(floor_ptr, y, x, DOOR_CURTAIN);
                                break;
 
                                /* Trap */
                        case '^':
-                               place_trap(y, x);
+                               place_trap(floor_ptr, y, x);
                                break;
 
                                /* Black market in a dungeon */
@@ -843,7 +843,7 @@ static void build_target_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
                        if (dist2(y0, x0, y, x, h1, h2, h3, h4) <= rad - 1)
                        {
                                /* inside- so is floor */
-                               place_floor_bold(y, x);
+                               place_floor_bold(floor_ptr, y, x);
                        }
                        else
                        {
@@ -872,7 +872,7 @@ static void build_target_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
                        if (dist2(y0, x0, y, x, h1, h2, h3, h4) == rad / 2)
                        {
                                /* Make an internal wall */
-                               place_inner_bold(y, x);
+                               place_inner_bold(floor_ptr, y, x);
                        }
                }
        }
@@ -880,27 +880,27 @@ static void build_target_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
        /* Add perpendicular walls */
        for (x = x0 - rad; x <= x0 + rad; x++)
        {
-               place_inner_bold(y0, x);
+               place_inner_bold(floor_ptr, y0, x);
        }
 
        for (y = y0 - rad; y <= y0 + rad; y++)
        {
-               place_inner_bold(y, x0);
+               place_inner_bold(floor_ptr, y, x0);
        }
 
        /* Make inner vault */
        for (y = y0 - 1; y <= y0 + 1; y++)
        {
-               place_inner_bold(y, x0 - 1);
-               place_inner_bold(y, x0 + 1);
+               place_inner_bold(floor_ptr, y, x0 - 1);
+               place_inner_bold(floor_ptr, y, x0 + 1);
        }
        for (x = x0 - 1; x <= x0 + 1; x++)
        {
-               place_inner_bold(y0 - 1, x);
-               place_inner_bold(y0 + 1, x);
+               place_inner_bold(floor_ptr, y0 - 1, x);
+               place_inner_bold(floor_ptr, y0 + 1, x);
        }
 
-       place_floor_bold(y0, x0);
+       place_floor_bold(floor_ptr, y0, x0);
 
 
        /* Add doors to vault */
@@ -908,14 +908,14 @@ static void build_target_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
        x = (rad - 2) / 4 + 1;
        y = rad / 2 + x;
 
-       add_door(x0 + x, y0);
-       add_door(x0 + y, y0);
-       add_door(x0 - x, y0);
-       add_door(x0 - y, y0);
-       add_door(x0, y0 + x);
-       add_door(x0, y0 + y);
-       add_door(x0, y0 - x);
-       add_door(x0, y0 - y);
+       add_door(floor_ptr, x0 + x, y0);
+       add_door(floor_ptr, x0 + y, y0);
+       add_door(floor_ptr, x0 - x, y0);
+       add_door(floor_ptr, x0 - y, y0);
+       add_door(floor_ptr, x0, y0 + x);
+       add_door(floor_ptr, x0, y0 + y);
+       add_door(floor_ptr, x0, y0 - x);
+       add_door(floor_ptr, x0, y0 - y);
 
        /* Fill with stuff - medium difficulty */
        fill_treasure(floor_ptr, x0 - rad, x0 + rad, y0 - rad, y0 + rad, randint1(3) + 3);
@@ -990,7 +990,7 @@ static void build_elemental_vault(floor_type *floor_ptr, POSITION x0, POSITION y
                generate_hmap(floor_ptr, y0, x0, xsize, ysize, grd, roug, c3);
 
                /* Convert to normal format+ clean up */
-               done = generate_lake(y0, x0, xsize, ysize, c1, c2, c3, type);
+               done = generate_lake(floor_ptr, y0, x0, xsize, ysize, c1, c2, c3, type);
        }
 
        /* Set icky flag because is a vault */
@@ -1005,7 +1005,7 @@ static void build_elemental_vault(floor_type *floor_ptr, POSITION x0, POSITION y
        /* make a few rooms in the vault */
        for (i = 1; i <= (xsize * ysize) / 50; i++)
        {
-               build_small_room(x0 + randint0(xsize - 4) - xsize / 2 + 2,
+               build_small_room(floor_ptr, x0 + randint0(xsize - 4) - xsize / 2 + 2,
                        y0 + randint0(ysize - 4) - ysize / 2 + 2);
        }
 
@@ -1113,7 +1113,7 @@ static void build_mini_c_vault(floor_type *floor_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(y, x);
+                               place_inner_bold(floor_ptr, y, x);
                        }
                }
        }
@@ -1123,15 +1123,15 @@ static void build_mini_c_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
        {
                /* left and right */
                y = randint1(dy) + dy / 2;
-               place_inner_bold(y1 + y, x1 - 1);
-               place_inner_bold(y1 + y, x2 + 1);
+               place_inner_bold(floor_ptr, y1 + y, x1 - 1);
+               place_inner_bold(floor_ptr, y1 + y, x2 + 1);
        }
        else
        {
                /* top and bottom */
                x = randint1(dx) + dx / 2;
-               place_inner_bold(y1 - 1, x1 + x);
-               place_inner_bold(y2 + 1, x1 + x);
+               place_inner_bold(floor_ptr, y1 - 1, x1 + x);
+               place_inner_bold(floor_ptr, y2 + 1, x1 + x);
        }
 
        /* Fill with monsters and treasure, highest difficulty */
@@ -1146,7 +1146,7 @@ static void build_mini_c_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
 *
 *This makes a vault that looks like a castle/ city in the dungeon.
 */
-static void build_castle_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
+static void build_castle_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
 {
        POSITION dy, dx;
        POSITION y1, x1, y2, x2;
@@ -1168,17 +1168,17 @@ static void build_castle_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
        {
                for (x = x1 - 1; x <= x2 + 1; x++)
                {
-                       p_ptr->current_floor_ptr->grid_array[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
+                       floor_ptr->grid_array[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
                        /* Make everything a floor */
-                       place_floor_bold(y, x);
+                       place_floor_bold(floor_ptr, y, x);
                }
        }
 
        /* Make the castle */
-       build_recursive_room(x1, y1, x2, y2, randint1(5));
+       build_recursive_room(floor_ptr, x1, y1, x2, y2, randint1(5));
 
        /* Fill with monsters and treasure, low difficulty */
-       fill_treasure(p_ptr->current_floor_ptr, x1, x2, y1, y2, randint1(3));
+       fill_treasure(floor_ptr, x1, x2, y1, y2, randint1(3));
 }
 
 
@@ -1187,7 +1187,7 @@ static void build_castle_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
 * @brief タイプ10の部屋…ランダム生成vault / Type 10 -- Random vaults
 * @return なし
 */
-bool build_type10(void)
+bool build_type10(floor_type *floor_ptr)
 {
        POSITION y0, x0, xsize, ysize, vtype;
 
@@ -1203,28 +1203,28 @@ bool build_type10(void)
        do
        {
                vtype = randint1(15);
-       } while ((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) &&
+       } while ((d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) &&
                ((vtype == 1) || (vtype == 3) || (vtype == 8) || (vtype == 9) || (vtype == 11)));
 #else /* ALLOW_CAVERNS_AND_LAKES */
        do
        {
                vtype = randint1(7);
-       } while ((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) &&
+       } while ((d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) &&
                ((vtype == 1) || (vtype == 3)));
 #endif /* ALLOW_CAVERNS_AND_LAKES */
 
        switch (vtype)
        {
                /* Build an appropriate room */
-       case 1: case  9: build_bubble_vault(p_ptr->current_floor_ptr, x0, y0, xsize, ysize); break;
-       case 2: case 10: build_room_vault(p_ptr->current_floor_ptr, x0, y0, xsize, ysize); break;
+       case 1: case  9: build_bubble_vault(floor_ptr, x0, y0, xsize, ysize); break;
+       case 2: case 10: build_room_vault(floor_ptr, x0, y0, xsize, ysize); break;
        case 3: case 11: build_cave_vault(x0, y0, xsize, ysize); break;
        case 4: case 12: build_maze_vault(x0, y0, xsize, ysize, TRUE); break;
-       case 5: case 13: build_mini_c_vault(p_ptr->current_floor_ptr, x0, y0, xsize, ysize); break;
-       case 6: case 14: build_castle_vault(x0, y0, xsize, ysize); break;
-       case 7: case 15: build_target_vault(p_ptr->current_floor_ptr, x0, y0, xsize, ysize); break;
+       case 5: case 13: build_mini_c_vault(floor_ptr, x0, y0, xsize, ysize); break;
+       case 6: case 14: build_castle_vault(floor_ptr, x0, y0, xsize, ysize); break;
+       case 7: case 15: build_target_vault(floor_ptr, x0, y0, xsize, ysize); break;
 #ifdef ALLOW_CAVERNS_AND_LAKES
-       case 8: build_elemental_vault(p_ptr->current_floor_ptr, x0, y0, xsize, ysize); break;
+       case 8: build_elemental_vault(floor_ptr, x0, y0, xsize, ysize); break;
 #endif /* ALLOW_CAVERNS_AND_LAKES */
                /* I know how to add a few more... give me some time. */
        default: return FALSE;