9 * @brief タイプ1の部屋…通常可変長方形の部屋を生成する / Type 1 -- normal rectangular rooms
12 bool build_type1(void)
14 POSITION y, x, y2, x2, yval, xval;
15 POSITION y1, x1, xsize, ysize;
21 bool curtain = (d_info[p_ptr->dungeon_idx].flags1 & DF1_CURTAIN) &&
22 one_in_((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 48 : 512);
24 /* Pick a room size */
33 /* Find and reserve some space in the dungeon. Get center of room. */
34 if (!find_space(&yval, &xval, ysize + 2, xsize + 2))
36 /* Limit to the minimum room size, and retry */
45 /* Find and reserve some space in the dungeon. Get center of room. */
46 if (!find_space(&yval, &xval, ysize + 2, xsize + 2)) return FALSE;
49 /* Choose lite or dark */
50 light = ((dun_level <= randint1(25)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
53 /* Get corner values */
54 y1 = yval - ysize / 2;
55 x1 = xval - xsize / 2;
56 y2 = yval + (ysize - 1) / 2;
57 x2 = xval + (xsize - 1) / 2;
60 /* Place a full floor under the room */
61 for (y = y1 - 1; y <= y2 + 1; y++)
63 for (x = x1 - 1; x <= x2 + 1; x++)
66 place_floor_grid(c_ptr);
67 c_ptr->info |= (CAVE_ROOM);
68 if (light) c_ptr->info |= (CAVE_GLOW);
72 /* Walls around the room */
73 for (y = y1 - 1; y <= y2 + 1; y++)
75 c_ptr = &cave[y][x1 - 1];
76 place_outer_grid(c_ptr);
77 c_ptr = &cave[y][x2 + 1];
78 place_outer_grid(c_ptr);
80 for (x = x1 - 1; x <= x2 + 1; x++)
82 c_ptr = &cave[y1 - 1][x];
83 place_outer_grid(c_ptr);
84 c_ptr = &cave[y2 + 1][x];
85 place_outer_grid(c_ptr);
89 /* Hack -- Occasional curtained room */
90 if (curtain && (y2 - y1 > 2) && (x2 - x1 > 2))
92 for (y = y1; y <= y2; y++)
95 c_ptr->feat = feat_door[DOOR_CURTAIN].closed;
96 c_ptr->info &= ~(CAVE_MASK);
98 c_ptr->feat = feat_door[DOOR_CURTAIN].closed;
99 c_ptr->info &= ~(CAVE_MASK);
101 for (x = x1; x <= x2; x++)
103 c_ptr = &cave[y1][x];
104 c_ptr->feat = feat_door[DOOR_CURTAIN].closed;
105 c_ptr->info &= ~(CAVE_MASK);
106 c_ptr = &cave[y2][x];
107 c_ptr->feat = feat_door[DOOR_CURTAIN].closed;
108 c_ptr->info &= ~(CAVE_MASK);
113 /* Hack -- Occasional pillar room */
116 for (y = y1; y <= y2; y += 2)
118 for (x = x1; x <= x2; x += 2)
121 place_inner_grid(c_ptr);
126 /* Hack -- Occasional room with four pillars */
127 else if (one_in_(20))
129 if ((y1 + 4 < y2) && (x1 + 4 < x2))
131 c_ptr = &cave[y1 + 1][x1 + 1];
132 place_inner_grid(c_ptr);
134 c_ptr = &cave[y1 + 1][x2 - 1];
135 place_inner_grid(c_ptr);
137 c_ptr = &cave[y2 - 1][x1 + 1];
138 place_inner_grid(c_ptr);
140 c_ptr = &cave[y2 - 1][x2 - 1];
141 place_inner_grid(c_ptr);
145 /* Hack -- Occasional ragged-edge room */
146 else if (one_in_(50))
148 for (y = y1 + 2; y <= y2 - 2; y += 2)
150 c_ptr = &cave[y][x1];
151 place_inner_grid(c_ptr);
152 c_ptr = &cave[y][x2];
153 place_inner_grid(c_ptr);
155 for (x = x1 + 2; x <= x2 - 2; x += 2)
157 c_ptr = &cave[y1][x];
158 place_inner_grid(c_ptr);
159 c_ptr = &cave[y2][x];
160 place_inner_grid(c_ptr);
163 /* Hack -- Occasional divided room */
164 else if (one_in_(50))
166 bool curtain2 = (d_info[p_ptr->dungeon_idx].flags1 & DF1_CURTAIN) &&
167 one_in_((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 2 : 128);
169 if (randint1(100) < 50)
171 /* Horizontal wall */
172 for (x = x1; x <= x2; x++)
174 place_inner_bold(yval, x);
175 if (curtain2) cave[yval][x].feat = feat_door[DOOR_CURTAIN].closed;
178 /* Prevent edge of wall from being tunneled */
179 place_solid_bold(yval, x1 - 1);
180 place_solid_bold(yval, x2 + 1);
185 for (y = y1; y <= y2; y++)
187 place_inner_bold(y, xval);
188 if (curtain2) cave[y][xval].feat = feat_door[DOOR_CURTAIN].closed;
191 /* Prevent edge of wall from being tunneled */
192 place_solid_bold(y1 - 1, xval);
193 place_solid_bold(y2 + 1, xval);
196 place_random_door(yval, xval, TRUE);
197 if (curtain2) cave[yval][xval].feat = feat_door[DOOR_CURTAIN].closed;
204 * @brief タイプ2の部屋…二重長方形の部屋を生成する / Type 2 -- Overlapping rectangular rooms
207 bool build_type2(void)
209 POSITION y, x, xval, yval;
210 POSITION y1a, x1a, y2a, x2a;
211 POSITION y1b, x1b, y2b, x2b;
215 /* Find and reserve some space in the dungeon. Get center of room. */
216 if (!find_space(&yval, &xval, 11, 25)) return FALSE;
218 /* Choose lite or dark */
219 light = ((dun_level <= randint1(25)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
221 /* Determine extents of the first room */
222 y1a = yval - randint1(4);
223 y2a = yval + randint1(3);
224 x1a = xval - randint1(11);
225 x2a = xval + randint1(10);
227 /* Determine extents of the second room */
228 y1b = yval - randint1(3);
229 y2b = yval + randint1(4);
230 x1b = xval - randint1(10);
231 x2b = xval + randint1(11);
234 /* Place a full floor for room "a" */
235 for (y = y1a - 1; y <= y2a + 1; y++)
237 for (x = x1a - 1; x <= x2a + 1; x++)
240 place_floor_grid(c_ptr);
241 c_ptr->info |= (CAVE_ROOM);
242 if (light) c_ptr->info |= (CAVE_GLOW);
246 /* Place a full floor for room "b" */
247 for (y = y1b - 1; y <= y2b + 1; y++)
249 for (x = x1b - 1; x <= x2b + 1; x++)
252 place_floor_grid(c_ptr);
253 c_ptr->info |= (CAVE_ROOM);
254 if (light) c_ptr->info |= (CAVE_GLOW);
259 /* Place the walls around room "a" */
260 for (y = y1a - 1; y <= y2a + 1; y++)
262 c_ptr = &cave[y][x1a - 1];
263 place_outer_grid(c_ptr);
264 c_ptr = &cave[y][x2a + 1];
265 place_outer_grid(c_ptr);
267 for (x = x1a - 1; x <= x2a + 1; x++)
269 c_ptr = &cave[y1a - 1][x];
270 place_outer_grid(c_ptr);
271 c_ptr = &cave[y2a + 1][x];
272 place_outer_grid(c_ptr);
275 /* Place the walls around room "b" */
276 for (y = y1b - 1; y <= y2b + 1; y++)
278 c_ptr = &cave[y][x1b - 1];
279 place_outer_grid(c_ptr);
280 c_ptr = &cave[y][x2b + 1];
281 place_outer_grid(c_ptr);
283 for (x = x1b - 1; x <= x2b + 1; x++)
285 c_ptr = &cave[y1b - 1][x];
286 place_outer_grid(c_ptr);
287 c_ptr = &cave[y2b + 1][x];
288 place_outer_grid(c_ptr);
293 /* Replace the floor for room "a" */
294 for (y = y1a; y <= y2a; y++)
296 for (x = x1a; x <= x2a; x++)
299 place_floor_grid(c_ptr);
303 /* Replace the floor for room "b" */
304 for (y = y1b; y <= y2b; y++)
306 for (x = x1b; x <= x2b; x++)
309 place_floor_grid(c_ptr);
317 * @brief タイプ3の部屋…十字型の部屋を生成する / Type 3 -- Cross shaped rooms
320 * Builds a room at a row, column coordinate\n
322 * Room "a" runs north/south, and Room "b" runs east/east\n
323 * So the "central pillar" runs from x1a, y1b to x2a, y2b.\n
325 * Note that currently, the "center" is always 3x3, but I think that\n
326 * the code below will work (with "bounds checking") for 5x5, or even\n
327 * for unsymetric values like 4x3 or 5x3 or 3x4 or 3x5, or even larger.\n
329 bool build_type3(void)
331 POSITION y, x, dy, dx, wy, wx;
332 POSITION y1a, x1a, y2a, x2a;
333 POSITION y1b, x1b, y2b, x2b;
339 /* Find and reserve some space in the dungeon. Get center of room. */
340 if (!find_space(&yval, &xval, 11, 25)) return FALSE;
343 /* Choose lite or dark */
344 light = ((dun_level <= randint1(25)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
346 /* For now, always 3x3 */
349 /* Pick max vertical size (at most 4) */
350 dy = rand_range(3, 4);
352 /* Pick max horizontal size (at most 15) */
353 dx = rand_range(3, 11);
356 /* Determine extents of the north/south room */
362 /* Determine extents of the east/west room */
369 /* Place a full floor for room "a" */
370 for (y = y1a - 1; y <= y2a + 1; y++)
372 for (x = x1a - 1; x <= x2a + 1; x++)
375 place_floor_grid(c_ptr);
376 c_ptr->info |= (CAVE_ROOM);
377 if (light) c_ptr->info |= (CAVE_GLOW);
381 /* Place a full floor for room "b" */
382 for (y = y1b - 1; y <= y2b + 1; y++)
384 for (x = x1b - 1; x <= x2b + 1; x++)
387 place_floor_grid(c_ptr);
388 c_ptr->info |= (CAVE_ROOM);
389 if (light) c_ptr->info |= (CAVE_GLOW);
394 /* Place the walls around room "a" */
395 for (y = y1a - 1; y <= y2a + 1; y++)
397 c_ptr = &cave[y][x1a - 1];
398 place_outer_grid(c_ptr);
399 c_ptr = &cave[y][x2a + 1];
400 place_outer_grid(c_ptr);
402 for (x = x1a - 1; x <= x2a + 1; x++)
404 c_ptr = &cave[y1a - 1][x];
405 place_outer_grid(c_ptr);
406 c_ptr = &cave[y2a + 1][x];
407 place_outer_grid(c_ptr);
410 /* Place the walls around room "b" */
411 for (y = y1b - 1; y <= y2b + 1; y++)
413 c_ptr = &cave[y][x1b - 1];
414 place_outer_grid(c_ptr);
415 c_ptr = &cave[y][x2b + 1];
416 place_outer_grid(c_ptr);
418 for (x = x1b - 1; x <= x2b + 1; x++)
420 c_ptr = &cave[y1b - 1][x];
421 place_outer_grid(c_ptr);
422 c_ptr = &cave[y2b + 1][x];
423 place_outer_grid(c_ptr);
427 /* Replace the floor for room "a" */
428 for (y = y1a; y <= y2a; y++)
430 for (x = x1a; x <= x2a; x++)
433 place_floor_grid(c_ptr);
437 /* Replace the floor for room "b" */
438 for (y = y1b; y <= y2b; y++)
440 for (x = x1b; x <= x2b; x++)
443 place_floor_grid(c_ptr);
449 /* Special features (3/4) */
452 /* Large solid middle pillar */
455 for (y = y1b; y <= y2b; y++)
457 for (x = x1a; x <= x2a; x++)
460 place_inner_grid(c_ptr);
466 /* Inner treasure vault */
469 /* Build the vault */
470 for (y = y1b; y <= y2b; y++)
472 c_ptr = &cave[y][x1a];
473 place_inner_grid(c_ptr);
474 c_ptr = &cave[y][x2a];
475 place_inner_grid(c_ptr);
477 for (x = x1a; x <= x2a; x++)
479 c_ptr = &cave[y1b][x];
480 place_inner_grid(c_ptr);
481 c_ptr = &cave[y2b][x];
482 place_inner_grid(c_ptr);
485 /* Place a secret door on the inner room */
488 case 0: place_secret_door(y1b, xval, DOOR_DEFAULT); break;
489 case 1: place_secret_door(y2b, xval, DOOR_DEFAULT); break;
490 case 2: place_secret_door(yval, x1a, DOOR_DEFAULT); break;
491 case 3: place_secret_door(yval, x2a, DOOR_DEFAULT); break;
494 /* Place a treasure in the vault */
495 place_object(yval, xval, 0L);
497 /* Let's guard the treasure well */
498 vault_monsters(yval, xval, randint0(2) + 3);
500 /* Traps naturally */
501 vault_traps(yval, xval, 4, 4, randint0(3) + 2);
509 /* Occasionally pinch the center shut */
512 /* Pinch the east/west sides */
513 for (y = y1b; y <= y2b; y++)
515 if (y == yval) continue;
516 c_ptr = &cave[y][x1a - 1];
517 place_inner_grid(c_ptr);
518 c_ptr = &cave[y][x2a + 1];
519 place_inner_grid(c_ptr);
522 /* Pinch the north/south sides */
523 for (x = x1a; x <= x2a; x++)
525 if (x == xval) continue;
526 c_ptr = &cave[y1b - 1][x];
527 place_inner_grid(c_ptr);
528 c_ptr = &cave[y2b + 1][x];
529 place_inner_grid(c_ptr);
532 /* Sometimes shut using secret doors */
535 int door_type = ((d_info[p_ptr->dungeon_idx].flags1 & DF1_CURTAIN) &&
536 one_in_((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 16 : 256)) ? DOOR_CURTAIN :
537 ((d_info[p_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR);
539 place_secret_door(yval, x1a - 1, door_type);
540 place_secret_door(yval, x2a + 1, door_type);
541 place_secret_door(y1b - 1, xval, door_type);
542 place_secret_door(y2b + 1, xval, door_type);
546 /* Occasionally put a "plus" in the center */
549 c_ptr = &cave[yval][xval];
550 place_inner_grid(c_ptr);
551 c_ptr = &cave[y1b][xval];
552 place_inner_grid(c_ptr);
553 c_ptr = &cave[y2b][xval];
554 place_inner_grid(c_ptr);
555 c_ptr = &cave[yval][x1a];
556 place_inner_grid(c_ptr);
557 c_ptr = &cave[yval][x2a];
558 place_inner_grid(c_ptr);
561 /* Occasionally put a pillar in the center */
564 c_ptr = &cave[yval][xval];
565 place_inner_grid(c_ptr);
576 * @brief タイプ4の部屋…固定サイズの二重構造部屋を生成する / Type 4 -- Large room with inner features
579 * Possible sub-types:\n
580 * 1 - Just an inner room with one door\n
581 * 2 - An inner room within an inner room\n
582 * 3 - An inner room with pillar(s)\n
583 * 4 - Inner room has a maze\n
584 * 5 - A set of four inner rooms\n
586 bool build_type4(void)
588 POSITION y, x, y1, x1;
589 POSITION y2, x2, tmp, yval, xval;
594 /* Find and reserve some space in the dungeon. Get center of room. */
595 if (!find_space(&yval, &xval, 11, 25)) return FALSE;
597 /* Choose lite or dark */
598 light = ((dun_level <= randint1(25)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
606 /* Place a full floor under the room */
607 for (y = y1 - 1; y <= y2 + 1; y++)
609 for (x = x1 - 1; x <= x2 + 1; x++)
612 place_floor_grid(c_ptr);
613 c_ptr->info |= (CAVE_ROOM);
614 if (light) c_ptr->info |= (CAVE_GLOW);
619 for (y = y1 - 1; y <= y2 + 1; y++)
621 c_ptr = &cave[y][x1 - 1];
622 place_outer_grid(c_ptr);
623 c_ptr = &cave[y][x2 + 1];
624 place_outer_grid(c_ptr);
626 for (x = x1 - 1; x <= x2 + 1; x++)
628 c_ptr = &cave[y1 - 1][x];
629 place_outer_grid(c_ptr);
630 c_ptr = &cave[y2 + 1][x];
631 place_outer_grid(c_ptr);
641 /* The inner walls */
642 for (y = y1 - 1; y <= y2 + 1; y++)
644 c_ptr = &cave[y][x1 - 1];
645 place_inner_grid(c_ptr);
646 c_ptr = &cave[y][x2 + 1];
647 place_inner_grid(c_ptr);
649 for (x = x1 - 1; x <= x2 + 1; x++)
651 c_ptr = &cave[y1 - 1][x];
652 place_inner_grid(c_ptr);
653 c_ptr = &cave[y2 + 1][x];
654 place_inner_grid(c_ptr);
658 /* Inner room variations */
661 /* Just an inner room with a monster */
664 /* Place a secret door */
667 case 1: place_secret_door(y1 - 1, xval, DOOR_DEFAULT); break;
668 case 2: place_secret_door(y2 + 1, xval, DOOR_DEFAULT); break;
669 case 3: place_secret_door(yval, x1 - 1, DOOR_DEFAULT); break;
670 case 4: place_secret_door(yval, x2 + 1, DOOR_DEFAULT); break;
673 /* Place a monster in the room */
674 vault_monsters(yval, xval, 1);
679 /* Treasure Vault (with a door) */
682 /* Place a secret door */
685 case 1: place_secret_door(y1 - 1, xval, DOOR_DEFAULT); break;
686 case 2: place_secret_door(y2 + 1, xval, DOOR_DEFAULT); break;
687 case 3: place_secret_door(yval, x1 - 1, DOOR_DEFAULT); break;
688 case 4: place_secret_door(yval, x2 + 1, DOOR_DEFAULT); break;
691 /* Place another inner room */
692 for (y = yval - 1; y <= yval + 1; y++)
694 for (x = xval - 1; x <= xval + 1; x++)
696 if ((x == xval) && (y == yval)) continue;
698 place_inner_grid(c_ptr);
702 /* Place a locked door on the inner room */
705 case 1: place_locked_door(yval - 1, xval); break;
706 case 2: place_locked_door(yval + 1, xval); break;
707 case 3: place_locked_door(yval, xval - 1); break;
708 case 4: place_locked_door(yval, xval + 1); break;
711 /* Monsters to guard the "treasure" */
712 vault_monsters(yval, xval, randint1(3) + 2);
715 if (randint0(100) < 80)
717 place_object(yval, xval, 0L);
723 place_random_stairs(yval, xval);
726 /* Traps to protect the treasure */
727 vault_traps(yval, xval, 4, 10, 2 + randint1(3));
732 /* Inner pillar(s). */
735 /* Place a secret door */
738 case 1: place_secret_door(y1 - 1, xval, DOOR_DEFAULT); break;
739 case 2: place_secret_door(y2 + 1, xval, DOOR_DEFAULT); break;
740 case 3: place_secret_door(yval, x1 - 1, DOOR_DEFAULT); break;
741 case 4: place_secret_door(yval, x2 + 1, DOOR_DEFAULT); break;
744 /* Large Inner Pillar */
745 for (y = yval - 1; y <= yval + 1; y++)
747 for (x = xval - 1; x <= xval + 1; x++)
750 place_inner_grid(c_ptr);
754 /* Occasionally, two more Large Inner Pillars */
758 for (y = yval - 1; y <= yval + 1; y++)
760 for (x = xval - 5 - tmp; x <= xval - 3 - tmp; x++)
763 place_inner_grid(c_ptr);
765 for (x = xval + 3 + tmp; x <= xval + 5 + tmp; x++)
768 place_inner_grid(c_ptr);
773 /* Occasionally, some Inner rooms */
776 int door_type = ((d_info[p_ptr->dungeon_idx].flags1 & DF1_CURTAIN) &&
777 one_in_((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 16 : 256)) ? DOOR_CURTAIN :
778 ((d_info[p_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR);
780 /* Long horizontal walls */
781 for (x = xval - 5; x <= xval + 5; x++)
783 c_ptr = &cave[yval - 1][x];
784 place_inner_grid(c_ptr);
785 c_ptr = &cave[yval + 1][x];
786 place_inner_grid(c_ptr);
789 /* Close off the left/right edges */
790 c_ptr = &cave[yval][xval - 5];
791 place_inner_grid(c_ptr);
792 c_ptr = &cave[yval][xval + 5];
793 place_inner_grid(c_ptr);
795 /* Secret doors (random top/bottom) */
796 place_secret_door(yval - 3 + (randint1(2) * 2), xval - 3, door_type);
797 place_secret_door(yval - 3 + (randint1(2) * 2), xval + 3, door_type);
800 vault_monsters(yval, xval - 2, randint1(2));
801 vault_monsters(yval, xval + 2, randint1(2));
804 if (one_in_(3)) place_object(yval, xval - 2, 0L);
805 if (one_in_(3)) place_object(yval, xval + 2, 0L);
814 /* Place a secret door */
817 case 1: place_secret_door(y1 - 1, xval, DOOR_DEFAULT); break;
818 case 2: place_secret_door(y2 + 1, xval, DOOR_DEFAULT); break;
819 case 3: place_secret_door(yval, x1 - 1, DOOR_DEFAULT); break;
820 case 4: place_secret_door(yval, x2 + 1, DOOR_DEFAULT); break;
823 /* Maze (really a checkerboard) */
824 for (y = y1; y <= y2; y++)
826 for (x = x1; x <= x2; x++)
831 place_inner_grid(c_ptr);
836 /* Monsters just love mazes. */
837 vault_monsters(yval, xval - 5, randint1(3));
838 vault_monsters(yval, xval + 5, randint1(3));
840 /* Traps make them entertaining. */
841 vault_traps(yval, xval - 3, 2, 8, randint1(3));
842 vault_traps(yval, xval + 3, 2, 8, randint1(3));
844 /* Mazes should have some treasure too. */
845 vault_objects(yval, xval, 3);
850 /* Four small rooms. */
853 int door_type = ((d_info[p_ptr->dungeon_idx].flags1 & DF1_CURTAIN) &&
854 one_in_((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 16 : 256)) ? DOOR_CURTAIN :
855 ((d_info[p_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR);
858 for (y = y1; y <= y2; y++)
860 c_ptr = &cave[y][xval];
861 place_inner_grid(c_ptr);
863 for (x = x1; x <= x2; x++)
865 c_ptr = &cave[yval][x];
866 place_inner_grid(c_ptr);
869 /* Doors into the rooms */
870 if (randint0(100) < 50)
872 int i = randint1(10);
873 place_secret_door(y1 - 1, xval - i, door_type);
874 place_secret_door(y1 - 1, xval + i, door_type);
875 place_secret_door(y2 + 1, xval - i, door_type);
876 place_secret_door(y2 + 1, xval + i, door_type);
881 place_secret_door(yval + i, x1 - 1, door_type);
882 place_secret_door(yval - i, x1 - 1, door_type);
883 place_secret_door(yval + i, x2 + 1, door_type);
884 place_secret_door(yval - i, x2 + 1, door_type);
887 /* Treasure, centered at the center of the cross */
888 vault_objects(yval, xval, 2 + randint1(2));
890 /* Gotta have some monsters. */
891 vault_monsters(yval + 1, xval - 4, randint1(4));
892 vault_monsters(yval + 1, xval + 4, randint1(4));
893 vault_monsters(yval - 1, xval - 4, randint1(4));
894 vault_monsters(yval - 1, xval + 4, randint1(4));
905 * @brief タイプ11の部屋…円形部屋の生成 / Type 11 -- Build an vertical oval room.
908 * For every grid in the possible square, check the distance.\n
909 * If it's less than the radius, make it a room square.\n
911 * When done fill from the inside to find the walls,\n
913 bool build_type11(void)
915 POSITION rad, x, y, x0, y0;
918 /* Occasional light */
919 if ((randint1(dun_level) <= 15) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
923 /* Find and reserve some space in the dungeon. Get center of room. */
924 if (!find_space(&y0, &x0, rad * 2 + 1, rad * 2 + 1)) return FALSE;
926 /* Make circular floor */
927 for (x = x0 - rad; x <= x0 + rad; x++)
929 for (y = y0 - rad; y <= y0 + rad; y++)
931 if (distance(y0, x0, y, x) <= rad - 1)
933 /* inside- so is floor */
934 place_floor_bold(y, x);
936 else if (distance(y0, x0, y, x) <= rad + 1)
938 /* make granite outside so arena works */
939 place_extra_bold(y, x);
944 /* Find visible outer walls and set to be FEAT_OUTER */
945 add_outer_wall(x0, y0, light, x0 - rad, y0 - rad, x0 + rad, y0 + rad);
952 * @brief タイプ12の部屋…ドーム型部屋の生成 / Type 12 -- Build crypt room.
955 * For every grid in the possible square, check the (fake) distance.\n
956 * If it's less than the radius, make it a room square.\n
958 * When done fill from the inside to find the walls,\n
960 bool build_type12(void)
962 POSITION rad, x, y, x0, y0;
964 bool emptyflag = TRUE;
966 /* Make a random metric */
967 POSITION h1, h2, h3, h4;
968 h1 = randint1(32) - 16;
971 h4 = randint1(32) - 16;
973 /* Occasional light */
974 if ((randint1(dun_level) <= 5) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
978 /* Find and reserve some space in the dungeon. Get center of room. */
979 if (!find_space(&y0, &x0, rad * 2 + 3, rad * 2 + 3)) return FALSE;
982 for (x = x0 - rad; x <= x0 + rad; x++)
984 for (y = y0 - rad; y <= y0 + rad; y++)
986 /* clear room flag */
987 cave[y][x].info &= ~(CAVE_ROOM);
989 if (dist2(y0, x0, y, x, h1, h2, h3, h4) <= rad - 1)
991 /* inside - so is floor */
992 place_floor_bold(y, x);
994 else if (distance(y0, x0, y, x) < 3)
996 place_floor_bold(y, x);
1000 /* make granite outside so arena works */
1001 place_extra_bold(y, x);
1004 /* proper boundary for arena */
1005 if (((y + rad) == y0) || ((y - rad) == y0) ||
1006 ((x + rad) == x0) || ((x - rad) == x0))
1008 place_extra_bold(y, x);
1013 /* Find visible outer walls and set to be FEAT_OUTER */
1014 add_outer_wall(x0, y0, light, x0 - rad - 1, y0 - rad - 1,
1015 x0 + rad + 1, y0 + rad + 1);
1017 /* Check to see if there is room for an inner vault */
1018 for (x = x0 - 2; x <= x0 + 2; x++)
1020 for (y = y0 - 2; y <= y0 + 2; y++)
1022 if (!is_floor_bold(y, x))
1024 /* Wall in the way */
1030 if (emptyflag && one_in_(2))
1032 /* Build the vault */
1033 build_small_room(x0, y0);
1035 /* Place a treasure in the vault */
1036 place_object(y0, x0, 0L);
1038 /* Let's guard the treasure well */
1039 vault_monsters(y0, x0, randint0(2) + 3);
1041 /* Traps naturally */
1042 vault_traps(y0, x0, 4, 4, randint0(3) + 2);