OSDN Git Service

#37353 特殊部屋生成処理を rooms.c から rooms-special.c/h へ分離。
authorDeskull <deskull@users.sourceforge.jp>
Sat, 15 Sep 2018 08:17:36 +0000 (17:17 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Sat, 15 Sep 2018 08:17:36 +0000 (17:17 +0900)
Separate generation of special room from rooms.c to rooms-special.c/h.

Hengband_vcs2015/Hengband/Hengband.vcxproj
Hengband_vcs2015/Hengband/Hengband.vcxproj.filters
src/rooms-pitnest.h
src/rooms-special.c [new file with mode: 0644]
src/rooms-special.h [new file with mode: 0644]
src/rooms.c
src/rooms.h

index c3e6271..33a1b21 100644 (file)
     <ClCompile Include="..\..\src\rooms-city.c" />\r
     <ClCompile Include="..\..\src\rooms-normal.c" />\r
     <ClCompile Include="..\..\src\rooms-pitnest.c" />\r
+    <ClCompile Include="..\..\src\rooms-special.c" />\r
     <ClCompile Include="..\..\src\rooms-trap.c" />\r
     <ClCompile Include="..\..\src\rooms-vault.c" />\r
     <ClCompile Include="..\..\src\rooms.c" />\r
     <ClInclude Include="..\..\src\rooms-city.h" />\r
     <ClInclude Include="..\..\src\rooms-normal.h" />\r
     <ClInclude Include="..\..\src\rooms-pitnest.h" />\r
+    <ClInclude Include="..\..\src\rooms-special.h" />\r
     <ClInclude Include="..\..\src\rooms-trap.h" />\r
     <ClInclude Include="..\..\src\rooms-vault.h" />\r
     <ClInclude Include="..\..\src\rooms.h" />\r
index a6eadac..2d09743 100644 (file)
     <ClCompile Include="..\..\src\rooms-trap.c">\r
       <Filter>Source</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\src\rooms-special.c">\r
+      <Filter>Source</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\src\angband.h">\r
     <ClInclude Include="..\..\src\rooms-trap.h">\r
       <Filter>Header</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\..\src\rooms-special.h">\r
+      <Filter>Header</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ResourceCompile Include="..\..\src\angband.rc" />\r
index 2606e1b..5a84723 100644 (file)
@@ -7,20 +7,6 @@ typedef struct
 }\r
 nest_mon_info_type;\r
 \r
-/*!\r
-* vault\82É\94z\92u\89Â\94\\82È\83\82\83\93\83X\83^\81[\82Ì\8fð\8c\8f\82ð\8ew\92è\82·\82é\83}\83N\83\8d / Monster validation macro\r
-*\r
-* Line 1 -- forbid town monsters\r
-* Line 2 -- forbid uniques\r
-* Line 3 -- forbid aquatic monsters\r
-*/\r
-#define vault_monster_okay(I) \\r
-       (mon_hook_dungeon(I) && \\r
-        !(r_info[I].flags1 & RF1_UNIQUE) && \\r
-        !(r_info[I].flags7 & RF7_UNIQUE2) && \\r
-        !(r_info[I].flagsr & RFR_RES_ALL) && \\r
-        !(r_info[I].flags7 & RF7_AQUATIC))\r
-\r
 extern bool build_type5(void);\r
 extern bool build_type6(void);\r
 extern bool build_type13(void);\r
