OSDN Git Service

Initial revision
[hengband/hengband.git] / src / generate.h
1 #define ALLOW_CAVERNS_AND_LAKES
2
3 #define SAFE_MAX_ATTEMPTS 5000
4
5 /*
6  * Dungeon generation values
7  */
8 #define DUN_UNUSUAL 250 /* Level/chance of unusual room (was 200) */
9 #define DUN_DEST    18  /* 1/chance of having a destroyed level */
10 #define SMALL_LEVEL 3   /* 1/chance of smaller size (3) */
11 #define EMPTY_LEVEL 24  /* 1/chance of being 'empty' (15) */
12 #define LAKE_LEVEL  24  /* 1/chance of being a lake on the level */
13 #define DARK_EMPTY  5   /* 1/chance of arena level NOT being lit (2) */
14 #define DUN_CAVERN  20  /* 1/chance of having a cavern level */
15
16 /* Number of rooms to attempt (was 50) */
17 #define DUN_ROOMS_MIN   10
18 #define DUN_ROOMS_MAX   100
19
20 /*
21  * Dungeon tunnel generation values
22  */
23 #define DUN_TUN_RND_MIN  5 /* Chance of random direction (was 10) */
24 #define DUN_TUN_RND_MAX 20
25 #define DUN_TUN_CHG_MIN 20 /* Chance of changing direction (was 30) */
26 #define DUN_TUN_CHG_MAX 60
27 #define DUN_TUN_CON_MIN 10 /* Chance of extra tunneling (was 15) */
28 #define DUN_TUN_CON_MAX 40
29 #define DUN_TUN_PEN_MIN 30 /* Chance of doors at room entrances (was 25) */
30 #define DUN_TUN_PEN_MAX 70
31 #define DUN_TUN_JCT_MIN 60 /* Chance of doors at tunnel junctions (was 90) */
32 #define DUN_TUN_JCT_MAX 90
33
34 extern int dun_rooms;
35
36 extern int dun_tun_rnd;
37 extern int dun_tun_chg;
38 extern int dun_tun_con;
39 extern int dun_tun_pen;
40 extern int dun_tun_jct;
41
42 /*
43  * Dungeon streamer generation values
44  */
45 #define DUN_STR_DEN     5       /* Density of streamers */
46 #define DUN_STR_RNG     2       /* Width of streamers */
47 #define DUN_STR_MAG     3       /* Number of magma streamers */
48 #define DUN_STR_MC     90       /* 1/chance of treasure per magma */
49 #define DUN_STR_QUA         2   /* Number of quartz streamers */
50 #define DUN_STR_QC     40       /* 1/chance of treasure per quartz */
51 #define DUN_STR_WLW     1       /* Width of lava & water streamers -KMW- */
52 #define DUN_STR_DWLW    8       /* Density of water & lava streams -KMW- */
53
54 #define DUN_MOS_DEN     2       /* Density of moss streamers */
55 #define DUN_MOS_RNG     10      /* Width of moss streamers */
56 #define DUN_STR_MOS     2       /* Number of moss streamers */
57 #define DUN_WAT_DEN     15      /* Density of rivers */
58 #define DUN_WAT_RNG     2       /* Width of rivers */
59 #define DUN_STR_WAT     3       /* Max number of rivers */
60 #define DUN_WAT_CHG     50      /* 1 in 50 chance of junction in river */
61
62 /*
63  * Dungeon treausre allocation values
64  */
65 #define DUN_AMT_ROOM    9       /* Amount of objects for rooms */
66 #define DUN_AMT_ITEM    3       /* Amount of objects for rooms/corridors */
67 #define DUN_AMT_GOLD    3       /* Amount of treasure for rooms/corridors */
68 #define DUN_AMT_INVIS 3 /* Amount of invisible walls for rooms/corridors */
69
70 /*
71  * Hack -- Dungeon allocation "places"
72  */
73 #define ALLOC_SET_CORR          1       /* Hallway */
74 #define ALLOC_SET_ROOM          2       /* Room */
75 #define ALLOC_SET_BOTH          3       /* Anywhere */
76
77 /*
78  * Hack -- Dungeon allocation "types"
79  */
80 #define ALLOC_TYP_RUBBLE        1       /* Rubble */
81 #define ALLOC_TYP_TRAP          3       /* Trap */
82 #define ALLOC_TYP_GOLD          4       /* Gold */
83 #define ALLOC_TYP_OBJECT        5       /* Object */
84 #define ALLOC_TYP_INVIS         6       /* Invisible wall */
85
86
87
88 /*
89  * The "size" of a "generation block" in grids
90  */
91 #define BLOCK_HGT       11
92 #define BLOCK_WID       11
93
94 /*
95  * Maximum numbers of rooms along each axis (currently 6x6)
96  */
97 #define MAX_ROOMS_ROW   (MAX_HGT / BLOCK_HGT)
98 #define MAX_ROOMS_COL   (MAX_WID / BLOCK_WID)
99
100
101 /*
102  * Bounds on some arrays used in the "dun_data" structure.
103  * These bounds are checked, though usually this is a formality.
104  */
105 #define CENT_MAX        100
106 #define DOOR_MAX        200
107 #define WALL_MAX        500
108 #define TUNN_MAX        900
109
110
111 /*
112  * Structure to hold all "dungeon generation" data
113  */
114
115 typedef struct dun_data dun_data;
116
117 struct dun_data
118 {
119         /* Array of centers of rooms */
120         int cent_n;
121         coord cent[CENT_MAX];
122
123         /* Array of possible door locations */
124         int door_n;
125         coord door[DOOR_MAX];
126
127         /* Array of wall piercing locations */
128         int wall_n;
129         coord wall[WALL_MAX];
130
131         /* Array of tunnel grids */
132         int tunn_n;
133         coord tunn[TUNN_MAX];
134
135         /* Number of blocks along each axis */
136         int row_rooms;
137         int col_rooms;
138
139         /* Array of which blocks are used */
140         bool room_map[MAX_ROOMS_ROW][MAX_ROOMS_COL];
141
142         /* Hack -- there is a pit/nest on this level */
143         int crowded;
144 };
145
146 extern dun_data *dun;