Hengband
2.2.1
|
#include "floor.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_data * | dun |
Dungeon generation data – see "cave_gen()" [詳解] | |
#define ALLOC_SET_BOTH 3 /* Anywhere */ |
#define ALLOC_SET_CORR 1 /* Hallway */ |
#define ALLOC_SET_ROOM 2 /* Room */ |
#define ALLOC_TYP_GOLD 4 /* Gold */ |
#define ALLOC_TYP_INVIS 6 /* Invisible wall */ |
#define ALLOC_TYP_OBJECT 5 /* Object */ |
#define ALLOC_TYP_RUBBLE 1 /* Rubble */ |
#define ALLOC_TYP_TRAP 3 /* Trap */ |
#define BLOCK_HGT 11 |
#define BLOCK_WID 11 |
#define CENT_MAX 100 |
#define DOOR_MAX 200 |
#define SAFE_MAX_ATTEMPTS 5000 |
生成処理基本試行回数
#define TUNN_MAX 900 |
#define WALL_MAX 500 |
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座標 |
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 | ( | 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.
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 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 place_quest_monsters | ( | floor_type * | floor_ptr, |
player_type * | creature_ptr | ||
) |
クエストに関わるモンスターの配置を行う / Place quest monsters
floor_ptr | 配置するフロアの参照ポインタ |
subject_ptr | 近隣への即出現を避けるためのプレイヤークリーチャー参照ポインタ |
void wipe_generate_random_floor_flags | ( | floor_type * | floor_ptr | ) |
フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after p_ptr->current_floor_ptr->grid_array generation
dun_data* dun |
Dungeon generation data – see "cave_gen()"
int dun_tun_chg |
ダンジョンの通路をクランクさせる頻度(一回の試行ごとにで判定している)
int dun_tun_con |
ダンジョンの通路を継続して引き延ばす頻度(一回の試行ごとにで判定している)
int dun_tun_jct |
ダンジョンの通路交差地点付近にドアを設置する頻度(一回の試行ごとにで判定している)
int dun_tun_pen |
ダンジョンの部屋入口にドアを設置する頻度(一回の試行ごとにで判定している)
int dun_tun_rnd |
ダンジョンの通路方向を掻き回す頻度(一回の試行ごとにで判定している)