OSDN Git Service

GLOW地形及び周囲8マスは暗黒属性や暗闇生成でも暗くならないように変更.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 7 Dec 2003 14:55:09 +0000 (14:55 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 7 Dec 2003 14:55:09 +0000 (14:55 +0000)
また, update_local_illumination()でプレイヤー自身のマスは更新する必要
がなかったので修正.

src/cave.c
src/spells1.c
src/spells2.c

index 86f2614..d080d0f 100644 (file)
@@ -442,10 +442,10 @@ void update_local_illumination(int y, int x)
        }
        else /* Player's grid */
        {
        }
        else /* Player's grid */
        {
-               for (i = 0; i < 9; i++)
+               for (i = 0; i < 8; i++)
                {
                {
-                       yy = y + ddy_ddd[i];
-                       xx = x + ddx_ddd[i];
+                       yy = y + ddy_cdd[i];
+                       xx = x + ddx_cdd[i];
                        if (!player_has_los_bold(yy, xx)) continue;
 
                        /* Update the monster */
                        if (!player_has_los_bold(yy, xx)) continue;
 
                        /* Update the monster */
index e6df64b..8f5d712 100644 (file)
@@ -1064,35 +1064,46 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                case GF_DARK_WEAK:
                case GF_DARK:
                {
                case GF_DARK_WEAK:
                case GF_DARK:
                {
-                       if (!p_ptr->inside_battle)
+                       bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
+                       int j;
+
+                       /* Turn off the light. */
+                       if (do_dark)
                        {
                        {
-                               /* Turn off the light. */
-                               if (!is_mirror_grid(c_ptr))
+                               for (j = 0; j < 9; j++)
                                {
                                {
-                                       c_ptr->info &= ~(CAVE_GLOW);
-
-                                       /* Hack -- Forget "boring" grids */
-                                       if (!have_flag(f_ptr->flags, FF_REMEMBER))
+                                       if (have_flag(f_flags_bold(y + ddy_ddd[j], x + ddx_ddd[j]), FF_GLOW))
                                        {
                                        {
-                                               /* Forget */
-                                               c_ptr->info &= ~(CAVE_MARK);
-
-                                               /* Notice */
-                                               note_spot(y, x);
+                                               do_dark = FALSE;
+                                               break;
                                        }
                                        }
+                               }
 
 
-                                       /* Redraw */
-                                       lite_spot(y, x);
+                               if (!do_dark) break;
 
 
-                                       update_local_illumination(y, x);
+                               c_ptr->info &= ~(CAVE_GLOW);
 
 
-                                       /* Notice */
-                                       if (player_can_see_bold(y, x)) obvious = TRUE;
+                               /* Hack -- Forget "boring" grids */
+                               if (!have_flag(f_ptr->flags, FF_REMEMBER))
+                               {
+                                       /* Forget */
+                                       c_ptr->info &= ~(CAVE_MARK);
 
 
-                                       /* Mega-Hack -- Update the monster in the affected grid */
-                                       /* This allows "spear of light" (etc) to work "correctly" */
-                                       if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+                                       /* Notice */
+                                       note_spot(y, x);
                                }
                                }
+
+                               /* Redraw */
+                               lite_spot(y, x);
+
+                               update_local_illumination(y, x);
+
+                               /* Notice */
+                               if (player_can_see_bold(y, x)) obvious = TRUE;
+
+                               /* Mega-Hack -- Update the monster in the affected grid */
+                               /* This allows "spear of light" (etc) to work "correctly" */
+                               if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
                        }
 
                        /* All done */
                        }
 
                        /* All done */
index 746e54a..e786125 100644 (file)
@@ -6091,15 +6091,28 @@ static void cave_temp_room_unlite(void)
        {
                int y = temp_y[i];
                int x = temp_x[i];
        {
                int y = temp_y[i];
                int x = temp_x[i];
+               int j;
 
                cave_type *c_ptr = &cave[y][x];
 
                cave_type *c_ptr = &cave[y][x];
+               bool do_dark = !is_mirror_grid(c_ptr);
 
                /* No longer in the array */
                c_ptr->info &= ~(CAVE_TEMP);
 
                /* Darken the grid */
 
                /* No longer in the array */
                c_ptr->info &= ~(CAVE_TEMP);
 
                /* Darken the grid */
-               if (!is_mirror_grid(c_ptr))
+               if (do_dark)
                {
                {
+                       for (j = 0; j < 9; j++)
+                       {
+                               if (have_flag(f_flags_bold(y + ddy_ddd[j], x + ddx_ddd[j]), FF_GLOW))
+                               {
+                                       do_dark = FALSE;
+                                       break;
+                               }
+                       }
+
+                       if (!do_dark) continue;
+
                        c_ptr->info &= ~(CAVE_GLOW);
 
                        /* Hack -- Forget "boring" grids */
                        c_ptr->info &= ~(CAVE_GLOW);
 
                        /* Hack -- Forget "boring" grids */