OSDN Git Service

分解属性の地形破壊をproject_f()で見るように変更. また, 分解属性のビー
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 1 Dec 2003 13:00:43 +0000 (13:00 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 1 Dec 2003 13:00:43 +0000 (13:00 +0000)
ムである場合はPROJECT_DISIを有効にするように変更. これにより, カオス
魔法 "混沌召来" で分解ビームが出た場合に一列を破壊するようにした. な
お, 以下の変更を含む.
* cave_stop_disintegration()の判定に!HURT_DISIがなかったので修正.
* breath_shapeから変数real_breath削除.
* 分解属性は地形が破壊されて当然の属性であり, PROJECT_GRIDを内部で必
  ず立てるようにした.
* do_disintegration()削除.
* 分解に限らず地形が破壊された後には視界が変わる可能性があるため, 必
  要であればアイテム処理の直前にupdate_stuff()を呼ぶようにした.

src/defines.h
src/externs.h
src/mspells2.c
src/spells1.c

index 113d15a..05697ef 100644 (file)
  */
 #define cave_stop_disintegration(Y,X) \
        (!have_flag(f_flags_bold((Y), (X)), FF_PROJECT) && \
-        have_flag(f_flags_bold((Y), (X)), FF_PERMANENT))
+        (!have_flag(f_flags_bold((Y), (X)), FF_HURT_DISI) || \
+         have_flag(f_flags_bold((Y), (X)), FF_PERMANENT)))
 
 
 /*
index 7f05edc..270f763 100644 (file)
@@ -1004,7 +1004,7 @@ extern bool save_floor(saved_floor_type *sf_ptr, u32b mode);
 
 /* 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);
index 6d674e7..c5dbe72 100644 (file)
@@ -131,7 +131,7 @@ static bool breath_direct(int y1, int x1, int y2, int x2, int rad, bool disint_b
 
        /* 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++)
        {
index d1a034c..1771e41 100644 (file)
@@ -686,7 +686,6 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                case GF_FORCE:
                case GF_HOLY_FIRE:
                case GF_HELL_FIRE:
-               case GF_DISINTEGRATE:
                case GF_PSI:
                case GF_PSI_DRAIN:
                case GF_TELEKINESIS:
@@ -1109,6 +1108,23 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                        }
                        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);
@@ -7959,39 +7975,9 @@ bool in_disintegration_range(int y1, int x1, int y2, int x2)
 
 
 /*
- *  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;
@@ -8043,16 +8029,7 @@ void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte
                                        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
                                        {
@@ -8367,9 +8344,10 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons
                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 */
@@ -8773,7 +8751,7 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons
                {
                        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
                {
@@ -8794,7 +8772,7 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons
                                                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
                                                {
@@ -8929,6 +8907,8 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons
                }
        }
 
+       /* Update stuff if needed */
+       if (p_ptr->update) update_stuff();
 
        /* Check objects */
        if (flg & (PROJECT_ITEM))