{
if (flg & PROJECT_DISI)
{
- if (in_disintegration_range(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
- if (in_disintegration_range(y1, x1, master_ptr->y, master_ptr->x) && (distance(y1, x1, master_ptr->y, master_ptr->x) <= rad)) hityou = TRUE;
+ if (in_disintegration_range(master_ptr->current_floor_ptr, y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
+ if (in_disintegration_range(master_ptr->current_floor_ptr, y1, x1, master_ptr->y, master_ptr->x) && (distance(y1, x1, master_ptr->y, master_ptr->x) <= rad)) hityou = TRUE;
}
else if (flg & PROJECT_LOS)
{
/* spells1.c */
extern PERCENTAGE beam_chance(player_type *caster_ptr);
-extern bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
+extern bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
extern void breath_shape(floor_type *floor_ptr, 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, EFFECT_ID typ);
extern POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
* Modified version of los() for calculation of disintegration balls.
* Disintegration effects are stopped by permanent walls.
*/
-bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
+bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
{
POSITION dx, dy; /* Delta */
POSITION ax, ay; /* Absolute */
if ((ax < 2) && (ay < 2)) return (TRUE);
/* Paranoia -- require "safe" origin */
- /* if (!in_bounds(p_ptr->current_floor_ptr, y1, x1)) return (FALSE); */
+ /* if (!in_bounds(floor_ptr, y1, x1)) return (FALSE); */
/* Directly South/North */
if (!dx)
{
for (ty = y1 + 1; ty < y2; ty++)
{
- if (cave_stop_disintegration(p_ptr->current_floor_ptr, ty, x1)) return (FALSE);
+ if (cave_stop_disintegration(floor_ptr, ty, x1)) return (FALSE);
}
}
{
for (ty = y1 - 1; ty > y2; ty--)
{
- if (cave_stop_disintegration(p_ptr->current_floor_ptr, ty, x1)) return (FALSE);
+ if (cave_stop_disintegration(floor_ptr, ty, x1)) return (FALSE);
}
}
{
for (tx = x1 + 1; tx < x2; tx++)
{
- if (cave_stop_disintegration(p_ptr->current_floor_ptr, y1, tx)) return (FALSE);
+ if (cave_stop_disintegration(floor_ptr, y1, tx)) return (FALSE);
}
}
{
for (tx = x1 - 1; tx > x2; tx--)
{
- if (cave_stop_disintegration(p_ptr->current_floor_ptr, y1, tx)) return (FALSE);
+ if (cave_stop_disintegration(floor_ptr, y1, tx)) return (FALSE);
}
}
{
if (ay == 2)
{
- if (!cave_stop_disintegration(p_ptr->current_floor_ptr, y1 + sy, x1)) return (TRUE);
+ if (!cave_stop_disintegration(floor_ptr, y1 + sy, x1)) return (TRUE);
}
}
{
if (ax == 2)
{
- if (!cave_stop_disintegration(p_ptr->current_floor_ptr, y1, x1 + sx)) return (TRUE);
+ if (!cave_stop_disintegration(floor_ptr, y1, x1 + sx)) return (TRUE);
}
}
/* the LOS exactly meets the corner of a tile. */
while (x2 - tx)
{
- if (cave_stop_disintegration(p_ptr->current_floor_ptr, ty, tx)) return (FALSE);
+ if (cave_stop_disintegration(floor_ptr, ty, tx)) return (FALSE);
qy += m;
else if (qy > f2)
{
ty += sy;
- if (cave_stop_disintegration(p_ptr->current_floor_ptr, ty, tx)) return (FALSE);
+ if (cave_stop_disintegration(floor_ptr, ty, tx)) return (FALSE);
qy -= f1;
tx += sx;
}
/* the LOS exactly meets the corner of a tile. */
while (y2 - ty)
{
- if (cave_stop_disintegration(p_ptr->current_floor_ptr, ty, tx)) return (FALSE);
+ if (cave_stop_disintegration(floor_ptr, ty, tx)) return (FALSE);
qx += m;
else if (qx > f2)
{
tx += sx;
- if (cave_stop_disintegration(p_ptr->current_floor_ptr, ty, tx)) return (FALSE);
+ if (cave_stop_disintegration(floor_ptr, ty, tx)) return (FALSE);
qx -= f1;
ty += sy;
}
break;
case GF_DISINTEGRATE:
/* Disintegration are stopped only by perma-walls */
- if (!in_disintegration_range(by, bx, y, x)) continue;
+ if (!in_disintegration_range(floor_ptr, by, bx, y, x)) continue;
break;
default:
/* Ball explosions are stopped by walls */
break;
case GF_DISINTEGRATE:
/* Disintegration are stopped only by perma-walls */
- if (!in_disintegration_range(by, bx, y, x)) continue;
+ if (!in_disintegration_range(caster_ptr->current_floor_ptr, by, bx, y, x)) continue;
break;
default:
/* Ball explosions are stopped by walls */