1 #include "angband.h"
\r
3 #include "generate.h"
\r
8 * @brief タイプ14の部屋…特殊トラップ部屋の生成 / Type 14 -- trapped rooms
\r
11 * A special trap is placed at center of the room
\r
13 bool build_type14(void)
\r
15 POSITION y, x, y2, x2, yval, xval;
\r
16 POSITION y1, x1, xsize, ysize;
\r
23 /* Pick a room size */
\r
29 xsize = x1 + x2 + 1;
\r
30 ysize = y1 + y2 + 1;
\r
32 /* Find and reserve some space in the dungeon. Get center of room. */
\r
33 if (!find_space(&yval, &xval, ysize + 2, xsize + 2)) return FALSE;
\r
35 /* Choose lite or dark */
\r
36 light = ((dun_level <= randint1(25)) && !(d_info[dungeon_type].flags1 & DF1_DARKNESS));
\r
39 /* Get corner values */
\r
40 y1 = yval - ysize / 2;
\r
41 x1 = xval - xsize / 2;
\r
42 y2 = yval + (ysize - 1) / 2;
\r
43 x2 = xval + (xsize - 1) / 2;
\r
46 /* Place a full floor under the room */
\r
47 for (y = y1 - 1; y <= y2 + 1; y++)
\r
49 for (x = x1 - 1; x <= x2 + 1; x++)
\r
51 c_ptr = &cave[y][x];
\r
52 place_floor_grid(c_ptr);
\r
53 c_ptr->info |= (CAVE_ROOM);
\r
54 if (light) c_ptr->info |= (CAVE_GLOW);
\r
58 /* Walls around the room */
\r
59 for (y = y1 - 1; y <= y2 + 1; y++)
\r
61 c_ptr = &cave[y][x1 - 1];
\r
62 place_outer_grid(c_ptr);
\r
63 c_ptr = &cave[y][x2 + 1];
\r
64 place_outer_grid(c_ptr);
\r
66 for (x = x1 - 1; x <= x2 + 1; x++)
\r
68 c_ptr = &cave[y1 - 1][x];
\r
69 place_outer_grid(c_ptr);
\r
70 c_ptr = &cave[y2 + 1][x];
\r
71 place_outer_grid(c_ptr);
\r
74 if (dun_level < 30 + randint1(30))
\r
75 trap = feat_trap_piranha;
\r
77 trap = feat_trap_armageddon;
\r
79 /* Place a special trap */
\r
80 c_ptr = &cave[rand_spread(yval, ysize / 4)][rand_spread(xval, xsize / 4)];
\r
81 c_ptr->mimic = c_ptr->feat;
\r
84 msg_format_wizard(CHEAT_DUNGEON, _("%sの部屋が生成されました。", "Room of %s was generated."), f_name + f_info[trap].name);
\r