-#include "angband.h"\r
-#include "grid.h"\r
-#include "generate.h"\r
-#include "rooms.h"\r
-#include "monsterrace-hook.h"\r
-#include "objectkind-hook.h"\r
-\r
-\r
-/*!\r
-* @brief タイプ15の部屋…ガラス部屋の生成 / Type 15 -- glass rooms\r
-* @return なし\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
- 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
- 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
- DIRECTION 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
- 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, _("ガラスの部屋が生成されました。", "Glass room was generated."));\r
-\r
- return TRUE;\r
-}\r
+#include "angband.h"
+#include "grid.h"
+#include "generate.h"
+#include "rooms.h"
+#include "monster.h"
+#include "monsterrace-hook.h"
+#include "objectkind-hook.h"
+#include "feature.h"
+
+
+/*!
+* @brief タイプ15の部屋…ガラス部屋の生成 / Type 15 -- glass rooms
+* @return なし
+*/
+bool build_type15(void)
+{
+ POSITION y, x, y2, x2, yval, xval;
+ POSITION y1, x1, xsize, ysize;
+ bool light;
+
+ grid_type *g_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 = ((current_floor_ptr->dun_level <= randint1(25)) && !(d_info[p_ptr->dungeon_idx].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++)
+ {
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ place_floor_grid(g_ptr);
+ g_ptr->feat = feat_glass_floor;
+ g_ptr->info |= (CAVE_ROOM);
+ if (light) g_ptr->info |= (CAVE_GLOW);
+ }
+ }
+
+ /* Walls around the room */
+ for (y = y1 - 1; y <= y2 + 1; y++)
+ {
+ g_ptr = ¤t_floor_ptr->grid_array[y][x1 - 1];
+ place_outer_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+ g_ptr = ¤t_floor_ptr->grid_array[y][x2 + 1];
+ place_outer_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+ }
+ for (x = x1 - 1; x <= x2 + 1; x++)
+ {
+ g_ptr = ¤t_floor_ptr->grid_array[y1 - 1][x];
+ place_outer_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+ g_ptr = ¤t_floor_ptr->grid_array[y2 + 1][x];
+ place_outer_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+ }
+
+ switch (randint1(3))
+ {
+ case 1: /* 4 lite breathers + potion */
+ {
+ DIRECTION dir1, dir2;
+ 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(current_floor_ptr->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++)
+ {
+ g_ptr = ¤t_floor_ptr->grid_array[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]];
+ place_inner_grid(g_ptr);
+ g_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];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ place_inner_perm_grid(g_ptr);
+ g_ptr->feat = feat_permanent_glass_wall;
+ current_floor_ptr->grid_array[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);
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ if (is_closed_door(g_ptr->feat)) g_ptr->mimic = feat_glass_wall;
+
+ /* Place a potion */
+ get_obj_num_hook = kind_is_potion;
+ place_object(yval, xval, AM_NO_FIXED_ART);
+ current_floor_ptr->grid_array[yval][xval].info |= (CAVE_ICKY);
+ }
+ break;
+
+ case 2: /* 1 lite breather + random object */
+ {
+ MONRACE_IDX r_idx;
+ DIRECTION dir1;
+
+ /* Pillars */
+ g_ptr = ¤t_floor_ptr->grid_array[y1 + 1][x1 + 1];
+ place_inner_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+
+ g_ptr = ¤t_floor_ptr->grid_array[y1 + 1][x2 - 1];
+ place_inner_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+
+ g_ptr = ¤t_floor_ptr->grid_array[y2 - 1][x1 + 1];
+ place_inner_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+
+ g_ptr = ¤t_floor_ptr->grid_array[y2 - 1][x2 - 1];
+ place_inner_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+ get_mon_num_prep(vault_aux_lite, NULL);
+
+ r_idx = get_mon_num(current_floor_ptr->dun_level);
+ if (r_idx) place_monster_aux(0, yval, xval, r_idx, 0L);
+
+ /* Walls around the breather */
+ for (dir1 = 0; dir1 < 8; dir1++)
+ {
+ g_ptr = ¤t_floor_ptr->grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]];
+ place_inner_grid(g_ptr);
+ g_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);
+ current_floor_ptr->grid_array[yval][xval].info |= (CAVE_ICKY);
+ }
+ break;
+
+ case 3: /* 4 shards breathers + 2 potions */
+ {
+ DIRECTION dir1;
+
+ /* Walls around the potion */
+ for (y = yval - 2; y <= yval + 2; y++)
+ {
+ g_ptr = ¤t_floor_ptr->grid_array[y][xval - 3];
+ place_inner_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+ g_ptr = ¤t_floor_ptr->grid_array[y][xval + 3];
+ place_inner_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+ }
+ for (x = xval - 2; x <= xval + 2; x++)
+ {
+ g_ptr = ¤t_floor_ptr->grid_array[yval - 3][x];
+ place_inner_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+ g_ptr = ¤t_floor_ptr->grid_array[yval + 3][x];
+ place_inner_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+ }
+ for (dir1 = 4; dir1 < 8; dir1++)
+ {
+ g_ptr = ¤t_floor_ptr->grid_array[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]];
+ place_inner_grid(g_ptr);
+ g_ptr->feat = feat_glass_wall;
+ }
+ get_mon_num_prep(vault_aux_shards, NULL);
+
+ /* Place shard berathers */
+ for (dir1 = 4; dir1 < 8; dir1++)
+ {
+ MONRACE_IDX r_idx = get_mon_num(current_floor_ptr->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++)
+ current_floor_ptr->grid_array[y][x].info |= (CAVE_ICKY);
+
+ }
+ break;
+ }
+
+ msg_print_wizard(CHEAT_DUNGEON, _("ガラスの部屋が生成されました。", "Glass room was generated."));
+
+ return TRUE;
+}