if (!is_floor_grid(c_ptr) || c_ptr->o_idx || c_ptr->m_idx) continue;
/* Avoid player location */
- if (py == y && px == x) continue;
+ if (player_bold(y, x)) continue;
/* Check for "room" */
room = (cave[y][x].info & CAVE_ROOM) ? TRUE : FALSE;
case ALLOC_TYP_OBJECT:
{
- place_object(y, x, FALSE, FALSE);
+ place_object(y, x, 0L);
break;
}
}
cave_type *c_ptr = &cave[0][x];
/* Set boundary mimic and add "solid" perma-wall */
- c_ptr->mimic = f_info[c_ptr->feat].mimic;
+ c_ptr->mimic = bound_walls_perm ? 0 : f_info[c_ptr->feat].mimic;
c_ptr->feat = FEAT_PERM_SOLID;
c_ptr = &cave[cur_hgt - 1][x];
/* Set boundary mimic and add "solid" perma-wall */
- c_ptr->mimic = f_info[c_ptr->feat].mimic;
+ c_ptr->mimic = bound_walls_perm ? 0 : f_info[c_ptr->feat].mimic;
c_ptr->feat = FEAT_PERM_SOLID;
}
cave_type *c_ptr = &cave[y][0];
/* Set boundary mimic and add "solid" perma-wall */
- c_ptr->mimic = f_info[c_ptr->feat].mimic;
+ c_ptr->mimic = bound_walls_perm ? 0 : f_info[c_ptr->feat].mimic;
c_ptr->feat = FEAT_PERM_SOLID;
c_ptr = &cave[y][cur_wid - 1];
/* Set boundary mimic and add "solid" perma-wall */
- c_ptr->mimic = f_info[c_ptr->feat].mimic;
+ c_ptr->mimic = bound_walls_perm ? 0 : f_info[c_ptr->feat].mimic;
c_ptr->feat = FEAT_PERM_SOLID;
}
alloc_object(ALLOC_SET_BOTH, ALLOC_TYP_GOLD, randnor(DUN_AMT_GOLD, 3));
}
- /* Put an Artifact and Artifact Guardian is requested */
- if (d_info[dungeon_type].final_guardian && (d_info[dungeon_type].maxdepth == dun_level))
- {
- int oy;
- int ox;
- int try = 4000;
-
- /* Find a good position */
- while(try)
- {
- /* Get a random spot */
- oy = randint1(cur_hgt - 4) + 2;
- ox = randint1(cur_wid - 4) + 2;
-
- /* Is it a good spot ? */
- if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(cave[oy][ox].feat, &r_info[d_info[dungeon_type].final_guardian]))
- {
- /* Place the guardian */
- if (place_monster_aux(0, oy, ox, d_info[dungeon_type].final_guardian, (PM_ALLOW_GROUP | PM_NO_KAGE | PM_NO_PET))) break;
- }
- /* One less try */
- try--;
- }
- }
+ /* Put the Guardian */
+ (void)alloc_guardian();
if (empty_level && (!one_in_(DARK_EMPTY) || (randint1(100) > dun_level)) && !(d_info[dungeon_type].flags1 & DF1_DARKNESS))
{
C_WIPE(m_list, m_max, monster_type);
m_max = 1;
m_cnt = 0;
+ precalc_cur_num_of_pet();
/* Start with a blank cave */
/* Nothing good here yet */
rating = 0;
-
- /* Fill the arrays of floors and walls in the good proportions */
- set_floor_and_wall(0);
}
{
int num;
+ /* Fill the arrays of floors and walls in the good proportions */
+ set_floor_and_wall(dungeon_type);
+
/* Generate */
for (num = 0; TRUE; num++)
{
/* Build the arena -KMW- */
if (p_ptr->inside_arena)
{
- /* Small arena */
+ /* Small arena */
arena_gen();
}
/* Build the battle -KMW- */
else if (p_ptr->inside_battle)
{
- /* Small arena */
+ /* Small arena */
battle_gen();
}
/* Build the town */
else if (!dun_level)
{
- /* Make the wilderness */
+ /* Make the wilderness */
if (p_ptr->wild_mode) wilderness_gen_small();
else wilderness_gen();
}
wipe_m_list();
}
- /* Glow deep lava */
- glow_deep_lava();
+ /* Glow deep lava and building entrances */
+ glow_deep_lava_and_bldg();
/* Reset flag */
p_ptr->enter_dungeon = FALSE;