OSDN Git Service

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