Hengband  2.2.1
geometry.h
[詳解]
1 #pragma once
2 
3 typedef struct player_type player_type;
4 
5 extern const POSITION ddd[9];
6 extern const POSITION ddx[10];
7 extern const POSITION ddy[10];
8 extern const POSITION ddx_ddd[9];
9 extern const POSITION ddy_ddd[9];
10 extern const POSITION cdd[8];
11 extern const POSITION ddx_cdd[8];
12 extern const POSITION ddy_cdd[8];
13 
14 extern DIRECTION coords_to_dir(player_type *creature_ptr, POSITION y, POSITION x);
15 
16 /*
17  * project()関数に用いられる、遠隔攻撃特性ビットフラグ / Bit flags for the "project()" function
18  */
19 #define PROJECT_JUMP 0x0001 /*!< 遠隔攻撃特性: 発動者からの軌跡を持たず、指定地点に直接発生する(予め置いたトラップ、上空からの発生などのイメージ) / Jump directly to the target location (this is a hack) */
20 #define PROJECT_BEAM 0x0002 /*!< 遠隔攻撃特性: ビーム範囲を持つ。 / Work as a beam weapon (affect every grid passed through) */
21 #define PROJECT_THRU 0x0004 /*!< 遠隔攻撃特性: 目標地点に到達しても射程と遮蔽の限り引き延ばす。 / Continue "through" the target (used for "bolts"/"beams") */
22 #define PROJECT_STOP 0x0008 /*!< 遠隔攻撃特性: 道中にプレイヤーかモンスターがいた時点で到達地点を更新して停止する(壁や森はPROJECT_DISIがない限り最初から貫通しない) */
23 #define PROJECT_GRID 0x0010 /*!< 遠隔攻撃特性: 射程内の地形に影響を及ぼす / Affect each grid in the "blast area" in some way */
24 #define PROJECT_ITEM 0x0020 /*!< 遠隔攻撃特性: 射程内のアイテムに影響を及ぼす / Affect each object in the "blast area" in some way */
25 #define PROJECT_KILL 0x0040 /*!< 遠隔攻撃特性: 射程内のモンスターに影響を及ぼす / Affect each monster in the "blast area" in some way */
26 #define PROJECT_HIDE 0x0080 /*!< 遠隔攻撃特性: / Hack -- disable "visual" feedback from projection */
27 #define PROJECT_DISI 0x0100 /*!< 遠隔攻撃特性: / Disintegrate non-permanent features */
28 #define PROJECT_PLAYER 0x0200 /*!< 遠隔攻撃特性: / Main target is player (used for riding player) */
29 #define PROJECT_AIMED 0x0400 /*!< 遠隔攻撃特性: / Target is only player or monster, so don't affect another. Depend on PROJECT_PLAYER. (used for minimum (rad == 0) balls on riding player) */
30 #define PROJECT_REFLECTABLE 0x0800 /*!< 遠隔攻撃特性: 反射可能(ボルト系魔法に利用) / Refrectable spell attacks (used for "bolts") */
31 #define PROJECT_NO_HANGEKI 0x1000 /*!< 遠隔攻撃特性: / Avoid counter attacks of monsters */
32 #define PROJECT_PATH 0x2000 /*!< 遠隔攻撃特性: / Only used for printing project path */
33 #define PROJECT_FAST 0x4000 /*!< 遠隔攻撃特性: / Hide "visual" of flying bolts until blast */
34 #define PROJECT_LOS 0x8000 /*!< 遠隔攻撃特性: / */
35 extern sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg);
36 
37 extern POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
38 
39 extern void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
40 extern void mmove2(POSITION *y, POSITION *x, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
41 
43 extern bool no_lite(void);
44 
45 /*!
46  * @brief 視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "p_ptr->current_floor_ptr->grid_array.c")
47  * @details We must be as large as "VIEW_MAX" and "LITE_MAX" for proper functioning
48  * of "update_view()" and "update_lite()". We must also be as large as the
49  * largest illuminatable room, but no room is larger than 800 grids. We
50  * must also be large enough to allow "good enough" use as a circular queue,
51  * to calculate monster flow, but note that the flow code is "paranoid".
52  */
53 #define TEMP_MAX 2298
54 
55 //!< 対象グリッドの一覧をまとめる構造体
56 typedef struct
57 {
58  POSITION_IDX n; //!< Array of grids for use by various functions (see grid.c")
61 } pos_list;
62 
63 //!< ターゲット指定構造体
64 typedef struct
65 {
69 } target_dir;
70 
71 /*
72  * Simple structure to hold a map location
73  */
74 typedef struct coord coord;
75 
76 struct coord
77 {
80 };
81 
82 /*
83  * Is the monster seen by the player?
84  */
85 #define is_seen(A) \
86  ((bool)((A)->ml && (!ignore_unview || p_ptr->phase_out || \
87  (player_can_see_bold((A)->fy, (A)->fx) && projectable(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, (A)->fy, (A)->fx)))))
88 
POSITION x
Definition: geometry.h:68
const POSITION ddd[9]
キーパッドの方向を南から反時計回り順に列挙 / Global array for looping through the "keypad directions"
Definition: geometry.c:9
POSITION x
Definition: player-status.h:723
const POSITION ddx[10]
dddで定義した順にベクトルのX軸成分を定義 / Global arrays for converting "keypad direction" into offsets
Definition: geometry.c:15
const POSITION ddx_ddd[9]
ddd越しにベクトルのX軸成分を定義 / Global arrays for optimizing "ddx[ddd[i]]" and "ddy[ddd[i]]"
Definition: geometry.c:27
const POSITION ddx_cdd[8]
cdd越しにベクトルのX軸成分を定義 / Global arrays for optimizing "ddx[cdd[i]]" and "ddy[cdd[i]]"
Definition: geometry.c:46
bool no_lite(void)
指定された座標をプレイヤー収められていない状態かどうか / Returns true if the player's grid is dark
Definition: grid.c:919
u32b BIT_FLAGS
32ビットのフラグ配列の型定義
Definition: h-type.h:225
unsigned short u16b
Definition: h-type.h:99
s32b POSITION
ゲーム中の座標型を定義
Definition: h-type.h:146
POSITION y
Definition: geometry.h:78
POSITION y
Definition: geometry.h:67
int sint
sint型をintとして定義 / A signed, standard integer (at least 2 bytes)
Definition: h-type.h:84
void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode)
Definition: geometry.c:469
POSITION y
Definition: player-status.h:722
const POSITION ddy_ddd[9]
ddd越しにベクトルのY軸成分を定義 / Global arrays for optimizing "ddx[ddd[i]]" and "ddy[ddd[i]]"
Definition: geometry.c:33
bool player_can_see_bold(POSITION y, POSITION x)
指定された座標をプレイヤーが視覚に収められるかを返す。 / Can the player "see" the given grid in detail?
Definition: geometry.c:538
POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
2点間の距離をニュートン・ラプソン法で算出する / Distance between two points via Newton-Raphson technique
Definition: geometry.c:64
int DIRECTION
ゲーム中の方角の型定義
Definition: h-type.h:198
const POSITION cdd[8]
キーパッドの円環状方向配列 / Circular keypad direction array
Definition: geometry.c:40
DIRECTION dir
Definition: geometry.h:66
Definition: player-status.h:86
void mmove2(POSITION *y, POSITION *x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
Definition: geometry.c:571
s16b POSITION_IDX
ゲーム中の座標リストID型
Definition: h-type.h:147
POSITION x
Definition: geometry.h:79
Definition: geometry.h:76
#define TEMP_MAX
視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "p_ptr->current_floor_ptr->grid_array....
Definition: geometry.h:53
sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg)
始点から終点への直線経路を返す / Determine the path taken by a projection.
Definition: geometry.c:165
DIRECTION coords_to_dir(player_type *creature_ptr, POSITION y, POSITION x)
プレイヤーから指定の座標がどの方角にあるかを返す / Convert an adjacent location to a direction.
Definition: geometry.c:102
const POSITION ddy_cdd[8]
cdd越しにベクトルのY軸成分を定義 / Global arrays for optimizing "ddx[cdd[i]]" and "ddy[cdd[i]]"
Definition: geometry.c:52
const POSITION ddy[10]
dddで定義した順にベクトルのY軸成分を定義 / Global arrays for converting "keypad direction" into offsets
Definition: geometry.c:21
Definition: geometry.h:64
POSITION_IDX n
Array of grids for use by various functions (see grid.c")
Definition: geometry.h:58
Definition: geometry.h:56