|
#define | MAX_DEPTH 128 |
| ダンジョンの最深層 / Maximum dungeon level. [詳解]
|
|
#define | BLOCK_HGT 11 |
| generate.cで用いられる基本的なブロック数単位(垂直方向) Number of grids in each block (vertically) Probably hard-coded to 11, see "generate.c" [詳解]
|
|
#define | BLOCK_WID 11 |
| generate.cで用いられる基本的なブロック数単位(水平方向) Number of grids in each block (horizontally) Probably hard-coded to 11, see "generate.c" [詳解]
|
|
#define | SCREEN_HGT 22 |
| 表示上の基本的なブロック単位(垂直方向、PANEL_HGTの倍数で設定すること) Number of grids used to display the dungeon (vertically). [詳解]
|
|
#define | SCREEN_WID 66 |
| 表示上の基本的なブロック単位(水平方向、PANEL_WIDの倍数で設定すること) Number of grids used to display the dungeon (horizontally). [詳解]
|
|
#define | MAX_HGT 66 |
| 表示上のダンジョンの最大垂直サイズ(SCREEN_HGTの3倍が望ましい) Maximum dungeon height in grids, must be a multiple of SCREEN_HGT, probably hard-coded to SCREEN_HGT * 3. [詳解]
|
|
#define | MAX_WID 198 |
| 表示上のダンジョンの最大水平サイズ(SCREEN_WIDの3倍が望ましい) Maximum dungeon width in grids, must be a multiple of SCREEN_WID, probably hard-coded to SCREEN_WID * 3. [詳解]
|
|
#define | LITE_MAX 600 |
| プレイヤー用光源処理配列サイズ / Maximum size of the "lite" array (see "grid.c") [詳解]
|
|
#define | MON_LITE_MAX 1536 |
| モンスター用光源処理配列サイズ / Maximum size of the "mon_lite" array (see ">grid.c") [詳解]
|
|
#define | VIEW_MAX 1536 |
| 視界処理配列サイズ / Maximum size of the "view" array (see "p_ptr->current_floor_ptr->grid_array.c") [詳解]
|
|
#define | REDRAW_MAX 2298 |
| 再描画処理用配列サイズ / Maximum size of the "redraw" array (see "p_ptr->current_floor_ptr->grid_array.c") [詳解]
|
|
#define | DUNGEON_MODE_NONE 0 |
|
#define | DUNGEON_MODE_AND 1 |
|
#define | DUNGEON_MODE_NAND 2 |
|
#define | DUNGEON_MODE_OR 3 |
|
#define | DUNGEON_MODE_NOR 4 |
|
#define | DF1_WINNER 0x00000001L |
|
#define | DF1_MAZE 0x00000002L |
|
#define | DF1_SMALLEST 0x00000004L |
|
#define | DF1_BEGINNER 0x00000008L |
|
#define | DF1_BIG 0x00000010L |
|
#define | DF1_NO_DOORS 0x00000020L |
|
#define | DF1_WATER_RIVER 0x00000040L |
|
#define | DF1_LAVA_RIVER 0x00000080L |
|
#define | DF1_CURTAIN 0x00000100L |
|
#define | DF1_GLASS_DOOR 0x00000200L |
|
#define | DF1_CAVE 0x00000400L |
|
#define | DF1_CAVERN 0x00000800L |
|
#define | DF1_ARCADE 0x00001000L |
|
#define | DF1_LAKE_ACID 0x00002000L |
|
#define | DF1_LAKE_POISONOUS 0x00004000L |
|
#define | DF1_XXX15 0x00008000L |
|
#define | DF1_FORGET 0x00010000L |
|
#define | DF1_LAKE_WATER 0x00020000L |
|
#define | DF1_LAKE_LAVA 0x00040000L |
|
#define | DF1_LAKE_RUBBLE 0x00080000L |
|
#define | DF1_LAKE_TREE 0x00100000L |
|
#define | DF1_NO_VAULT 0x00200000L |
|
#define | DF1_ARENA 0x00400000L |
|
#define | DF1_DESTROY 0x00800000L |
|
#define | DF1_GLASS_ROOM 0x01000000L |
|
#define | DF1_NO_CAVE 0x02000000L |
|
#define | DF1_NO_MAGIC 0x04000000L |
|
#define | DF1_NO_MELEE 0x08000000L |
|
#define | DF1_CHAMELEON 0x10000000L |
|
#define | DF1_DARKNESS 0x20000000L |
|
#define | DF1_ACID_RIVER 0x40000000L |
|
#define | DF1_POISONOUS_RIVER 0x80000000L |
|
#define | DF1_LAKE_MASK (DF1_LAKE_WATER | DF1_LAKE_LAVA | DF1_LAKE_RUBBLE | DF1_LAKE_TREE | DF1_LAKE_POISONOUS | DF1_LAKE_ACID) |
|
#define | in_bounds(F, Y, X) (((Y) > 0) && ((X) > 0) && ((Y) < (F)->height-1) && ((X) < (F)->width-1)) |
|
#define | in_bounds2(F, Y, X) (((Y) >= 0) && ((X) >= 0) && ((Y) < (F)->height) && ((X) < (F)->width)) |
|
#define | in_bounds2u(F, Y, X) (((Y) < (F)->height) && ((X) < (F)->width)) |
|
#define | player_bold(C, Y, X) (((Y) == (C)->y) && ((X) == (C)->x)) |
|
#define | player_grid(C, G) ((G) == &(C)->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x]) |
|
#define | cave_have_flag_bold(Y, X, INDEX) (have_flag(f_info[p_ptr->current_floor_ptr->grid_array[(Y)][(X)].feat].flags, (INDEX))) |
|
#define | cave_have_flag_grid(C, INDEX) (have_flag(f_info[(C)->feat].flags, (INDEX))) |
|
#define | feat_supports_los(F) (have_flag(f_info[(F)].flags, FF_LOS)) |
|
#define | cave_los_bold(F, Y, X) (feat_supports_los((F)->grid_array[(Y)][(X)].feat)) |
|
#define | cave_los_grid(C) (feat_supports_los((C)->feat)) |
|
#define | cave_clean_bold(F, Y, X) |
|
#define | cave_drop_bold(F, Y, X) |
|
#define | cave_empty_bold(F, Y, X) |
|
#define | cave_empty_bold2(F, Y, X) |
|
#define | cave_naked_bold(C, F, Y, X) |
|
#define | cave_perma_bold(Y, X) (cave_have_flag_bold((Y), (X), FF_PERMANENT)) |
|
#define | cave_empty_grid(C) |
|
#define | cave_perma_grid(C) (cave_have_flag_grid((C), FF_PERMANENT)) |
|
#define | pattern_tile(Y, X) (cave_have_flag_bold((Y), (X), FF_PATTERN)) |
|
#define | cave_stop_disintegration(Y, X) |
|
#define | player_has_los_grid(C) (((C)->info & (CAVE_VIEW)) != 0) |
|
#define | player_has_los_bold(C, Y, X) ((((C)->current_floor_ptr->grid_array[Y][X].info & (CAVE_VIEW)) != 0) || (C)->phase_out) |
|
#define | permanent_wall(F) |
|
#define | GRID(Y, X) (256 * (Y) + (X)) |
|
#define | GRID_Y(G) ((int)((G) / 256U)) |
|
#define | GRID_X(G) ((int)((G) % 256U)) |
|
|
void | update_smell (floor_type *floor_ptr, player_type *subject_ptr) |
|
void | add_door (floor_type *floor_ptr, POSITION x, POSITION y) |
|
void | place_secret_door (floor_type *floor_ptr, POSITION y, POSITION x, int type) |
| 隠しドアを配置する [詳解]
|
|
void | place_locked_door (floor_type *floor_ptr, POSITION y, POSITION x) |
| 鍵のかかったドアを配置する [詳解]
|
|
void | forget_flow (floor_type *floor_ptr) |
|
void | place_random_stairs (floor_type *floor_ptr, POSITION y, POSITION x) |
| 所定の位置に上り階段か下り階段を配置する / Place an up/down staircase at given location [詳解]
|
|
bool | los (floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2) |
| LOS(Line Of Sight / 視線が通っているか)の判定を行う。 [詳解]
|
|
bool | projectable (floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2) |
|
void | vault_monsters (floor_type *floor_ptr, POSITION y1, POSITION x1, int num) |
| 特殊な部屋地形向けにモンスターを配置する / Hack – Place some sleeping monsters near the given location [詳解]
|
|
bool | cave_valid_bold (floor_type *floor_ptr, POSITION y, POSITION x) |
| 指定された座標が地震や階段生成の対象となるマスかを返す。 / Determine if a given location may be "destroyed" [詳解]
|
|
LOS(Line Of Sight / 視線が通っているか)の判定を行う。
- 引数
-
y1 | 始点のy座標 |
x1 | 始点のx座標 |
y2 | 終点のy座標 |
x2 | 終点のx座標 |
- 戻り値
- LOSが通っているならTRUEを返す。
A simple, fast, integer-based line-of-sight algorithm. By Joseph Hall,
4116 Brewster Drive, Raleigh NC 27606. Email to jnh@e.nosp@m.cemw.nosp@m.l.ncs.nosp@m.u.ed.nosp@m.u.
Returns TRUE if a line of sight can be traced from (x1,y1) to (x2,y2).
The LOS begins at the center of the tile (x1,y1) and ends at the center of
the tile (x2,y2). If los() is to return TRUE, all of the tiles this line
passes through must be floor tiles, except for (x1,y1) and (x2,y2).
We assume that the "mathematical corner" of a non-floor tile does not
block line of sight.
Because this function uses (short) ints for all calculations, overflow may
occur if dx and dy exceed 90.
Once all the degenerate cases are eliminated, the values "qx", "qy", and
"m" are multiplied by a scale factor "f1 = abs(dx * dy * 2)", so that
we can use integer arithmetic.
We travel from start to finish along the longer axis, starting at the border
between the first and second tiles, where the y offset = .5 * slope, taking
into account the scale factor. See below.
Also note that this function and the "move towards target" code do NOT
share the same properties. Thus, you can see someone, target them, and
then fire a bolt at them, but the bolt may hit a wall, not them. However
, by clever choice of target locations, you can sometimes throw a "curve".
Note that "line of sight" is not "reflexive" in all cases.
Use the "projectable()" routine to test "spell/missile line of sight".
Use the "update_view()" function to determine player line-of-sight.