diff --git a/src/rooms-special.c b/src/rooms-special.c
new file mode 100644 (file)
index 0000000..f0650bf
--- /dev/null
@@ -0,0 +1,290 @@
+#include "angband.h"\r
+#include "grid.h"\r
+#include "generate.h"\r
+#include "rooms.h"\r
+\r
+/*\r
+* Helper function for "glass room"\r
+*/\r
+static bool vault_aux_lite(MONRACE_IDX r_idx)\r
+{\r
+       monster_race *r_ptr = &r_info[r_idx];\r
+\r
+       /* Validate the monster */\r
+       if (!vault_monster_okay(r_idx)) return FALSE;\r
+\r
+       /* Require lite attack */\r
+       if (!(r_ptr->flags4 & RF4_BR_LITE) && !(r_ptr->a_ability_flags1 & RF5_BA_LITE)) return FALSE;\r
+\r
+       /* No wall passing monsters */\r
+       if (r_ptr->flags2 & (RF2_PASS_WALL | RF2_KILL_WALL)) return FALSE;\r
+\r
+       /* No disintegrating monsters */\r
+       if (r_ptr->flags4 & RF4_BR_DISI) return FALSE;\r
+\r
+       return TRUE;\r
+}\r
+\r
+/*\r
+* Helper function for "glass room"\r
+*/\r
+static bool vault_aux_shards(MONRACE_IDX r_idx)\r
+{\r
+       monster_race *r_ptr = &r_info[r_idx];\r
+\r
+       /* Validate the monster */\r
+       if (!vault_monster_okay(r_idx)) return FALSE;\r
+\r
+       /* Require shards breath attack */\r
+       if (!(r_ptr->flags4 & RF4_BR_SHAR)) return FALSE;\r
+\r
+       return TRUE;\r
+}\r
+\r
+/*\r
+* Hack -- determine if a template is potion\r
+*/\r
+static bool kind_is_potion(KIND_OBJECT_IDX k_idx)\r
+{\r
+       return k_info[k_idx].tval == TV_POTION;\r
+}\r
+\r
+/*!\r
+* @brief \83^\83C\83v15\82Ì\95\94\89®\81c\83K\83\89\83X\95\94\89®\82Ì\90\90¬ / Type 15 -- glass rooms\r
+* @return \82È\82µ\r
+*/\r
+bool build_type15(void)\r
+{\r
+       POSITION y, x, y2, x2, yval, xval;\r
+       POSITION y1, x1, xsize, ysize;\r
+       bool light;\r
+\r
+       cave_type *c_ptr;\r
+\r
+       /* Pick a room size */\r
+       xsize = rand_range(9, 13);\r
+       ysize = rand_range(9, 13);\r
+\r
+       /* Find and reserve some space in the dungeon.  Get center of room. */\r
+       if (!find_space(&yval, &xval, ysize + 2, xsize + 2)) return FALSE;\r
+\r
+       /* Choose lite or dark */\r
+       light = ((dun_level <= randint1(25)) && !(d_info[dungeon_type].flags1 & DF1_DARKNESS));\r
+\r
+       /* Get corner values */\r
+       y1 = yval - ysize / 2;\r
+       x1 = xval - xsize / 2;\r
+       y2 = yval + (ysize - 1) / 2;\r
+       x2 = xval + (xsize - 1) / 2;\r
+\r
+       /* Place a full floor under the room */\r
+       for (y = y1 - 1; y <= y2 + 1; y++)\r
+       {\r
+               for (x = x1 - 1; x <= x2 + 1; x++)\r
+               {\r
+                       c_ptr = &cave[y][x];\r
+                       place_floor_grid(c_ptr);\r
+                       c_ptr->feat = feat_glass_floor;\r
+                       c_ptr->info |= (CAVE_ROOM);\r
+                       if (light) c_ptr->info |= (CAVE_GLOW);\r
+               }\r
+       }\r
+\r
+       /* Walls around the room */\r
+       for (y = y1 - 1; y <= y2 + 1; y++)\r
+       {\r
+               c_ptr = &cave[y][x1 - 1];\r
+               place_outer_grid(c_ptr);\r
+               c_ptr->feat = feat_glass_wall;\r
+               c_ptr = &cave[y][x2 + 1];\r
+               place_outer_grid(c_ptr);\r
+               c_ptr->feat = feat_glass_wall;\r
+       }\r
+       for (x = x1 - 1; x <= x2 + 1; x++)\r
+       {\r
+               c_ptr = &cave[y1 - 1][x];\r
+               place_outer_grid(c_ptr);\r
+               c_ptr->feat = feat_glass_wall;\r
+               c_ptr = &cave[y2 + 1][x];\r
+               place_outer_grid(c_ptr);\r
+               c_ptr->feat = feat_glass_wall;\r
+       }\r
+\r
+       switch (randint1(3))\r
+       {\r
+       case 1: /* 4 lite breathers + potion */\r
+       {\r
+               int dir1, dir2;\r
+\r
+               /* Prepare allocation table */\r
+               get_mon_num_prep(vault_aux_lite, NULL);\r
+\r
+               /* Place fixed lite berathers */\r
+               for (dir1 = 4; dir1 < 8; dir1++)\r
+               {\r
+                       MONRACE_IDX r_idx = get_mon_num(dun_level);\r
+\r
+                       y = yval + 2 * ddy_ddd[dir1];\r
+                       x = xval + 2 * ddx_ddd[dir1];\r
+                       if (r_idx) place_monster_aux(0, y, x, r_idx, PM_ALLOW_SLEEP);\r
+\r
+                       /* Walls around the breather */\r
+                       for (dir2 = 0; dir2 < 8; dir2++)\r
+                       {\r
+                               c_ptr = &cave[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]];\r
+                               place_inner_grid(c_ptr);\r
+                               c_ptr->feat = feat_glass_wall;\r
+                       }\r
+               }\r
+\r
+               /* Walls around the potion */\r
+               for (dir1 = 0; dir1 < 4; dir1++)\r
+               {\r
+                       y = yval + 2 * ddy_ddd[dir1];\r
+                       x = xval + 2 * ddx_ddd[dir1];\r
+                       c_ptr = &cave[y][x];\r
+                       place_inner_perm_grid(c_ptr);\r
+                       c_ptr->feat = feat_permanent_glass_wall;\r
+                       cave[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]].info |= (CAVE_ICKY);\r
+               }\r
+\r
+               /* Glass door */\r
+               dir1 = randint0(4);\r
+               y = yval + 2 * ddy_ddd[dir1];\r
+               x = xval + 2 * ddx_ddd[dir1];\r
+               place_secret_door(y, x, DOOR_GLASS_DOOR);\r
+               c_ptr = &cave[y][x];\r
+               if (is_closed_door(c_ptr->feat)) c_ptr->mimic = feat_glass_wall;\r
+\r
+               /* Place a potion */\r
+               get_obj_num_hook = kind_is_potion;\r
+               place_object(yval, xval, AM_NO_FIXED_ART);\r
+               cave[yval][xval].info |= (CAVE_ICKY);\r
+       }\r
+       break;\r
+\r
+       case 2: /* 1 lite breather + random object */\r
+       {\r
+               MONRACE_IDX r_idx;\r
+               DIRECTION dir1;\r
+\r
+               /* Pillars */\r
+               c_ptr = &cave[y1 + 1][x1 + 1];\r
+               place_inner_grid(c_ptr);\r
+               c_ptr->feat = feat_glass_wall;\r
+\r
+               c_ptr = &cave[y1 + 1][x2 - 1];\r
+               place_inner_grid(c_ptr);\r
+               c_ptr->feat = feat_glass_wall;\r
+\r
+               c_ptr = &cave[y2 - 1][x1 + 1];\r
+               place_inner_grid(c_ptr);\r
+               c_ptr->feat = feat_glass_wall;\r
+\r
+               c_ptr = &cave[y2 - 1][x2 - 1];\r
+               place_inner_grid(c_ptr);\r
+               c_ptr->feat = feat_glass_wall;\r
+\r
+               /* Prepare allocation table */\r
+               get_mon_num_prep(vault_aux_lite, NULL);\r
+\r
+               r_idx = get_mon_num(dun_level);\r
+               if (r_idx) place_monster_aux(0, yval, xval, r_idx, 0L);\r
+\r
+               /* Walls around the breather */\r
+               for (dir1 = 0; dir1 < 8; dir1++)\r
+               {\r
+                       c_ptr = &cave[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]];\r
+                       place_inner_grid(c_ptr);\r
+                       c_ptr->feat = feat_glass_wall;\r
+               }\r
+\r
+               /* Curtains around the breather */\r
+               for (y = yval - 1; y <= yval + 1; y++)\r
+               {\r
+                       place_closed_door(y, xval - 2, DOOR_CURTAIN);\r
+                       place_closed_door(y, xval + 2, DOOR_CURTAIN);\r
+               }\r
+               for (x = xval - 1; x <= xval + 1; x++)\r
+               {\r
+                       place_closed_door(yval - 2, x, DOOR_CURTAIN);\r
+                       place_closed_door(yval + 2, x, DOOR_CURTAIN);\r
+               }\r
+\r
+               /* Place an object */\r
+               place_object(yval, xval, AM_NO_FIXED_ART);\r
+               cave[yval][xval].info |= (CAVE_ICKY);\r
+       }\r
+       break;\r
+\r
+       case 3: /* 4 shards breathers + 2 potions */\r
+       {\r
+               int dir1;\r
+\r
+               /* Walls around the potion */\r
+               for (y = yval - 2; y <= yval + 2; y++)\r
+               {\r
+                       c_ptr = &cave[y][xval - 3];\r
+                       place_inner_grid(c_ptr);\r
+                       c_ptr->feat = feat_glass_wall;\r
+                       c_ptr = &cave[y][xval + 3];\r
+                       place_inner_grid(c_ptr);\r
+                       c_ptr->feat = feat_glass_wall;\r
+               }\r
+               for (x = xval - 2; x <= xval + 2; x++)\r
+               {\r
+                       c_ptr = &cave[yval - 3][x];\r
+                       place_inner_grid(c_ptr);\r
+                       c_ptr->feat = feat_glass_wall;\r
+                       c_ptr = &cave[yval + 3][x];\r
+                       place_inner_grid(c_ptr);\r
+                       c_ptr->feat = feat_glass_wall;\r
+               }\r
+               for (dir1 = 4; dir1 < 8; dir1++)\r
+               {\r
+                       c_ptr = &cave[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]];\r
+                       place_inner_grid(c_ptr);\r
+                       c_ptr->feat = feat_glass_wall;\r
+               }\r
+\r
+               /* Prepare allocation table */\r
+               get_mon_num_prep(vault_aux_shards, NULL);\r
+\r
+               /* Place shard berathers */\r
+               for (dir1 = 4; dir1 < 8; dir1++)\r
+               {\r
+                       MONRACE_IDX r_idx = get_mon_num(dun_level);\r
+\r
+                       y = yval + ddy_ddd[dir1];\r
+                       x = xval + ddx_ddd[dir1];\r
+                       if (r_idx) place_monster_aux(0, y, x, r_idx, 0L);\r
+               }\r
+\r
+               /* Place two potions */\r
+               if (one_in_(2))\r
+               {\r
+                       get_obj_num_hook = kind_is_potion;\r
+                       place_object(yval, xval - 1, AM_NO_FIXED_ART);\r
+                       get_obj_num_hook = kind_is_potion;\r
+                       place_object(yval, xval + 1, AM_NO_FIXED_ART);\r
+               }\r
+               else\r
+               {\r
+                       get_obj_num_hook = kind_is_potion;\r
+                       place_object(yval - 1, xval, AM_NO_FIXED_ART);\r
+                       get_obj_num_hook = kind_is_potion;\r
+                       place_object(yval + 1, xval, AM_NO_FIXED_ART);\r
+               }\r
+\r
+               for (y = yval - 2; y <= yval + 2; y++)\r
+                       for (x = xval - 2; x <= xval + 2; x++)\r
+                               cave[y][x].info |= (CAVE_ICKY);\r
+\r
+       }\r
+       break;\r
+       }\r
+\r
+       msg_print_wizard(CHEAT_DUNGEON, _("\83K\83\89\83X\82Ì\95\94\89®\82ª\90\90¬\82³\82ê\82Ü\82µ\82½\81B", "Glass room was generated."));\r
+\r
+       return TRUE;\r
+}\r
diff --git a/src/rooms-special.h b/src/rooms-special.h
new file mode 100644 (file)
index 0000000..0378353
--- /dev/null
@@ -0,0 +1,2 @@
+extern bool build_type15(void);\r
+\r
index 4079e69..04d1575 100644 (file)
@@ -44,6 +44,7 @@
 #include "rooms-city.h"
 #include "rooms-normal.h"
 #include "rooms-pitnest.h"
