case GF_SOUND: return (0x09);
case GF_SHARDS: return (0x08);
case GF_FORCE: return (0x09);
- case GF_INERTIA: return (0x09);
+ case GF_INERTIAL: return (0x09);
case GF_GRAVITY: return (0x09);
case GF_TIME: return (0x09);
case GF_LITE_WEAK: return (0x06);
* 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, int 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座標 */
/*!
* 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);
* "flg" was added.
* </pre>
*/
-static bool project_m(int who, int r, int y, int x, int 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, int 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;
}
/* Inertia -- breathers resist */
- case GF_INERTIA:
+ case GF_INERTIAL:
{
if (seen) obvious = TRUE;
if (r_ptr->flagsr & RFR_RES_ALL)
{
- note = _("には効果がなかった!", " is immune.");
+ note = _("には効果がなかった!", " is immune.");
dam = 0;
if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
break;
break;
}
- if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
+ if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
{
if (who > 0)
{
case 3: case 4: case 5: case 6:
if (!count)
{
- int dam = damroll(10, 10);
+ int extra_dam = damroll(10, 10);
msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
- project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
+ project(0, 8, ty, tx, extra_dam, GF_MANA, curse_flg, -1);
if (!one_in_(6)) break;
}
case 7: case 8:
* 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, int 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 */
/* Arrow -- XXX no dodging */
case GF_ARROW:
{
- if (fuzzy)
- {
- msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
- }
+ if (fuzzy)
+ {
+ msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
+ }
else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
{
- msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
+ msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
break;
}
get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
{
- int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
- (void)set_stun(p_ptr->stun + k);
+ int plus_stun = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
+ (void)set_stun(p_ptr->stun + plus_stun);
}
if (!(p_ptr->resist_fire ||
- IS_OPPOSE_FIRE() ||
- p_ptr->immune_fire))
+ IS_OPPOSE_FIRE() ||
+ p_ptr->immune_fire))
{
inven_damage(set_acid_destroy, 3);
}
if (p_ptr->resist_neth)
{
if (!prace_is_(RACE_SPECTRE))
+ {
dam *= 6; dam /= (randint1(4) + 7);
+ }
}
else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
}
else if (!CHECK_MULTISHADOW())
{
- int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
- (void)set_stun(p_ptr->stun + k);
+ int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
+ (void)set_stun(p_ptr->stun + plus_stun);
}
if (!p_ptr->resist_sound || one_in_(13))
}
/* Inertia -- slowness */
- case GF_INERTIA:
+ case GF_INERTIAL:
{
if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
case GF_GRAVITY:
{
if (fuzzy) msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!"));
- msg_print(_("周辺の重力がゆがんだ。", "Gravity warps around you."));
+ msg_print(_("周辺の重力がゆがんだ。", "Gravity warps around you."));
if (!CHECK_MULTISHADOW())
{
(void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
if (!(p_ptr->resist_sound || p_ptr->levitation))
{
- int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
- (void)set_stun(p_ptr->stun + k);
+ int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
+ (void)set_stun(p_ptr->stun + plus_stun);
}
}
if (p_ptr->levitation)
* 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, int *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, int 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;
monster_target_y=(s16b)y;
monster_target_x=(s16b)x;
- remove_mirror(y,x);
- next_mirror( &oy,&ox,y,x );
+ remove_mirror(y, x);
+ next_mirror(&oy, &ox, y, x);
path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
- for( j = last_i; j <=i ; j++ )
+ for(j = last_i; j <= i; j++)
{
y = GRID_Y(path_g[j]);
x = GRID_X(path_g[j]);
- if(project_m(0,0,y,x,dam,GF_SEEKER,flg,TRUE))notice=TRUE;
+ if(project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice=TRUE;
if(!who && (project_m_n==1) && !jump ){
if(cave[project_m_y][project_m_x].m_idx >0 ){
monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
last_i = i;
}
}
- for( i = last_i ; i < path_n ; i++ )
+ for(i = last_i ; i < path_n ; i++)
{
- int x,y;
- y = GRID_Y(path_g[i]);
- x = GRID_X(path_g[i]);
- if(project_m(0,0,y,x,dam,GF_SEEKER,flg,TRUE))
- notice=TRUE;
+ int py, px;
+ py = GRID_Y(path_g[i]);
+ px = GRID_X(path_g[i]);
+ if(project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
+ notice = TRUE;
if(!who && (project_m_n==1) && !jump ){
- if(cave[project_m_y][project_m_x].m_idx >0 ){
- monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
+ if(cave[project_m_y][project_m_x].m_idx > 0)
+ {
+ monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
- if (m_ptr->ml)
- {
- /* Hack -- auto-recall */
- if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
+ if (m_ptr->ml)
+ {
+ /* Hack -- auto-recall */
+ if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- /* Hack - auto-track */
- health_track(cave[project_m_y][project_m_x].m_idx);
- }
- }
+ /* Hack - auto-track */
+ health_track(cave[project_m_y][project_m_x].m_idx);
+ }
+ }
}
- (void)project_f(0,0,y,x,dam,GF_SEEKER);
+ (void)project_f(0, 0, py, px, dam, GF_SEEKER);
}
return notice;
}
}
for( i = 0; i < path_n ; i++ )
{
- int x,y;
- y = GRID_Y(path_g[i]);
- x = GRID_X(path_g[i]);
- (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg,TRUE);
- if(!who && (project_m_n==1) && !jump ){
- if(cave[project_m_y][project_m_x].m_idx >0 ){
- monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
+ int py, px;
+ py = GRID_Y(path_g[i]);
+ px = GRID_X(path_g[i]);
+ (void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
+ if(!who && (project_m_n == 1) && !jump){
+ if(cave[project_m_y][project_m_x].m_idx >0 ){
+ monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
- if (m_ptr->ml)
- {
- /* Hack -- auto-recall */
- if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
+ if (m_ptr->ml)
+ {
+ /* Hack -- auto-recall */
+ if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- /* Hack - auto-track */
- health_track(cave[project_m_y][project_m_x].m_idx);
- }
- }
+ /* Hack - auto-track */
+ health_track(cave[project_m_y][project_m_x].m_idx);
+ }
+ }
}
- (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
+ (void)project_f(0, 0, py, px, dam, GF_SUPER_RAY);
}
return notice;
}
((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 */