OSDN Git Service

吸血鬼, [吸血鬼]の1マス暗視を取り下げ, 以前の永久光源に戻した. なお,
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 21 Jun 2003 12:54:13 +0000 (12:54 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 21 Jun 2003 12:54:13 +0000 (12:54 +0000)
以下の修正を含む.
* update_mon_lite()内で, 限界の距離はモンスターのループ以前に計算して
  おくように修正.
* 性格いかさまの忍者で, 'C'表示で自分自身に光源があるように表示されて
  いたバグを修正.

src/cave.c
src/files.c
src/monster2.c
src/types.h
src/xtra1.c

index 263fcb7..842a32f 100644 (file)
@@ -445,15 +445,8 @@ bool player_can_see_bold(int y, int x)
        /* Require line of sight to the grid */
        if (!player_has_los_bold(y, x)) return (FALSE);
 
-       /* Ninja or Vampire without lite */
-       if (p_ptr->see_nocto > p_ptr->cur_lite)
-       {
-               if (p_ptr->see_nocto == MAX_SIGHT) return TRUE;
-               else
-               {
-                       if ((y >= (py - 1)) && (y <= (py + 1)) && (x >= (px - 1)) && (x <= (px + 1))) return TRUE;
-               }
-       }
+       /* Noctovision of Ninja */
+       if (p_ptr->see_nocto) return TRUE;
 
        /* Require "perma-lite" of the grid */
        if (!(c_ptr->info & CAVE_MNLT) && ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW)) return FALSE;
@@ -892,8 +885,6 @@ void map_info(int y, int x, byte *ap, char *cp)
        byte a;
        byte c;
 
-       bool can_see_dark_grid;
-
        /* Get the cave */
        c_ptr = &cave[y][x];
 
@@ -903,25 +894,11 @@ void map_info(int y, int x, byte *ap, char *cp)
        /* Floors (etc) */
        if ((feat <= FEAT_INVIS) || (feat == FEAT_DIRT) || (feat == FEAT_GRASS))
        {
-               /* Normal */
-               if (p_ptr->see_nocto <= p_ptr->cur_lite) can_see_dark_grid = FALSE;
-
-               /* Ninja or Vampire without lite */
-               else
-               {
-                       if (p_ptr->see_nocto == MAX_SIGHT) can_see_dark_grid = TRUE;
-                       else
-                       {
-                               if ((y < (py - 1)) || (y > (py + 1)) || (x < (px - 1)) || (x > (px + 1))) can_see_dark_grid = FALSE;
-                               else can_see_dark_grid = TRUE;
-                       }
-               }
-
                /* Memorized (or visible) floor */
                if ((c_ptr->info & CAVE_MARK) ||
                  (((c_ptr->info & (CAVE_LITE | CAVE_MNLT)) ||
                   ((c_ptr->info & CAVE_VIEW) &&
-                  (((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) || can_see_dark_grid))) &&
+                 (((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) || p_ptr->see_nocto))) &&
                   !p_ptr->blind))
                {
                        /* Access floor */
@@ -1717,14 +1694,8 @@ void note_spot(int y, int x)
                /* Require "perma-lite" of the grid */
                if (!(c_ptr->info & CAVE_MNLT) && ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW))
                {
-                       /* Neither Ninja nor Vampire without lite */
-                       if (p_ptr->see_nocto <= p_ptr->cur_lite) return;
-
-                       /* Hack -- Vampires' noctovision is limited to adjacent grids */
-                       else if (p_ptr->see_nocto == 1)
-                       {
-                               if ((y < (py - 1)) || (y > (py + 1)) || (x < (px - 1)) || (x > (px + 1))) return;
-                       }
+                       /* Not Ninja */
+                       if (!p_ptr->see_nocto) return;
                }
        }
 
@@ -1778,7 +1749,7 @@ void note_spot(int y, int x)
                        c_ptr->info |= (CAVE_MARK);
                }
 
-               /* Mwemorize walls seen by noctovision of Ninja or Vampire */
+               /* Memorize walls seen by noctovision of Ninja */
                else if (p_ptr->see_nocto)
                {
                        /* Memorize */
@@ -3231,7 +3202,8 @@ void update_mon_lite(void)
        s16b end_temp;
 
        /* Non-Ninja player in the darkness */
-       bool in_darkness = (d_info[dungeon_type].flags1 & DF1_DARKNESS) && (p_ptr->see_nocto < MAX_SIGHT);
+       int dis_lim = ((d_info[dungeon_type].flags1 & DF1_DARKNESS) && !p_ptr->see_nocto) ?
+               (MAX_SIGHT / 2 + 1) : (MAX_SIGHT + 3);
 
        /* Clear all monster lit squares */
        for (i = 0; i < mon_lite_n; i++)
@@ -3259,7 +3231,7 @@ void update_mon_lite(void)
                if (!m_ptr->r_idx) continue;
 
                /* Is it too far away? */
-               if (m_ptr->cdis > (in_darkness ? MAX_SIGHT / 2 + 1 : MAX_SIGHT + 3)) continue;
+               if (m_ptr->cdis > dis_lim) continue;
 
                /* Get lite radius */
                rad = 0;
@@ -4385,25 +4357,6 @@ void update_view(void)
        /* None left */
        temp_n = 0;
 
-
-       /*** Step 6 -- Vampires hack if without lite ***/
-
-       if ((p_ptr->see_nocto == 1) && !p_ptr->cur_lite && !p_ptr->blind)
-       {
-               /* Hack -- Vampires' noctovision is limited to adjacent grids */
-               for (n = 0; n < 9; n++)
-               {
-                       y = py + ddy_ddd[n];
-                       x = px + ddx_ddd[n];
-
-                       /* Access the grid */
-                       c_ptr = &cave[y][x];
-
-                       /* Add it to later visual update */
-                       cave_note_and_redraw_later(c_ptr, y, x);
-               }
-       }
-
        /* Mega-Hack -- Visual update later */
        p_ptr->update |= (PU_DELAY_VIS);
 }
