OSDN Git Service

モンスターの暗黒光源を実装.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 20 Jun 2003 15:13:34 +0000 (15:13 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 20 Jun 2003 15:13:34 +0000 (15:13 +0000)
* HAS_DARK_{1|2}, SELF_DARK_{1|2}で使用可能. 最大半径3.
* 暗黒光源は普通の光源には負ける.
* 暗黒光源のあるモンスターは対忍者でも閃光を使わない.
* 暗黒光源範囲では忍者の超隠密条件に影響しない. これは暗黒光源持ちは
  自分の闇からの不意打ちを受けない解釈による.
* 暗黒光源の中でも赤外線やテレパシー/ESPは有効.
* 話し合いで決まったモンスターに実験的に与えてある. モンスターでの修
  正は必要と思われる.

13 files changed:
lib/edit/r_info.txt
src/cave.c
src/cmd1.c
src/defines.h
src/dungeon.c
src/init1.c
src/load.c
src/melee2.c
src/monster1.c
src/monster2.c
src/mspells1.c
src/xtra1.c
src/xtra2.c

index 7f58eae..b9e5536 100644 (file)
@@ -4515,7 +4515,7 @@ I:110:6d6:30:30:0
 W:15:1:0:50:0:0
 B:BITE:HURT:1d6
 F:FORCE_SLEEP | DROP_CORPSE
-F:FRIENDS | 
+F:FRIENDS | SELF_DARK_1 | SELF_DARK_2 |
 F:BASH_DOOR | HURT_LITE | 
 F:ANIMAL
 S:1_IN_5 | 
@@ -8111,7 +8111,7 @@ W:33:3:0:700:15000:643
 B:CLAW:HURT:2d4
 B:CLAW:HURT:2d4
 B:BITE:EXP_10:3d6
-F:FORCE_SLEEP | FORCE_MAXHP
+F:FORCE_SLEEP | FORCE_MAXHP | SELF_DARK_1
 F:ONLY_ITEM | DROP_2D2 |
 F:INVISIBLE | OPEN_DOOR | BASH_DOOR |
 F:EVIL | DRAGON | NO_CONF | NO_SLEEP 
@@ -11664,7 +11664,7 @@ B:CLAW:HURT:4d10
 B:CLAW:HURT:4d10
 B:BITE:EXP_80:3d6
 B:BITE:EXP_80:3d6
-F:FORCE_SLEEP | FORCE_MAXHP | 
+F:FORCE_SLEEP | FORCE_MAXHP | SELF_DARK_1 |
 F:ONLY_ITEM | DROP_2D2 | DROP_4D2 | RES_TELE
 F:INVISIBLE | TAKE_ITEM | CAN_FLY |
 F:PASS_WALL | POWERFUL | MOVE_BODY | RES_NETH |
@@ -12193,7 +12193,7 @@ B:GAZE:EXP_40
 B:GAZE:PARALYZE
 B:GAZE:LOSE_INT:2d6
 B:GAZE:DR_MANA:4d6
-F:FORCE_SLEEP | FORCE_MAXHP | RES_TELE
+F:FORCE_SLEEP | FORCE_MAXHP | RES_TELE | HAS_DARK_1 |
 F:COLD_BLOOD | BASH_DOOR | 
 F:EVIL | UNDEAD | CAN_FLY |
 F:IM_ACID | IM_FIRE | IM_COLD | IM_ELEC | IM_POIS | 
@@ -12222,7 +12222,7 @@ B:TOUCH:DR_MANA:2d10
 B:CLAW:LOSE_INT:1d10
 B:CLAW:LOSE_WIS:1d10
 F:FORCE_SLEEP | CAN_FLY |
-F:ONLY_ITEM | DROP_1D2 | POWERFUL | REGENERATE | HURT_LITE |
+F:ONLY_ITEM | DROP_1D2 | POWERFUL | REGENERATE | HURT_LITE | SELF_DARK_1 |
 F:INVISIBLE | COLD_BLOOD | PASS_WALL | FRIENDS | RES_NETH |
 F:EVIL | DEMON | IM_COLD | IM_POIS | NO_CONF | NO_SLEEP
 S:1_IN_8 | 
@@ -15060,7 +15060,7 @@ B:HIT:EXP_80:6d12
 B:HIT:DR_MANA:5d10
 B:HIT:LOSE_STR:4d6
 B:GAZE:TERRIFY:4d6
-F:FORCE_SLEEP | FORCE_MAXHP | 
+F:FORCE_SLEEP | FORCE_MAXHP | SELF_DARK_2 |
 F:ONLY_ITEM | DROP_2D2 | DROP_3D2 | DROP_4D2 | 
 F:INVISIBLE | COLD_BLOOD | TAKE_ITEM | PASS_WALL | 
 F:EVIL | UNDEAD | CAN_FLY |
@@ -15542,7 +15542,7 @@ B:HIT:HURT:10d10
 B:HIT:LOSE_STR:4d6
 B:HIT:LOSE_STR:4d6
 F:UNIQUE | MALE | 
-F:FORCE_SLEEP | FORCE_MAXHP | CAN_SPEAK | CAN_FLY |
+F:FORCE_SLEEP | FORCE_MAXHP | CAN_SPEAK | CAN_FLY | HAS_DARK_2 |
 F:ONLY_ITEM | DROP_3D2 | DROP_4D2 | DROP_GOOD | 
 F:INVISIBLE | COLD_BLOOD | PASS_WALL | 
 F:EVIL | UNDEAD | IM_COLD | AURA_COLD |
@@ -15835,7 +15835,7 @@ B:TOUCH:DR_MANA:6d16
 F:PASS_WALL | NO_CONF | NO_SLEEP | NONLIVING | IM_ACID | CAN_FLY |
 F:ONLY_ITEM | DROP_2D2 | DROP_4D2 | DROP_GOOD | SMART | EVIL |
 F:ELDRITCH_HORROR | IM_COLD | RES_NETH | NO_STUN | UNIQUE |
-F:REGENERATE | FORCE_MAXHP
+F:REGENERATE | FORCE_MAXHP | SELF_DARK_1 | SELF_DARK_2
 S:1_IN_5
 S:BR_NETH | BRAIN_SMASH | SCARE | S_UNDEAD | S_HI_UNDEAD |
 S:DRAIN_MANA | HEAL | ANIM_DEAD
@@ -15986,7 +15986,7 @@ B:BITE:POISON:3d9
 B:STING:POISON:2d5
 B:STING:POISON:2d5
 F:UNIQUE | FEMALE | 
-F:FORCE_SLEEP | FORCE_MAXHP | DROP_CORPSE 
+F:FORCE_SLEEP | FORCE_MAXHP | DROP_CORPSE | SELF_DARK_1 | SELF_DARK_2 |
 F:ONLY_ITEM | DROP_4D2 | DROP_GOOD | 
 F:SMART | BASH_DOOR | 
 F:ANIMAL | EVIL | IM_POIS | HURT_LITE | NO_CONF | NO_SLEEP
@@ -16547,7 +16547,7 @@ B:CRUSH:HURT:15d15
 B:CRUSH:HURT:15d15
 B:CRUSH:HURT:15d15
 F:UNIQUE | CAN_SPEAK | RES_TELE | ELDRITCH_HORROR | CAN_FLY |
-F:FORCE_SLEEP | FORCE_MAXHP | SMART | 
+F:FORCE_SLEEP | FORCE_MAXHP | SMART | SELF_DARK_1 | SELF_DARK_2 |
 F:ONLY_ITEM | DROP_3D2 | DROP_4D2 | DROP_GOOD | 
 F:COLD_BLOOD | OPEN_DOOR | BASH_DOOR | MOVE_BODY | 
 F:EVIL | DEMON | IM_ACID | IM_ELEC |
@@ -17634,7 +17634,7 @@ B:HIT:SHATTER:20d10
 B:HIT:LOSE_ALL:10d12
 B:TOUCH:UN_POWER
 F:UNIQUE | MALE | 
-F:FORCE_SLEEP | FORCE_MAXHP | FORCE_DEPTH | 
+F:FORCE_SLEEP | FORCE_MAXHP | FORCE_DEPTH | SELF_DARK_1 | SELF_DARK_2 |
 F:ONLY_ITEM | DROP_1D2 | DROP_2D2 | DROP_3D2 | DROP_4D2 | 
 F:DROP_GOOD | DROP_GREAT |
 F:SMART | KILL_WALL | MOVE_BODY | AURA_COLD |
index b59d8a3..263fcb7 100644 (file)
@@ -456,7 +456,7 @@ bool player_can_see_bold(int y, int x)
        }
 
        /* Require "perma-lite" of the grid */
