3 #include "floor-save.h"
9 * The array of floor [MAX_WID][MAX_HGT].
10 * Not completely allocated, that would be inefficient
11 * Not completely hardcoded, that would overflow memory
13 floor_type floor_info;
16 * The array of saved floors
18 saved_floor_type saved_floors[MAX_SAVED_FLOORS];
21 * @brief 鍵のかかったドアを配置する
22 * @param y 配置したいフロアのY座標
23 * @param x 配置したいフロアのX座標
26 void place_locked_door(floor_type *floor_ptr, POSITION y, POSITION x)
28 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_DOORS)
30 place_floor_bold(y, x);
34 set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_locked_door_random((d_info[p_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR));
35 p_ptr->current_floor_ptr->grid_array[y][x].info &= ~(CAVE_FLOOR);
43 * @param y 配置したいフロアのY座標
44 * @param x 配置したいフロアのX座標
45 * @param type DOOR_DEFAULT / DOOR_DOOR / DOOR_GLASS_DOOR / DOOR_CURTAIN のいずれか
48 void place_secret_door(floor_type *floor_ptr, POSITION y, POSITION x, int type)
50 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_DOORS)
52 place_floor_bold(y, x);
56 grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
58 if (type == DOOR_DEFAULT)
60 type = ((d_info[p_ptr->dungeon_idx].flags1 & DF1_CURTAIN) &&
61 one_in_((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 16 : 256)) ? DOOR_CURTAIN :
62 ((d_info[p_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR);
65 /* Create secret door */
66 place_closed_door(y, x, type);
68 if (type != DOOR_CURTAIN)
70 /* Hide by inner wall because this is used in rooms only */
71 g_ptr->mimic = feat_wall_inner;
73 /* Floor type terrain cannot hide a door */
74 if (feat_supports_los(g_ptr->mimic) && !feat_supports_los(g_ptr->feat))
76 if (have_flag(f_info[g_ptr->mimic].flags, FF_MOVE) || have_flag(f_info[g_ptr->mimic].flags, FF_CAN_FLY))
78 g_ptr->feat = one_in_(2) ? g_ptr->mimic : feat_ground_type[randint0(100)];
84 g_ptr->info &= ~(CAVE_FLOOR);