+#include "rooms-special.h"
 #include "rooms-trap.h"
 #include "rooms-vault.h"
 
@@ -2863,294 +2864,6 @@ static bool build_type10(void)
 }
 
 
-
-/*
- * Helper function for "glass room"
- */
-static bool vault_aux_lite(MONRACE_IDX r_idx)
-{
-       monster_race *r_ptr = &r_info[r_idx];
-
-       /* Validate the monster */
-       if (!vault_monster_okay(r_idx)) return FALSE;
-
-       /* Require lite attack */
-       if (!(r_ptr->flags4 & RF4_BR_LITE) && !(r_ptr->a_ability_flags1 & RF5_BA_LITE)) return FALSE;
-
-       /* No wall passing monsters */
-       if (r_ptr->flags2 & (RF2_PASS_WALL | RF2_KILL_WALL)) return FALSE;
-
-       /* No disintegrating monsters */
-       if (r_ptr->flags4 & RF4_BR_DISI) return FALSE;
-
-       return TRUE;
-}
-
-/*
- * Helper function for "glass room"
- */
-static bool vault_aux_shards(MONRACE_IDX r_idx)
-{
-       monster_race *r_ptr = &r_info[r_idx];
-
-       /* Validate the monster */
-       if (!vault_monster_okay(r_idx)) return FALSE;
-
-       /* Require shards breath attack */
-       if (!(r_ptr->flags4 & RF4_BR_SHAR)) return FALSE;
-
-       return TRUE;
-}
-
-/*
- * Hack -- determine if a template is potion
- */
-static bool kind_is_potion(KIND_OBJECT_IDX k_idx)
-{
-       return k_info[k_idx].tval == TV_POTION;
-}
-
-/*!
- * @brief タイプ15の部屋…ガラス部屋の生成 / Type 15 -- glass rooms
- * @return なし
- */
-static bool build_type15(void)
-{
-       POSITION y, x, y2, x2, yval, xval;
-       POSITION y1, x1, xsize, ysize;
-       bool light;
-
-       cave_type *c_ptr;
-
-       /* Pick a room size */
-       xsize = rand_range(9, 13);
-       ysize = rand_range(9, 13);
-
-       /* Find and reserve some space in the dungeon.  Get center of room. */
-       if (!find_space(&yval, &xval, ysize + 2, xsize + 2)) return FALSE;
-
-       /* Choose lite or dark */
-       light = ((dun_level <= randint1(25)) && !(d_info[dungeon_type].flags1 & DF1_DARKNESS));
-
-       /* Get corner values */
-       y1 = yval - ysize / 2;
-       x1 = xval - xsize / 2;
-       y2 = yval + (ysize - 1) / 2;
-       x2 = xval + (xsize - 1) / 2;
-
-       /* Place a full floor under the room */
-       for (y = y1 - 1; y <= y2 + 1; y++)
-       {
-               for (x = x1 - 1; x <= x2 + 1; x++)
-               {
-                       c_ptr = &cave[y][x];
-                       place_floor_grid(c_ptr);
-                       c_ptr->feat = feat_glass_floor;
-                       c_ptr->info |= (CAVE_ROOM);
-                       if (light) c_ptr->info |= (CAVE_GLOW);
-               }
-       }
-
-       /* Walls around the room */
-       for (y = y1 - 1; y <= y2 + 1; y++)
-       {
-               c_ptr = &cave[y][x1 - 1];
-               place_outer_grid(c_ptr);
-               c_ptr->feat = feat_glass_wall;
-               c_ptr = &cave[y][x2 + 1];
-               place_outer_grid(c_ptr);
-               c_ptr->feat = feat_glass_wall;
-       }
-       for (x = x1 - 1; x <= x2 + 1; x++)
-       {
-               c_ptr = &cave[y1 - 1][x];
-               place_outer_grid(c_ptr);
-               c_ptr->feat = feat_glass_wall;
-               c_ptr = &cave[y2 + 1][x];
-               place_outer_grid(c_ptr);
-               c_ptr->feat = feat_glass_wall;
-       }
-
-       switch (randint1(3))
-       {
-       case 1: /* 4 lite breathers + potion */
-               {
-                       int dir1, dir2;
-
-                       /* Prepare allocation table */
-                       get_mon_num_prep(vault_aux_lite, NULL);
-
-                       /* Place fixed lite berathers */
-                       for (dir1 = 4; dir1 < 8; dir1++)
-                       {
-                               MONRACE_IDX r_idx = get_mon_num(dun_level);
-
-                               y = yval + 2 * ddy_ddd[dir1];
-                               x = xval + 2 * ddx_ddd[dir1];
-                               if (r_idx) place_monster_aux(0, y, x, r_idx, PM_ALLOW_SLEEP);
-
-                               /* Walls around the breather */
-                               for (dir2 = 0; dir2 < 8; dir2++)
-                               {
-                                       c_ptr = &cave[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]];
-                                       place_inner_grid(c_ptr);
-                                       c_ptr->feat = feat_glass_wall;
-                               }
-                       }
-
-                       /* Walls around the potion */
-                       for (dir1 = 0; dir1 < 4; dir1++)
-                       {
-                               y = yval + 2 * ddy_ddd[dir1];
-                               x = xval + 2 * ddx_ddd[dir1];
-                               c_ptr = &cave[y][x];
-                               place_inner_perm_grid(c_ptr);
-                               c_ptr->feat = feat_permanent_glass_wall;
-                               cave[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]].info |= (CAVE_ICKY);
-                       }
-
-                       /* Glass door */
-                       dir1 = randint0(4);
-                       y = yval + 2 * ddy_ddd[dir1];
-                       x = xval + 2 * ddx_ddd[dir1];
-                       place_secret_door(y, x, DOOR_GLASS_DOOR);
-                       c_ptr = &cave[y][x];
-                       if (is_closed_door(c_ptr->feat)) c_ptr->mimic = feat_glass_wall;
-
-                       /* Place a potion */
-                       get_obj_num_hook = kind_is_potion;
-                       place_object(yval, xval, AM_NO_FIXED_ART);
-                       cave[yval][xval].info |= (CAVE_ICKY);
-               }
-               break;
-
-       case 2: /* 1 lite breather + random object */
-               {
-                       MONRACE_IDX r_idx;
-                       DIRECTION dir1;
-
-                       /* Pillars */
-                       c_ptr = &cave[y1 + 1][x1 + 1];
-                       place_inner_grid(c_ptr);
-                       c_ptr->feat = feat_glass_wall;
-
-                       c_ptr = &cave[y1 + 1][x2 - 1];
-                       place_inner_grid(c_ptr);
-                       c_ptr->feat = feat_glass_wall;
-
-                       c_ptr = &cave[y2 - 1][x1 + 1];
-                       place_inner_grid(c_ptr);
-                       c_ptr->feat = feat_glass_wall;
-
-                       c_ptr = &cave[y2 - 1][x2 - 1];
-                       place_inner_grid(c_ptr);
-                       c_ptr->feat = feat_glass_wall;
-
-                       /* Prepare allocation table */
-                       get_mon_num_prep(vault_aux_lite, NULL);
-
-                       r_idx = get_mon_num(dun_level);
-                       if (r_idx) place_monster_aux(0, yval, xval, r_idx, 0L);
-
-                       /* Walls around the breather */
-                       for (dir1 = 0; dir1 < 8; dir1++)
-                       {
-                               c_ptr = &cave[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]];
-                               place_inner_grid(c_ptr);
-                               c_ptr->feat = feat_glass_wall;
-                       }
-
-                       /* Curtains around the breather */
-                       for (y = yval - 1; y <= yval + 1; y++)
-                       {
-                               place_closed_door(y, xval - 2, DOOR_CURTAIN);
-                               place_closed_door(y, xval + 2, DOOR_CURTAIN);
-                       }
-                       for (x = xval - 1; x <= xval + 1; x++)
-                       {
-                               place_closed_door(yval - 2, x, DOOR_CURTAIN);
-                               place_closed_door(yval + 2, x, DOOR_CURTAIN);
-                       }
-
-                       /* Place an object */
-                       place_object(yval, xval, AM_NO_FIXED_ART);
-                       cave[yval][xval].info |= (CAVE_ICKY);
-               }
-               break;
-
-       case 3: /* 4 shards breathers + 2 potions */
-               {
-                       int dir1;
-
-                       /* Walls around the potion */
-                       for (y = yval - 2; y <= yval + 2; y++)
-                       {
-                               c_ptr = &cave[y][xval - 3];
-                               place_inner_grid(c_ptr);
-                               c_ptr->feat = feat_glass_wall;
-                               c_ptr = &cave[y][xval + 3];
-                               place_inner_grid(c_ptr);
-                               c_ptr->feat = feat_glass_wall;
-                       }
-                       for (x = xval - 2; x <= xval + 2; x++)
-                       {
-                               c_ptr = &cave[yval - 3][x];
-                               place_inner_grid(c_ptr);
-                               c_ptr->feat = feat_glass_wall;
-                               c_ptr = &cave[yval + 3][x];
-                               place_inner_grid(c_ptr);
-                               c_ptr->feat = feat_glass_wall;
-                       }
-                       for (dir1 = 4; dir1 < 8; dir1++)
-                       {
-                               c_ptr = &cave[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]];
-                               place_inner_grid(c_ptr);
-                               c_ptr->feat = feat_glass_wall;
-                       }
-
-                       /* Prepare allocation table */
-                       get_mon_num_prep(vault_aux_shards, NULL);
-
-                       /* Place shard berathers */
-                       for (dir1 = 4; dir1 < 8; dir1++)
-                       {
-                               MONRACE_IDX r_idx = get_mon_num(dun_level);
-
-                               y = yval + ddy_ddd[dir1];
-                               x = xval + ddx_ddd[dir1];
-                               if (r_idx) place_monster_aux(0, y, x, r_idx, 0L);
-                       }
-
-                       /* Place two potions */
-                       if (one_in_(2))
-                       {
-                               get_obj_num_hook = kind_is_potion;
-                               place_object(yval, xval - 1, AM_NO_FIXED_ART);
-                               get_obj_num_hook = kind_is_potion;
-                               place_object(yval, xval + 1, AM_NO_FIXED_ART);
-                       }
-                       else
-                       {
-                               get_obj_num_hook = kind_is_potion;
-                               place_object(yval - 1, xval, AM_NO_FIXED_ART);
-                               get_obj_num_hook = kind_is_potion;
-                               place_object(yval + 1, xval, AM_NO_FIXED_ART);
-                       }
-
-                       for (y = yval - 2; y <= yval + 2; y++)
-                               for (x = xval - 2; x <= xval + 2; x++)
-                                       cave[y][x].info |= (CAVE_ICKY);
-
-               }
-               break;
-       }
-
-       msg_print_wizard(CHEAT_DUNGEON, _("ガラスの部屋が生成されました。", "Glass room was generated."));
-
-       return TRUE;
-}
-
-
 /* Create a new floor room with optional light */
 void generate_room_floor(int y1, int x1, int y2, int x2, int light)
 {
index 3f962d3..a44acba 100644 (file)
@@ -58,6 +58,21 @@ struct room_info_type
 };
 
 
+/*!
+* vaultに配置可能なモンスターの条件を指定するマクロ / Monster validation macro
+*
+* Line 1 -- forbid town monsters
+* Line 2 -- forbid uniques
+* Line 3 -- forbid aquatic monsters
+*/
+#define vault_monster_okay(I) \
+       (mon_hook_dungeon(I) && \
+        !(r_info[I].flags1 & RF1_UNIQUE) && \
+        !(r_info[I].flags7 & RF7_UNIQUE2) && \
+        !(r_info[I].flagsr & RFR_RES_ALL) && \
+        !(r_info[I].flags7 & RF7_AQUATIC))
+
+
 /* Externs */
 #ifdef ALLOW_CAVERNS_AND_LAKES
 extern void build_lake(int type);