-       if (!(c_ptr->info & (CAVE_GLOW | CAVE_MNLT))) return (FALSE);
+       if (!(c_ptr->info & CAVE_MNLT) && ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW)) return FALSE;
 
        /* Floors are simple */
        if (cave_floor_bold(y, x)) return (TRUE);
@@ -466,7 +466,7 @@ bool player_can_see_bold(int y, int x)
        xx = (x < px) ? (x + 1) : (x > px) ? (x - 1) : x;
 
        /* Check for "local" illumination */
-       if (cave[yy][xx].info & (CAVE_GLOW | CAVE_MNLT))
+       if ((cave[yy][xx].info & CAVE_MNLT) || ((cave[yy][xx].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW))
        {
                /* Assume the wall is really illuminated */
                return (TRUE);
@@ -921,7 +921,7 @@ void map_info(int y, int x, byte *ap, char *cp)
                if ((c_ptr->info & CAVE_MARK) ||
                  (((c_ptr->info & (CAVE_LITE | CAVE_MNLT)) ||
                   ((c_ptr->info & CAVE_VIEW) &&
-                  ((c_ptr->info & CAVE_GLOW) || can_see_dark_grid))) &&
+                  (((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) || can_see_dark_grid))) &&
                   !p_ptr->blind))
                {
                        /* Access floor */
@@ -981,7 +981,7 @@ void map_info(int y, int x, byte *ap, char *cp)
                                }
 
                                /* Handle "dark" grids */
-                               else if (!(c_ptr->info & CAVE_GLOW))
+                               else if ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW)
                                {
                                        if (use_graphics)
                                        {
@@ -1117,7 +1117,7 @@ void map_info(int y, int x, byte *ap, char *cp)
                                        }
 
                                        /* Not glowing */
-                                       else if (!(c_ptr->info & CAVE_GLOW))
+                                       else if ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW)
                                        {
                                                if (is_ascii_graphics(a))
                                                {
@@ -1185,7 +1185,7 @@ void map_info(int y, int x, byte *ap, char *cp)
                                        }
 
                                        /* Not glowing */
-                                       else if (!(c_ptr->info & CAVE_GLOW))
+                                       else if ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW)
                                        {
                                                if (use_graphics)
                                                {
@@ -1208,7 +1208,7 @@ void map_info(int y, int x, byte *ap, char *cp)
                                                xx = (x < px) ? (x + 1) : (x > px) ? (x - 1) : x;
 
                                                /* Check for "local" illumination */
-                                               if (!(cave[yy][xx].info & CAVE_GLOW))
+                                               if ((cave[yy][xx].info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW)
                                                {
                                                        if (use_graphics)
                                                        {
@@ -1715,7 +1715,7 @@ void note_spot(int y, int x)
                if (!(c_ptr->info & (CAVE_VIEW))) return;
 
                /* Require "perma-lite" of the grid */
-               if (!(c_ptr->info & (CAVE_GLOW | CAVE_MNLT)))
+               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;
@@ -1757,7 +1757,7 @@ void note_spot(int y, int x)
                        }
 
                        /* Option -- memorize all perma-lit floors */
-                       else if (view_perma_grids && (c_ptr->info & (CAVE_GLOW)))
+                       else if (view_perma_grids && ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW))
                        {
                                /* Memorize */
                                c_ptr->info |= (CAVE_MARK);
@@ -1795,7 +1795,7 @@ void note_spot(int y, int x)
                        xx = (x < px) ? (x + 1) : (x > px) ? (x - 1) : x;
 
                        /* Check for "local" illumination */
-                       if (cave[yy][xx].info & (CAVE_GLOW))
+                       if ((cave[yy][xx].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
                        {
                                /* Memorize */
                                c_ptr->info |= (CAVE_MARK);
@@ -3156,28 +3156,68 @@ static void mon_lite_hack(int y, int x)
        /* Hack XXX XXX - Is it a wall and monster not in LOS? */
        if (!cave_floor_grid(c_ptr) && mon_invis) return;
 
-       /* Save this square */
        if (temp_n < TEMP_MAX)
        {
+               /* New grid */
+               if (!(c_ptr->info & CAVE_MNDK))
+               {
+                       /* Save this square */
+                       temp_x[temp_n] = x;
+                       temp_y[temp_n] = y;
+                       temp_n++;
+               }
+
+               /* Darkened grid */
+               else
+               {
+                       /* No longer dark */
+                       c_ptr->info &= ~(CAVE_MNDK);
+               }
+
+               /* Light it */
+               c_ptr->info |= CAVE_MNLT;
+       }
+}
+
+
+/*
+ * Add a square to the changes array
+ */
+static void mon_dark_hack(int y, int x)
+{
+       cave_type *c_ptr;
+
+       /* Out of bounds */
+       if (!in_bounds2(y, x)) return;
+
+       c_ptr = &cave[y][x];
+
+       /* Want a unlit and undarkened square in view of the player */
+       if ((c_ptr->info & (CAVE_LITE | CAVE_MNLT)) || ((c_ptr->info & (CAVE_MNDK | CAVE_VIEW)) != CAVE_VIEW)) return;
+
+       /* Hack XXX XXX - Is it a wall and monster not in LOS? */
+       if (!cave_floor_grid(c_ptr) && mon_invis) return;
+
+       if (temp_n < TEMP_MAX)
+       {
+               /* Save this square */
                temp_x[temp_n] = x;
                temp_y[temp_n] = y;
                temp_n++;
-       }
 
-       /* Light it */
-       c_ptr->info |= CAVE_MNLT;
+               /* Darken it */
+               c_ptr->info |= CAVE_MNDK;
+       }
 }
 
-
 
 /*
- * Update squares illuminated by monsters.
+ * Update squares illuminated or darkened by monsters.
  *
  * Hack - use the CAVE_ROOM flag (renamed to be CAVE_MNLT) to
  * denote squares illuminated by monsters.
  *
- * The CAVE_TEMP flag is used to store the state during the
+ * The CAVE_TEMP and CAVE_XTRA flag are used to store the state during the
  * updating.  Only squares in view of the player, whos state
  * changes are drawn via lite_spot().
  */
@@ -3199,11 +3239,11 @@ void update_mon_lite(void)
                /* Point to grid */
                c_ptr = &cave[mon_lite_y[i]][mon_lite_x[i]];
 
-               /* Set temp flag */
-               c_ptr->info |= (CAVE_TEMP);
+               /* Set temp or xtra flag */
+               c_ptr->info |= (c_ptr->info & CAVE_MNLT) ? CAVE_TEMP : CAVE_XTRA;
 
                /* Clear monster illumination flag */
-               c_ptr->info &= ~(CAVE_MNLT);
+               c_ptr->info &= ~(CAVE_MNLT | CAVE_MNDK);
        }
 
        /* Empty temp list of new squares to lite up */
@@ -3227,15 +3267,23 @@ void update_mon_lite(void)
                /* Note the radii are cumulative */
                if (r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_SELF_LITE_1)) rad++;
                if (r_ptr->flags7 & (RF7_HAS_LITE_2 | RF7_SELF_LITE_2)) rad += 2;
+               if (r_ptr->flags7 & (RF7_HAS_DARK_1 | RF7_SELF_DARK_1)) rad--;
+               if (r_ptr->flags7 & (RF7_HAS_DARK_2 | RF7_SELF_DARK_2)) rad -= 2;
 
                /* Exit if has no light */
                if (!rad) continue;
-               if (!(r_ptr->flags7 & (RF7_SELF_LITE_1 | RF7_SELF_LITE_2)) && (m_ptr->csleep || (!dun_level && is_daytime()) || p_ptr->inside_battle)) continue;
+               else if (rad > 0)
+               {
+                       if (!(r_ptr->flags7 & (RF7_SELF_LITE_1 | RF7_SELF_LITE_2)) && (m_ptr->csleep || (!dun_level && is_daytime()) || p_ptr->inside_battle)) continue;
+                       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) rad = 1;
+               }
+               else
+               {
+                       if (!(r_ptr->flags7 & (RF7_SELF_DARK_1 | RF7_SELF_DARK_2)) && (m_ptr->csleep || (!dun_level && !is_daytime()))) continue;
+               }
 
                if (world_monster) continue;
 
-               if (d_info[dungeon_type].flags1 & DF1_DARKNESS) rad = 1;
-
                /* Access the location */
                fx = m_ptr->fx;
                fy = m_ptr->fy;
@@ -3243,120 +3291,242 @@ void update_mon_lite(void)
                /* Is the monster visible? */
                mon_invis = !(cave[fy][fx].info & CAVE_VIEW);
 
-               /* The square it is on */
-               mon_lite_hack(fy, fx);
-
-               /* Adjacent squares */
-               mon_lite_hack(fy + 1, fx);
-               mon_lite_hack(fy - 1, fx);
-               mon_lite_hack(fy, fx + 1);
-               mon_lite_hack(fy, fx - 1);
-               mon_lite_hack(fy + 1, fx + 1);
-               mon_lite_hack(fy + 1, fx - 1);
-               mon_lite_hack(fy - 1, fx + 1);
-               mon_lite_hack(fy - 1, fx - 1);
-
-               /* Radius 2 */
-               if (rad >= 2)
+               if (rad > 0) /* Lite */
                {
-                       /* South of the monster */
-                       if (cave_floor_bold(fy + 1, fx))
+                       /* The square it is on */
+                       mon_lite_hack(fy, fx);
+
+                       /* Adjacent squares */
+                       mon_lite_hack(fy + 1, fx);
+                       mon_lite_hack(fy - 1, fx);
+                       mon_lite_hack(fy, fx + 1);
+                       mon_lite_hack(fy, fx - 1);
+                       mon_lite_hack(fy + 1, fx + 1);
+                       mon_lite_hack(fy + 1, fx - 1);
+                       mon_lite_hack(fy - 1, fx + 1);
+                       mon_lite_hack(fy - 1, fx - 1);
+
+                       /* Radius 2 */
+                       if (rad >= 2)
                        {
-                               mon_lite_hack(fy + 2, fx + 1);
-                               mon_lite_hack(fy + 2, fx);
-                               mon_lite_hack(fy + 2, fx - 1);
+                               /* South of the monster */
+                               if (cave_floor_bold(fy + 1, fx))
+                               {
+                                       mon_lite_hack(fy + 2, fx + 1);
+                                       mon_lite_hack(fy + 2, fx);
+                                       mon_lite_hack(fy + 2, fx - 1);
 
-                               c_ptr = &cave[fy + 2][fx];
+                                       c_ptr = &cave[fy + 2][fx];
 
-                               /* Radius 3 */
-                               if ((rad == 3) && cave_floor_grid(c_ptr))
-                               {
-                                       mon_lite_hack(fy + 3, fx + 1);
-                                       mon_lite_hack(fy + 3, fx);
-                                       mon_lite_hack(fy + 3, fx - 1);
+                                       /* Radius 3 */
+                                       if ((rad == 3) && cave_floor_grid(c_ptr))
+                                       {
+                                               mon_lite_hack(fy + 3, fx + 1);
+                                               mon_lite_hack(fy + 3, fx);
+                                               mon_lite_hack(fy + 3, fx - 1);
+                                       }
                                }
-                       }
 
-                       /* North of the monster */
-                       if (cave_floor_bold(fy - 1, fx))
-                       {
-                               mon_lite_hack(fy - 2, fx + 1);
-                               mon_lite_hack(fy - 2, fx);
-                               mon_lite_hack(fy - 2, fx - 1);
+                               /* North of the monster */
+                               if (cave_floor_bold(fy - 1, fx))
+                               {
+                                       mon_lite_hack(fy - 2, fx + 1);
+                                       mon_lite_hack(fy - 2, fx);
+                                       mon_lite_hack(fy - 2, fx - 1);
 
-                               c_ptr = &cave[fy - 2][fx];
+                                       c_ptr = &cave[fy - 2][fx];
 
-                               /* Radius 3 */
-                               if ((rad == 3) && cave_floor_grid(c_ptr))
-                               {
-                                       mon_lite_hack(fy - 3, fx + 1);
-                                       mon_lite_hack(fy - 3, fx);
-                                       mon_lite_hack(fy - 3, fx - 1);
+                                       /* Radius 3 */
+                                       if ((rad == 3) && cave_floor_grid(c_ptr))
+                                       {
+                                               mon_lite_hack(fy - 3, fx + 1);
+                                               mon_lite_hack(fy - 3, fx);
+                                               mon_lite_hack(fy - 3, fx - 1);
+                                       }
                                }
-                       }
 
-                       /* East of the monster */
-                       if (cave_floor_bold(fy, fx + 1))
-                       {
-                               mon_lite_hack(fy + 1, fx + 2);
-                               mon_lite_hack(fy, fx + 2);
-                               mon_lite_hack(fy - 1, fx + 2);
+                               /* East of the monster */
+                               if (cave_floor_bold(fy, fx + 1))
+                               {
+                                       mon_lite_hack(fy + 1, fx + 2);
+                                       mon_lite_hack(fy, fx + 2);
+                                       mon_lite_hack(fy - 1, fx + 2);
 
-                               c_ptr = &cave[fy][fx + 2];
+                                       c_ptr = &cave[fy][fx + 2];
 
-                               /* Radius 3 */
-                               if ((rad == 3) && cave_floor_grid(c_ptr))
+                                       /* Radius 3 */
+                                       if ((rad == 3) && cave_floor_grid(c_ptr))
+                                       {
+                                               mon_lite_hack(fy + 1, fx + 3);
+                                               mon_lite_hack(fy, fx + 3);
+                                               mon_lite_hack(fy - 1, fx + 3);
+                                       }
+                               }
+
+                               /* West of the monster */
+                               if (cave_floor_bold(fy, fx - 1))
                                {
-                                       mon_lite_hack(fy + 1, fx + 3);
-                                       mon_lite_hack(fy, fx + 3);
-                                       mon_lite_hack(fy - 1, fx + 3);
+                                       mon_lite_hack(fy + 1, fx - 2);
+                                       mon_lite_hack(fy, fx - 2);
+                                       mon_lite_hack(fy - 1, fx - 2);
+
+                                       c_ptr = &cave[fy][fx - 2];
+
+                                       /* Radius 3 */
+                                       if ((rad == 3) && cave_floor_grid(c_ptr))
+                                       {
+                                               mon_lite_hack(fy + 1, fx - 3);
+                                               mon_lite_hack(fy, fx - 3);
+                                               mon_lite_hack(fy - 1, fx - 3);
+                                       }
                                }
                        }
 
-                       /* West of the monster */
-                       if (cave_floor_bold(fy, fx - 1))
+                       /* Radius 3 */
+                       if (rad == 3)
                        {
-                               mon_lite_hack(fy + 1, fx - 2);
-                               mon_lite_hack(fy, fx - 2);
-                               mon_lite_hack(fy - 1, fx - 2);
+                               /* South-East of the monster */
+                               if (cave_floor_bold(fy + 1, fx + 1))
+                               {
+                                       mon_lite_hack(fy + 2, fx + 2);
+                               }
+
+                               /* South-West of the monster */
+                               if (cave_floor_bold(fy + 1, fx - 1))
+                               {
+                                       mon_lite_hack(fy + 2, fx - 2);
+                               }
 
-                               c_ptr = &cave[fy][fx - 2];
+                               /* North-East of the monster */
+                               if (cave_floor_bold(fy - 1, fx + 1))
+                               {
+                                       mon_lite_hack(fy - 2, fx + 2);
+                               }
 
-                               /* Radius 3 */
-                               if ((rad == 3) && cave_floor_grid(c_ptr))
+                               /* North-West of the monster */
+                               if (cave_floor_bold(fy - 1, fx - 1))
                                {
-                                       mon_lite_hack(fy + 1, fx - 3);
-                                       mon_lite_hack(fy, fx - 3);
-                                       mon_lite_hack(fy - 1, fx - 3);
+                                       mon_lite_hack(fy - 2, fx - 2);
                                }
                        }
                }
-
-               /* Radius 3 */
-               if (rad == 3)
+               else /* Dark (rad < 0) */
                {
-                       /* South-East of the monster */
-                       if (cave_floor_bold(fy + 1, fx + 1))
+                       /* The square it is on */
+                       mon_dark_hack(fy, fx);
+
+                       /* Adjacent squares */
+                       mon_dark_hack(fy + 1, fx);
+                       mon_dark_hack(fy - 1, fx);
+                       mon_dark_hack(fy, fx + 1);
+                       mon_dark_hack(fy, fx - 1);
+                       mon_dark_hack(fy + 1, fx + 1);
+                       mon_dark_hack(fy + 1, fx - 1);
+                       mon_dark_hack(fy - 1, fx + 1);
+                       mon_dark_hack(fy - 1, fx - 1);
+
+                       /* Radius -2 */
+                       if (rad <= -2)
                        {
-                               mon_lite_hack(fy + 2, fx + 2);
-                       }
+                               /* South of the monster */
+                               if (cave_floor_bold(fy + 1, fx))
+                               {
+                                       mon_dark_hack(fy + 2, fx + 1);
+                                       mon_dark_hack(fy + 2, fx);
+                                       mon_dark_hack(fy + 2, fx - 1);
 
-                       /* South-West of the monster */
-                       if (cave_floor_bold(fy + 1, fx - 1))
-                       {
-                               mon_lite_hack(fy + 2, fx - 2);
-                       }
+                                       c_ptr = &cave[fy + 2][fx];
 
-                       /* North-East of the monster */
-                       if (cave_floor_bold(fy - 1, fx + 1))
-                       {
-                               mon_lite_hack(fy - 2, fx + 2);
+                                       /* Radius -3 */
+                                       if ((rad == -3) && cave_floor_grid(c_ptr))
+                                       {
+                                               mon_dark_hack(fy + 3, fx + 1);
+                                               mon_dark_hack(fy + 3, fx);
+                                               mon_dark_hack(fy + 3, fx - 1);
+                                       }
+                               }
+
+                               /* North of the monster */
+                               if (cave_floor_bold(fy - 1, fx))
+                               {
+                                       mon_dark_hack(fy - 2, fx + 1);
+                                       mon_dark_hack(fy - 2, fx);
+                                       mon_dark_hack(fy - 2, fx - 1);
+
+                                       c_ptr = &cave[fy - 2][fx];
+
+                                       /* Radius -3 */
+                                       if ((rad == -3) && cave_floor_grid(c_ptr))
+                                       {
+                                               mon_dark_hack(fy - 3, fx + 1);
+                                               mon_dark_hack(fy - 3, fx);
+                                               mon_dark_hack(fy - 3, fx - 1);
+                                       }
+                               }
+
+                               /* East of the monster */
+                               if (cave_floor_bold(fy, fx + 1))
+                               {
+                                       mon_dark_hack(fy + 1, fx + 2);
+                                       mon_dark_hack(fy, fx + 2);
+                                       mon_dark_hack(fy - 1, fx + 2);
+
+                                       c_ptr = &cave[fy][fx + 2];
+
+                                       /* Radius -3 */
+                                       if ((rad == -3) && cave_floor_grid(c_ptr))
+                                       {
+                                               mon_dark_hack(fy + 1, fx + 3);
+                                               mon_dark_hack(fy, fx + 3);
+                                               mon_dark_hack(fy - 1, fx + 3);
+                                       }
+                               }
+
+                               /* West of the monster */
+                               if (cave_floor_bold(fy, fx - 1))
+                               {
+                                       mon_dark_hack(fy + 1, fx - 2);
+                                       mon_dark_hack(fy, fx - 2);
+                                       mon_dark_hack(fy - 1, fx - 2);
+
+                                       c_ptr = &cave[fy][fx - 2];
+
+                                       /* Radius -3 */
+                                       if ((rad == -3) && cave_floor_grid(c_ptr))
+                                       {
+                                               mon_dark_hack(fy + 1, fx - 3);
+                                               mon_dark_hack(fy, fx - 3);
+                                               mon_dark_hack(fy - 1, fx - 3);
+                                       }
+                               }
                        }
 
-                       /* North-West of the monster */
-                       if (cave_floor_bold(fy - 1, fx - 1))
+                       /* Radius -3 */
+                       if (rad == -3)
                        {
-                               mon_lite_hack(fy - 2, fx - 2);
+                               /* South-East of the monster */
+                               if (cave_floor_bold(fy + 1, fx + 1))
+                               {
+                                       mon_dark_hack(fy + 2, fx + 2);
+                               }
+
+                               /* South-West of the monster */
+                               if (cave_floor_bold(fy + 1, fx - 1))
+                               {
+                                       mon_dark_hack(fy + 2, fx - 2);
+                               }
+
+                               /* North-East of the monster */
+                               if (cave_floor_bold(fy - 1, fx + 1))
+                               {
+                                       mon_dark_hack(fy - 2, fx + 2);
+                               }
+
+                               /* North-West of the monster */
+                               if (cave_floor_bold(fy - 1, fx - 1))
+                               {
+                                       mon_dark_hack(fy - 2, fx - 2);
+                               }
                        }
                }
        }
@@ -3372,16 +3542,30 @@ void update_mon_lite(void)
                fx = mon_lite_x[i];
                fy = mon_lite_y[i];
 
-               if (!in_bounds2(fy, fx)) continue;
+               /* We trust this grid is in bounds */
 
                /* Point to grid */
                c_ptr = &cave[fy][fx];
 
-               /* It it no longer lit? */
-               if (!(c_ptr->info & CAVE_MNLT) && player_has_los_grid(c_ptr))
+               if (c_ptr->info & CAVE_TEMP) /* Pervious lit */
                {
-                       /* Add it to later visual update */
-                       cave_note_and_redraw_later(c_ptr, fy, fx);
+                       /* It it no longer lit? */
+                       if ((c_ptr->info & (CAVE_VIEW | CAVE_MNLT)) == CAVE_VIEW)
+                       {
+                               /* It is now unlit */
+                               /* Add it to later visual update */
+                               cave_note_and_redraw_later(c_ptr, fy, fx);
+                       }
+               }
+               else /* Pervious darkened */
+               {
+                       /* It it no longer darken? */
+                       if ((c_ptr->info & (CAVE_VIEW | CAVE_MNDK)) == CAVE_VIEW)
+                       {
+                               /* It is now undarken */
+                               /* Add it to later visual update */
+                               cave_note_and_redraw_later(c_ptr, fy, fx);
+                       }
                }
 
                /* Add to end of temp array */
@@ -3394,22 +3578,17 @@ void update_mon_lite(void)
        mon_lite_n = 0;
 
        /* Copy the temp array into the lit array lighting the new squares. */
-       for (i = 0; i < temp_n; i++)
+       for (i = 0; i < end_temp; i++)
        {
                fx = temp_x[i];
                fy = temp_y[i];
 
-               if (!in_bounds2(fy, fx)) continue;
+               /* We trust this grid is in bounds */
 
                /* Point to grid */
                c_ptr = &cave[fy][fx];
 
-               if (i >= end_temp)
-               {
-                       /* Clear the temp flag for the old lit grids */
-                       c_ptr->info &= ~(CAVE_TEMP);
-               }
-               else
+               if (c_ptr->info & CAVE_MNLT) /* Lit */
                {
                        /* The is the square newly lit and visible? */
                        if ((c_ptr->info & (CAVE_VIEW | CAVE_TEMP)) == CAVE_VIEW)
@@ -3418,12 +3597,30 @@ void update_mon_lite(void)
                                /* Add it to later visual update */
                                cave_note_and_redraw_later(c_ptr, fy, fx);
                        }
-
-                       /* Save in the monster lit array */
-                       mon_lite_x[mon_lite_n] = fx;
-                       mon_lite_y[mon_lite_n] = fy;
-                       mon_lite_n++;
                }
+               else /* Darkened */
+               {
+                       /* The is the square newly darkened and visible? */
+                       if ((c_ptr->info & (CAVE_VIEW | CAVE_XTRA)) == CAVE_VIEW)
+                       {
+                               /* It is now darkened */
+                               /* Add it to later visual update */
+                               cave_note_and_redraw_later(c_ptr, fy, fx);
+                       }
+               }
+
+               /* Save in the monster lit or darkened array */
+               mon_lite_x[mon_lite_n] = fx;
+               mon_lite_y[mon_lite_n] = fy;
+               mon_lite_n++;
+       }
+
+       /* Clear the temp flag for the old lit or darken grids */
+       for (i = end_temp; i < temp_n; i++)
+       {
+               /* We trust this grid is in bounds */
+
+               cave[temp_y[i]][temp_x[i]].info &= ~(CAVE_TEMP | CAVE_XTRA);
        }
 
        /* Finished with temp_n */
@@ -3471,7 +3668,7 @@ void clear_mon_lite(void)
                c_ptr = &cave[mon_lite_y[i]][mon_lite_x[i]];
 
                /* Clear monster illumination flag */
-               c_ptr->info &= ~(CAVE_MNLT);
+               c_ptr->info &= ~(CAVE_MNLT | CAVE_MNDK);
        }
 
        /* Empty the array */
index 9d5a807..0fd3787 100644 (file)
@@ -2070,7 +2070,7 @@ static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int
 
        /* Disturb the monster */
        m_ptr->csleep = 0;
-       if (r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2))
+       if (r_ptr->flags7 & RF7_HAS_LD_MASK)
                p_ptr->update |= (PU_MON_LITE);
 
        /* Extract monster name (or "it") */
