Hengband  2.2.1
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 #include "floor.h"
14 
15 #define ALLOW_CAVERNS_AND_LAKES
16 
17 #define DUN_ROOMS_MAX 40 /*!< 部屋生成処理の最大試行数 / Number of rooms to attempt (was 50) */
18 
19 
20 /* 池型地形の生成ID / Room types for generate_lake() */
21 #define LAKE_T_LAVA 1 /*!< 池型地形ID: 溶岩 */
22 #define LAKE_T_WATER 2 /*!< 池型地形ID: 池 */
23 #define LAKE_T_CAVE 3 /*!< 池型地形ID: 空洞 */
24 #define LAKE_T_EARTH_VAULT 4 /*!< 池型地形ID: 地属性VAULT */
25 #define LAKE_T_AIR_VAULT 5 /*!< 池型地形ID: 風属性VAULT */
26 #define LAKE_T_WATER_VAULT 6 /*!< 池型地形ID: 水属性VAULT */
27 #define LAKE_T_FIRE_VAULT 7 /*!< 池型地形ID: 火属性VAULT */
28 
29 
30 /* 部屋型ID / Room types for room_build() */
31 #define ROOM_T_NORMAL 0 /*!<部屋型ID:基本長方形 / Simple (33x11) */
32 #define ROOM_T_OVERLAP 1 /*!<部屋型ID:長方形二つ重ね / Overlapping (33x11) */
33 #define ROOM_T_CROSS 2 /*!<部屋型ID:十字 / Crossed (33x11) */
34 #define ROOM_T_INNER_FEAT 3 /*!<部屋型ID:二重壁 / Large (33x11) */
35 #define ROOM_T_NEST 4 /*!<部屋型ID:モンスターNEST / Monster nest (33x11) */
36 #define ROOM_T_PIT 5 /*!<部屋型ID:モンスターPIT / Monster pit (33x11) */
37 #define ROOM_T_LESSER_VAULT 6 /*!<部屋型ID:小型VAULT / Lesser vault (33x22) */
38 #define ROOM_T_GREATER_VAULT 7 /*!<部屋型ID:大型VAULT / Greater vault (66x44) */
39 #define ROOM_T_FRACAVE 8 /*!<部屋型ID:フラクタル地形 / Fractal p_ptr->current_floor_ptr->grid_array (42x24) */
40 #define ROOM_T_RANDOM_VAULT 9 /*!<部屋型ID:ランダムVAULT / Random vault (44x22) */
41 #define ROOM_T_OVAL 10 /*!<部屋型ID:円形部屋 / Circular rooms (22x22) */
42 #define ROOM_T_CRYPT 11 /*!<部屋型ID:聖堂 / Crypts (22x22) */
43 #define ROOM_T_TRAP_PIT 12 /*!<部屋型ID:トラップつきモンスターPIT / Trapped monster pit */
44 #define ROOM_T_TRAP 13 /*!<部屋型ID:トラップ部屋 / Piranha/Armageddon trap room */
45 #define ROOM_T_GLASS 14 /*!<部屋型ID:ガラス部屋 / Glass room */
46 #define ROOM_T_ARCADE 15 /*!<部屋型ID:商店 / Arcade */
47 #define ROOM_T_FIXED 16 /*!<部屋型ID:固定部屋 / Fixed room */
48 
49 #define ROOM_T_MAX 17 /*!<部屋型ID最大数 */
50 
51 
52 /*
53  * Room type information
54  */
56 
58 {
59  /* Allocation information. */
61 
62  /* Minimum level on which room can appear. */
63  byte min_level;
64 };
65 
66 /* Externs */
67 #ifdef ALLOW_CAVERNS_AND_LAKES
68 extern void build_lake(floor_type *floor_ptr, int type);
69 extern void build_cavern(floor_type *floor_ptr);
70 #endif /* ALLOW_CAVERNS_AND_LAKES */
71 
72 /* Maximum locked/jammed doors */
73 #define MAX_LJ_DOORS 8
74 
75 /*
76  * A structure type for doors
77  */
78 typedef struct
79 {
87 } door_type;
88 
90 
91 extern bool generate_rooms(floor_type *floor_ptr);
92 extern void build_maze_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault);
93 extern bool find_space(POSITION *y, POSITION *x, POSITION height, POSITION width);
94 extern void build_small_room(floor_type *floor_ptr, POSITION x0, POSITION y0);
95 extern void add_outer_wall(POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2);
96 extern POSITION dist2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, POSITION h1, POSITION h2, POSITION h3, POSITION h4);
97 extern void generate_room_floor(POSITION y1, POSITION x1, POSITION y2, POSITION x2, int light);
98 extern void generate_fill_perm_bold(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
99 extern void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff);
100 extern bool generate_fracave(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room);
101 extern void fill_treasure(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty);
102 extern bool generate_lake(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type);
103 extern void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power);
104 extern void build_room(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2);
105 extern void r_visit(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited);
bool find_space(POSITION *y, POSITION *x, POSITION height, POSITION width)
部屋生成が可能なスペースを確保する / Find a good spot for the next room.
Definition: rooms.c:383
door_type feat_door[MAX_DOOR_TYPES]
Definition: rooms.h:89
FEAT_IDX broken
Definition: rooms.h:81
Definition: floor.h:85
Definition: rooms.h:57
#define ROOM_T_MAX
部屋型ID最大数
Definition: rooms.h:49
s16b prob[ROOM_T_MAX]
Definition: rooms.h:60
void build_room(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2)
Definition: rooms.c:1521
void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff)
Definition: rooms.c:599
FEAT_IDX open
Definition: rooms.h:80
FEAT_IDX num_locked
Definition: rooms.h:84
void build_small_room(floor_type *floor_ptr, POSITION x0, POSITION y0)
1マスだけの部屋を作成し、上下左右いずれか一つに隠しドアを配置する。
Definition: rooms.c:166
Definition: rooms.h:78
#define MAX_LJ_DOORS
Definition: rooms.h:73
void build_lake(floor_type *floor_ptr, int type)
Definition: rooms.c:1328
s32b POSITION
ゲーム中の座標型を定義
Definition: h-type.h:146
void build_maze_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault)
Definition: rooms.c:1692
void generate_room_floor(POSITION y1, POSITION x1, POSITION y2, POSITION x2, int light)
Definition: rooms.c:2044
FEAT_IDX closed
Definition: rooms.h:82
#define MAX_DOOR_TYPES
Definition: grid.h:373
bool generate_lake(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type)
Definition: rooms.c:1182
void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power)
Definition: rooms.c:1763
byte min_level
Definition: rooms.h:63
POSITION dist2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, POSITION h1, POSITION h2, POSITION h3, POSITION h4)
Definition: rooms.c:2019
int DIRECTION
ゲーム中の方角の型定義
Definition: h-type.h:198
void generate_fill_perm_bold(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
Definition: rooms.c:2063
FEAT_IDX num_jammed
Definition: rooms.h:86
void fill_treasure(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty)
Definition: rooms.c:1383
signed short s16b
Definition: h-type.h:98
void add_outer_wall(POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2)
Definition: rooms.c:1967
bool generate_rooms(floor_type *floor_ptr)
部屋生成処理のメインルーチン(Sangbandを経由してOangbandからの実装を引用) / Generate rooms in dungeon.
Definition: rooms.c:2122
void build_cavern(floor_type *floor_ptr)
Definition: rooms.c:1144
bool generate_fracave(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room)
Definition: rooms.c:955
void r_visit(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited)
Definition: rooms.c:1608
s16b FEAT_IDX
ゲーム中の地形ID型を定義
Definition: h-type.h:115