index d4a489f..9b37d7f 100644 (file)
@@ -2308,6 +2308,7 @@ static void player_flags(u32b flgs[TR_FLAG_SIZE])
                        add_flag(flgs, TR_HOLD_LIFE);
                        add_flag(flgs, TR_RES_DARK);
                        add_flag(flgs, TR_RES_NETHER);
+                       if (p_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE);
                        add_flag(flgs, TR_RES_POIS);
                        add_flag(flgs, TR_RES_COLD);
                        add_flag(flgs, TR_SEE_INVIS);
@@ -2455,6 +2456,7 @@ static void player_flags(u32b flgs[TR_FLAG_SIZE])
                add_flag(flgs, TR_HOLD_LIFE);
                add_flag(flgs, TR_RES_DARK);
                add_flag(flgs, TR_RES_NETHER);
+               if (p_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE);
                add_flag(flgs, TR_RES_POIS);
                add_flag(flgs, TR_RES_COLD);
                break;
@@ -2571,7 +2573,7 @@ static void player_flags(u32b flgs[TR_FLAG_SIZE])
                add_flag(flgs, TR_RES_BLIND);
                add_flag(flgs, TR_RES_CONF);
                add_flag(flgs, TR_HOLD_LIFE);
-               add_flag(flgs, TR_LITE);
+               if (p_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE);
                if (p_ptr->lev > 9)
                        add_flag(flgs, TR_SPEED);
        }
index 9622259..f43494d 100644 (file)
@@ -2318,7 +2318,7 @@ void update_mon(int m_idx, bool full)
        bool easy = FALSE;
 
        /* Non-Ninja player in the darkness */
-       bool in_darkness = (d_info[dungeon_type].flags1 & DF1_DARKNESS) && (p_ptr->see_nocto < MAX_SIGHT);
+       bool in_darkness = (d_info[dungeon_type].flags1 & DF1_DARKNESS) && !p_ptr->see_nocto;
 
        /* Do disturb? */
        if (disturb_high)
index 7ce7df9..8396df1 100644 (file)
@@ -1296,6 +1296,7 @@ struct player_type
        bool heavy_spell;
        bool warning;
        bool mighty_throw;
+       bool see_nocto;         /* Noctovision */
 
        s16b to_dd[2]; /* Extra dice/sides */
        s16b to_ds[2];
@@ -1324,7 +1325,6 @@ struct player_type
        s16b ac;                        /* Base ac */
 
        s16b see_infra;         /* Infravision range */
-       s16b see_nocto;         /* Noctovision range */
 
        s16b skill_dis;         /* Skill: Disarming */
        s16b skill_dev;         /* Skill: Magic Devices */
index 9de8852..83f91c8 100644 (file)
@@ -3146,6 +3146,7 @@ void calc_bonuses(void)
        p_ptr->anti_tele = FALSE;
        p_ptr->warning = FALSE;
        p_ptr->mighty_throw = FALSE;
+       p_ptr->see_nocto = FALSE;
 
        p_ptr->immune_acid = FALSE;
        p_ptr->immune_elec = FALSE;
@@ -3165,9 +3166,6 @@ void calc_bonuses(void)
        /* Base infravision (purely racial) */
        p_ptr->see_infra = tmp_rp_ptr->infra;
 
-       /* Base noctovision (If player is neither Ninja nor Vampire, always 0) */
-       p_ptr->see_nocto = 0;
-
        /* Base skill -- disarming */
        p_ptr->skill_dis = tmp_rp_ptr->r_dis + cp_ptr->c_dis + ap_ptr->a_dis;
 
@@ -3311,7 +3309,7 @@ void calc_bonuses(void)
                                p_ptr->oppose_pois = 1;
                                p_ptr->redraw |= PR_STATUS;
                        }
-                       if (p_ptr->see_nocto < MAX_SIGHT) p_ptr->see_nocto = MAX_SIGHT;
+                       p_ptr->see_nocto = TRUE;
                        break;
        }
 
@@ -3365,7 +3363,7 @@ void calc_bonuses(void)
                        new_speed += 3;
                        p_ptr->to_a += 10;
                        p_ptr->dis_to_a += 10;
-                       if (p_ptr->see_nocto < 1) p_ptr->see_nocto = 1;
+                       if (p_ptr->pclass != CLASS_NINJA) p_ptr->lite = TRUE;
                        break;
                }
        }
@@ -3500,7 +3498,7 @@ void calc_bonuses(void)
                        p_ptr->resist_neth = TRUE;
                        p_ptr->resist_cold = TRUE;
                        p_ptr->resist_pois = TRUE;
-                       if (p_ptr->see_nocto < 1) p_ptr->see_nocto = 1;
+                       if (p_ptr->pclass != CLASS_NINJA) p_ptr->lite = TRUE;
                        break;
                case RACE_SPECTRE:
                        p_ptr->ffall = TRUE;
@@ -3652,7 +3650,7 @@ void calc_bonuses(void)
                p_ptr->resist_blind = TRUE;
                p_ptr->resist_conf  = TRUE;
                p_ptr->hold_life = TRUE;
-               if (!p_ptr->see_nocto) p_ptr->lite = TRUE;
+               if (p_ptr->pclass != CLASS_NINJA) p_ptr->lite = TRUE;
 
                if ((p_ptr->prace != RACE_KLACKON) && (p_ptr->prace != RACE_SPRITE))
                        /* Munchkin become faster */