ダンジョンの生成処理の基幹部分ヘッダーファイル [詳細]
マクロ定義 | |
#define | set_cave_feat(Y, X, F) (cave[(Y)][(X)].feat = (F)) |
#define | add_cave_info(Y, X, I) (cave[(Y)][(X)].info |= (I)) |
#define | place_rubble(Y, X) set_cave_feat(Y,X,feat_rubble) |
指定座標が瓦礫かどうかを返す [詳細] | |
#define | place_up_stairs(Y, X) set_cave_feat(Y,X,feat_up_stair) |
指定座標が上り階段かどうかを返す [詳細] | |
#define | place_down_stairs(Y, X) set_cave_feat(Y,X,feat_down_stair) |
指定座標が下り階段かどうかを返す [詳細] | |
#define | is_floor_bold(Y, X) (cave[Y][X].info & CAVE_FLOOR) |
指定座標がFLOOR属性を持ったマスかどうかを返す [詳細] | |
#define | is_extra_bold(Y, X) (cave[Y][X].info & CAVE_EXTRA) |
#define | is_inner_bold(Y, X) (cave[Y][X].info & CAVE_INNER) |
#define | is_outer_bold(Y, X) (cave[Y][X].info & CAVE_OUTER) |
#define | is_solid_bold(Y, X) (cave[Y][X].info & CAVE_SOLID) |
#define | is_floor_grid(C) ((C)->info & CAVE_FLOOR) |
#define | is_extra_grid(C) ((C)->info & CAVE_EXTRA) |
#define | is_inner_grid(C) ((C)->info & CAVE_INNER) |
#define | is_outer_grid(C) ((C)->info & CAVE_OUTER) |
#define | is_solid_grid(C) ((C)->info & CAVE_SOLID) |
#define | place_floor_bold(Y, X) |
#define | place_floor_grid(C) |
#define | place_extra_bold(Y, X) |
#define | place_extra_grid(C) |
#define | place_extra_perm_bold(Y, X) |
#define | place_extra_perm_grid(C) |
#define | place_extra_noperm_bold(Y, X) |
#define | place_inner_bold(Y, X) |
#define | place_inner_grid(C) |
#define | place_inner_perm_bold(Y, X) |
#define | place_inner_perm_grid(C) |
#define | place_outer_bold(Y, X) |
#define | place_outer_grid(C) |
#define | place_outer_perm_bold(Y, X) |
#define | place_outer_perm_grid(C) |
#define | place_outer_noperm_bold(Y, X) |
#define | place_outer_noperm_grid(C) |
#define | place_solid_bold(Y, X) |
#define | place_solid_grid(C) |
#define | place_solid_perm_bold(Y, X) |
#define | place_solid_perm_grid(C) |
#define | place_solid_noperm_bold(Y, X) |
#define | place_solid_noperm_grid(C) |
関数 | |
bool | new_player_spot (void) |
新規フロアに入りたてのプレイヤーをランダムな場所に配置する / Returns random co-ordinates for player/monster/object [詳細] | |
void | place_random_stairs (int y, int x) |
所定の位置に上り階段か下り階段を配置する / Place an up/down staircase at given location [詳細] | |
void | place_random_door (int y, int x, bool room) |
所定の位置にさまざまな状態や種類のドアを配置する / Place a random type of door at the given location [詳細] | |
void | place_closed_door (int y, int x, int type) |
所定の位置に各種の閉じたドアを配置する / Place a random type of normal door at the given location. [詳細] | |
void | place_floor (int x1, int x2, int y1, int y2, bool light) |
長方形の空洞を生成する / Make an empty square floor, for the middle of rooms [詳細] | |
void | place_room (int x1, int x2, int y1, int y2, bool light) |
長方形の部屋を生成する / Make an empty square room, only floor and wall grids [詳細] | |
void | vault_monsters (int y1, int x1, int num) |
特殊な部屋地形向けにモンスターを配置する / Hack – Place some sleeping monsters near the given location [詳細] | |
void | vault_objects (int y, int x, int num) |
特殊な部屋向けに各種アイテムを配置する / Create up to "num" objects near the given coordinates [詳細] | |
void | vault_trap_aux (int y, int x, int yd, int xd) |
特殊な部屋向けに各種アイテムを配置する(vault_trapのサブセット) / Place a trap with a given displacement of point [詳細] | |
void | vault_traps (int y, int x, int yd, int xd, int num) |
特殊な部屋向けに各種アイテムを配置する(メインルーチン) / Place some traps with a given displacement of given location [詳細] | |
void | correct_dir (int *rdir, int *cdir, int y1, int x1, int y2, int x2) |
build_tunnel用に通路を掘るための方向を位置関係通りに決める / Always picks a correct direction [詳細] | |
void | rand_dir (int *rdir, int *cdir) |
build_tunnel用に通路を掘るための方向をランダムに決める / Pick a random direction [詳細] | |
bool | get_is_floor (int x, int y) |
指定のマスが床系地形であるかを返す / Function that sees if a square is a floor. [詳細] | |
void | set_floor (int x, int y) |
指定のマスを床地形に変える / Set a square to be floor. [詳細] | |
bool | build_tunnel (int row1, int col1, int row2, int col2) |
部屋間のトンネルを生成する / Constructs a tunnel between two points [詳細] | |
bool | build_tunnel2 (int x1, int y1, int x2, int y2, int type, int cutoff) |
特定の壁(永久壁など)を避けながら部屋間の通路を作成する / This routine maps a path from (x1, y1) to (x2, y2) avoiding SOLID walls. [詳細] | |
ダンジョンの生成処理の基幹部分ヘッダーファイル
Purpose: header file for grid.c, used only in dungeon generation files (generate.c, rooms.c)
#define add_cave_info | ( | Y, | |
X, | |||
I | |||
) | (cave[(Y)][(X)].info |= (I)) |
#define is_extra_bold | ( | Y, | |
X | |||
) | (cave[Y][X].info & CAVE_EXTRA) |
#define is_extra_grid | ( | C | ) | ((C)->info & CAVE_EXTRA) |
#define is_floor_bold | ( | Y, | |
X | |||
) | (cave[Y][X].info & CAVE_FLOOR) |
指定座標がFLOOR属性を持ったマスかどうかを返す
Y | 指定Y座標 |
X | 指定X座標 |
#define is_floor_grid | ( | C | ) | ((C)->info & CAVE_FLOOR) |
#define is_inner_bold | ( | Y, | |
X | |||
) | (cave[Y][X].info & CAVE_INNER) |
#define is_inner_grid | ( | C | ) | ((C)->info & CAVE_INNER) |
#define is_outer_bold | ( | Y, | |
X | |||
) | (cave[Y][X].info & CAVE_OUTER) |
#define is_outer_grid | ( | C | ) | ((C)->info & CAVE_OUTER) |
#define is_solid_bold | ( | Y, | |
X | |||
) | (cave[Y][X].info & CAVE_SOLID) |
#define is_solid_grid | ( | C | ) | ((C)->info & CAVE_SOLID) |
#define place_down_stairs | ( | Y, | |
X | |||
) | set_cave_feat(Y,X,feat_down_stair) |
指定座標が下り階段かどうかを返す
Y | 指定Y座標 |
X | 指定X座標 |
#define place_extra_bold | ( | Y, | |
X | |||
) |
#define place_extra_grid | ( | C | ) |
#define place_extra_noperm_bold | ( | Y, | |
X | |||
) |
#define place_extra_perm_bold | ( | Y, | |
X | |||
) |
#define place_extra_perm_grid | ( | C | ) |
#define place_floor_bold | ( | Y, | |
X | |||
) |
#define place_floor_grid | ( | C | ) |
#define place_inner_bold | ( | Y, | |
X | |||
) |
#define place_inner_grid | ( | C | ) |
#define place_inner_perm_bold | ( | Y, | |
X | |||
) |
#define place_inner_perm_grid | ( | C | ) |
#define place_outer_bold | ( | Y, | |
X | |||
) |
#define place_outer_grid | ( | C | ) |
#define place_outer_noperm_bold | ( | Y, | |
X | |||
) |
#define place_outer_noperm_grid | ( | C | ) |
#define place_outer_perm_bold | ( | Y, | |
X | |||
) |
#define place_outer_perm_grid | ( | C | ) |
#define place_rubble | ( | Y, | |
X | |||
) | set_cave_feat(Y,X,feat_rubble) |
指定座標が瓦礫かどうかを返す
Y | 指定Y座標 |
X | 指定X座標 |
#define place_solid_bold | ( | Y, | |
X | |||
) |
#define place_solid_grid | ( | C | ) |
#define place_solid_noperm_bold | ( | Y, | |
X | |||
) |
#define place_solid_noperm_grid | ( | C | ) |
#define place_solid_perm_bold | ( | Y, | |
X | |||
) |
#define place_solid_perm_grid | ( | C | ) |
#define place_up_stairs | ( | Y, | |
X | |||
) | set_cave_feat(Y,X,feat_up_stair) |
指定座標が上り階段かどうかを返す
Y | 指定Y座標 |
X | 指定X座標 |
#define set_cave_feat | ( | Y, | |
X, | |||
F | |||
) | (cave[(Y)][(X)].feat = (F)) |
bool build_tunnel | ( | int | row1, |
int | col1, | ||
int | row2, | ||
int | col2 | ||
) |
部屋間のトンネルを生成する / Constructs a tunnel between two points
row1 | 始点Y座標 |
col1 | 始点X座標 |
row2 | 終点Y座標 |
col2 | 終点X座標 |
This function must be called BEFORE any streamers are created,
since we use the special "granite wall" sub-types to keep track
of legal places for corridors to pierce rooms.
We use "door_flag" to prevent excessive construction of doors
along overlapping corridors.
We queue the tunnel grids to prevent door creation along a corridor
which intersects itself.
We queue the wall piercing grids to prevent a corridor from leaving
a room and then coming back in through the same entrance.
We "pierce" grids which are "outer" walls of rooms, and when we
do so, we change all adjacent "outer" walls of rooms into "solid"
walls so that no two corridors may use adjacent grids for exits.
The "solid" wall check prevents corridors from "chopping" the
corners of rooms off, as well as "silly" door placement, and
"excessively wide" room entrances.
Kind of walls:
extra – walls
inner – inner room walls
outer – outer room walls
solid – solid room walls
bool build_tunnel2 | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | type, | ||
int | cutoff | ||
) |
特定の壁(永久壁など)を避けながら部屋間の通路を作成する / This routine maps a path from (x1, y1) to (x2, y2) avoiding SOLID walls.
Permanent rock is ignored in this path finding- sometimes there is no
path around anyway -so there will be a crash if we try to find one.
This routine is much like the river creation routine in Zangband.
It works by dividing a line segment into two. The segments are divided
until they are less than "cutoff" - when the corresponding routine from
"short_seg_hack" is called.
Note it is VERY important that the "stop if hit another passage" logic
stays as is. Without this the dungeon turns into Swiss Cheese...
void correct_dir | ( | int * | rdir, |
int * | cdir, | ||
int | y1, | ||
int | x1, | ||
int | y2, | ||
int | x2 | ||
) |
build_tunnel用に通路を掘るための方向を位置関係通りに決める / Always picks a correct direction
rdir | Y方向に取るべきベクトル値を返す参照ポインタ |
cdir | X方向に取るべきベクトル値を返す参照ポインタ |
y1 | 始点Y座標 |
x1 | 始点X座標 |
y2 | 終点Y座標 |
x2 | 終点X座標 |
bool get_is_floor | ( | int | x, |
int | y | ||
) |
指定のマスが床系地形であるかを返す / Function that sees if a square is a floor.
(Includes range checking.)
x | チェックするマスのX座標 |
y | チェックするマスのY座標 |
bool new_player_spot | ( | void | ) |
新規フロアに入りたてのプレイヤーをランダムな場所に配置する / Returns random co-ordinates for player/monster/object
void place_closed_door | ( | int | y, |
int | x, | ||
int | type | ||
) |
所定の位置に各種の閉じたドアを配置する / Place a random type of normal door at the given location.
y | ドアの配置を試みたいマスのY座標 |
x | ドアの配置を試みたいマスのX座標 |
type | ドアの地形ID |
void place_floor | ( | int | x1, |
int | x2, | ||
int | y1, | ||
int | y2, | ||
bool | light | ||
) |
長方形の空洞を生成する / Make an empty square floor, for the middle of rooms
x1 | 長方形の左端X座標(-1) |
x2 | 長方形の右端X座標(+1) |
y1 | 長方形の上端Y座標(-1) |
y2 | 長方形の下端Y座標(+1) |
light | 照明の有無 |
void place_random_door | ( | int | y, |
int | x, | ||
bool | room | ||
) |
所定の位置にさまざまな状態や種類のドアを配置する / Place a random type of door at the given location
y | ドアの配置を試みたいマスのY座標 |
x | ドアの配置を試みたいマスのX座標 |
room | 部屋に接している場合向けのドア生成か否か |
void place_random_stairs | ( | int | y, |
int | x | ||
) |
所定の位置に上り階段か下り階段を配置する / Place an up/down staircase at given location
y | 配置を試みたいマスのY座標 |
x | 配置を試みたいマスのX座標 |
void place_room | ( | int | x1, |
int | x2, | ||
int | y1, | ||
int | y2, | ||
bool | light | ||
) |
長方形の部屋を生成する / Make an empty square room, only floor and wall grids
x1 | 長方形の左端X座標(-1) |
x2 | 長方形の右端X座標(+1) |
y1 | 長方形の上端Y座標(-1) |
y2 | 長方形の下端Y座標(+1) |
light | 照明の有無 |
void rand_dir | ( | int * | rdir, |
int * | cdir | ||
) |
build_tunnel用に通路を掘るための方向をランダムに決める / Pick a random direction
rdir | Y方向に取るべきベクトル値を返す参照ポインタ |
cdir | X方向に取るべきベクトル値を返す参照ポインタ |
void set_floor | ( | int | x, |
int | y | ||
) |
指定のマスを床地形に変える / Set a square to be floor.
(Includes range checking.)
x | 地形を変えたいマスのX座標 |
y | 地形を変えたいマスのY座標 |
void vault_monsters | ( | int | y1, |
int | x1, | ||
int | num | ||
) |
特殊な部屋地形向けにモンスターを配置する / Hack – Place some sleeping monsters near the given location
y1 | モンスターを配置したいマスの中心Y座標 |
x1 | モンスターを配置したいマスの中心X座標 |
num | 配置したいモンスターの数 |
Only really called by some of the "vault" routines.
void vault_objects | ( | int | y, |
int | x, | ||
int | num | ||
) |
特殊な部屋向けに各種アイテムを配置する / Create up to "num" objects near the given coordinates
y | 配置したい中心マスのY座標 |
x | 配置したい中心マスのX座標 |
num | 配置したい数 |
Only really called by some of the "vault" routines.
void vault_trap_aux | ( | int | y, |
int | x, | ||
int | yd, | ||
int | xd | ||
) |
特殊な部屋向けに各種アイテムを配置する(vault_trapのサブセット) / Place a trap with a given displacement of point
y | トラップを配置したいマスの中心Y座標 |
x | トラップを配置したいマスの中心X座標 |
yd | Y方向の配置分散マス数 |
xd | X方向の配置分散マス数 |
Only really called by some of the "vault" routines.
void vault_traps | ( | int | y, |
int | x, | ||
int | yd, | ||
int | xd, | ||
int | num | ||
) |
特殊な部屋向けに各種アイテムを配置する(メインルーチン) / Place some traps with a given displacement of given location
y | トラップを配置したいマスの中心Y座標 |
x | トラップを配置したいマスの中心X座標 |
yd | Y方向の配置分散マス数 |
xd | X方向の配置分散マス数 |
num | 配置したいトラップの数 |
Only really called by some of the "vault" routines.