Hengband  2.1.4
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  * Dungeon generation values
15  */
16 #define DUN_UNUSUAL 250 /*!< 通常ではない部屋が生成される基本確率(レベル/定数) / Level/chance of unusual room (was 200) */
17 #define DUN_DEST 18 /*!< 破壊地形がフロアに発生する基本確率(1/定数) / 1/chance of having a destroyed level */
18 #define SMALL_LEVEL 3 /*!< 小さいフロアの生成される基本確率(1/定数) / 1/chance of smaller size (3) */
19 #define EMPTY_LEVEL 24 /*!< アリーナレベル(外壁のないフロア)の生成される基本確率(1/定数) / 1/chance of being 'empty' (15) */
20 #define LAKE_LEVEL 24 /*!< 川や湖のあるフロアの生成される確率(1/定数) / 1/chance of being a lake on the level */
21 #define DARK_EMPTY 5 /*!< フロア全体が暗い可能性の基本確率(1/定数) / 1/chance of arena level NOT being lit (2) */
22 #define DUN_CAVERN 20 /*!< 洞窟状のダンジョンが生成される基本確率(1/定数) / 1/chance of having a cavern level */
23 
24 /*
25  * Dungeon tunnel generation values
26  */
27 #define DUN_TUN_RND_MIN 5 /* Chance of random direction (was 10) */
28 #define DUN_TUN_RND_MAX 20
29 #define DUN_TUN_CHG_MIN 20 /* Chance of changing direction (was 30) */
30 #define DUN_TUN_CHG_MAX 60
31 #define DUN_TUN_CON_MIN 10 /* Chance of extra tunneling (was 15) */
32 #define DUN_TUN_CON_MAX 40
33 #define DUN_TUN_PEN_MIN 30 /* Chance of doors at room entrances (was 25) */
34 #define DUN_TUN_PEN_MAX 70
35 #define DUN_TUN_JCT_MIN 60 /* Chance of doors at tunnel junctions (was 90) */
36 #define DUN_TUN_JCT_MAX 90
37 
38 
39 extern int dun_tun_rnd; /*!< ダンジョンの通路方向を掻き回す頻度(一回の試行ごとに%で判定している) */
40 extern int dun_tun_chg; /*!< ダンジョンの通路をクランクさせる頻度(一回の試行ごとに%で判定している) */
41 extern int dun_tun_con; /*!< ダンジョンの通路を継続して引き延ばす頻度(一回の試行ごとに%で判定している) */
42 extern int dun_tun_pen; /*!< ダンジョンの部屋入口にドアを設置する頻度(一回の試行ごとに%で判定している) */
43 extern int dun_tun_jct; /*!< ダンジョンの通路交差地点付近にドアを設置する頻度(一回の試行ごとに%で判定している) */
44 /*
45  * Dungeon streamer generation values
46  */
47 #define DUN_STR_DEN 5 /* Density of streamers */
48 #define DUN_STR_RNG 5 /* Width of streamers */
49 #define DUN_STR_MAG 6 /* Number of magma streamers */
50 #define DUN_STR_MC 30 /* 1/chance of treasure per magma */
51 #define DUN_STR_QUA 4 /* Number of quartz streamers */
52 #define DUN_STR_QC 15 /* 1/chance of treasure per quartz */
53 #define DUN_STR_WLW 1 /* Width of lava & water streamers -KMW- */
54 #define DUN_STR_DWLW 8 /* Density of water & lava streams -KMW- */
55 
56 #define DUN_MOS_DEN 2 /* Density of moss streamers */
57 #define DUN_MOS_RNG 10 /* Width of moss streamers */
58 #define DUN_STR_MOS 2 /* Number of moss streamers */
59 #define DUN_WAT_DEN 15 /* Density of rivers */
60 #define DUN_WAT_RNG 2 /* Width of rivers */
61 #define DUN_STR_WAT 3 /* Max number of rivers */
62 #define DUN_WAT_CHG 50 /* 1 in 50 chance of junction in river */
63 
64 /*
65  * Dungeon treausre allocation values
66  */
67 #define DUN_AMT_ROOM 9 /* Amount of objects for rooms */
68 #define DUN_AMT_ITEM 3 /* Amount of objects for rooms/corridors */
69 #define DUN_AMT_GOLD 3 /* Amount of treasure for rooms/corridors */
70 #define DUN_AMT_INVIS 3 /* Amount of invisible walls for rooms/corridors */
71 
72 /*
73  * Hack -- Dungeon allocation "places"
74  */
75 #define ALLOC_SET_CORR 1 /* Hallway */
76 #define ALLOC_SET_ROOM 2 /* Room */
77 #define ALLOC_SET_BOTH 3 /* Anywhere */
78 
79 /*
80  * Hack -- Dungeon allocation "types"
81  */
82 #define ALLOC_TYP_RUBBLE 1 /* Rubble */
83 #define ALLOC_TYP_TRAP 3 /* Trap */
84 #define ALLOC_TYP_GOLD 4 /* Gold */
85 #define ALLOC_TYP_OBJECT 5 /* Object */
86 #define ALLOC_TYP_INVIS 6 /* Invisible wall */
87 
88 
89 
90 /*
91  * The "size" of a "generation block" in grids
92  */
93 #define BLOCK_HGT 11
94 #define BLOCK_WID 11
95 
96 /*
97  * Maximum numbers of rooms along each axis (currently 6x6)
98  */
99 #define MAX_ROOMS_ROW (MAX_HGT / BLOCK_HGT)
100 #define MAX_ROOMS_COL (MAX_WID / BLOCK_WID)
101 
102 
103 /*
104  * Bounds on some arrays used in the "dun_data" structure.
105  * These bounds are checked, though usually this is a formality.
106  */
107 #define CENT_MAX 100
108 #define DOOR_MAX 200
109 #define WALL_MAX 500
110 #define TUNN_MAX 900
111 
112 
113 /*
114  * Structure to hold all "dungeon generation" data
115  */
116 
117 typedef struct dun_data dun_data;
118 
119 struct dun_data
120 {
121  /* Array of centers of rooms */
122  int cent_n;
124 
125  /* Array of possible door locations */
126  int door_n;
128 
129  /* Array of wall piercing locations */
130  int wall_n;
132 
133  /* Array of tunnel grids */
134  int tunn_n;
136 
137  /* Number of blocks along each axis */
140 
141  /* Array of which blocks are used */
143 
144  /* Various type of dungeon floors */
145  bool destroyed;
147  bool cavern;
148  int laketype;
149 };
150 
151 extern dun_data *dun;
int dun_tun_chg
ダンジョンの通路をクランクさせる頻度(一回の試行ごとにで判定している)
Definition: generate.c:106
bool cavern
Definition: generate.h:147
int tunn_n
Definition: generate.h:134
int wall_n
Definition: generate.h:130
#define DOOR_MAX
Definition: generate.h:108
#define CENT_MAX
Definition: generate.h:107
int door_n
Definition: generate.h:126
int dun_tun_pen
ダンジョンの部屋入口にドアを設置する頻度(一回の試行ごとにで判定している)
Definition: generate.c:108
coord door[DOOR_MAX]
Definition: generate.h:127
coord tunn[TUNN_MAX]
Definition: generate.h:135
int dun_tun_rnd
ダンジョンの通路方向を掻き回す頻度(一回の試行ごとにで判定している)
Definition: generate.c:105
int col_rooms
Definition: generate.h:139
int dun_tun_jct
ダンジョンの通路交差地点付近にドアを設置する頻度(一回の試行ごとにで判定している)
Definition: generate.c:109
#define WALL_MAX
Definition: generate.h:109
bool destroyed
Definition: generate.h:145
int cent_n
Definition: generate.h:122
coord cent[CENT_MAX]
Definition: generate.h:123
#define MAX_ROOMS_COL
Definition: generate.h:100
int row_rooms
Definition: generate.h:138
#define TUNN_MAX
Definition: generate.h:110
Definition: generate.h:119
#define MAX_ROOMS_ROW
Definition: generate.h:99
int dun_tun_con
ダンジョンの通路を継続して引き延ばす頻度(一回の試行ごとにで判定している)
Definition: generate.c:107
coord wall[WALL_MAX]
Definition: generate.h:131
Definition: types.h:481
bool empty_level
Definition: generate.h:146
int laketype
Definition: generate.h:148
dun_data * dun
Dungeon generation data – see "cave_gen()"
Definition: generate.c:115
bool room_map[MAX_ROOMS_ROW][MAX_ROOMS_COL]
Definition: generate.h:142