index f995d6d..837a9a1 100644 (file)
 #define CAVE_VIEW       0x0020    /* view flag */
 #define CAVE_TEMP       0x0040    /* temp flag */
 #define CAVE_XTRA       0x0080    /* misc flag */
-#define CAVE_MNLT      0x0100    /* Illuminated by monster */
-
-#define CAVE_XXX0       0x8000    /* Now unused */
+#define CAVE_MNLT       0x0100    /* Illuminated by monster */
+#define CAVE_MNDK       0x8000    /* Darken by monster */
 
 /* Used only while cave generation */
 #define CAVE_FLOOR      0x0200
 #define CAVE_XXXX1      0x0200
 #define CAVE_NOTE       0x0400    /* Flag for delayed visual update (needs note_spot()) */
 #define CAVE_REDRAW     0x0800    /* Flag for delayed visual update (needs lite_spot()) */
-#define CAVE_OBJECT     0x1000    /* mirror */
+#define CAVE_OBJECT     0x1000    /* Mirror, glyph, etc. */
 #define CAVE_UNSAFE     0x2000    /* Might have trap */
 #define CAVE_IN_DETECT  0x4000    /* trap detected area (inner circle only) */
 
 #define RF7_CHAMELEON           0x00002000  /* Chameleon can change */
 #define RF7_KILL_EXP            0x00004000  /* No exp until you kill it */
 #define RF7_TANUKI              0x00008000  /* Tanuki disguise */
