* If the distance is not "one", we (may) return "*".
* </pre>
*/
-u16b bolt_pict(int y, int x, int ny, int nx, int typ)
+u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, int typ)
{
int base;
* by "update_view_los()", and very different from the one used by "los()".
* </pre>
*/
-sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg)
+sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg)
{
int y, x;
* Mega-Hack -- track "affected" monsters (see "project()" comments)
*/
static int project_m_n; /*!< 魔法効果範囲内にいるモンスターの数 */
-static int project_m_x; /*!< 処理中のモンスターX座標 */
-static int project_m_y; /*!< 処理中のモンスターY座標 */
+static POSITION project_m_x; /*!< 処理中のモンスターX座標 */
+static POSITION project_m_y; /*!< 処理中のモンスターY座標 */
/* Mega-Hack -- monsters target */
-static s16b monster_target_x; /*!< モンスターの攻撃目標X座標 */
-static s16b monster_target_y; /*!< モンスターの攻撃目標Y座標 */
+static POSITION monster_target_x; /*!< モンスターの攻撃目標X座標 */
+static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
/*!
* XXX XXX XXX Perhaps we should affect doors?
* </pre>
*/
-static bool project_f(int who, int r, int y, int x, int dam, int typ)
+static bool project_f(int who, int r, int y, int x, HIT_POINT dam, int typ)
{
cave_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
* We return "TRUE" if the effect of the projection is "obvious".
* </pre>
*/
-static bool project_o(int who, int r, int y, int x, int dam, int typ)
+static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, int typ)
{
cave_type *c_ptr = &cave[y][x];
- s16b this_o_idx, next_o_idx = 0;
+ OBJECT_IDX this_o_idx, next_o_idx = 0;
bool obvious = FALSE;
bool known = player_has_los_bold(y, x);
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
char o_name[MAX_NLEN];
- int k_idx = 0;
+ KIND_OBJECT_IDX k_idx = 0;
bool is_potion = FALSE;
if (o_ptr->tval == TV_CORPSE)
{
int i;
- u32b mode = 0L;
+ BIT_FLAGS mode = 0L;
if (!who || is_pet(&m_list[who]))
mode |= PM_FORCE_PET;
* "flg" was added.
* </pre>
*/
-static bool project_m(int who, int r, int y, int x, HIT_POINT dam, int typ, int flg, bool see_s_msg)
+static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, int typ, BIT_FLAGS flg, bool see_s_msg)
{
int tmp;
char m_name[80];
char m_poss[10];
- int photo = 0;
+ PARAMETER_VALUE photo = 0;
/* Assume no note */
cptr note = NULL;
case 19: case 20: case 21: case 22:
{
bool pet = !one_in_(3);
- u32b mode = PM_ALLOW_GROUP;
+ BIT_FLAGS mode = PM_ALLOW_GROUP;
if (pet) mode |= PM_FORCE_PET;
else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
* We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
* we just assume that the effects were obvious, for historical reasons.
*/
-static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
+static bool project_p(int who, cptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, int typ, BIT_FLAGS flg, int monspell)
{
int k = 0;
int rlev = 0;
if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
{
- byte t_y, t_x;
+ POSITION t_y, t_x;
int max_attempts = 10;
- if (blind)
- msg_print(_("何かが跳ね返った!", "Something bounces!"));
+ if (blind)
+ msg_print(_("何かが跳ね返った!", "Something bounces!"));
else if (p_ptr->special_defense & KATA_FUUJIN)
- msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
+ msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
else
- msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
+ msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
/* Choose 'new' target */
/*
* Find the distance from (x, y) to a line.
*/
-int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
+POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
{
/* Vector from (x, y) to (x1, y1) */
- int py = y1 - y;
- int px = x1 - x;
+ POSITION py = y1 - y;
+ POSITION px = x1 - x;
/* Normal vector */
- int ny = x2 - x1;
- int nx = y1 - y2;
+ POSITION ny = x2 - x1;
+ POSITION nx = y1 - y2;
- /* Length of N */
- int pd = distance(y1, x1, y, x);
- int nd = distance(y1, x1, y2, x2);
+ /* Length of N */
+ POSITION pd = distance(y1, x1, y, x);
+ POSITION nd = distance(y1, x1, y2, x2);
if (pd > nd) return distance(y, x, y2, x2);
/* Component of P on N */
nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
- /* Absolute value */
- return((nd >= 0) ? nd : 0 - nd);
+ /* Absolute value */
+ return((nd >= 0) ? nd : 0 - nd);
}
* Modified version of los() for calculation of disintegration balls.
* Disintegration effects are stopped by permanent walls.
*/
-bool in_disintegration_range(int y1, int x1, int y2, int x2)
+bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
{
/* Delta */
- int dx, dy;
+ POSITION dx, dy;
/* Absolute */
- int ax, ay;
+ POSITION ax, ay;
/* Signs */
- int sx, sy;
+ POSITION sx, sy;
/* Fractions */
- int qx, qy;
+ POSITION qx, qy;
/* Scanners */
- int tx, ty;
+ POSITION tx, ty;
/* Scale factors */
- int f1, f2;
+ POSITION f1, f2;
/* Slope, or 1/Slope, of LOS */
- int m;
+ POSITION m;
/* Extract the offset */
/*
* breath shape
*/
-void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte *gm, int *pgm_rad, int rad, int y1, int x1, int y2, int x2, int typ)
+void breath_shape(u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int typ)
{
- int by = y1;
- int bx = x1;
+ POSITION by = y1;
+ POSITION bx = x1;
int brad = 0;
int brev = rad * rad / dist;
int bdis = 0;
* and "update_view()" and "update_monsters()" need to be called.
* </pre>
*/
-bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
+bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, int typ, BIT_FLAGS flg, int monspell)
{
int i, t, dist;
- int y1, x1;
- int y2, x2;
- int by, bx;
+ POSITION y1, x1;
+ POSITION y2, x2;
+ POSITION by, bx;
int dist_hack = 0;
- int y_saver, x_saver; /* For reflecting monsters */
+ POSITION y_saver, x_saver; /* For reflecting monsters */
int msec = delay_factor * delay_factor * delay_factor;
int grids = 0;
/* Coordinates of the affected grids */
- byte gx[1024], gy[1024];
+ POSITION gx[1024], gy[1024];
/* Encoded "radius" info (see above) */
- byte gm[32];
+ POSITION gm[32];
/* Actual radius encoded in gm[] */
- int gm_rad = rad;
+ POSITION gm_rad = rad;
bool jump = FALSE;
((cave[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
(!who || dist_hack > 1) && !one_in_(10))
{
- byte t_y, t_x;
+ POSITION t_y, t_x;
int max_attempts = 10;
/* Choose 'new' target */
* @param dam ダメージ量
* @return 効果があったらTRUEを返す
*/
-bool binding_field( int dam )
+bool binding_field( HIT_POINT dam )
{
int mirror_x[10],mirror_y[10]; /* 鏡はもっと少ない */
int mirror_num=0; /* 鏡の数 */
* @param dam ダメージ量
* @return 効果があったらTRUEを返す
*/
-void seal_of_mirror( int dam )
+void seal_of_mirror( HIT_POINT dam )
{
int x,y;