OSDN Git Service

v3.0.0 Alpha5 OSDN最終版
[hengband/hengband.git] / src / generate.h
1 /*!
2  * @file generate.h
3  * @brief ダンジョン生成処理のヘッダーファイル
4  * @date 2014/08/08
5  * @author
6  * 不明(変愚蛮怒スタッフ?)
7  */
8
9 #define ALLOW_CAVERNS_AND_LAKES
10
11 #define SAFE_MAX_ATTEMPTS 5000 /*!< 生成処理基本試行回数 */
12
13
14
15 extern int dun_tun_rnd; /*!< ダンジョンの通路方向を掻き回す頻度(一回の試行ごとに%で判定している) */
16 extern int dun_tun_chg; /*!< ダンジョンの通路をクランクさせる頻度(一回の試行ごとに%で判定している) */
17 extern int dun_tun_con; /*!< ダンジョンの通路を継続して引き延ばす頻度(一回の試行ごとに%で判定している) */
18 extern int dun_tun_pen; /*!< ダンジョンの部屋入口にドアを設置する頻度(一回の試行ごとに%で判定している) */
19 extern int dun_tun_jct; /*!< ダンジョンの通路交差地点付近にドアを設置する頻度(一回の試行ごとに%で判定している) */
20
21 /*
22  * Hack -- Dungeon allocation "places"
23  */
24 #define ALLOC_SET_CORR          1       /* Hallway */
25 #define ALLOC_SET_ROOM          2       /* Room */
26 #define ALLOC_SET_BOTH          3       /* Anywhere */
27
28 /*
29  * Hack -- Dungeon allocation "types"
30  */
31 #define ALLOC_TYP_RUBBLE        1       /* Rubble */
32 #define ALLOC_TYP_TRAP          3       /* Trap */
33 #define ALLOC_TYP_GOLD          4       /* Gold */
34 #define ALLOC_TYP_OBJECT        5       /* Object */
35 #define ALLOC_TYP_INVIS         6       /* Invisible wall */
36
37
38
39 /*
40  * The "size" of a "generation block" in grids
41  */
42 #define BLOCK_HGT       11
43 #define BLOCK_WID       11
44
45 /*
46  * Maximum numbers of rooms along each axis (currently 6x6)
47  */
48 #define MAX_ROOMS_ROW   (MAX_HGT / BLOCK_HGT)
49 #define MAX_ROOMS_COL   (MAX_WID / BLOCK_WID)
50
51
52 /*
53  * Bounds on some arrays used in the "dun_data" structure.
54  * These bounds are checked, though usually this is a formality.
55  */
56 #define CENT_MAX        100
57 #define DOOR_MAX        200
58 #define WALL_MAX        500
59 #define TUNN_MAX        900
60
61
62 /*
63  * Structure to hold all "dungeon generation" data
64  */
65
66 typedef struct dun_data dun_data;
67
68 struct dun_data
69 {
70         /* Array of centers of rooms */
71         int cent_n;
72         coord cent[CENT_MAX];
73
74         /* Array of possible door locations */
75         int door_n;
76         coord door[DOOR_MAX];
77
78         /* Array of wall piercing locations */
79         int wall_n;
80         coord wall[WALL_MAX];
81
82         /* Array of tunnel grids */
83         int tunn_n;
84         coord tunn[TUNN_MAX];
85
86         /* Number of blocks along each axis */
87         int row_rooms;
88         int col_rooms;
89
90         /* Array of which blocks are used */
91         bool room_map[MAX_ROOMS_ROW][MAX_ROOMS_COL];
92
93         /* Various type of dungeon floors */
94         bool destroyed;
95         bool empty_level;
96         bool cavern;
97         int laketype;
98 };
99
100 extern dun_data *dun;
101
102 extern bool place_quest_monsters(void);
103 extern void wipe_generate_cave_flags(void);
104 extern void clear_cave(void);
105 extern void generate_cave(void);