/* spells1.c */
extern bool in_disintegration_range(int y1, int x1, int y2, int x2);
-extern 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, bool disint_ball, bool real_breath);
+extern 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, bool disint_ball);
extern int take_hit(int damage_type, int damage, cptr kb_str, int monspell);
extern u16b bolt_pict(int y, int x, int ny, int nx, int typ);
extern sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg);
/* Check the projection path */
grid_n = project_path(grid_g, MAX_RANGE, y1, x1, y2, x2, disint_ball ? PROJECT_DISI : 0);
- breath_shape(grid_g, grid_n, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y2, x2, disint_ball, FALSE);
+ breath_shape(grid_g, grid_n, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y2, x2, disint_ball);
for (i = 0; i < grids; i++)
{
case GF_FORCE:
case GF_HOLY_FIRE:
case GF_HELL_FIRE:
- case GF_DISINTEGRATE:
case GF_PSI:
case GF_PSI_DRAIN:
case GF_TELEKINESIS:
}
break;
}
+
+ case GF_DISINTEGRATE:
+ {
+ /* Destroy mirror */
+ if (is_mirror_grid(c_ptr)) remove_mirror(y, x);
+
+ /* Permanent features don't get effect */
+ /* But not protect monsters and other objects */
+ if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
+ {
+ cave_alter_feat(y, x, FF_HURT_DISI);
+
+ /* Update some things -- similar to GF_KILL_WALL */
+ p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
+ }
+ break;
+ }
}
lite_spot(y, x);
/*
- * Do disintegration effect on the terrain
- * before we decide the region of the effect.
- */
-static bool do_disintegration(int by, int bx, int y, int x)
-{
- feature_type *f_ptr;
-
- /* Disintegration balls explosions are stopped by perma-walls */
- if (!in_disintegration_range(by, bx, y, x)) return FALSE;
-
- /* Destroy mirror */
- if (is_mirror_grid(&cave[y][x])) remove_mirror(y, x);
-
- f_ptr = &f_info[cave[y][x].feat];
-
- /* Permanent features don't get effect */
- /* But not protect monsters and other objects */
- if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
- {
- cave_alter_feat(y, x, FF_HURT_DISI);
-
- /* Update some things -- similar to GF_KILL_WALL */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
- }
-
- return TRUE;
-}
-
-
-/*
* 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, bool disint_ball, bool real_breath)
+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, bool disint_ball)
{
int by = y1;
int bx = x1;
if (disint_ball)
{
/* Disintegration are stopped only by perma-walls */
- if (real_breath)
- {
- /* Destroy terrains */
- if (!do_disintegration(by, bx, y, x)) continue;
- }
- else
- {
- /* No actual disintegration */
- if (!in_disintegration_range(by, bx, y, x)) continue;
- }
+ if (!in_disintegration_range(by, bx, y, x)) continue;
}
else
{
grids++;
}
- if (breath && typ == GF_DISINTEGRATE)
+ if (typ == GF_DISINTEGRATE)
{
- flg |= (PROJECT_DISI);
+ flg |= (PROJECT_GRID);
+ if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
}
/* Calculate the projection path */
{
flg &= ~(PROJECT_HIDE);
- breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, (bool)(typ == GF_DISINTEGRATE), TRUE);
+ breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, (bool)(typ == GF_DISINTEGRATE));
}
else
{
if (typ == GF_DISINTEGRATE)
{
/* Disintegration are stopped only by perma-walls */
- if (!do_disintegration(by, bx, y, x)) continue;
+ if (!in_disintegration_range(by, bx, y, x)) continue;
}
else
{
}
}
+ /* Update stuff if needed */
+ if (p_ptr->update) update_stuff();
/* Check objects */
if (flg & (PROJECT_ITEM))