OSDN Git Service

ダンジョンの主の配置コードを関数にまとめた. また, *破壊*等で消えた
[hengband/hengband.git] / src / generate.c
index e54d345..7b9d444 100644 (file)
@@ -227,7 +227,7 @@ static void alloc_object(int set, int typ, int num)
                        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;
@@ -1083,30 +1083,8 @@ msg_format("
                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))
        {
@@ -1712,8 +1690,8 @@ if (why) msg_format("
                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;