5 #include "floor-generate.h"
12 * @brief タイプ14の部屋…特殊トラップ部屋の生成 / Type 14 -- trapped rooms
15 * A special trap is placed at center of the room
17 bool build_type14(void)
19 POSITION y, x, y2, x2, yval, xval;
20 POSITION y1, x1, xsize, ysize;
27 /* Pick a room size */
36 /* Find and reserve some space in the dungeon. Get center of room. */
37 if (!find_space(&yval, &xval, ysize + 2, xsize + 2)) return FALSE;
39 /* Choose lite or dark */
40 light = ((current_floor_ptr->dun_level <= randint1(25)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
43 /* Get corner values */
44 y1 = yval - ysize / 2;
45 x1 = xval - xsize / 2;
46 y2 = yval + (ysize - 1) / 2;
47 x2 = xval + (xsize - 1) / 2;
50 /* Place a full floor under the room */
51 for (y = y1 - 1; y <= y2 + 1; y++)
53 for (x = x1 - 1; x <= x2 + 1; x++)
55 g_ptr = ¤t_floor_ptr->grid_array[y][x];
56 place_floor_grid(g_ptr);
57 g_ptr->info |= (CAVE_ROOM);
58 if (light) g_ptr->info |= (CAVE_GLOW);
62 /* Walls around the room */
63 for (y = y1 - 1; y <= y2 + 1; y++)
65 g_ptr = ¤t_floor_ptr->grid_array[y][x1 - 1];
66 place_outer_grid(g_ptr);
67 g_ptr = ¤t_floor_ptr->grid_array[y][x2 + 1];
68 place_outer_grid(g_ptr);
70 for (x = x1 - 1; x <= x2 + 1; x++)
72 g_ptr = ¤t_floor_ptr->grid_array[y1 - 1][x];
73 place_outer_grid(g_ptr);
74 g_ptr = ¤t_floor_ptr->grid_array[y2 + 1][x];
75 place_outer_grid(g_ptr);
78 if (current_floor_ptr->dun_level < 30 + randint1(30))
79 trap = feat_trap_piranha;
81 trap = feat_trap_armageddon;
83 /* Place a special trap */
84 g_ptr = ¤t_floor_ptr->grid_array[rand_spread(yval, ysize / 4)][rand_spread(xval, xsize / 4)];
85 g_ptr->mimic = g_ptr->feat;
88 msg_format_wizard(CHEAT_DUNGEON, _("%sの部屋が生成されました。", "Room of %s was generated."), f_name + f_info[trap].name);