From 776e71b2edd6edf0f20908cefb87fbfe4bf293c6 Mon Sep 17 00:00:00 2001 From: nothere Date: Fri, 20 Jun 2003 15:13:34 +0000 Subject: [PATCH] =?utf8?q?=E3=83=A2=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=BC?= =?utf8?q?=E3=81=AE=E6=9A=97=E9=BB=92=E5=85=89=E6=BA=90=E3=82=92=E5=AE=9F?= =?utf8?q?=E8=A3=85.=20*=20HAS=5FDARK=5F{1|2},=20SELF=5FDARK=5F{1|2}?= =?utf8?q?=E3=81=A7=E4=BD=BF=E7=94=A8=E5=8F=AF=E8=83=BD.=20=E6=9C=80?= =?utf8?q?=E5=A4=A7=E5=8D=8A=E5=BE=843.=20*=20=E6=9A=97=E9=BB=92=E5=85=89?= =?utf8?q?=E6=BA=90=E3=81=AF=E6=99=AE=E9=80=9A=E3=81=AE=E5=85=89=E6=BA=90?= =?utf8?q?=E3=81=AB=E3=81=AF=E8=B2=A0=E3=81=91=E3=82=8B.=20*=20=E6=9A=97?= =?utf8?q?=E9=BB=92=E5=85=89=E6=BA=90=E3=81=AE=E3=81=82=E3=82=8B=E3=83=A2?= =?utf8?q?=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=BC=E3=81=AF=E5=AF=BE=E5=BF=8D?= =?utf8?q?=E8=80=85=E3=81=A7=E3=82=82=E9=96=83=E5=85=89=E3=82=92=E4=BD=BF?= =?utf8?q?=E3=82=8F=E3=81=AA=E3=81=84.=20*=20=E6=9A=97=E9=BB=92=E5=85=89?= =?utf8?q?=E6=BA=90=E7=AF=84=E5=9B=B2=E3=81=A7=E3=81=AF=E5=BF=8D=E8=80=85?= =?utf8?q?=E3=81=AE=E8=B6=85=E9=9A=A0=E5=AF=86=E6=9D=A1=E4=BB=B6=E3=81=AB?= =?utf8?q?=E5=BD=B1=E9=9F=BF=E3=81=97=E3=81=AA=E3=81=84.=20=E3=81=93?= =?utf8?q?=E3=82=8C=E3=81=AF=E6=9A=97=E9=BB=92=E5=85=89=E6=BA=90=E6=8C=81?= =?utf8?q?=E3=81=A1=E3=81=AF=20=20=20=E8=87=AA=E5=88=86=E3=81=AE=E9=97=87?= =?utf8?q?=E3=81=8B=E3=82=89=E3=81=AE=E4=B8=8D=E6=84=8F=E6=89=93=E3=81=A1?= =?utf8?q?=E3=82=92=E5=8F=97=E3=81=91=E3=81=AA=E3=81=84=E8=A7=A3=E9=87=88?= =?utf8?q?=E3=81=AB=E3=82=88=E3=82=8B.=20*=20=E6=9A=97=E9=BB=92=E5=85=89?= =?utf8?q?=E6=BA=90=E3=81=AE=E4=B8=AD=E3=81=A7=E3=82=82=E8=B5=A4=E5=A4=96?= =?utf8?q?=E7=B7=9A=E3=82=84=E3=83=86=E3=83=AC=E3=83=91=E3=82=B7=E3=83=BC/?= =?utf8?q?ESP=E3=81=AF=E6=9C=89=E5=8A=B9.=20*=20=E8=A9=B1=E3=81=97?= =?utf8?q?=E5=90=88=E3=81=84=E3=81=A7=E6=B1=BA=E3=81=BE=E3=81=A3=E3=81=9F?= =?utf8?q?=E3=83=A2=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=BC=E3=81=AB=E5=AE=9F?= =?utf8?q?=E9=A8=93=E7=9A=84=E3=81=AB=E4=B8=8E=E3=81=88=E3=81=A6=E3=81=82?= =?utf8?q?=E3=82=8B.=20=E3=83=A2=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=BC?= =?utf8?q?=E3=81=A7=E3=81=AE=E4=BF=AE=20=20=20=E6=AD=A3=E3=81=AF=E5=BF=85?= =?utf8?q?=E8=A6=81=E3=81=A8=E6=80=9D=E3=82=8F=E3=82=8C=E3=82=8B.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/edit/r_info.txt | 22 +-- src/cave.c | 451 +++++++++++++++++++++++++++++++++++++--------------- src/cmd1.c | 2 +- src/defines.h | 26 ++- src/dungeon.c | 6 +- src/init1.c | 8 +- src/load.c | 2 +- src/melee2.c | 3 +- src/monster1.c | 68 +++++--- src/monster2.c | 4 +- src/mspells1.c | 5 +- src/xtra1.c | 3 +- src/xtra2.c | 2 +- 13 files changed, 419 insertions(+), 183 deletions(-) diff --git a/lib/edit/r_info.txt b/lib/edit/r_info.txt index 7f58eaede..b9e553686 100644 --- a/lib/edit/r_info.txt +++ b/lib/edit/r_info.txt @@ -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 | diff --git a/src/cave.c b/src/cave.c index b59d8a3df..263fcb702 100644 --- a/src/cave.c +++ b/src/cave.c @@ -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 */ diff --git a/src/cmd1.c b/src/cmd1.c index 9d5a80769..0fd3787e3 100644 --- a/src/cmd1.c +++ b/src/cmd1.c @@ -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") */ diff --git a/src/defines.h b/src/defines.h index f995d6dd7..837a9a123 100644 --- a/src/defines.h +++ b/src/defines.h @@ -2374,9 +2374,8 @@ #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 @@ -2391,7 +2390,7 @@ #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) */ @@ -3527,6 +3526,10 @@ #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 @@ -3748,6 +3751,21 @@ #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 diff --git a/src/dungeon.c b/src/dungeon.c index 2e37fdcc3..a9b659730 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -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); } diff --git a/src/init1.c b/src/init1.c index 306248e7c..eeee53895 100644 --- a/src/init1.c +++ b/src/init1.c @@ -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", diff --git a/src/load.c b/src/load.c index e289b1ea7..57b7216ae 100644 --- a/src/load.c +++ b/src/load.c @@ -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 */ diff --git a/src/melee2.c b/src/melee2.c index 0b13520cb..dd16ceeb9 100644 --- a/src/melee2.c +++ b/src/melee2.c @@ -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); diff --git a/src/monster1.c b/src/monster1.c index 240009db9..6bac8fd86 100644 --- a/src/monster1.c +++ b/src/monster1.c @@ -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 diff --git a/src/monster2.c b/src/monster2.c index 910df9065..7e3d59a41 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -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 */ diff --git a/src/mspells1.c b/src/mspells1.c index 4fe8bd485..03ef020a9 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -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); } diff --git a/src/xtra1.c b/src/xtra1.c index d658a8d9a..9de88520e 100644 --- a/src/xtra1.c +++ b/src/xtra1.c @@ -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); diff --git a/src/xtra2.c b/src/xtra2.c index 66ecdf443..c8284538c 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -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); -- 2.11.0