Hengband
2.2.1
|
ダンジョンフロアの部屋生成処理 / make rooms. [詳解]
#include "angband.h"
#include "util.h"
#include "feature.h"
#include "floor.h"
#include "floor-generate.h"
#include "dungeon.h"
#include "grid.h"
#include "rooms.h"
#include "rooms-city.h"
#include "rooms-fractal.h"
#include "rooms-normal.h"
#include "rooms-pitnest.h"
#include "rooms-special.h"
#include "rooms-trap.h"
#include "rooms-vault.h"
#include "trap.h"
#include "monster.h"
データ構造 | |
struct | fill_data_type |
マクロ定義 | |
#define | MOVE_PLIST(dst, src) (prob_list[dst] += prob_list[src], prob_list[src] = 0) |
指定した部屋の生成確率を別の部屋に加算し、指定した部屋の生成率を0にする [詳解] | |
型定義 | |
typedef struct fill_data_type | fill_data_type |
関数 | |
void | build_small_room (floor_type *floor_ptr, POSITION x0, POSITION y0) |
1マスだけの部屋を作成し、上下左右いずれか一つに隠しドアを配置する。 [詳解] | |
static void | check_room_boundary (POSITION x1, POSITION y1, POSITION x2, POSITION y2) |
指定範囲に通路が通っていることを確認した上で床で埋める This function tunnels around a room if it will cut off part of a p_ptr->current_floor_ptr->grid_array system. [詳解] | |
static bool | find_space_aux (POSITION blocks_high, POSITION blocks_wide, POSITION block_y, POSITION block_x) |
find_space()の予備処理として部屋の生成が可能かを判定する / Helper function for find_space(). [詳解] | |
bool | find_space (POSITION *y, POSITION *x, POSITION height, POSITION width) |
部屋生成が可能なスペースを確保する / Find a good spot for the next room. [詳解] | |
static void | store_height (floor_type *floor_ptr, POSITION x, POSITION y, FEAT_IDX val) |
void | generate_hmap (floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff) |
static bool | hack_isnt_wall (floor_type *floor_ptr, POSITION y, POSITION x, int c1, int c2, int c3, FEAT_IDX feat1, FEAT_IDX feat2, FEAT_IDX feat3, BIT_FLAGS info1, BIT_FLAGS info2, BIT_FLAGS info3) |
static void | cave_fill (floor_type *floor_ptr, POSITION y, POSITION x) |
bool | generate_fracave (floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room) |
void | build_cavern (floor_type *floor_ptr) |
bool | generate_lake (floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type) |
void | build_lake (floor_type *floor_ptr, int type) |
void | fill_treasure (floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty) |
void | build_room (floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2) |
void | r_visit (floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited) |
void | build_maze_vault (POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault) |
void | build_recursive_room (floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power) |
void | add_outer_wall (POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2) |
POSITION | dist2 (POSITION x1, POSITION y1, POSITION x2, POSITION y2, POSITION h1, POSITION h2, POSITION h3, POSITION h4) |
void | generate_room_floor (POSITION y1, POSITION x1, POSITION y2, POSITION x2, int light) |
void | generate_fill_perm_bold (POSITION y1, POSITION x1, POSITION y2, POSITION x2) |
static bool | room_build (floor_type *floor_ptr, EFFECT_ID typ) |
与えられた部屋型IDに応じて部屋の生成処理分岐を行い結果を返す / Attempt to build a room of the given type at the given block [詳解] | |
bool | generate_rooms (floor_type *floor_ptr) |
部屋生成処理のメインルーチン(Sangbandを経由してOangbandからの実装を引用) / Generate rooms in dungeon. [詳解] | |
変数 | |
static room_info_type | room_info_normal [ROOM_T_MAX] |
各部屋タイプの生成比定義 [from SAngband (originally from OAngband)] Table of values that control how many times each type of room will appear. [詳解] | |
static byte | room_build_order [ROOM_T_MAX] |
部屋の生成処理順 / Build rooms in descending order of difficulty. [詳解] | |
static fill_data_type | fill_data |
ダンジョンフロアの部屋生成処理 / make rooms.
Used by generate.c when creating dungeons.
Room building routines.
Room types:
1 – normal
2 – overlapping
3 – cross shaped
4 – large room with features
5 – monster nests
6 – monster pits
7 – simple vaults
8 – greater vaults
9 – fractal caves
10 – random vaults
11 – circular rooms
12 – crypts
13 – trapped monster pits
14 – trapped room
15 – glass room
16 – underground arcade
Some functions are used to determine if the given monster
is appropriate for inclusion in a monster nest or monster pit or
the given type.
None of the pits/nests are allowed to include "unique" monsters.
#define MOVE_PLIST | ( | dst, | |
src | |||
) | (prob_list[dst] += prob_list[src], prob_list[src] = 0) |
指定した部屋の生成確率を別の部屋に加算し、指定した部屋の生成率を0にする
dst | 確率を移す先の部屋種ID |
src | 確率を与える元の部屋種ID |
typedef struct fill_data_type fill_data_type |
void add_outer_wall | ( | POSITION | x, |
POSITION | y, | ||
int | light, | ||
POSITION | x1, | ||
POSITION | y1, | ||
POSITION | x2, | ||
POSITION | y2 | ||
) |
void build_cavern | ( | floor_type * | floor_ptr | ) |
void build_lake | ( | floor_type * | floor_ptr, |
int | type | ||
) |
void build_recursive_room | ( | floor_type * | floor_ptr, |
POSITION | x1, | ||
POSITION | y1, | ||
POSITION | x2, | ||
POSITION | y2, | ||
int | power | ||
) |
void build_room | ( | floor_type * | floor_ptr, |
POSITION | x1, | ||
POSITION | x2, | ||
POSITION | y1, | ||
POSITION | y2 | ||
) |
void build_small_room | ( | floor_type * | floor_ptr, |
POSITION | x0, | ||
POSITION | y0 | ||
) |
1マスだけの部屋を作成し、上下左右いずれか一つに隠しドアを配置する。
floor_ptr | 配置するフロアの参照ポインタ |
y0 | 配置したい中心のY座標 |
x0 | 配置したい中心のX座標 |
This funtion makes a very small room centred at (x0, y0) This is used in crypts, and random elemental vaults.
Note - this should be used only on allocated regions within another room.
|
static |
指定範囲に通路が通っていることを確認した上で床で埋める This function tunnels around a room if it will cut off part of a p_ptr->current_floor_ptr->grid_array system.
x1 | 範囲の左端 |
y1 | 範囲の上端 |
x2 | 範囲の右端 |
y2 | 範囲の下端 |
POSITION dist2 | ( | POSITION | x1, |
POSITION | y1, | ||
POSITION | x2, | ||
POSITION | y2, | ||
POSITION | h1, | ||
POSITION | h2, | ||
POSITION | h3, | ||
POSITION | h4 | ||
) |
void fill_treasure | ( | floor_type * | floor_ptr, |
POSITION | x1, | ||
POSITION | x2, | ||
POSITION | y1, | ||
POSITION | y2, | ||
int | difficulty | ||
) |
部屋生成が可能なスペースを確保する / Find a good spot for the next room.
-LM-
y | 部屋の生成が可能な中心Y座標を返す参照ポインタ |
x | 部屋の生成が可能な中心X座標を返す参照ポインタ |
height | 確保したい領域の高さ |
width | 確保したい領域の幅 |
Find and allocate a free space in the dungeon large enough to hold
the room calling this function.
We allocate space in 11x11 blocks, but want to make sure that rooms
align neatly on the standard screen. Therefore, we make them use
blocks in few 11x33 rectangles as possible.
Be careful to include the edges of the room in height and width!
Return TRUE and values for the center of the room if all went well.
Otherwise, return FALSE.
|
static |
find_space()の予備処理として部屋の生成が可能かを判定する / Helper function for find_space().
Is this a good location?
blocks_high | 範囲の高さ |
blocks_wide | 範囲の幅 |
block_y | 範囲の上端 |
block_x | 範囲の左端 |
bool generate_fracave | ( | floor_type * | floor_ptr, |
POSITION | y0, | ||
POSITION | x0, | ||
POSITION | xsize, | ||
POSITION | ysize, | ||
int | cutoff, | ||
bool | light, | ||
bool | room | ||
) |
void generate_hmap | ( | floor_type * | floor_ptr, |
POSITION | y0, | ||
POSITION | x0, | ||
POSITION | xsiz, | ||
POSITION | ysiz, | ||
int | grd, | ||
int | roug, | ||
int | cutoff | ||
) |
bool generate_lake | ( | floor_type * | floor_ptr, |
POSITION | y0, | ||
POSITION | x0, | ||
POSITION | xsize, | ||
POSITION | ysize, | ||
int | c1, | ||
int | c2, | ||
int | c3, | ||
int | type | ||
) |
bool generate_rooms | ( | floor_type * | floor_ptr | ) |
部屋生成処理のメインルーチン(Sangbandを経由してOangbandからの実装を引用) / Generate rooms in dungeon.
Build bigger rooms at first. [from SAngband (originally from OAngband)]
ダンジョンにBEGINNER、CHAMELEON、SMALLESTいずれのフラグもなく、 かつ「常に通常でない部屋を生成する」フラグがONならば、 GRATER_VAULTのみを生成対象とする。 / Ironman sees only Greater Vaults
ダンジョンにNO_VAULTフラグがあるならば、LESSER_VAULT / GREATER_VAULT/ RANDOM_VAULTを除外 / Forbidden vaults
ダンジョンにBEGINNERフラグがあるならば、FIXED_ROOMを除外 / Forbidden vaults
ダンジョンにNO_CAVEフラグがある場合、FRACAVEの生成枠がNORMALに与えられる。CRIPT、OVALの生成枠がINNER_Fに与えられる。/ NO_CAVE dungeon (Castle)
ダンジョンにCAVEフラグがある場合、NORMALの生成枠がFRACAVEに与えられる。/ CAVE dungeon (Orc floor_ptr->grid_array etc.)
ダンジョンの基本地形が最初から渓谷かアリーナ型の場合 FRACAVE は生成から除外。 / No caves when a (random) cavern exists: they look bad
ダンジョンに最初からGLASS_ROOMフラグがある場合、GLASS を生成から除外。/ Forbidden glass rooms
ARCADEは同フラグがダンジョンにないと生成されない。 / Forbidden glass rooms
部屋生成数が2未満の場合生成失敗を返す
|
static |
void r_visit | ( | floor_type * | floor_ptr, |
POSITION | y1, | ||
POSITION | x1, | ||
POSITION | y2, | ||
POSITION | x2, | ||
int | node, | ||
DIRECTION | dir, | ||
int * | visited | ||
) |
|
static |
与えられた部屋型IDに応じて部屋の生成処理分岐を行い結果を返す / Attempt to build a room of the given type at the given block
type | 部屋型ID |
|
static |
|
static |
|
static |
部屋の生成処理順 / Build rooms in descending order of difficulty.
|
static |
各部屋タイプの生成比定義 [from SAngband (originally from OAngband)]
Table of values that control how many times each type of room will
appear.
Each type of room has its own row, and each column
corresponds to dungeon levels 0, 10, 20, and so on. The final
value is the minimum depth the room can appear at. -LM-
Level 101 and below use the values for level 100.
Rooms with lots of monsters or loot may not be generated if the
object or monster lists are already nearly full. Rooms will not
appear above their minimum depth. Tiny levels will not have space
for all the rooms you ask for.