OSDN Git Service

更新指示に関する変更.
[hengband/hengband.git] / src / spells2.c
index d78d0cb..cd7da5a 100644 (file)
@@ -5262,8 +5262,8 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
 
                        if (!in_generate) /* Normal */
                        {
-                               /* Lose unsafety and runes/mirrors */
-                               c_ptr->info &= ~(CAVE_UNSAFE | CAVE_OBJECT);
+                               /* Lose unsafety */
+                               c_ptr->info &= ~(CAVE_UNSAFE);
 
                                /* Hack -- Notice player affect */
                                if (player_bold(y, x))
@@ -5418,9 +5418,47 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
                }
        }
 
-
        if (!in_generate)
        {
+               /* Process "re-glowing" */
+               for (y = (y1 - r); y <= (y1 + r); y++)
+               {
+                       for (x = (x1 - r); x <= (x1 + r); x++)
+                       {
+                               /* Skip illegal grids */
+                               if (!in_bounds(y, x)) continue;
+
+                               /* Extract the distance */
+                               k = distance(y1, x1, y, x);
+
+                               /* Stay in the circle of death */
+                               if (k > r) continue;
+
+                               /* Access the grid */
+                               c_ptr = &cave[y][x];
+
+                               if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
+                               else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
+                               {
+                                       int i, yy, xx;
+                                       cave_type *cc_ptr;
+
+                                       for (i = 0; i < 9; i++)
+                                       {
+                                               yy = y + ddy_ddd[i];
+                                               xx = x + ddx_ddd[i];
+                                               if (!in_bounds2(yy, xx)) continue;
+                                               cc_ptr = &cave[yy][xx];
+                                               if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
+                                               {
+                                                       c_ptr->info |= CAVE_GLOW;
+                                                       break;
+                                               }
+                                       }
+                               }
+                       }
+               }
+
                /* Hack -- Affect player */
                if (flag)
                {
@@ -5437,11 +5475,6 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
                                /* Become blind */
                                (void)set_blind(p_ptr->blind + 10 + randint1(10));
                        }
-
-                       if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->cur_lite <= 0))
-                       {
-                               if (!(cave[py][px].info & CAVE_GLOW)) set_superstealth(TRUE);
-                       }
                }
 
                forget_flow();
@@ -5450,16 +5483,18 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
                p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
 
                /* Update stuff */
-               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
-
-               /* Update the monsters */
-               p_ptr->update |= (PU_MONSTERS);
+               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
 
                /* Redraw map */
                p_ptr->redraw |= (PR_MAP);
 
                /* Window stuff */
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+
+               if (p_ptr->special_defense & NINJA_S_STEALTH)
+               {
+                       if (cave[py][px].info & CAVE_GLOW) set_superstealth(FALSE);
+               }
        }
 
        /* Success */
@@ -5686,11 +5721,6 @@ if (damage) take_hit(DAMAGE_ATTACK, damage, "
 
        }
 
-       if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->cur_lite <= 0))
-       {
-               if (!(cave[py][px].info & CAVE_GLOW)) set_superstealth(TRUE);
-       }
-
        /* Examine the quaked region */
        for (dy = -r; dy <= r; dy++)
        {
@@ -5871,9 +5901,6 @@ msg_format("%^s
                                /* Delete objects */
                                delete_object(yy, xx);
 
-                               /* Clear mirror, runes flag */
-                               c_ptr->info &= ~CAVE_OBJECT;
-
                                /* Wall (or floor) type */
                                t = cave_have_flag_bold(yy, xx, FF_PROJECT) ? randint0(100) : 200;
 
@@ -5909,14 +5936,52 @@ msg_format("%^s
        }
 
 
+       /* Process "re-glowing" */
+       for (dy = -r; dy <= r; dy++)
+       {
+               for (dx = -r; dx <= r; dx++)
+               {
+                       /* Extract the location */
+                       yy = cy + dy;
+                       xx = cx + dx;
+
+                       /* Skip illegal grids */
+                       if (!in_bounds(yy, xx)) continue;
+
+                       /* Skip distant grids */
+                       if (distance(cy, cx, yy, xx) > r) continue;
+
+                       /* Access the grid */
+                       c_ptr = &cave[yy][xx];
+
+                       if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
+                       else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
+                       {
+                               int ii, yyy, xxx;
+                               cave_type *cc_ptr;
+
+                               for (ii = 0; ii < 9; ii++)
+                               {
+                                       yyy = yy + ddy_ddd[ii];
+                                       xxx = xx + ddx_ddd[ii];
+                                       if (!in_bounds2(yyy, xxx)) continue;
+                                       cc_ptr = &cave[yyy][xxx];
+                                       if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
+                                       {
+                                               c_ptr->info |= CAVE_GLOW;
+                                               break;
+                                       }
+                               }
+                       }
+               }
+       }
+
+
        /* Mega-Hack -- Forget the view and lite */
        p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
 
        /* Update stuff */
-       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
-
-       /* Update the monsters */
-       p_ptr->update |= (PU_DISTANCE);
+       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
 
        /* Update the health bar */
        p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
@@ -5927,6 +5992,11 @@ msg_format("%^s
        /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
+       if (p_ptr->special_defense & NINJA_S_STEALTH)
+       {
+               if (cave[py][px].info & CAVE_GLOW) set_superstealth(FALSE);
+       }
+
        /* Success */
        return (TRUE);
 }
@@ -6116,28 +6186,25 @@ static void cave_temp_room_unlite(void)
                /* Darken the grid */
                if (do_dark)
                {
-                       if (!p_ptr->inside_arena)
+                       for (j = 0; j < 9; j++)
                        {
-                               for (j = 0; j < 9; j++)
+                               int by = y + ddy_ddd[j];
+                               int bx = x + ddx_ddd[j];
+
+                               if (in_bounds2(by, bx))
                                {
-                                       int by = y + ddy_ddd[j];
-                                       int bx = x + ddx_ddd[j];
+                                       cave_type *cc_ptr = &cave[by][bx];
 
-                                       if (in_bounds2(by, bx))
+                                       if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
                                        {
-                                               cave_type *cc_ptr = &cave[by][bx];
-
-                                               if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
-                                               {
-                                                       do_dark = FALSE;
-                                                       break;
-                                               }
+                                               do_dark = FALSE;
+                                               break;
                                        }
                                }
-
-                               if (!do_dark) continue;
                        }
 
+                       if (!do_dark) continue;
+
                        c_ptr->info &= ~(CAVE_GLOW);
 
                        /* Hack -- Forget "boring" grids */
@@ -6385,11 +6452,6 @@ void unlite_room(int y1, int x1)
 
        /* Now, darken them all at once */
        cave_temp_room_unlite();
-
-       if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->cur_lite <= 0))
-       {
-               if (!(cave[py][px].info & CAVE_GLOW)) set_superstealth(TRUE);
-       }
 }
 
 
@@ -6954,17 +7016,11 @@ bool wall_stone(void)
        bool dummy = (project(0, 1, py, px, 0, GF_STONE_WALL, flg, -1));
 
        /* Update stuff */
-       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
-
-       /* Update the monsters */
-       p_ptr->update |= (PU_MONSTERS);
+       p_ptr->update |= (PU_FLOW);
 
        /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
-       /* Window stuff */
-       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-
        return dummy;
 }