+#define RF7_HAS_DARK_1          0x00010000  /* Monster carries darkness */
+#define RF7_SELF_DARK_1         0x00020000  /* Monster darkens itself */
+#define RF7_HAS_DARK_2          0x00040000  /* Monster carries darkness */
+#define RF7_SELF_DARK_2         0x00080000  /* Monster darkens itself */
 
 /*
  * Monster race flags
 #define RF6_NOMAGIC_MASK \
        (RF6_BREATH_MASK | RF6_SPECIAL)
 
+/*
+ * Hack -- "torch" masks
+ */
+#define RF7_LITE_MASK \
+       (RF7_HAS_LITE_1 | RF7_SELF_LITE_1 | RF7_HAS_LITE_2 | RF7_SELF_LITE_2)
+
+#define RF7_DARK_MASK \
+       (RF7_HAS_DARK_1 | RF7_SELF_DARK_1 | RF7_HAS_DARK_2 | RF7_SELF_DARK_2)
+
+#define RF7_HAS_LD_MASK \
+       (RF7_HAS_LITE_1 | RF7_HAS_LITE_2 | RF7_HAS_DARK_1 | RF7_HAS_DARK_2)
+
+#define RF7_SELF_LD_MASK \
+       (RF7_SELF_LITE_1 | RF7_SELF_LITE_2 | RF7_SELF_DARK_1 | RF7_SELF_DARK_2)
+
 
 #define MR1_SINKA 0x01
 
