ダンジョンの生成処理の基幹部分 / low-level dungeon creation primitives [詳細]
関数 | |
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_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 | vault_monsters (int y1, int x1, int num) |
特殊な部屋地形向けにモンスターを配置する / Hack – Place some sleeping monsters near the 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 [詳細] | |
static bool | set_tunnel (int *x, int *y, bool affectwall) |
トンネル生成のための基準点を指定する。 [詳細] | |
static void | create_cata_tunnel (int x, int y) |
外壁を削って「カタコンベ状」の通路を作成する / This routine creates the catacomb-like tunnels by removing extra rock. [詳細] | |
static void | short_seg_hack (int x1, int y1, int x2, int y2, int type, int count, bool *fail) |
トンネル生成処理(詳細調査中)/ This routine does the bulk of the work in creating the new types of tunnels. [詳細] | |
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. [詳細] | |
ダンジョンの生成処理の基幹部分 / low-level dungeon creation primitives
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座標 |
|
static |
外壁を削って「カタコンベ状」の通路を作成する / This routine creates the catacomb-like tunnels by removing extra rock.
x | 基準点のX座標 |
y | 基準点のY座標 |
Note that this routine is only called on "even" squares - so it gives a natural checkerboard pattern.
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座標 |
トンネル生成のための基準点を指定する。
x | 基準点を指定するX座標の参照ポインタ、適時値が修正される。 |
y | 基準点を指定するY座標の参照ポインタ、適時値が修正される。 |
affectwall | (調査中) |
This routine adds the square to the tunnel
It also checks for SOLID walls - and returns a nearby
non-SOLID square in (x,y) so that a simple avoiding
routine can be used. The returned boolean value reflects
whether or not this routine hit a SOLID wall.
"affectwall" toggles whether or not this new square affects
the boundaries of rooms. - This is used by the catacomb
routine.
|
static |
トンネル生成処理(詳細調査中)/ This routine does the bulk of the work in creating the new types of tunnels.
It is designed to use very simple algorithms to go from (x1,y1) to (x2,y2)
It doesn't need to add any complexity - straight lines are fine.
The SOLID walls are avoided by a recursive algorithm which tries random ways
around the obstical until it works. The number of itterations is counted, and it
this gets too large the routine exits. This should stop any crashes - but may leave
small gaps in the tunnel where there are too many SOLID walls.
Type 1 tunnels are extremely simple - straight line from A to B. This is only used
as a part of the dodge SOLID walls algorithm.
Type 2 tunnels are made of two straight lines at right angles. When this is used with
short line segments it gives the "cavelike" tunnels seen deeper in the dungeon.
Type 3 tunnels are made of two straight lines like type 2, but with extra rock removed.
This, when used with longer line segments gives the "catacomb-like" tunnels seen near
the surface.
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.