{{ 0, 1, 1, 1, 2, 3, 5, 6, 8, 10, 13}, 10}, /*NEST */
{{ 0, 1, 1, 2, 3, 4, 6, 8, 10, 13, 16}, 10}, /*PIT */
{{ 0, 1, 1, 1, 2, 2, 3, 5, 6, 8, 10}, 10}, /*LESSER_V */
- {{ 0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 6}, 20}, /*GREATER_V*/
+ {{ 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4}, 20}, /*GREATER_V*/
{{ 0,100,200,300,400,500,600,700,800,900,999}, 10}, /*FRACAVE */
- {{ 0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3}, 10}, /*RANDOM_V */
+ {{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2}, 10}, /*RANDOM_V */
{{ 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40}, 3}, /*OVAL */
{{ 1, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60}, 10}, /*CRYPT */
{{ 0, 0, 1, 1, 1, 2, 3, 4, 5, 6, 8}, 20}, /*TRAP_PIT */
c_ptr->mimic = feat_wall_inner;
/* Floor type terrain cannot hide a door */
- if (feat_floor(c_ptr->mimic))
+ if (feat_supports_los(c_ptr->mimic) && !feat_supports_los(c_ptr->feat))
{
- c_ptr->feat = c_ptr->mimic;
+ if (have_flag(f_info[c_ptr->mimic].flags, FF_MOVE) || have_flag(f_info[c_ptr->mimic].flags, FF_CAN_FLY))
+ {
+ c_ptr->feat = one_in_(2) ? c_ptr->mimic : floor_type[randint0(100)];
+ }
c_ptr->mimic = 0;
}
return FALSE;
}
- /* Choose a random one */
- pick = randint1(candidates);
+ /* Normal dungeon */
+ if (!(d_info[dungeon_type].flags1 & DF1_NO_CAVE))
+ {
+ /* Choose a random one */
+ pick = randint1(candidates);
+ }
+
+ /* NO_CAVE dungeon (Castle) */
+ else
+ {
+ /* Always choose the center one */
+ pick = candidates/2 + 1;
+ }
/* Pick up the choosen location */
for (block_y = dun->row_rooms - blocks_high; block_y >= 0; block_y--)
if (r_ptr->flags3 & (RF3_EVIL)) return (FALSE);
/* Require icky thing, jelly, mold, or mushroom */
- if (!strchr("ijm,", r_ptr->d_char)) return (FALSE);
+ if (!my_strchr("ijm,", r_ptr->d_char)) return (FALSE);
/* Okay */
return (TRUE);
if (!vault_monster_okay(r_idx)) return (FALSE);
/* Require a Zephyr Hound or a dog */
- if (!strchr("CZ", r_ptr->d_char)) return (FALSE);
+ if (!my_strchr("CZ", r_ptr->d_char)) return (FALSE);
/* Okay */
return (TRUE);
/* Validate the monster */
if (!vault_monster_okay(r_idx)) return (FALSE);
-
+
/* Require mimic */
- if (!strchr("!|$?=", r_ptr->d_char)) return (FALSE);
+ if (!my_strchr("!$&(/=?[\\|", r_ptr->d_char)) return (FALSE);
/* Okay */
return (TRUE);
while (attempts--)
{
/* Get a (hard) monster type */
- r_idx = get_mon_num(dun_level + 10);
+ r_idx = get_mon_num(dun_level + 11);
r_ptr = &r_info[r_idx];
/* Decline incorrect alignment */
while (attempts--)
{
/* Get a (hard) monster type */
- r_idx = get_mon_num(dun_level + 10);
+ r_idx = get_mon_num(dun_level + 11);
r_ptr = &r_info[r_idx];
/* Decline incorrect alignment */
/* Permanent wall (inner) */
case 'X':
- c_ptr->feat = FEAT_PERM_INNER;
- c_ptr->info &= ~(CAVE_MASK);
- c_ptr->info |= CAVE_INNER;
+ place_inner_perm_grid(c_ptr);
break;
/* Treasure/trap */
* The tricky part is making sure the created cave is connected. This
* is done by 'filling' from the inside and only keeping the 'filled'
* floor. Walls bounding the 'filled' floor are also kept. Everything
-* else is converted to the normal granite FEAT_WALL_EXTRA.
+* else is converted to the normal _extra_.
*/
fill_data.ymin = y0 - yhsize;
fill_data.xmax = x0 + xhsize;
fill_data.ymax = y0 + yhsize;
-
+
/* Store cutoff in global for quick access */
fill_data.c1 = cutoff;
-
+
/*
* Scale factor for middle points:
* About sqrt(2) * 256 - correct for a square lattice
{
for (j = 0; j <= ysize; j++)
{
- /* 255 is a flag for "not done yet" */
- cave[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].feat = 255;
+ /* -1 is a flag for "not done yet" */
+ cave[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].feat = -1;
/* Clear icky flag because may be redoing the cave */
cave[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].info &= ~(CAVE_ICKY);
}
xhstep /= 2;
ystep = yhstep;
yhstep /= 2;
-
+
/* cache well used values */
xstep2 = xstep / 256;
ystep2 = ystep / 256;
-
+
xhstep2 = xhstep / 256;
yhstep2 = yhstep / 256;
/* cache often used values */
ii = i / 256 + fill_data.xmin;
jj = j / 256 + fill_data.ymin;
-
+
/* Test square */
- if (cave[jj][ii].feat == 255)
- {
+ if (cave[jj][ii].feat == -1)
+ {
if (xhstep2 > grd)
{
/* If greater than 'grid' level then is random */
/* cache often used values */
ii = i / 256 + fill_data.xmin;
jj = j / 256 + fill_data.ymin;
-
+
/* Test square */
- if (cave[jj][ii].feat == 255)
+ if (cave[jj][ii].feat == -1)
{
if (xhstep2 > grd)
{
/* cache often used values */
ii = i / 256 + fill_data.xmin;
jj = j / 256 + fill_data.ymin;
-
+
/* Test square */
- if (cave[jj][ii].feat == 255)
- {
+ if (cave[jj][ii].feat == -1)
+ {
if (xhstep2 > grd)
{
/* If greater than 'grid' level then is random */
xm = fill_data.xmin + (i - xhstep) / 256;
xp = fill_data.xmin + (i + xhstep) / 256;
ym = fill_data.ymin + (j - yhstep) / 256;
- yp = fill_data.ymin + (j + yhstep) / 256;
-
+ yp = fill_data.ymin + (j + yhstep) / 256;
+
/*
* Average over all four corners + scale by diagsize to
* reduce the effect of the square grid on the shape of the fractal
- */
+ */
store_height(ii, jj,
(cave[ym][xm].feat + cave[yp][xm].feat
+ cave[ym][xp].feat + cave[yp][xp].feat) / 4
static bool generate_fracave(int y0, int x0, int xsize, int ysize, int cutoff, bool light, bool room)
{
int x, y, i, xhsize, yhsize;
-
/* offsets to middle from corner */
xhsize = xsize / 2;
* XXX XXX XXX There is a slight problem when tunnels pierce the caves:
* Extra doors appear inside the system. (Its not very noticeable though.)
* This can be removed by "filling" from the outside in. This allows a separation
- * from FEAT_WALL_OUTER with FEAT_WALL_INNER. (Internal walls are F.W.OUTER instead.)
+ * from _outer_ with _inner_. (Internal walls are _outer_ instead.)
* The extra effort for what seems to be only a minor thing (even non-existant if you
* think of the caves not as normal rooms, but as holes in the dungeon), doesn't seem
* worth it.
/* turn off icky flag (no longer needed.) */
cave[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
- /* Light lava and trees */
- if ((cave[y0 + y - yhsize][x0 + x - xhsize].feat == FEAT_DEEP_LAVA) ||
- (cave[y0 + y - yhsize][x0 + x - xhsize].feat == FEAT_SHAL_LAVA))
+ /* Light lava */
+ if (have_flag(f_flags_bold(y0 + y - yhsize, x0 + x - xhsize), FF_LAVA))
{
if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) cave[y0 + y - yhsize][x0 + x - xhsize].info |= CAVE_GLOW;
}
/* if floor, shallow water and lava */
if (is_floor_bold(y, x) ||
- (cave[y][x].feat == FEAT_SHAL_WATER) ||
- (cave[y][x].feat == FEAT_SHAL_LAVA))
+ (have_flag(f_flags_bold(y, x), FF_PLACE) && have_flag(f_flags_bold(y, x), FF_DROP)))
{
/* The smaller 'value' is, the better the stuff */
if (value < 0)
c_ptr->info |= (CAVE_ROOM | CAVE_ICKY);
/* Permanent walls */
- c_ptr->feat = FEAT_PERM_INNER;
- c_ptr->info &= ~(CAVE_MASK);
- c_ptr->info |= CAVE_INNER;
+ place_inner_perm_grid(c_ptr);
}
}
* Note: no range checking is done so must be inside dungeon
* This routine also stomps on doors
*/
-static void add_outer_wall(int x, int y, int light,
- int x1, int y1, int x2, int y2)
+static void add_outer_wall(int x, int y, int light, int x1, int y1, int x2, int y2)
{
+ cave_type *c_ptr;
+ feature_type *f_ptr;
int i, j;
if (!in_bounds(y, x)) return;
+ c_ptr = &cave[y][x];
+
/* hack- check to see if square has been visited before
* if so, then exit (use room flag to do this) */
- if (cave[y][x].info & CAVE_ROOM) return;
+ if (c_ptr->info & CAVE_ROOM) return;
/* set room flag */
- cave[y][x].info |= CAVE_ROOM;
+ c_ptr->info |= CAVE_ROOM;
+
+ f_ptr = &f_info[c_ptr->feat];
if (is_floor_bold(y, x))
{
(y + j >= y1) && (y + j <= y2))
{
add_outer_wall(x + i, y + j, light, x1, y1, x2, y2);
- if (light) cave[y][x].info |= CAVE_GLOW;
+ if (light) c_ptr->info |= CAVE_GLOW;
}
}
}
{
/* Set bounding walls */
place_outer_bold(y, x);
- if (light) cave[y][x].info |= CAVE_GLOW;
+ if (light) c_ptr->info |= CAVE_GLOW;
}
- else if (cave[y][x].feat == FEAT_PERM_OUTER)
+ else if (permanent_wall(f_ptr))
{
/* Set bounding walls */
- if (light) cave[y][x].info |= CAVE_GLOW;
+ if (light) c_ptr->info |= CAVE_GLOW;
}
}
bool light;
cave_type *c_ptr;
- byte trap;
+ s16b trap;
/* Pick a room size */
y1 = randint1(4);
int area_size = 100 * (cur_hgt*cur_wid) / (MAX_HGT*MAX_WID);
int level_index = MIN(10, div_round(dun_level, 10));
- /* Number of each type of room on this level */
- s16b room_num[ROOM_T_MAX];
+ /* Number of each type of room on this level */
+ s16b room_num[ROOM_T_MAX];
/* Limit number of rooms */
- int dun_rooms = rand_range(DUN_ROOMS_MIN, DUN_ROOMS_MAX * area_size / 100);
+ int dun_rooms = DUN_ROOMS_MAX * area_size / 100;
/* Assume normal cave */
room_info_type *room_info_ptr = room_info_normal;
if (!remain) break;
}
+ if (cheat_room)
+ {
+#ifdef JP
+ msg_format("Éô²°¿ô: %d", rooms_built);
+#else
+ msg_format("Number of Rooms: %d", rooms_built);
+#endif
+ }
}
-
-