index 2e37fdc..a9b6597 100644 (file)
@@ -1287,7 +1287,7 @@ static void process_monsters_counters(void)
                                                        if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
                                                        if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
 
-                                                       if (r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2))
+                                                       if (r_ptr->flags7 & RF7_HAS_LD_MASK)
                                                                p_ptr->update |= (PU_MON_LITE);
 
                                                        /* Hack -- Count the wakings */
@@ -2239,7 +2239,7 @@ if (cheat_xtra) msg_print("
        {
                if (!dun_level && !p_ptr->resist_lite && !IS_INVULN() && is_daytime())
                {
-                       if (cave[py][px].info & CAVE_GLOW)
+                       if ((cave[py][px].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
                        {
                                /* Take damage */
 #ifdef JP
@@ -3382,7 +3382,7 @@ msg_print("
                        msg_print(NULL);
 
                        /* Absorb light from the current possition */
-                       if (cave[py][px].info & CAVE_GLOW)
+                       if ((cave[py][px].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
                        {
                                hp_player(10);
                        }
index 306248e..eeee538 100644 (file)
@@ -397,10 +397,10 @@ static cptr r_info_flags7[] =
        "CHAMELEON",
        "KILL_EXP",
        "TANUKI",
-       "XXX7X16",
-       "XXX7X17",
-       "XXX7X18",
-       "XXX7X19",
+       "HAS_DARK_1",
+       "SELF_DARK_1",
+       "HAS_DARK_2",
+       "SELF_DARK_2",
        "XXX7X20",
        "XXX7X21",
        "XXX7X22",
index e289b1e..57b7216 100644 (file)
@@ -2148,7 +2148,7 @@ static errr rd_dungeon_old(void)
                        rd_u16b(&info);
 
                        /* Decline invalid flags */
-                       info &= ~(CAVE_LITE | CAVE_VIEW | CAVE_MNLT);
+                       info &= ~(CAVE_LITE | CAVE_VIEW | CAVE_MNLT | CAVE_MNDK);
                }
 
                /* Apply the RLE info */
index 0b13520..dd16cee 100644 (file)
@@ -3468,7 +3468,8 @@ msg_format("%^s
        }
 
        /* Notice changes in view */
-       if (do_move && ((r_ptr->flags7 & (RF7_SELF_LITE_1 | RF7_SELF_LITE_2)) || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !p_ptr->inside_battle)))
+       if (do_move && ((r_ptr->flags7 & (RF7_SELF_LD_MASK | RF7_HAS_DARK_1 | RF7_HAS_DARK_2))
+               || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !p_ptr->inside_battle)))
        {
                /* Update some things */
                p_ptr->update |= (PU_MON_LITE);
index 240009d..6bac8fd 100644 (file)
@@ -1478,7 +1478,7 @@ if (flags6 & (RF6_TELE_LEVEL))      {vp[vn] = "
 
        if (flags6 & (RF6_DARKNESS))
        {
-               if ((p_ptr->pclass != CLASS_NINJA) || (r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)))
+               if ((p_ptr->pclass != CLASS_NINJA) || (r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) || (r_ptr->flags7 & RF7_DARK_MASK))
                {
 #ifdef JP
                        vp[vn] =  "°Å°Ç"; color[vn++] = TERM_L_DARK;
@@ -1757,57 +1757,63 @@ if (flags6 & (RF6_S_UNIQUE))        {vp[vn] = "
        /* Collect special abilities. */
        vn = 0;
 #ifdef JP
-if (flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) vp[vn++] = "¥À¥ó¥¸¥ç¥ó¤ò¾È¤é¤¹";
+       if (flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) { vp[vn] = "¥À¥ó¥¸¥ç¥ó¤ò¾È¤é¤¹";     color[vn++] = TERM_WHITE; }
 #else
-       if (flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) vp[vn++] = "illuminate the dungeon";
+       if (flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) { vp[vn] = "illuminate the dungeon"; color[vn++] = TERM_WHITE; }
 #endif
 
 #ifdef JP
-if (flags2 & RF2_OPEN_DOOR) vp[vn++] = "¥É¥¢¤ò³«¤±¤ë";
+       if (flags7 & (RF7_HAS_DARK_1 | RF7_HAS_DARK_2)) { vp[vn] = "¥À¥ó¥¸¥ç¥ó¤ò°Å¤¯¤¹¤ë";   color[vn++] = TERM_L_DARK; }
 #else
-       if (flags2 & RF2_OPEN_DOOR) vp[vn++] = "open doors";
+       if (flags7 & (RF7_HAS_DARK_1 | RF7_HAS_DARK_2)) { vp[vn] = "darken the dungeon";     color[vn++] = TERM_L_DARK; }
 #endif
 
 #ifdef JP
-if (flags2 & RF2_BASH_DOOR) vp[vn++] = "¥É¥¢¤òÂǤÁÇˤë";
+       if (flags2 & RF2_OPEN_DOOR) { vp[vn] = "¥É¥¢¤ò³«¤±¤ë"; color[vn++] = TERM_WHITE; }
 #else
-       if (flags2 & RF2_BASH_DOOR) vp[vn++] = "bash down doors";
+       if (flags2 & RF2_OPEN_DOOR) { vp[vn] = "open doors"; color[vn++] = TERM_WHITE; }
 #endif
 
 #ifdef JP
-if (flags2 & RF2_PASS_WALL) vp[vn++] = "Êɤò¤¹¤êÈ´¤±¤ë";
+       if (flags2 & RF2_BASH_DOOR) { vp[vn] = "¥É¥¢¤òÂǤÁÇˤë"; color[vn++] = TERM_WHITE; }
 #else
-       if (flags2 & RF2_PASS_WALL) vp[vn++] = "pass through walls";
+       if (flags2 & RF2_BASH_DOOR) { vp[vn] = "bash down doors"; color[vn++] = TERM_WHITE; }
 #endif
 
 #ifdef JP
-if (flags2 & RF2_KILL_WALL) vp[vn++] = "Êɤò·¡¤ê¿Ê¤à";
+       if (flags2 & RF2_PASS_WALL) { vp[vn] = "Êɤò¤¹¤êÈ´¤±¤ë"; color[vn++] = TERM_WHITE; }
 #else
-       if (flags2 & RF2_KILL_WALL) vp[vn++] = "bore through walls";
+       if (flags2 & RF2_PASS_WALL) { vp[vn] = "pass through walls"; color[vn++] = TERM_WHITE; }
 #endif
 
 #ifdef JP
-if (flags2 & RF2_MOVE_BODY) vp[vn++] = "¼å¤¤¥â¥ó¥¹¥¿¡¼¤ò²¡¤·¤Î¤±¤ë";
+       if (flags2 & RF2_KILL_WALL) { vp[vn] = "Êɤò·¡¤ê¿Ê¤à"; color[vn++] = TERM_WHITE; }
 #else
-       if (flags2 & RF2_MOVE_BODY) vp[vn++] = "push past weaker monsters";
+       if (flags2 & RF2_KILL_WALL) { vp[vn] = "bore through walls"; color[vn++] = TERM_WHITE; }
 #endif
 
 #ifdef JP
-if (flags2 & RF2_KILL_BODY) vp[vn++] = "¼å¤¤¥â¥ó¥¹¥¿¡¼¤òÅݤ¹";
+       if (flags2 & RF2_MOVE_BODY) { vp[vn] = "¼å¤¤¥â¥ó¥¹¥¿¡¼¤ò²¡¤·¤Î¤±¤ë"; color[vn++] = TERM_WHITE; }
 #else
-       if (flags2 & RF2_KILL_BODY) vp[vn++] = "destroy weaker monsters";
+       if (flags2 & RF2_MOVE_BODY) { vp[vn] = "push past weaker monsters"; color[vn++] = TERM_WHITE; }
 #endif
 
 #ifdef JP
-if (flags2 & RF2_TAKE_ITEM) vp[vn++] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦";
+       if (flags2 & RF2_KILL_BODY) { vp[vn] = "¼å¤¤¥â¥ó¥¹¥¿¡¼¤òÅݤ¹"; color[vn++] = TERM_WHITE; }
 #else
-       if (flags2 & RF2_TAKE_ITEM) vp[vn++] = "pick up objects";
+       if (flags2 & RF2_KILL_BODY) { vp[vn] = "destroy weaker monsters"; color[vn++] = TERM_WHITE; }
 #endif
 
 #ifdef JP
-if (flags2 & RF2_KILL_ITEM) vp[vn++] = "¥¢¥¤¥Æ¥à¤ò²õ¤¹";
+       if (flags2 & RF2_TAKE_ITEM) { vp[vn] = "¥¢¥¤¥Æ¥à¤ò½¦¤¦"; color[vn++] = TERM_WHITE; }
 #else
-       if (flags2 & RF2_KILL_ITEM) vp[vn++] = "destroy objects";
+       if (flags2 & RF2_TAKE_ITEM) { vp[vn] = "pick up objects"; color[vn++] = TERM_WHITE; }
+#endif
+
+#ifdef JP
+       if (flags2 & RF2_KILL_ITEM) { vp[vn] = "¥¢¥¤¥Æ¥à¤ò²õ¤¹"; color[vn++] = TERM_WHITE; }
+#else
+       if (flags2 & RF2_KILL_ITEM) { vp[vn] = "destroy objects"; color[vn++] = TERM_WHITE; }
 #endif
 
 
@@ -1827,19 +1833,20 @@ if (flags2 & RF2_KILL_ITEM) vp[vn++] = "
                {
                        /* Intro */
 #ifdef JP
-                       if(n!=vn-1){
-                         jverb(vp[n],jverb_buf,JVERB_AND);
-                         hooked_roff(jverb_buf);
-                         hooked_roff("¡¢");
+                       if (n != vn - 1)
+                       {
+                               jverb(vp[n], jverb_buf, JVERB_AND);
+                               hook_c_roff(color[n], jverb_buf);
+                               hooked_roff("¡¢");
                        }
-                       else  hooked_roff(vp[n]);
+                       else hook_c_roff(color[n], vp[n]);
 #else
                        if (n == 0) hooked_roff(" can ");
-                       else if (n < vn-1) hooked_roff(", ");
+                       else if (n < vn - 1) hooked_roff(", ");
                        else hooked_roff(" and ");
 
                        /* Dump */
-                       hooked_roff(vp[n]);
+                       hook_c_roff(color[n], vp[n]);
 #endif
 
                }
@@ -1864,6 +1871,15 @@ if (flags2 & RF2_KILL_ITEM) vp[vn++] = "
 #endif
 
        }
+       if (flags7 & (RF7_SELF_DARK_1 | RF7_SELF_DARK_2))
+       {
+#ifdef JP
+               hook_c_roff(TERM_L_DARK, format("%^s¤Ï°Å¹õ¤ËÊñ¤Þ¤ì¤Æ¤¤¤ë¡£", wd_he[msex]));
+#else
+               hook_c_roff(TERM_L_DARK, format("%^s is surrounded by darkness.  ", wd_he[msex]));
+#endif
+
+       }
        if (flags2 & RF2_INVISIBLE)
        {
 #ifdef JP
index 910df90..7e3d59a 100644 (file)
@@ -3329,9 +3329,9 @@ msg_print("
        }
 
 
-       if (r_ptr->flags7 & (RF7_SELF_LITE_1 | RF7_SELF_LITE_2))
+       if (r_ptr->flags7 & RF7_SELF_LD_MASK)
                p_ptr->update |= (PU_MON_LITE);
-       else if ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !m_ptr->csleep)
+       else if ((r_ptr->flags7 & RF7_HAS_LD_MASK) && !m_ptr->csleep)
                p_ptr->update |= (PU_MON_LITE);
 
        /* Update the monster */
index 4fe8bd4..03ef020 100644 (file)
@@ -1401,7 +1401,10 @@ bool make_attack_spell(int m_idx)
        {
                f5 &= ~(RF5_DRAIN_MANA);
        }
-       if ((p_ptr->pclass == CLASS_NINJA) && (r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)))
+
+       if ((p_ptr->pclass == CLASS_NINJA) &&
+           ((r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) ||
+            (r_ptr->flags7 & RF7_DARK_MASK)))
        {
                f6 &= ~(RF6_DARKNESS);
        }
index d658a8d..9de8852 100644 (file)
@@ -2926,7 +2926,8 @@ static void calc_torch(void)
        if (p_ptr->old_lite != p_ptr->cur_lite)
        {
                /* Update the lite */
-               p_ptr->update |= (PU_LITE);
+               /* Hack -- PU_MON_LITE for monsters' darkness */
+               p_ptr->update |= (PU_LITE | PU_MON_LITE);
 
                /* Update the monsters */
                p_ptr->update |= (PU_MONSTERS);
index 66ecdf4..c828453 100644 (file)
@@ -660,7 +660,7 @@ void monster_death(int m_idx, bool drop_item)
        if (world_monster) world_monster = FALSE;
 
        /* Notice changes in view */
-       if (r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2 | RF7_SELF_LITE_1 | RF7_SELF_LITE_2))
+       if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
        {
                /* Update some things */
                p_ptr->update |= (PU_MON_LITE);