Hengband
2.2.1
|
ダンジョンの生成処理の基幹部分ヘッダーファイル [詳解]
データ構造 | |
struct | grid_type |
struct | grid_template_type |
マクロ定義 | |
#define | feat_locked_door_random(DOOR_TYPE) |
#define | feat_jammed_door_random(DOOR_TYPE) |
#define | set_cave_feat(FL, Y, X, F) ((FL)->grid_array[(Y)][(X)].feat = (F)) |
#define | add_cave_info(FL, Y, X, I) ((FL)->grid_array[(Y)][(X)].info |= (I)) |
#define | place_rubble(F, Y, X) set_cave_feat(F,Y,X,feat_rubble) |
指定座標に瓦礫を配置する [詳解] | |
#define | is_floor_bold(F, Y, X) (F->grid_array[Y][X].info & CAVE_FLOOR) |
指定座標がFLOOR属性を持ったマスかどうかを返す [詳解] | |
#define | is_extra_bold(F, Y, X) (F->grid_array[Y][X].info & CAVE_EXTRA) |
#define | is_inner_bold(F, Y, X) (F->grid_array[Y][X].info & CAVE_INNER) |
#define | is_outer_bold(F, Y, X) (F->grid_array[Y][X].info & CAVE_OUTER) |
#define | is_solid_bold(F, Y, X) (F->grid_array[Y][X].info & CAVE_SOLID) |
#define | is_floor_grid(C) ((C)->info & CAVE_FLOOR) |
#define | is_extra_grid(C) ((C)->info & CAVE_EXTRA) |
#define | is_inner_grid(C) ((C)->info & CAVE_INNER) |
#define | is_outer_grid(C) ((C)->info & CAVE_OUTER) |
#define | is_solid_grid(C) ((C)->info & CAVE_SOLID) |
#define | place_floor_bold(F, Y, X) |
#define | place_floor_grid(C) |
#define | place_extra_bold(Y, X) |
#define | place_extra_grid(C) |
#define | place_extra_perm_bold(Y, X) |
#define | place_extra_perm_grid(C) |
#define | place_extra_noperm_bold(F, Y, X) |
#define | place_inner_bold(F, Y, X) |
#define | place_inner_grid(C) |
#define | place_inner_perm_bold(Y, X) |
#define | place_inner_perm_grid(C) |
#define | place_outer_bold(Y, X) |
#define | place_outer_grid(C) |
#define | place_outer_perm_bold(Y, X) |
#define | place_outer_perm_grid(C) |
#define | place_outer_noperm_bold(Y, X) |
#define | place_outer_noperm_grid(C) |
#define | place_solid_bold(Y, X) |
#define | place_solid_grid(C) |
#define | place_solid_perm_bold(Y, X) |
#define | place_solid_perm_grid(C) |
#define | place_solid_noperm_bold(Y, X) |
#define | place_solid_noperm_grid(C) |
#define | CAVE_MARK 0x0001 |
現在プレイヤーの記憶に収まっている / memorized feature [詳解] | |
#define | CAVE_GLOW 0x0002 |
マス自体が光源を持っている / self-illuminating [詳解] | |
#define | CAVE_ICKY 0x0004 |
生成されたVaultの一部である / part of a vault [詳解] | |
#define | CAVE_ROOM 0x0008 |
生成された部屋の一部である / part of a room [詳解] | |
#define | CAVE_LITE 0x0010 |
現在光に照らされている / lite flag [詳解] | |
#define | CAVE_VIEW 0x0020 |
現在プレイヤーの視界に収まっている / view flag [詳解] | |
#define | CAVE_TEMP 0x0040 |
光源に関する処理のアルゴリズム用記録フラグ / temp flag [詳解] | |
#define | CAVE_XTRA 0x0080 |
視界に関する処理のアルゴリズム用記録フラグ(update_view()等参照) / misc flag [詳解] | |
#define | CAVE_MNLT 0x0100 |
モンスターの光源によって照らされている / Illuminated by monster [詳解] | |
#define | CAVE_MNDK 0x8000 |
モンスターの暗源によって暗闇になっている / Darken by monster [詳解] | |
#define | CAVE_FLOOR 0x0200 |
フロア属性のあるマス [詳解] | |
#define | CAVE_EXTRA 0x0400 |
#define | CAVE_INNER 0x0800 |
#define | CAVE_OUTER 0x1000 |
#define | CAVE_SOLID 0x2000 |
#define | CAVE_VAULT 0x4000 |
#define | CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT) |
#define | CAVE_KNOWN 0x0200 /* Directly viewed or map detected flag */ |
#define | CAVE_NOTE 0x0400 /* Flag for delayed visual update (needs note_spot()) */ |
#define | CAVE_REDRAW 0x0800 /* Flag for delayed visual update (needs lite_spot()) */ |
#define | CAVE_OBJECT 0x1000 /* Mirror, glyph, etc. */ |
#define | CAVE_UNSAFE 0x2000 /* Might have trap */ |
#define | CAVE_IN_DETECT 0x4000 /* trap detected area (inner circle only) */ |
#define | CONVERT_TYPE_FLOOR 0 |
#define | CONVERT_TYPE_WALL 1 |
#define | CONVERT_TYPE_INNER 2 |
#define | CONVERT_TYPE_OUTER 3 |
#define | CONVERT_TYPE_SOLID 4 |
#define | CONVERT_TYPE_STREAM1 5 |
#define | CONVERT_TYPE_STREAM2 6 |
#define | DOOR_DEFAULT -1 |
#define | DOOR_DOOR 0 |
#define | DOOR_GLASS_DOOR 1 |
#define | DOOR_CURTAIN 2 |
#define | MAX_DOOR_TYPES 3 |
#define | feat_uses_special(F) (have_flag(f_info[(F)].flags, FF_SPECIAL)) |
マス構造体のspecial要素を利用する地形かどうかを判定するマクロ / Is this feature has special meaning (except floor_id) with g_ptr->special? [詳解] | |
#define | darkened_grid(C) |
モンスターにより照明が消されている地形か否かを判定する。 / Is this grid "darkened" by monster? [詳解] | |
#define | get_feat_mimic(C) (f_info[(C)->mimic ? (C)->mimic : (C)->feat].mimic) |
#define | cave_lite_hack(F, Y, X) |
#define | cave_note_and_redraw_later(C, Y, X) |
#define | cave_redraw_later(C, Y, X) |
#define | cave_view_hack(C, Y, X) |
型定義 | |
typedef struct player_type | player_type |
typedef struct grid_type | grid_type |
関数 | |
bool | new_player_spot (player_type *creature_ptr) |
新規フロアに入りたてのプレイヤーをランダムな場所に配置する / Returns random co-ordinates for player/monster/object [詳解] | |
void | place_random_door (POSITION y, POSITION x, bool room) |
所定の位置にさまざまな状態や種類のドアを配置する / Place a random type of door at the given location [詳解] | |
void | place_closed_door (POSITION y, POSITION x, int type) |
所定の位置に各種の閉じたドアを配置する / Place a random type of normal door at the given location. [詳解] | |
void | try_door (POSITION y, POSITION x) |
ドアの設置を試みる / Places door at y, x position if at least 2 walls found [詳解] | |
void | place_floor (POSITION x1, POSITION x2, POSITION y1, POSITION y2, bool light) |
長方形の空洞を生成する / Make an empty square floor, for the middle of rooms [詳解] | |
void | place_room (POSITION x1, POSITION x2, POSITION y1, POSITION y2, bool light) |
長方形の部屋を生成する / Make an empty square room, only floor and wall grids [詳解] | |
void | vault_objects (POSITION y, POSITION x, int num) |
特殊な部屋向けに各種アイテムを配置する / Create up to "num" objects near the given coordinates [詳解] | |
void | vault_trap_aux (POSITION y, POSITION x, POSITION yd, POSITION xd) |
特殊な部屋向けに各種アイテムを配置する(vault_trapのサブセット) / Place a trap with a given displacement of point [詳解] | |
void | vault_traps (POSITION y, POSITION x, POSITION yd, POSITION xd, int num) |
特殊な部屋向けに各種アイテムを配置する(メインルーチン) / Place some traps with a given displacement of given location [詳解] | |
bool | get_is_floor (POSITION x, POSITION y) |
指定のマスが床系地形であるかを返す / Function that sees if a square is a floor. [詳解] | |
void | set_floor (POSITION x, POSITION y) |
指定のマスを床地形に変える / Set a square to be floor. [詳解] | |
void | place_bound_perm_wall (grid_type *g_ptr) |
マスにフロア端用の永久壁を配置する / Set boundary mimic and add "solid" perma-wall [詳解] | |
bool | is_known_trap (grid_type *g_ptr) |
マスに看破済みの罠があるかの判定を行う。 / Return TRUE if the given grid is a known trap [詳解] | |
bool | is_hidden_door (grid_type *g_ptr) |
マスに隠されたドアがあるかの判定を行う。 / Return TRUE if the given grid is a hidden closed door [詳解] | |
bool | is_mirror_grid (grid_type *g_ptr) |
bool | is_glyph_grid (grid_type *g_ptr) |
bool | is_explosive_rune_grid (grid_type *g_ptr) |
bool | player_can_enter (FEAT_IDX feature, BIT_FLAGS16 mode) |
プレイヤーが地形踏破可能かを返す [詳解] | |
POSITION | distance (POSITION y1, POSITION x1, POSITION y2, POSITION x2) |
2点間の距離をニュートン・ラプソン法で算出する / Distance between two points via Newton-Raphson technique [詳解] | |
void | update_local_illumination (player_type *creature_ptr, POSITION y, POSITION x) |
指定された座標の照明状態を更新する / Update "local" illumination [詳解] | |
bool | player_can_see_bold (POSITION y, POSITION x) |
指定された座標をプレイヤーが視覚に収められるかを返す。 / Can the player "see" the given grid in detail? [詳解] | |
bool | no_lite (void) |
指定された座標をプレイヤー収められていない状態かどうか / Returns true if the player's grid is dark [詳解] | |
void | map_info (POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp) |
Mコマンドによる縮小マップの表示を行う / Extract the attr/char to display at the given (legal) map location [詳解] | |
void | print_rel (SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x) |
void | note_spot (POSITION y, POSITION x) |
void | lite_spot (POSITION y, POSITION x) |
void | delayed_visual_update (void) |
void | update_flow (void) |
void | cave_set_feat (POSITION y, POSITION x, FEAT_IDX feat) |
FEAT_IDX | conv_dungeon_feat (FEAT_IDX newfeat) |
FEAT_IDX | feat_state (FEAT_IDX feat, int action) |
void | cave_alter_feat (POSITION y, POSITION x, int action) |
void | remove_mirror (POSITION y, POSITION x) |
bool | is_open (FEAT_IDX feat) |
地形は開くものであって、かつ開かれているかを返す / Attempt to open the given chest at the given location [詳解] | |
bool | check_local_illumination (POSITION y, POSITION x) |
指定された座標のマスが現在照らされているかを返す。 / Check for "local" illumination [詳解] | |
bool | cave_monster_teleportable_bold (MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode) |
指定されたマスがモンスターのテレポート可能先かどうかを判定する。 [詳解] | |
bool | cave_player_teleportable_bold (POSITION y, POSITION x, BIT_FLAGS mode) |
指定されたマスにプレイヤーがテレポート可能かどうかを判定する。 [詳解] | |
ダンジョンの生成処理の基幹部分ヘッダーファイル
Purpose: header file for grid.c, used only in dungeon generation files (generate.c, rooms.c)
#define add_cave_info | ( | FL, | |
Y, | |||
X, | |||
I | |||
) | ((FL)->grid_array[(Y)][(X)].info |= (I)) |
#define CAVE_EXTRA 0x0400 |
#define CAVE_FLOOR 0x0200 |
フロア属性のあるマス
#define CAVE_GLOW 0x0002 |
マス自体が光源を持っている / self-illuminating
#define CAVE_ICKY 0x0004 |
生成されたVaultの一部である / part of a vault
#define CAVE_IN_DETECT 0x4000 /* trap detected area (inner circle only) */ |
#define CAVE_INNER 0x0800 |
#define CAVE_KNOWN 0x0200 /* Directly viewed or map detected flag */ |
#define CAVE_LITE 0x0010 |
現在光に照らされている / lite flag
#define cave_lite_hack | ( | F, | |
Y, | |||
X | |||
) |
#define CAVE_MARK 0x0001 |
現在プレイヤーの記憶に収まっている / memorized feature
#define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT) |
#define CAVE_MNDK 0x8000 |
モンスターの暗源によって暗闇になっている / Darken by monster
#define CAVE_MNLT 0x0100 |
モンスターの光源によって照らされている / Illuminated by monster
#define CAVE_NOTE 0x0400 /* Flag for delayed visual update (needs note_spot()) */ |
#define cave_note_and_redraw_later | ( | C, | |
Y, | |||
X | |||
) |
#define CAVE_OBJECT 0x1000 /* Mirror, glyph, etc. */ |
#define CAVE_OUTER 0x1000 |
#define CAVE_REDRAW 0x0800 /* Flag for delayed visual update (needs lite_spot()) */ |
#define cave_redraw_later | ( | C, | |
Y, | |||
X | |||
) |
#define CAVE_ROOM 0x0008 |
生成された部屋の一部である / part of a room
#define CAVE_SOLID 0x2000 |
#define CAVE_TEMP 0x0040 |
光源に関する処理のアルゴリズム用記録フラグ / temp flag
#define CAVE_UNSAFE 0x2000 /* Might have trap */ |
#define CAVE_VAULT 0x4000 |
#define CAVE_VIEW 0x0020 |
現在プレイヤーの視界に収まっている / view flag
#define cave_view_hack | ( | C, | |
Y, | |||
X | |||
) |
#define CAVE_XTRA 0x0080 |
視界に関する処理のアルゴリズム用記録フラグ(update_view()等参照) / misc flag
#define CONVERT_TYPE_FLOOR 0 |
#define CONVERT_TYPE_INNER 2 |
#define CONVERT_TYPE_OUTER 3 |
#define CONVERT_TYPE_SOLID 4 |
#define CONVERT_TYPE_STREAM1 5 |
#define CONVERT_TYPE_STREAM2 6 |
#define CONVERT_TYPE_WALL 1 |
#define darkened_grid | ( | C | ) |
モンスターにより照明が消されている地形か否かを判定する。 / Is this grid "darkened" by monster?
#define DOOR_CURTAIN 2 |
#define DOOR_DEFAULT -1 |
#define DOOR_DOOR 0 |
#define DOOR_GLASS_DOOR 1 |
#define feat_jammed_door_random | ( | DOOR_TYPE | ) |
#define feat_locked_door_random | ( | DOOR_TYPE | ) |
#define feat_uses_special | ( | F | ) | (have_flag(f_info[(F)].flags, FF_SPECIAL)) |
マス構造体のspecial要素を利用する地形かどうかを判定するマクロ / Is this feature has special meaning (except floor_id) with g_ptr->special?
#define get_feat_mimic | ( | C | ) | (f_info[(C)->mimic ? (C)->mimic : (C)->feat].mimic) |
#define is_extra_bold | ( | F, | |
Y, | |||
X | |||
) | (F->grid_array[Y][X].info & CAVE_EXTRA) |
#define is_extra_grid | ( | C | ) | ((C)->info & CAVE_EXTRA) |
#define is_floor_bold | ( | F, | |
Y, | |||
X | |||
) | (F->grid_array[Y][X].info & CAVE_FLOOR) |
指定座標がFLOOR属性を持ったマスかどうかを返す
Y | 指定Y座標 |
X | 指定X座標 |
#define is_floor_grid | ( | C | ) | ((C)->info & CAVE_FLOOR) |
#define is_inner_bold | ( | F, | |
Y, | |||
X | |||
) | (F->grid_array[Y][X].info & CAVE_INNER) |
#define is_inner_grid | ( | C | ) | ((C)->info & CAVE_INNER) |
#define is_outer_bold | ( | F, | |
Y, | |||
X | |||
) | (F->grid_array[Y][X].info & CAVE_OUTER) |
#define is_outer_grid | ( | C | ) | ((C)->info & CAVE_OUTER) |
#define is_solid_bold | ( | F, | |
Y, | |||
X | |||
) | (F->grid_array[Y][X].info & CAVE_SOLID) |
#define is_solid_grid | ( | C | ) | ((C)->info & CAVE_SOLID) |
#define MAX_DOOR_TYPES 3 |
#define place_extra_bold | ( | Y, | |
X | |||
) |
#define place_extra_grid | ( | C | ) |
#define place_extra_noperm_bold | ( | F, | |
Y, | |||
X | |||
) |
#define place_extra_perm_bold | ( | Y, | |
X | |||
) |
#define place_extra_perm_grid | ( | C | ) |
#define place_floor_bold | ( | F, | |
Y, | |||
X | |||
) |
#define place_floor_grid | ( | C | ) |
#define place_inner_bold | ( | F, | |
Y, | |||
X | |||
) |
#define place_inner_grid | ( | C | ) |
#define place_inner_perm_bold | ( | Y, | |
X | |||
) |
#define place_inner_perm_grid | ( | C | ) |
#define place_outer_bold | ( | Y, | |
X | |||
) |
#define place_outer_grid | ( | C | ) |
#define place_outer_noperm_bold | ( | Y, | |
X | |||
) |
#define place_outer_noperm_grid | ( | C | ) |
#define place_outer_perm_bold | ( | Y, | |
X | |||
) |
#define place_outer_perm_grid | ( | C | ) |
#define place_rubble | ( | F, | |
Y, | |||
X | |||
) | set_cave_feat(F,Y,X,feat_rubble) |
指定座標に瓦礫を配置する
Y | 指定Y座標 |
X | 指定X座標 |
#define place_solid_bold | ( | Y, | |
X | |||
) |
#define place_solid_grid | ( | C | ) |
#define place_solid_noperm_bold | ( | Y, | |
X | |||
) |
#define place_solid_noperm_grid | ( | C | ) |
#define place_solid_perm_bold | ( | Y, | |
X | |||
) |
#define place_solid_perm_grid | ( | C | ) |
#define set_cave_feat | ( | FL, | |
Y, | |||
X, | |||
F | |||
) | ((FL)->grid_array[(Y)][(X)].feat = (F)) |
typedef struct player_type player_type |
bool cave_monster_teleportable_bold | ( | MONSTER_IDX | m_idx, |
POSITION | y, | ||
POSITION | x, | ||
BIT_FLAGS | mode | ||
) |
指定されたマスがモンスターのテレポート可能先かどうかを判定する。
m_idx | モンスターID |
y | 移動先Y座標 |
x | 移動先X座標 |
mode | オプション |
指定されたマスにプレイヤーがテレポート可能かどうかを判定する。
y | 移動先Y座標 |
x | 移動先X座標 |
mode | オプション |
指定された座標のマスが現在照らされているかを返す。 / Check for "local" illumination
y | y座標 |
x | x座標 |
void delayed_visual_update | ( | void | ) |
2点間の距離をニュートン・ラプソン法で算出する / Distance between two points via Newton-Raphson technique
y1 | 1点目のy座標 |
x1 | 1点目のx座標 |
y2 | 2点目のy座標 |
x2 | 2点目のx座標 |
指定のマスが床系地形であるかを返す / Function that sees if a square is a floor.
(Includes range checking.)
x | チェックするマスのX座標 |
y | チェックするマスのY座標 |
マスに隠されたドアがあるかの判定を行う。 / Return TRUE if the given grid is a hidden closed door
g_ptr | マス構造体の参照ポインタ |
マスに看破済みの罠があるかの判定を行う。 / Return TRUE if the given grid is a known trap
g_ptr | マス構造体の参照ポインタ |
地形は開くものであって、かつ開かれているかを返す / Attempt to open the given chest at the given location
feat | 地形ID |
void map_info | ( | POSITION | y, |
POSITION | x, | ||
TERM_COLOR * | ap, | ||
SYMBOL_CODE * | cp, | ||
TERM_COLOR * | tap, | ||
SYMBOL_CODE * | tcp | ||
) |
Mコマンドによる縮小マップの表示を行う / Extract the attr/char to display at the given (legal) map location
Basically, we "paint" the chosen attr/char in several passes, starting
with any known "terrain features" (defaulting to darkness), then adding
any known "objects", and finally, adding any known "monsters". This
is not the fastest method but since most of the calls to this function
are made for grids with no monsters or objects, it is fast enough.
Note that this function, if used on the grid containing the "player",
will return the attr/char of the grid underneath the player, and not
the actual player attr/char itself, allowing a lot of optimization
in various "display" functions.
Note that the "zero" entry in the feature/object/monster arrays are
used to provide "special" attr/char codes, with "monster zero" being
used for the player attr/char, "object zero" being used for the "stack"
attr/char, and "feature zero" being used for the "nothing" attr/char,
though this function makes use of only "feature zero".
Note that monsters can have some "special" flags, including "ATTR_MULTI",
which means their color changes, and "ATTR_CLEAR", which means they take
the color of whatever is under them, and "CHAR_CLEAR", which means that
they take the symbol of whatever is under them. Technically, the flag
"CHAR_MULTI" is supposed to indicate that a monster looks strange when
examined, but this flag is currently ignored.
Currently, we do nothing with multi-hued objects, because there are
not any. If there were, they would have to set "shimmer_objects"
when they were created, and then new "shimmer" code in "dungeon.c"
would have to be created handle the "shimmer" effect, and the code
in "p_ptr->current_floor_ptr->grid_array.c" would have to be updated to create the shimmer effect.
Note the effects of hallucination. Objects always appear as random
"objects", monsters as random "monsters", and normal grids occasionally
appear as random "monsters" or "objects", but note that these random
"monsters" and "objects" are really just "colored ascii symbols".
Note that "floors" and "invisible traps" (and "zero" features) are
drawn as "floors" using a special check for optimization purposes,
and these are the only features which get drawn using the special
lighting effects activated by "view_special_lite".
Note the use of the "mimic" field in the "terrain feature" processing,
which allows any feature to "pretend" to be another feature. This is
used to "hide" secret doors, and to make all "doors" appear the same,
and all "walls" appear the same, and "hidden" treasure stay hidden.
It is possible to use this field to make a feature "look" like a floor,
but the "special lighting effects" for floors will not be used.
Note the use of the new "terrain feature" information. Note that the
assumption that all interesting "objects" and "terrain features" are
memorized allows extremely optimized processing below. Note the use
of separate flags on objects to mark them as memorized allows a grid
to have memorized "terrain" without granting knowledge of any object
which may appear in that grid.
Note the efficient code used to determine if a "floor" grid is
"memorized" or "viewable" by the player, where the test for the
grid being "viewable" is based on the facts that (1) the grid
must be "lit" (torch-lit or perma-lit), (2) the grid must be in
line of sight, and (3) the player must not be blind, and uses the
assumption that all torch-lit grids are in line of sight.
Note that floors (and invisible traps) are the only grids which are
not memorized when seen, so only these grids need to check to see if
the grid is "viewable" to the player (if it is not memorized). Since
most non-memorized grids are in fact walls, this induces massive
efficiency, at the cost of forcing the memorization of non-floor
grids when they are first seen. Note that "invisible traps" are
always treated exactly like "floors", which prevents "cheating".
Note the "special lighting effects" which can be activated for floor
grids using the "view_special_lite" option (for "white" floor grids),
causing certain grids to be displayed using special colors. If the
player is "blind", we will use "dark gray", else if the grid is lit
by the torch, and the "view_yellow_lite" option is set, we will use
"yellow", else if the grid is "dark", we will use "dark gray", else
if the grid is not "viewable", and the "view_bright_lite" option is
set, and the we will use "slate" (gray). We will use "white" for all
other cases, in particular, for illuminated viewable floor grids.
Note the "special lighting effects" which can be activated for wall
grids using the "view_granite_lite" option (for "white" wall grids),
causing certain grids to be displayed using special colors. If the
player is "blind", we will use "dark gray", else if the grid is lit
by the torch, and the "view_yellow_lite" option is set, we will use
"yellow", else if the "view_bright_lite" option is set, and the grid
is not "viewable", or is "dark", or is glowing, but not when viewed
from the player's current location, we will use "slate" (gray). We
will use "white" for all other cases, in particular, for correctly
illuminated viewable wall grids.
Note that, when "view_granite_lite" is set, we use an inline version
of the "player_can_see_bold()" function to check the "viewability" of
grids when the "view_bright_lite" option is set, and we do NOT use
any special colors for "dark" wall grids, since this would allow the
player to notice the walls of illuminated rooms from a hallway that
happened to run beside the room. The alternative, by the way, would
be to prevent the generation of hallways next to rooms, but this
would still allow problems when digging towards a room.
Note that bizarre things must be done when the "attr" and/or "char"
codes have the "high-bit" set, since these values are used to encode
various "special" pictures in some versions, and certain situations,
such as "multi-hued" or "clear" monsters, cause the attr/char codes
to be "scrambled" in various ways.
Note that eventually we may use the "&" symbol for embedded treasure,
and use the "*" symbol to indicate multiple objects, though this will
have to wait for Angband 2.8.0 or later. Note that currently, this
is not important, since only one object or terrain feature is allowed
in each grid. If needed, "k_info[0]" will hold the "stack" attr/char.
Note the assumption that doing "x_ptr = &x_info[x]" plus a few of
"x_ptr->xxx", is quicker than "x_info[x].xxx", if this is incorrect
then a whole lot of code should be changed... XXX XXX
bool new_player_spot | ( | player_type * | creature_ptr | ) |
新規フロアに入りたてのプレイヤーをランダムな場所に配置する / Returns random co-ordinates for player/monster/object
creature_ptr | 配置したいクリーチャーの参照ポインタ |
bool no_lite | ( | void | ) |
指定された座標をプレイヤー収められていない状態かどうか / Returns true if the player's grid is dark
player_can_see_bold()関数の返り値の否定を返している。
void place_bound_perm_wall | ( | grid_type * | g_ptr | ) |
マスにフロア端用の永久壁を配置する / Set boundary mimic and add "solid" perma-wall
g_ptr | 永久壁を配置したいマス構造体の参照ポインタ |
所定の位置に各種の閉じたドアを配置する / Place a random type of normal door at the given location.
y | ドアの配置を試みたいマスのY座標 |
x | ドアの配置を試みたいマスのX座標 |
type | ドアの地形ID |
長方形の空洞を生成する / Make an empty square floor, for the middle of rooms
x1 | 長方形の左端X座標(-1) |
x2 | 長方形の右端X座標(+1) |
y1 | 長方形の上端Y座標(-1) |
y2 | 長方形の下端Y座標(+1) |
light | 照明の有無 |
所定の位置にさまざまな状態や種類のドアを配置する / Place a random type of door at the given location
y | ドアの配置を試みたいマスのY座標 |
x | ドアの配置を試みたいマスのX座標 |
room | 部屋に接している場合向けのドア生成か否か |
長方形の部屋を生成する / Make an empty square room, only floor and wall grids
x1 | 長方形の左端X座標(-1) |
x2 | 長方形の右端X座標(+1) |
y1 | 長方形の上端Y座標(-1) |
y2 | 長方形の下端Y座標(+1) |
light | 照明の有無 |
bool player_can_enter | ( | FEAT_IDX | feature, |
BIT_FLAGS16 | mode | ||
) |
プレイヤーが地形踏破可能かを返す
feature | 判定したい地形ID |
mode | 移動に関するオプションフラグ |
指定された座標をプレイヤーが視覚に収められるかを返す。 / Can the player "see" the given grid in detail?
y | y座標 |
x | x座標 |
He must have vision, illumination, and line of sight.
Note – "CAVE_LITE" is only set if the "torch" has "los()".
So, given "CAVE_LITE", we know that the grid is "fully visible".
Note that "CAVE_GLOW" makes little sense for a wall, since it would mean
that a wall is visible from any direction. That would be odd. Except
under wizard light, which might make sense. Thus, for walls, we require
not only that they be "CAVE_GLOW", but also, that they be adjacent to a
grid which is not only "CAVE_GLOW", but which is a non-wall, and which is
in line of sight of the player.
This extra check is expensive, but it provides a more "correct" semantics.
Note that we should not run this check on walls which are "outer walls" of
the dungeon, or we will induce a memory fault, but actually verifying all
of the locations would be extremely expensive.
Thus, to speed up the function, we assume that all "perma-walls" which are
"CAVE_GLOW" are "illuminated" from all sides. This is correct for all cases
except "vaults" and the "buildings" in town. But the town is a hack anyway,
and the player has more important things on his mind when he is attacking a
monster vault. It is annoying, but an extremely important optimization.
Note that "glowing walls" are only considered to be "illuminated" if the
grid which is next to the wall in the direction of the player is also a
"glowing" grid. This prevents the player from being able to "see" the
walls of illuminated rooms from a corridor outside the room.
void print_rel | ( | SYMBOL_CODE | c, |
TERM_COLOR | a, | ||
TERM_LEN | y, | ||
TERM_LEN | x | ||
) |
指定のマスを床地形に変える / Set a square to be floor.
(Includes range checking.)
x | 地形を変えたいマスのX座標 |
y | 地形を変えたいマスのY座標 |
ドアの設置を試みる / Places door at y, x position if at least 2 walls found
y | 設置を行いたいマスのY座標 |
x | 設置を行いたいマスのX座標 |
void update_flow | ( | void | ) |
void update_local_illumination | ( | player_type * | creature_ptr, |
POSITION | y, | ||
POSITION | x | ||
) |
指定された座標の照明状態を更新する / Update "local" illumination
creature_ptr | 視界元のクリーチャー |
y | 視界先y座標 |
x | 視界先x座標 |
特殊な部屋向けに各種アイテムを配置する / Create up to "num" objects near the given coordinates
y | 配置したい中心マスのY座標 |
x | 配置したい中心マスのX座標 |
num | 配置したい数 |
Only really called by some of the "vault" routines.
特殊な部屋向けに各種アイテムを配置する(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.
特殊な部屋向けに各種アイテムを配置する(メインルーチン) / 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.