Hengband
2.2.1
|
#include "angband.h"
#include "util.h"
#include "core.h"
#include "bldg.h"
#include "cmd-dump.h"
#include "grid.h"
#include "rooms.h"
#include "dungeon.h"
#include "floor.h"
#include "floor-save.h"
#include "floor-streams.h"
#include "floor-generate.h"
#include "floor-events.h"
#include "feature.h"
#include "trap.h"
#include "monster.h"
#include "quest.h"
#include "player-status.h"
#include "wild.h"
#include "monster-status.h"
#include "dungeon-file.h"
#include "init.h"
#include "spells.h"
#include "world.h"
#include "view-mainwindow.h"
関数 | |
static int | next_to_walls (floor_type *floor_ptr, POSITION y, POSITION x) |
上下左右の外壁数をカウントする / Count the number of walls adjacent to the given grid. [詳解] | |
static bool | alloc_stairs_aux (floor_type *floor_ptr, POSITION y, POSITION x, int walls) |
alloc_stairs()の補助として指定の位置に階段を生成できるかの判定を行う / Helper function for alloc_stairs(). [詳解] | |
static bool | alloc_stairs (floor_type *floor_ptr, FEAT_IDX feat, int num, int walls) |
外壁に隣接させて階段を生成する / Places some staircases near walls [詳解] | |
static void | alloc_object (floor_type *floor_ptr, int set, EFFECT_ID typ, int num) |
フロア上のランダム位置に各種オブジェクトを配置する / Allocates some objects (using "place" and "type") [詳解] | |
bool | place_quest_monsters (floor_type *floor_ptr, player_type *creature_ptr) |
クエストに関わるモンスターの配置を行う / Place quest monsters [詳解] | |
static void | gen_caverns_and_lakes (dungeon_type *dungeon_ptr, floor_type *floor_ptr) |
フロアに洞窟や湖を配置する / Generate various caverns and lakes [詳解] | |
static bool | cave_gen (floor_type *floor_ptr) |
ダンジョン生成のメインルーチン / Generate a new dungeon level [詳解] | |
static void | build_arena (floor_type *floor_ptr) |
闘技場用のアリーナ地形を作成する / Builds the arena after it is entered -KMW- [詳解] | |
static void | generate_challenge_arena (floor_type *floor_ptr) |
挑戦時闘技場への入場処理 / Town logic flow for generation of arena -KMW- [詳解] | |
static void | build_battle (floor_type *floor_ptr) |
モンスター闘技場のフロア生成 / Builds the arena after it is entered -KMW- [詳解] | |
static void | generate_gambling_arena (floor_type *floor_ptr, player_type *creature_ptr) |
モンスター闘技場への導入処理 / Town logic flow for generation of arena -KMW- [詳解] | |
static void | generate_fixed_floor (floor_type *floor_ptr) |
固定マップクエストのフロア生成 / Generate a quest level [詳解] | |
static bool | level_gen (floor_type *floor_ptr, concptr *why) |
ダンジョン時のランダムフロア生成 / Make a real level [詳解] | |
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- [詳解] | |
static void | rand_dir (POSITION *rdir, POSITION *cdir) |
build_tunnel用に通路を掘るための方向をランダムに決める / Pick a random direction [詳解] | |
static void | correct_dir (POSITION *rdir, POSITION *cdir, POSITION y1, POSITION x1, POSITION y2, POSITION x2) |
build_tunnel用に通路を掘るための方向を位置関係通りに決める / Always picks a correct direction [詳解] | |
bool | build_tunnel (floor_type *floor_ptr, POSITION row1, POSITION col1, POSITION row2, POSITION col2) |
部屋間のトンネルを生成する / Constructs a tunnel between two points [詳解] | |
static bool | set_tunnel (floor_type *floor_ptr, POSITION *x, POSITION *y, bool affectwall) |
トンネル生成のための基準点を指定する。 [詳解] | |
static void | create_cata_tunnel (floor_type *floor_ptr, POSITION x, POSITION y) |
外壁を削って「カタコンベ状」の通路を作成する / This routine creates the catacomb-like tunnels by removing extra rock. [詳解] | |
static void | short_seg_hack (floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION 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 (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()" [詳解] | |
|
static |
フロア上のランダム位置に各種オブジェクトを配置する / Allocates some objects (using "place" and "type")
set | 配置したい地形の種類 |
typ | 配置したいオブジェクトの種類 |
num | 配置したい数 |
|
static |
外壁に隣接させて階段を生成する / Places some staircases near walls
feat | 配置したい地形ID |
num | 配置したい階段の数 |
walls | 最低減隣接させたい外壁の数 |
|
static |
alloc_stairs()の補助として指定の位置に階段を生成できるかの判定を行う / Helper function for alloc_stairs().
Is this a good location for stairs?
y | 基準のy座標 |
x | 基準のx座標 |
walls | 最低減隣接させたい外壁の数 |
|
static |
闘技場用のアリーナ地形を作成する / Builds the arena after it is entered -KMW-
|
static |
モンスター闘技場のフロア生成 / Builds the arena after it is entered -KMW-
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...
|
static |
ダンジョン生成のメインルーチン / Generate a new dungeon level
Note that "dun_body" adds about 4000 bytes of memory to the stack.
void clear_cave | ( | floor_type * | floor_ptr | ) |
フロアの全情報を初期化する / Clear and empty the p_ptr->current_floor_ptr->grid_array
|
static |
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.
|
static |
フロアに洞窟や湖を配置する / Generate various caverns and lakes
There were moved from cave_gen().
|
static |
挑戦時闘技場への入場処理 / Town logic flow for generation of arena -KMW-
|
static |
固定マップクエストのフロア生成 / Generate a quest level
void generate_floor | ( | floor_type * | floor_ptr | ) |
ダンジョンのランダムフロアを生成する / Generates a random dungeon level -RAK-
|
static |
モンスター闘技場への導入処理 / Town logic flow for generation of arena -KMW-
|
static |
ダンジョン時のランダムフロア生成 / Make a real level
|
static |
上下左右の外壁数をカウントする / Count the number of walls adjacent to the given grid.
y | 基準のy座標 |
x | 基準のx座標 |
We count only granite walls and permanent walls.
bool place_quest_monsters | ( | floor_type * | floor_ptr, |
player_type * | creature_ptr | ||
) |
クエストに関わるモンスターの配置を行う / Place quest monsters
floor_ptr | 配置するフロアの参照ポインタ |
subject_ptr | 近隣への即出現を避けるためのプレイヤークリーチャー参照ポインタ |
build_tunnel用に通路を掘るための方向をランダムに決める / Pick a random direction
rdir | Y方向に取るべきベクトル値を返す参照ポインタ |
cdir | X方向に取るべきベクトル値を返す参照ポインタ |
|
static |
トンネル生成のための基準点を指定する。
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 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 |
ダンジョンの通路方向を掻き回す頻度(一回の試行ごとにで判定している)