OSDN Git Service

83590f8377752db14cb9cf9e725411d889bec1cc
[hengband/hengband.git] / src / floor-generate.h
1 #pragma once
2
3 /*!
4  * @file generate.h
5  * @brief \83_\83\93\83W\83\87\83\93\90\90¬\8f\88\97\9d\82Ì\83w\83b\83_\81[\83t\83@\83C\83\8b
6  * @date 2014/08/08
7  * @author
8  * \95s\96¾(\95Ï\8bð\94Ø\93{\83X\83^\83b\83t\81H)
9  */
10
11 #define SAFE_MAX_ATTEMPTS 5000 /*!< \90\90¬\8f\88\97\9d\8aî\96{\8e\8e\8ds\89ñ\90\94 */
12
13
14
15 extern int dun_tun_rnd; /*!< \83_\83\93\83W\83\87\83\93\82Ì\92Ê\98H\95û\8cü\82ð\91~\82«\89ñ\82·\95p\93x(\88ê\89ñ\82Ì\8e\8e\8ds\82²\82Æ\82É%\82Å\94»\92è\82µ\82Ä\82¢\82é) */
16 extern int dun_tun_chg; /*!< \83_\83\93\83W\83\87\83\93\82Ì\92Ê\98H\82ð\83N\83\89\83\93\83N\82³\82¹\82é\95p\93x(\88ê\89ñ\82Ì\8e\8e\8ds\82²\82Æ\82É%\82Å\94»\92è\82µ\82Ä\82¢\82é) */
17 extern int dun_tun_con; /*!< \83_\83\93\83W\83\87\83\93\82Ì\92Ê\98H\82ð\8cp\91±\82µ\82Ä\88ø\82«\89\84\82Î\82·\95p\93x(\88ê\89ñ\82Ì\8e\8e\8ds\82²\82Æ\82É%\82Å\94»\92è\82µ\82Ä\82¢\82é) */
18 extern int dun_tun_pen; /*!< \83_\83\93\83W\83\87\83\93\82Ì\95\94\89®\93ü\8cû\82É\83h\83A\82ð\90Ý\92u\82·\82é\95p\93x(\88ê\89ñ\82Ì\8e\8e\8ds\82²\82Æ\82É%\82Å\94»\92è\82µ\82Ä\82¢\82é) */
19 extern int dun_tun_jct; /*!< \83_\83\93\83W\83\87\83\93\82Ì\92Ê\98H\8cð\8d·\92n\93_\95t\8bß\82É\83h\83A\82ð\90Ý\92u\82·\82é\95p\93x(\88ê\89ñ\82Ì\8e\8e\8ds\82²\82Æ\82É%\82Å\94»\92è\82µ\82Ä\82¢\82é) */
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_random_floor_flags(void);
104 extern void clear_cave(void);
105 extern void generate_random_floor(void);
106
107 extern bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2);
108 extern bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff);