OSDN Git Service

[Refactor] #38862 Moved room*.c/h to room/
[hengband/hengband.git] / src / room / rooms.h
1 /*!
2  * @file rooms.h
3  * @brief 部屋生成処理の定義ヘッダー / Header file for rooms.c, used only in generate.c
4  * @date 2014/09/07
5  * @author
6  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke<br>
7  * This software may be copied and distributed for educational, research,
8  * and not for profit purposes provided that this copyright and statement
9  * are included in all such copies.  Other copyrights may also apply.<br
10  */
11
12 #pragma once
13
14 #define ALLOW_CAVERNS_AND_LAKES
15
16 #define DUN_ROOMS_MAX   40 /*!< 部屋生成処理の最大試行数 / Number of rooms to attempt (was 50) */
17
18
19 /* 池型地形の生成ID / Room types for generate_lake() */
20 #define LAKE_T_LAVA        1 /*!< 池型地形ID: 溶岩 */
21 #define LAKE_T_WATER       2 /*!< 池型地形ID: 池 */
22 #define LAKE_T_CAVE        3 /*!< 池型地形ID: 空洞 */
23 #define LAKE_T_EARTH_VAULT 4 /*!< 池型地形ID: 地属性VAULT */
24 #define LAKE_T_AIR_VAULT   5 /*!< 池型地形ID: 風属性VAULT */
25 #define LAKE_T_WATER_VAULT 6 /*!< 池型地形ID: 水属性VAULT */
26 #define LAKE_T_FIRE_VAULT  7 /*!< 池型地形ID: 火属性VAULT */
27
28
29 /* 部屋型ID / Room types for room_build() */
30 #define ROOM_T_NORMAL         0  /*!<部屋型ID:基本長方形 / Simple (33x11) */
31 #define ROOM_T_OVERLAP        1  /*!<部屋型ID:長方形二つ重ね / Overlapping (33x11) */
32 #define ROOM_T_CROSS          2  /*!<部屋型ID:十字 / Crossed (33x11) */
33 #define ROOM_T_INNER_FEAT     3  /*!<部屋型ID:二重壁 / Large (33x11) */
34 #define ROOM_T_NEST           4  /*!<部屋型ID:モンスターNEST / Monster nest (33x11) */
35 #define ROOM_T_PIT            5  /*!<部屋型ID:モンスターPIT / Monster pit (33x11) */
36 #define ROOM_T_LESSER_VAULT   6  /*!<部屋型ID:小型VAULT / Lesser vault (33x22) */
37 #define ROOM_T_GREATER_VAULT  7  /*!<部屋型ID:大型VAULT / Greater vault (66x44) */
38 #define ROOM_T_FRACAVE        8  /*!<部屋型ID:フラクタル地形 / Fractal room (42x24) */
39 #define ROOM_T_RANDOM_VAULT   9  /*!<部屋型ID:ランダムVAULT / Random vault (44x22) */
40 #define ROOM_T_OVAL          10  /*!<部屋型ID:円形部屋 / Circular rooms (22x22) */
41 #define ROOM_T_CRYPT         11  /*!<部屋型ID:聖堂 / Crypts (22x22) */
42 #define ROOM_T_TRAP_PIT      12  /*!<部屋型ID:トラップつきモンスターPIT / Trapped monster pit */
43 #define ROOM_T_TRAP          13  /*!<部屋型ID:トラップ部屋 / Piranha/Armageddon trap room */
44 #define ROOM_T_GLASS         14  /*!<部屋型ID:ガラス部屋 / Glass room */
45 #define ROOM_T_ARCADE        15  /*!<部屋型ID:商店 / Arcade */
46 #define ROOM_T_FIXED         16  /*!<部屋型ID:固定部屋 / Fixed room */
47
48 #define ROOM_T_MAX 17 /*!<部屋型ID最大数 */
49
50
51 /*
52  * Room type information
53  */
54 typedef struct room_info_type room_info_type;
55
56 struct room_info_type
57 {
58         /* Allocation information. */
59         s16b prob[ROOM_T_MAX];
60
61         /* Minimum level on which room can appear. */
62         byte min_level;
63 };
64
65 extern void build_lake(player_type *player_ptr, int type);
66 extern void build_cavern(player_type *player_ptr);
67
68 /* Maximum locked/jammed doors */
69 #define MAX_LJ_DOORS 8
70
71 /*
72  * A structure type for doors
73  */
74 typedef struct
75 {
76         FEAT_IDX open;
77         FEAT_IDX broken;
78         FEAT_IDX closed;
79         FEAT_IDX locked[MAX_LJ_DOORS];
80         FEAT_IDX num_locked;
81         FEAT_IDX jammed[MAX_LJ_DOORS];
82         FEAT_IDX num_jammed;
83 } door_type;
84
85 door_type feat_door[MAX_DOOR_TYPES];
86
87 extern bool generate_rooms(player_type *player_ptr);
88 extern void build_maze_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault);
89 extern bool find_space(player_type *player_ptr, POSITION *y, POSITION *x, POSITION height, POSITION width);
90 extern void build_small_room(player_type *player_ptr, POSITION x0, POSITION y0);
91 extern void add_outer_wall(player_type *player_ptr, POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2);
92 extern POSITION dist2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, POSITION h1, POSITION h2, POSITION h3, POSITION h4);
93 extern void generate_room_floor(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int light);
94 extern void generate_fill_perm_bold(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
95 extern void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff);
96 extern bool generate_fracave(player_type *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room);
97 extern void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty);
98 extern bool generate_lake(player_type *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type);
99 extern void build_recursive_room(player_type *player_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power);
100 extern void build_room(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2);
101 extern void r_visit(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited);