Hengband  2.2.1
データ構造 | マクロ定義 | 型定義 | 関数 | 変数
floor-generate.h ファイル
#include "floor.h"
floor-generate.h の依存先関係図:
被依存関係図:

[ソースコード]

データ構造

struct  dun_data
 

マクロ定義

#define SAFE_MAX_ATTEMPTS   5000
 生成処理基本試行回数 [詳解]
 
#define ALLOC_SET_CORR   1 /* Hallway */
 
#define ALLOC_SET_ROOM   2 /* Room */
 
#define ALLOC_SET_BOTH   3 /* Anywhere */
 
#define ALLOC_TYP_RUBBLE   1 /* Rubble */
 
#define ALLOC_TYP_TRAP   3 /* Trap */
 
#define ALLOC_TYP_GOLD   4 /* Gold */
 
#define ALLOC_TYP_OBJECT   5 /* Object */
 
#define ALLOC_TYP_INVIS   6 /* Invisible wall */
 
#define BLOCK_HGT   11
 
#define BLOCK_WID   11
 
#define MAX_ROOMS_ROW   (MAX_HGT / BLOCK_HGT)
 
#define MAX_ROOMS_COL   (MAX_WID / BLOCK_WID)
 
#define CENT_MAX   100
 
#define DOOR_MAX   200
 
#define WALL_MAX   500
 
#define TUNN_MAX   900
 

型定義

typedef struct dun_data dun_data
 

関数

bool place_quest_monsters (floor_type *floor_ptr, player_type *creature_ptr)
 クエストに関わるモンスターの配置を行う / Place quest monsters [詳解]
 
void wipe_generate_random_floor_flags (floor_type *floor_ptr)
 フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after p_ptr->current_floor_ptr->grid_array generation [詳解]
 
void clear_cave (floor_type *floor_ptr)
 フロアの全情報を初期化する / Clear and empty the p_ptr->current_floor_ptr->grid_array [詳解]
 
void generate_floor (floor_type *floor_ptr)
 ダンジョンのランダムフロアを生成する / Generates a random dungeon level -RAK- [詳解]
 
bool build_tunnel (floor_type *floor_ptr, POSITION row1, POSITION col1, POSITION row2, POSITION col2)
 部屋間のトンネルを生成する / Constructs a tunnel between two points [詳解]
 
bool build_tunnel2 (floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff)
 特定の壁(永久壁など)を避けながら部屋間の通路を作成する / This routine maps a path from (x1, y1) to (x2, y2) avoiding SOLID walls. [詳解]
 

変数

int dun_tun_rnd
 ダンジョンの通路方向を掻き回す頻度(一回の試行ごとにで判定している) [詳解]
 
int dun_tun_chg
 ダンジョンの通路をクランクさせる頻度(一回の試行ごとにで判定している) [詳解]
 
int dun_tun_con
 ダンジョンの通路を継続して引き延ばす頻度(一回の試行ごとにで判定している) [詳解]
 
int dun_tun_pen
 ダンジョンの部屋入口にドアを設置する頻度(一回の試行ごとにで判定している) [詳解]
 
int dun_tun_jct
 ダンジョンの通路交差地点付近にドアを設置する頻度(一回の試行ごとにで判定している) [詳解]
 
dun_datadun
 Dungeon generation data – see "cave_gen()" [詳解]
 

マクロ定義詳解

◆ ALLOC_SET_BOTH

#define ALLOC_SET_BOTH   3 /* Anywhere */

◆ ALLOC_SET_CORR

#define ALLOC_SET_CORR   1 /* Hallway */

◆ ALLOC_SET_ROOM

#define ALLOC_SET_ROOM   2 /* Room */

◆ ALLOC_TYP_GOLD

#define ALLOC_TYP_GOLD   4 /* Gold */

◆ ALLOC_TYP_INVIS

#define ALLOC_TYP_INVIS   6 /* Invisible wall */

◆ ALLOC_TYP_OBJECT

#define ALLOC_TYP_OBJECT   5 /* Object */

◆ ALLOC_TYP_RUBBLE

#define ALLOC_TYP_RUBBLE   1 /* Rubble */

◆ ALLOC_TYP_TRAP

#define ALLOC_TYP_TRAP   3 /* Trap */

◆ BLOCK_HGT

#define BLOCK_HGT   11

◆ BLOCK_WID

#define BLOCK_WID   11

◆ CENT_MAX

#define CENT_MAX   100

◆ DOOR_MAX

#define DOOR_MAX   200

◆ MAX_ROOMS_COL

#define MAX_ROOMS_COL   (MAX_WID / BLOCK_WID)

◆ MAX_ROOMS_ROW

#define MAX_ROOMS_ROW   (MAX_HGT / BLOCK_HGT)

◆ SAFE_MAX_ATTEMPTS

#define SAFE_MAX_ATTEMPTS   5000

生成処理基本試行回数

◆ TUNN_MAX

#define TUNN_MAX   900

◆ WALL_MAX

#define WALL_MAX   500

型定義詳解

◆ dun_data

typedef struct dun_data dun_data

関数詳解

◆ build_tunnel()

bool build_tunnel ( floor_type floor_ptr,
POSITION  row1,
POSITION  col1,
POSITION  row2,
POSITION  col2 
)

部屋間のトンネルを生成する / Constructs a tunnel between two points

引数
row1始点Y座標
col1始点X座標
row2終点Y座標
col2終点X座標
戻り値
生成に成功したらTRUEを返す

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

呼び出し関係図:

◆ build_tunnel2()

bool build_tunnel2 ( floor_type floor_ptr,
POSITION  x1,
POSITION  y1,
POSITION  x2,
POSITION  y2,
int  type,
int  cutoff 
)

特定の壁(永久壁など)を避けながら部屋間の通路を作成する / This routine maps a path from (x1, y1) to (x2, y2) avoiding SOLID walls.

戻り値
なし
todo:
詳細要調査

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...

呼び出し関係図:

◆ clear_cave()

void clear_cave ( floor_type floor_ptr)

フロアの全情報を初期化する / Clear and empty the p_ptr->current_floor_ptr->grid_array

戻り値
なし
呼び出し関係図:

◆ generate_floor()

void generate_floor ( floor_type floor_ptr)

ダンジョンのランダムフロアを生成する / Generates a random dungeon level -RAK-

戻り値
なし
覚え書き
Hack – regenerate any "overflow" levels
呼び出し関係図:

◆ place_quest_monsters()

bool place_quest_monsters ( floor_type floor_ptr,
player_type creature_ptr 
)

クエストに関わるモンスターの配置を行う / Place quest monsters

引数
floor_ptr配置するフロアの参照ポインタ
subject_ptr近隣への即出現を避けるためのプレイヤークリーチャー参照ポインタ
戻り値
成功したならばTRUEを返す
呼び出し関係図:

◆ wipe_generate_random_floor_flags()

void wipe_generate_random_floor_flags ( floor_type floor_ptr)

フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after p_ptr->current_floor_ptr->grid_array generation

戻り値
なし

変数詳解

◆ dun

dun_data* dun

Dungeon generation data – see "cave_gen()"

◆ dun_tun_chg

int dun_tun_chg

ダンジョンの通路をクランクさせる頻度(一回の試行ごとにで判定している)

◆ dun_tun_con

int dun_tun_con

ダンジョンの通路を継続して引き延ばす頻度(一回の試行ごとにで判定している)

◆ dun_tun_jct

int dun_tun_jct

ダンジョンの通路交差地点付近にドアを設置する頻度(一回の試行ごとにで判定している)

◆ dun_tun_pen

int dun_tun_pen

ダンジョンの部屋入口にドアを設置する頻度(一回の試行ごとにで判定している)

◆ dun_tun_rnd

int dun_tun_rnd

ダンジョンの通路方向を掻き回す頻度(一回の試行ごとにで判定している)