/* File: cave.c */
+/*
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
+ *
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies. Other copyrights may also apply.
+ */
+
/* Purpose: low level dungeon routines -BEN- */
case FEAT_TRAP_POISON:
case FEAT_TRAP_SLEEP:
case FEAT_TRAP_TRAPS:
+ case FEAT_TRAP_ALARM:
+ case FEAT_TRAP_OPEN:
+ case FEAT_TRAP_ARMAGEDDON:
+ case FEAT_TRAP_PIRANHA:
{
/* A trap */
return (TRUE);
/*
+ * Return TRUE if the given grid is a known trap
+ */
+bool is_known_trap(cave_type *c_ptr)
+{
+ if (!c_ptr->mimic && is_trap(c_ptr->feat)) return TRUE;
+ else return FALSE;
+}
+
+
+/*
+ * Return TRUE if the given grid is a closed door
+ */
+bool is_closed_door(int feat)
+{
+ return (feat >= FEAT_DOOR_HEAD && feat <= FEAT_DOOR_TAIL);
+}
+
+
+/*
+ * Return TRUE if the given grid is a hidden closed door
+ */
+bool is_hidden_door(cave_type *c_ptr)
+{
+ if (c_ptr->mimic &&
+ is_closed_door(c_ptr->feat))
+ return TRUE;
+ else
+ return FALSE;
+}
+
+
+/*
* A simple, fast, integer-based line-of-sight algorithm. By Joseph Hall,
* 4116 Brewster Drive, Raleigh NC 27606. Email to jnh@ecemwl.ncsu.edu.
*
/* Require line of sight to the grid */
if (!player_has_los_bold(y, x)) return (FALSE);
- if (p_ptr->pclass == CLASS_NINJA) return TRUE;
+ /* Noctovision of Ninja */
+ if (p_ptr->see_nocto) return TRUE;
/* 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);
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);
/*
* Hack -- Legal monster codes
*/
-static cptr image_monster_hack = \
+static char image_monster_hack[] = \
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
/*
- * Hack -- Legal monster codes for IBM pseudo-graphics
- */
-static cptr image_monster_hack_ibm = \
-"aaa";
-
-/*
* Mega-Hack -- Hallucinatory monster
*/
static void image_monster(byte *ap, char *cp)
{
- int n = strlen(image_monster_hack);
-
/* Random symbol from set above */
if (use_graphics)
{
- /* Normal graphics */
- if (!(streq(ANGBAND_SYS, "ibm")))
- {
- (*cp) = r_info[randint1(max_r_idx-1)].x_char;
- (*ap) = r_info[randint1(max_r_idx-1)].x_attr;
- }
- else
- /* IBM-pseudo graphics */
- {
- n = strlen(image_monster_hack_ibm);
- (*cp) = (image_monster_hack_ibm[randint0(n)]);
+ monster_race *r_ptr = &r_info[randint1(max_r_idx - 1)];
- /* Random color */
- (*ap) = randint1(15);
- }
+ *cp = r_ptr->x_char;
+ *ap = r_ptr->x_attr;
}
else
/* Text mode */
{
- (*cp) = (image_monster_hack[randint0(n)]);
+ int n = sizeof(image_monster_hack) - 1;
+
+ *cp = image_monster_hack[randint0(n)];
/* Random color */
- (*ap) = randint1(15);
+ *ap = randint1(15);
}
}
/*
* Hack -- Legal object codes
*/
-static cptr image_object_hack = \
-"?/|\\\"!$()_-=[]{},~";
-
-static cptr image_object_hack_ibm = \
-"aaa";
+static char image_object_hack[] = "?/|\\\"!$()_-=[]{},~";
/*
* Mega-Hack -- Hallucinatory object
*/
static void image_object(byte *ap, char *cp)
{
- int n = strlen(image_object_hack);
-
if (use_graphics)
{
- if (!(streq(ANGBAND_SYS, "ibm")))
- {
- (*cp) = k_info[randint1(max_k_idx-1)].x_char;
- (*ap) = k_info[randint1(max_k_idx-1)].x_attr;
- }
- else
- {
- n = strlen(image_object_hack_ibm);
- (*cp) = (image_object_hack_ibm[randint0(n)]);
+ object_kind *k_ptr = &k_info[randint1(max_k_idx-1)];
- /* Random color */
- (*ap) = randint1(15);
- }
+ *cp = k_ptr->x_char;
+ *ap = k_ptr->x_attr;
}
else
{
- (*cp) = (image_object_hack[randint0(n)]);
+ int n = sizeof(image_object_hack) - 1;
+
+ *cp = image_object_hack[randint0(n)];
/* Random color */
- (*ap) = randint1(15);
+ *ap = randint1(15);
}
}
/*
* Not using graphical tiles for this feature?
*/
-#define is_ascii_graphics(C , A) \
- (!(((C) & 0x80) && ((A) & 0x80)))
+#define is_ascii_graphics(A) (!((A) & 0x80))
/*
* The 16x16 tile of the terrain supports lighting
*/
static bool feat_supports_lighting(byte feat)
{
- if (is_trap(feat)) return TRUE;
+ if (is_trap(feat)) return streq(ANGBAND_GRAF, "new");
switch (feat)
{
case FEAT_MORE:
case FEAT_LESS_LESS:
case FEAT_MORE_MORE:
- case FEAT_SECRET:
case FEAT_RUBBLE:
case FEAT_MAGMA:
case FEAT_QUARTZ:
{TERM_WHITE, TERM_L_DARK},
/* TERM_ORANGE */
- {TERM_YELLOW, TERM_UMBER},
+ {TERM_L_UMBER, TERM_UMBER},
/* TERM_RED */
{TERM_RED, TERM_RED},
{TERM_L_BLUE, TERM_L_BLUE},
/* TERM_L_UMBER */
- {TERM_YELLOW, TERM_UMBER}
+ {TERM_L_UMBER, TERM_UMBER}
};
+
+/*
+ * Mega-Hack -- Partial code of map_info() for darkened grids
+ * Note: Each variable is declared in map_info().
+ * This macro modifies "feat", "f_ptr", "c" and "a".
+ */
+#define darkened_grid_hack() \
+{ \
+ if (feat_floor(feat)) \
+ { \
+ /* Unsafe cave grid -- idea borrowed from Unangband */ \
+ if (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) \
+ { \
+ feat = FEAT_UNDETECTD; \
+\
+ /* Access unsafe darkness */ \
+ f_ptr = &f_info[feat]; \
+\
+ /* Char and attr of unsafe grid */ \
+ c = f_ptr->x_char; \
+ a = f_ptr->x_attr; \
+ } \
+ else \
+ { \
+ /* For feat_priority control */ \
+ feat = FEAT_NONE; \
+\
+ if (use_graphics) \
+ { \
+ /* Access darkness */ \
+ f_ptr = &f_info[feat]; \
+\
+ /* Char and attr of darkness */ \
+ c = f_ptr->x_char; \
+ a = f_ptr->x_attr; \
+ } \
+ else \
+ { \
+ /* Use "black" */ \
+ a = TERM_DARK; \
+ } \
+ } \
+ } \
+ else \
+ { \
+ if (is_ascii_graphics(a)) \
+ { \
+ /* Use darkened colour */ \
+ a = !new_ascii_graphics ? TERM_L_DARK : lighting_colours[a][1]; \
+ } \
+ else if (use_graphics && feat_supports_lighting(feat)) \
+ { \
+ /* Use a dark tile */ \
+ c++; \
+ } \
+ } \
+} ;
+
+
/*
* Extract the attr/char to display at the given (legal) map location
*
void map_info(int y, int x, byte *ap, char *cp)
#endif /* USE_TRANSPARENCY */
{
- cave_type *c_ptr;
+ /* Get the cave */
+ cave_type *c_ptr = &cave[y][x];
feature_type *f_ptr;
s16b this_o_idx, next_o_idx = 0;
- byte feat;
+ /* Feature code (applying "mimic" field) */
+ byte feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
byte a;
byte c;
- /* Get the cave */
- c_ptr = &cave[y][x];
-
- /* Feature code */
- feat = c_ptr->feat;
+ /* Is this grid "darkened" by monster? */
+ bool darkened_grid = ((c_ptr->info & (CAVE_VIEW | CAVE_LITE | CAVE_MNLT | CAVE_MNDK)) == (CAVE_VIEW | CAVE_MNDK)) &&
+ !p_ptr->see_nocto && !p_ptr->blind;
/* Floors (etc) */
if ((feat <= FEAT_INVIS) || (feat == FEAT_DIRT) || (feat == FEAT_GRASS))
{
/* Memorized (or visible) floor */
- if ((c_ptr->info & CAVE_MARK) ||
- (((c_ptr->info & CAVE_LITE) || (c_ptr->info & CAVE_MNLT) ||
- ((c_ptr->info & CAVE_GLOW) &&
- (c_ptr->info & CAVE_VIEW))) &&
- !p_ptr->blind))
+ 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) || p_ptr->see_nocto))) &&
+ !p_ptr->blind))
{
/* Access floor */
f_ptr = &f_info[feat];
/* Normal attr */
a = f_ptr->x_attr;
+ /* Mega-Hack -- Handle "in-sight" and "darkened" grids first */
+ if (darkened_grid)
+ {
+ darkened_grid_hack();
+ }
+
/* Special lighting effects */
- if (view_special_lite && (!p_ptr->wild_mode) && ((a == TERM_WHITE) || use_graphics))
+ else if (view_special_lite && (!p_ptr->wild_mode) && ((a == TERM_WHITE) || use_graphics))
{
/* Handle "blind" */
if (p_ptr->blind)
{
- if (new_ascii_graphics)
+ if (use_graphics)
{
- if (is_ascii_graphics(c,a))
- {
- /* Use darkened colour */
- a = lighting_colours[a][1];
- }
- else if (use_graphics && feat_supports_lighting(feat))
- {
- /* Use a dark tile */
- c++;
- }
+ /*
+ * feat_supports_lighting(feat)
+ * is always TRUE here
+ */
+
+ /* Use a dark tile */
+ c++;
}
else
{
- if (use_graphics)
- {
- /* Use a dark tile */
- c++;
- }
- else
- {
- /* Use "dark gray" */
- a = TERM_L_DARK;
- }
+ /* Use "dark gray" */
+ a = TERM_L_DARK;
}
- }
+ }
/* Handle "torch-lit" grids */
else if (c_ptr->info & (CAVE_LITE | CAVE_MNLT))
{
- /* Torch lite */
- if (view_yellow_lite && !p_ptr->wild_mode)
- {
- if (new_ascii_graphics)
+ /* Torch lite */
+ if (view_yellow_lite && !p_ptr->wild_mode)
+ {
+ if (use_graphics)
{
- if (is_ascii_graphics(c,a))
- {
- /* Use lightened colour */
- a = lighting_colours[a][0];
- }
- else if (use_graphics &&
- feat_supports_lighting(feat))
- {
- /* Use a brightly lit tile */
- c += 2;
- }
+ /*
+ * feat_supports_lighting(feat)
+ * is always TRUE here
+ */
+
+ /* Use a brightly lit tile */
+ c += 2;
}
else
{
- /* Torch lite */
- if (view_yellow_lite)
- {
- if (use_graphics)
- {
- /* Use a brightly lit tile */
- c += 2;
- }
- else
- {
- /* Use "yellow" */
- a = TERM_YELLOW;
- }
- }
+ /* Use "yellow" */
+ a = TERM_YELLOW;
}
}
}
- /* Handle "dark" grids */
- else if (!(c_ptr->info & CAVE_GLOW))
- {
- if (new_ascii_graphics)
+ /* Handle "dark" grids */
+ else if ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW)
+ {
+ if (use_graphics)
{
- if (is_ascii_graphics(c,a))
- {
- /* Use darkened colour */
- a = lighting_colours[a][1];
- }
- else if (use_graphics && feat_supports_lighting(feat))
- {
- /* Use a dark tile */
- c++;
- }
+ /*
+ * feat_supports_lighting(feat)
+ * is always TRUE here
+ */
+
+ /* Use a dark tile */
+ c++;
}
else
{
- if (use_graphics)
- {
- /* Use a dark tile */
- c++;
- }
- else
- {
- /* Use "dark gray" */
- a = TERM_L_DARK;
- }
+ /* Use "dark gray" */
+ a = TERM_L_DARK;
}
- }
+ }
/* Handle "out-of-sight" grids */
else if (!(c_ptr->info & CAVE_VIEW))
/* Special flag */
if (view_bright_lite && !p_ptr->wild_mode)
{
- if (new_ascii_graphics)
+ if (use_graphics)
{
- if (is_ascii_graphics(c,a))
- {
- /* Use darkened colour */
- a = lighting_colours[a][1];
- }
- else if (use_graphics && feat_supports_lighting(feat))
- {
- /* Use a dark tile */
- c++;
- }
+ /*
+ * feat_supports_lighting(feat)
+ * is always TRUE here
+ */
+
+ /* Use a dark tile */
+ c++;
}
else
{
- if (use_graphics)
- {
- /* Use a dark tile */
- c++;
- }
- else
- {
- /* Use "gray" */
- a = TERM_SLATE;
- }
+ /* Use "gray" */
+ a = TERM_SLATE;
}
}
}
/* Unknown */
else
{
- feat = FEAT_NONE;
+ /* Unsafe cave grid -- idea borrowed from Unangband */
+ if (view_unsafe_grids && (c_ptr->info & (CAVE_UNSAFE)))
+ feat = FEAT_UNDETECTD;
+ else
+ feat = FEAT_NONE;
/* Access darkness */
f_ptr = &f_info[feat];
else
{
/* Memorized grids */
- if ((c_ptr->info & CAVE_MARK) && (view_granite_lite || !new_ascii_graphics))
+ if ((c_ptr->info & CAVE_MARK) && (view_granite_lite || new_ascii_graphics))
{
- /* Apply "mimic" field */
- if (c_ptr->mimic)
- feat = c_ptr->mimic;
- else
- feat = f_info[feat].mimic;
-
/* Access feature */
f_ptr = &f_info[feat];
/* Normal attr */
a = f_ptr->x_attr;
- if (new_ascii_graphics)
+ /* Mega-Hack -- Handle "in-sight" and "darkened" grids first */
+ if (darkened_grid)
+ {
+ darkened_grid_hack();
+ }
+
+ else if (new_ascii_graphics)
{
/* Handle "blind" */
if (p_ptr->blind)
{
- if (is_ascii_graphics(c,a))
+ if (is_ascii_graphics(a))
{
/* Use darkened colour */
a = lighting_colours[a][1];
else if (c_ptr->info & (CAVE_LITE | CAVE_MNLT))
{
/* Torch lite */
- if (view_yellow_lite && !p_ptr->wild_mode && ((use_graphics && feat_supports_lighting(feat)) || is_ascii_graphics(c,a)))
+ if (view_yellow_lite && !p_ptr->wild_mode && ((use_graphics && feat_supports_lighting(feat)) || is_ascii_graphics(a)))
{
- if (is_ascii_graphics(c,a))
+ if (is_ascii_graphics(a))
{
/* Use lightened colour */
a = lighting_colours[a][0];
}
else if (use_graphics &&
- feat_supports_lighting(c_ptr->feat))
+ feat_supports_lighting(feat))
{
/* Use a brightly lit tile */
c += 2;
}
/* Handle "view_bright_lite" */
- else if (view_bright_lite && !p_ptr->wild_mode && ((use_graphics && feat_supports_lighting(feat)) || is_ascii_graphics(c,a)))
+ else if (view_bright_lite && !p_ptr->wild_mode && ((use_graphics && feat_supports_lighting(feat)) || is_ascii_graphics(a)))
{
/* Not viewable */
if (!(c_ptr->info & CAVE_VIEW))
{
- if (is_ascii_graphics(c,a))
+ if (is_ascii_graphics(a))
{
/* Use darkened colour */
a = lighting_colours[a][1];
}
/* Not glowing */
- else if (!(c_ptr->info & CAVE_GLOW))
+ else if ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW)
{
- if (is_ascii_graphics(c,a))
+ if (is_ascii_graphics(a))
{
/* Use darkened colour */
a = lighting_colours[a][1];
}
}
}
+
/* Special lighting effects */
else if (view_granite_lite && !p_ptr->wild_mode &&
(((a == TERM_WHITE) && !use_graphics) ||
- (use_graphics && feat_supports_lighting(c_ptr->feat))))
+ (use_graphics && feat_supports_lighting(feat))))
{
/* Handle "blind" */
if (p_ptr->blind)
}
/* Not glowing */
- else if (!(c_ptr->info & CAVE_GLOW))
+ else if ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW)
{
if (use_graphics)
{
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)
{
}
}
- /* "Simple Lighting" */
- else
- {
- /* Handle "blind" */
- if (!(c_ptr->info & CAVE_MARK))
- {
- feat = FEAT_NONE;
- }
+ /* "Simple Lighting" */
+ else
+ {
+ /* Handle "blind" */
+ if (!(c_ptr->info & CAVE_MARK))
+ {
+ /* Unsafe cave grid -- idea borrowed from Unangband */
+ if (view_unsafe_grids && (c_ptr->info & (CAVE_UNSAFE)))
+ feat = FEAT_UNDETECTD;
+ else
+ feat = FEAT_NONE;
+ }
+
+ /* Access feature */
+ f_ptr = &f_info[feat];
- /* Access feature */
- f_ptr = &f_info[feat];
+ /* Normal attr */
+ a = f_ptr->x_attr;
- /* Normal attr */
- a = f_ptr->x_attr;
+ /* Normal char */
+ c = f_ptr->x_char;
- /* Normal char */
- c = f_ptr->x_char;
- }
- }
+ /* Mega-Hack -- Handle "in-sight" and "darkened" grids */
+ if (darkened_grid)
+ {
+ darkened_grid_hack();
+ }
+ }
+ }
if (feat_priority == -1)
{
switch (feat)
{
case FEAT_NONE:
+ case FEAT_UNDETECTD:
case FEAT_DARK_PIT:
feat_priority = 1;
break;
case FEAT_TRAP_POISON:
case FEAT_TRAP_SLEEP:
case FEAT_TRAP_TRAPS:
+ case FEAT_TRAP_ALARM:
case FEAT_DIRT:
case FEAT_GRASS:
case FEAT_FLOWER:
case FEAT_DEEP_GRASS:
case FEAT_SWAMP:
case FEAT_TREES:
- case FEAT_SECRET:
case FEAT_RUBBLE:
case FEAT_MAGMA:
case FEAT_QUARTZ:
case FEAT_MAGMA_K:
case FEAT_QUARTZ_K:
- feat_priority = 3;
+ /* Now a days treasere grid is too many */
+ feat_priority = 2;
break;
case FEAT_MOUNTAIN:
}
}
- /* Hack -- rare random hallucination, except on outer dungeon walls */
- if (p_ptr->image && (c_ptr->feat < FEAT_PERM_SOLID) && !randint0(256))
- {
- /* Hallucinate */
- image_random(ap, cp);
- }
-
#ifdef USE_TRANSPARENCY
/* Save the terrain info for the transparency effects */
(*tap) = a;
(*ap) = a;
(*cp) = c;
+ /* Hack -- rare random hallucination, except on outer dungeon walls */
+ if (p_ptr->image && (feat < FEAT_PERM_SOLID) && one_in_(256))
+ {
+ /* Hallucinate */
+ image_random(ap, cp);
+ }
+
/* Objects */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
if(match_autopick == -1)
continue;
- act = autopick_action[match_autopick];
+ act = autopick_list[match_autopick].action;
if ((act & DO_DISPLAY) && (act & display_autopick))
{
/* Visible monster */
if (m_ptr->ml)
{
- monster_race *r_ptr;
- if (m_ptr->mflag2 & MFLAG_KAGE) r_ptr = &r_info[MON_KAGE];
- else r_ptr = &r_info[m_ptr->r_idx];
-
- /* Desired attr */
- a = r_ptr->x_attr;
-
- /* Desired char */
- c = r_ptr->x_char;
+ monster_race *r_ptr = &r_info[m_ptr->ap_r_idx];
feat_priority = 30;
- /* Mimics' colors vary */
- if (strchr("\"!=", c) && !(r_ptr->flags1 & RF1_UNIQUE))
+ /* Hallucination */
+ if (p_ptr->image)
{
- /* Use char */
- (*cp) = c;
-
- /* Use semi-random attr */
- (*ap) = c_ptr->m_idx % 15 + 1;
+ /*
+ * Monsters with both CHAR_CLEAR and ATTR_CLEAR
+ * flags are always unseen.
+ */
+ if ((r_ptr->flags1 & (RF1_CHAR_CLEAR | RF1_ATTR_CLEAR)) == (RF1_CHAR_CLEAR | RF1_ATTR_CLEAR))
+ {
+ /* Do nothing */
+ }
+ else
+ {
+ /* Hallucinatory monster */
+ image_monster(ap, cp);
+ }
}
-
- /* Special attr/char codes */
- else if ((a & 0x80) && (c & 0x80))
+ else
{
- /* Use char */
- (*cp) = c;
+ /* Monster attr/char */
+ a = r_ptr->x_attr;
+ c = r_ptr->x_char;
- /* Use attr */
- (*ap) = a;
- }
+ /* Normal monsters */
+ if (!(r_ptr->flags1 & (RF1_CHAR_CLEAR | RF1_SHAPECHANGER | RF1_ATTR_CLEAR
+ | RF1_ATTR_MULTI | RF1_ATTR_SEMIRAND)))
+ {
+ /* Desired monster attr/char */
+ *ap = a;
+ *cp = c;
+ }
- /* Multi-hued monster */
- else if (r_ptr->flags1 & (RF1_ATTR_MULTI))
- {
- /* Is it a shapechanger? */
- if (r_ptr->flags2 & (RF2_SHAPECHANGER))
+ /*
+ * Monsters with both CHAR_CLEAR and ATTR_CLEAR
+ * flags are always unseen.
+ */
+ else if ((r_ptr->flags1 & (RF1_CHAR_CLEAR | RF1_ATTR_CLEAR)) == (RF1_CHAR_CLEAR | RF1_ATTR_CLEAR))
{
- if (use_graphics)
+ /* Do nothing */
+ }
+
+ else
+ {
+ /*** Monster's attr ***/
+ if ((r_ptr->flags1 & RF1_ATTR_CLEAR) && (*ap != TERM_DARK) && !use_graphics)
+ {
+ /* Clear-attr */
+ /* Do nothing */
+ }
+ else if ((r_ptr->flags1 & RF1_ATTR_MULTI) && !use_graphics)
+ {
+ /* Multi-hued attr */
+ if (r_ptr->flags2 & RF2_ATTR_ANY) *ap = randint1(15);
+ else switch (randint1(7))
+ {
+ case 1: *ap = TERM_RED; break;
+ case 2: *ap = TERM_L_RED; break;
+ case 3: *ap = TERM_WHITE; break;
+ case 4: *ap = TERM_L_GREEN; break;
+ case 5: *ap = TERM_BLUE; break;
+ case 6: *ap = TERM_L_DARK; break;
+ case 7: *ap = TERM_GREEN; break;
+ }
+ }
+ else if ((r_ptr->flags1 & RF1_ATTR_SEMIRAND) && !use_graphics)
+ {
+ /* Use semi-random attr (usually mimics' colors vary) */
+ *ap = c_ptr->m_idx % 15 + 1;
+ }
+ else
+ {
+ /* Normal case */
+ *ap = a;
+ }
+
+ /*** Monster's char ***/
+ if ((r_ptr->flags1 & RF1_CHAR_CLEAR) && (*cp != ' ') && !use_graphics)
+ {
+ /* Clear-char */
+ /* Do nothing */
+ }
+ else if (r_ptr->flags1 & RF1_SHAPECHANGER)
{
- if (!(streq(ANGBAND_SYS, "ibm")))
+ if (use_graphics)
{
- (*cp) = r_info[randint1(max_r_idx-1)].x_char;
- (*ap) = r_info[randint1(max_r_idx-1)].x_attr;
+ monster_race *tmp_r_ptr = &r_info[randint1(max_r_idx - 1)];
+ *cp = tmp_r_ptr->x_char;
+ *ap = tmp_r_ptr->x_attr;
}
else
{
- int n = strlen(image_monster_hack_ibm);
- (*cp) = (image_monster_hack_ibm[randint0(n)]);
-
- /* Random color */
- (*ap) = randint1(15);
+ *cp = (one_in_(25) ?
+ image_object_hack[randint0(sizeof(image_object_hack) - 1)] :
+ image_monster_hack[randint0(sizeof(image_monster_hack) - 1)]);
}
}
else
{
- (*cp) = (one_in_(25) ?
- image_object_hack[randint0(strlen(image_object_hack))] :
- image_monster_hack[randint0(strlen(image_monster_hack))]);
+ /* Normal case */
+ *cp = c;
}
}
- else
- (*cp) = c;
-
- /* Multi-hued attr */
- if (r_ptr->flags2 & RF2_ATTR_ANY)
- (*ap) = randint1(15);
- else switch (randint1(7))
- {
- case 1:
- (*ap) = TERM_RED;
- break;
- case 2:
- (*ap) = TERM_L_RED;
- break;
- case 3:
- (*ap) = TERM_WHITE;
- break;
- case 4:
- (*ap) = TERM_L_GREEN;
- break;
- case 5:
- (*ap) = TERM_BLUE;
- break;
- case 6:
- (*ap) = TERM_L_DARK;
- break;
- case 7:
- (*ap) = TERM_GREEN;
- break;
- }
- }
-
- /* Normal monster (not "clear" in any way) */
- else if (!(r_ptr->flags1 & (RF1_ATTR_CLEAR | RF1_CHAR_CLEAR)))
- {
- /* Use char */
- (*cp) = c;
-
- /* Use attr */
- (*ap) = a;
- }
-
- /* Hack -- Bizarre grid under monster */
- else if ((*ap & 0x80) || (*cp & 0x80))
- {
- /* Use char */
- (*cp) = c;
-
- /* Use attr */
- (*ap) = a;
- }
-
- /* Normal */
- else
- {
- /* Normal (non-clear char) monster */
- if (!(r_ptr->flags1 & (RF1_CHAR_CLEAR)))
- {
- /* Normal char */
- (*cp) = c;
- }
-
- /* Normal (non-clear attr) monster */
- else if (!(r_ptr->flags1 & (RF1_ATTR_CLEAR)))
- {
- /* Normal attr */
- (*ap) = a;
- }
- }
-
- /* Hack -- hallucination */
- if (p_ptr->image)
- {
- /* Hallucinatory monster */
- image_monster(ap, cp);
}
}
}
/* Handle "player" */
- if ((y == py) && (x == px))
+ if (player_bold(y, x))
{
monster_race *r_ptr = &r_info[0];
- feat_priority = 31;
-
/* Get the "player" attr */
- a = r_ptr->x_attr;
+ *ap = r_ptr->x_attr;
/* Get the "player" char */
- c = r_ptr->x_char;
+ *cp = r_ptr->x_char;
-#ifdef VARIABLE_PLAYER_GRAPH
+ feat_priority = 31;
+ }
+}
- if (!streq(ANGBAND_GRAF, "new"))
- {
- if (streq(ANGBAND_SYS,"ibm"))
- {
- if (use_graphics && player_symbols)
- {
- if (p_ptr->psex == SEX_FEMALE) c = (char)242;
- switch (p_ptr->pclass)
- {
- case CLASS_PALADIN:
- if (p_ptr->lev < 20)
- a = TERM_L_WHITE;
- else
- a = TERM_WHITE;
- c = 253;
- break;
- case CLASS_WARRIOR_MAGE:
- case CLASS_RED_MAGE:
- if (p_ptr->lev < 20)
- a = TERM_L_RED;
- else
- a = TERM_VIOLET;
- break;
- case CLASS_CHAOS_WARRIOR:
- do
- {
- a = randint1(15);
- }
- while (a == TERM_DARK);
- break;
- case CLASS_MAGE:
- case CLASS_HIGH_MAGE:
- case CLASS_SORCERER:
- case CLASS_MAGIC_EATER:
- case CLASS_BLUE_MAGE:
- if (p_ptr->lev < 20)
- a = TERM_L_RED;
- else
- a = TERM_RED;
- c = 248;
- break;
- case CLASS_PRIEST:
- case CLASS_BARD:
- if (p_ptr->lev < 20)
- a = TERM_L_BLUE;
- else
- a = TERM_BLUE;
- c = 248;
- break;
- case CLASS_RANGER:
- case CLASS_ARCHER:
- if (p_ptr->lev < 20)
- a = TERM_L_GREEN;
- else
- a = TERM_GREEN;
- break;
- case CLASS_ROGUE:
- case CLASS_NINJA:
- if (p_ptr->lev < 20)
- a = TERM_SLATE;
- else
- a = TERM_L_DARK;
- break;
- case CLASS_WARRIOR:
- case CLASS_SMITH:
- case CLASS_BERSERKER:
- case CLASS_SAMURAI:
- if (p_ptr->lev < 20)
- a = TERM_L_UMBER;
- else
- a = TERM_UMBER;
- break;
- case CLASS_MONK:
- case CLASS_MINDCRAFTER:
- case CLASS_FORCETRAINER:
- case CLASS_MIRROR_MASTER:
- if (p_ptr->lev < 20)
- a = TERM_L_UMBER;
- else
- a = TERM_UMBER;
- c = 248;
- break;
- default: /* Unknown */
- a = TERM_WHITE;
- }
- switch (p_ptr->prace)
- {
- case RACE_GNOME:
- case RACE_HOBBIT:
- c = 144;
- break;
- case RACE_DWARF:
- c = 236;
- break;
- case RACE_HALF_ORC:
- c = 243;
- break;
- case RACE_HALF_TROLL:
- c = 184;
- break;
- case RACE_ELF:
- case RACE_ENT:
- case RACE_HALF_ELF:
- case RACE_HIGH_ELF:
- case RACE_KUTA:
- c = 223;
- break;
- case RACE_HALF_OGRE:
- c = 168;
- break;
- case RACE_HALF_GIANT:
- case RACE_HALF_TITAN:
- case RACE_CYCLOPS:
- c = 145;
- break;
- case RACE_YEEK:
- c = 209;
- break;
- case RACE_KLACKON:
- c = 229;
- break;
- case RACE_KOBOLD:
- c = 204;
- break;
- case RACE_NIBELUNG:
- c = 144;
- break;
- case RACE_DARK_ELF:
- c = 223;
- break;
- case RACE_DRACONIAN:
- if (p_ptr->lev < 20)
- c = 240;
- else if (p_ptr->lev < 40)
- c = 22;
- else
- c = 137;
- break;
- case RACE_MIND_FLAYER:
- c = 236;
- break;
- case RACE_IMP:
- c = 142;
- break;
- case RACE_GOLEM:
- case RACE_ANDROID:
- c = 6;
- break;
- case RACE_SKELETON:
- if (p_ptr->pclass == CLASS_MAGE ||
- p_ptr->pclass == CLASS_PRIEST ||
- p_ptr->pclass == CLASS_HIGH_MAGE ||
- p_ptr->pclass == CLASS_SORCERER ||
- p_ptr->pclass == CLASS_MONK ||
- p_ptr->pclass == CLASS_FORCETRAINER ||
- p_ptr->pclass == CLASS_BLUE_MAGE ||
- p_ptr->pclass == CLASS_MIRROR_MASTER ||
- p_ptr->pclass == CLASS_MINDCRAFTER)
- c = 159;
- else
- c = 181;
- break;
- case RACE_ZOMBIE:
- c = 221;
- break;
- case RACE_VAMPIRE:
- c = 217;
- break;
- case RACE_SPECTRE:
- c = 241;
- break;
- case RACE_SPRITE:
- case RACE_S_FAIRY:
- c = 244;
- break;
- case RACE_BEASTMAN:
- c = 154;
- break;
- case RACE_ANGEL:
- case RACE_DEMON:
- c = 144;
- break;
- }
- }
- }
- }
-
- /* Save the info */
- (*ap) = a;
- (*cp) = c;
+#ifdef JP
+/*
+ * Table of Ascii-to-Zenkaku
+ * ¡Ö¢£¡×¤ÏÆóÇÜÉýƦÉå¤ÎÆâÉô¥³¡¼¥É¤Ë»ÈÍÑ¡£
+ */
+static char ascii_to_zenkaku[2*128+1] = "\
+¡¡¡ª¡É¡ô¡ð¡ó¡õ¡Ç¡Ê¡Ë¡ö¡Ü¡¤¡Ý¡¥¡¿\
+£°£±£²£³£´£µ£¶£·£¸£¹¡§¡¨¡ã¡á¡ä¡©\
+¡÷£Á£Â£Ã£Ä£Å£Æ£Ç£È£É£Ê£Ë£Ì£Í£Î£Ï\
+£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡Î¡À¡Ï¡°¡²\
+¡Æ£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï\
+£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡Ð¡Ã¡Ñ¡Á¢£";
+#endif
-#endif /* VARIABLE_PLAYER_GRAPH */
+/*
+ * Prepare Bigtile or 2-bytes character attr/char pairs
+ */
+void bigtile_attr(char *cp, byte *ap, char *cp2, byte *ap2)
+{
+ if ((*ap & 0x80) && (*cp & 0x80))
+ {
+ *ap2 = 255;
+ *cp2 = -1;
+ return;
+ }
+#ifdef JP
+ if (isprint(*cp) || *cp == 127)
+ {
+ *ap2 = (*ap) | 0xf0;
+ *cp2 = ascii_to_zenkaku[2*(*cp-' ') + 1];
+ *cp = ascii_to_zenkaku[2*(*cp-' ')];
+ return;
}
+#endif
+
+ *ap2 = TERM_WHITE;
+ *cp2 = ' ';
}
+/*
+ * Calculate panel colum of a location in the map
+ */
+static int panel_col_of(int col)
+{
+ col -= panel_col_min;
+ if (use_bigtile) col *= 2;
+ return col + 13;
+}
+
/*
* Moves the cursor to a given MAP (y,x) location
{
/* Real co-ords convert to screen positions */
row -= panel_row_prt;
- col -= panel_col_prt;
/* Go there */
- Term_gotoxy(col, row);
+ Term_gotoxy(panel_col_of(col), row);
}
*/
void print_rel(char c, byte a, int y, int x)
{
+ char c2;
+ byte a2;
+
/* Only do "legal" locations */
if (panel_contains(y, x))
{
/* Hack -- fake monochrome */
- if (!use_graphics || streq(ANGBAND_SYS, "ibm"))
+ if (!use_graphics)
{
if (world_monster) a = TERM_DARK;
- else if (p_ptr->invuln || world_player) a = TERM_WHITE;
- else if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN)) a = TERM_WHITE;
+ else if (IS_INVULN() || world_player) a = TERM_WHITE;
else if (p_ptr->wraith_form) a = TERM_L_DARK;
}
+ if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
+
/* Draw the char using the attr */
- Term_draw(x-panel_col_prt, y-panel_row_prt, a, c);
+ Term_draw(panel_col_of(x), y-panel_row_prt, a, c);
+ if (use_bigtile)
+ Term_draw(panel_col_of(x)+1, y-panel_row_prt, a2, c2);
}
}
s16b this_o_idx, next_o_idx = 0;
+ byte feat;
+
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Blind players see nothing */
if (p_ptr->blind) return;
/* Require line of sight to the grid */
if (!(c_ptr->info & (CAVE_VIEW))) return;
- if (p_ptr->pclass != CLASS_NINJA)
- {
/* Require "perma-lite" of the grid */
- if (!(c_ptr->info & (CAVE_GLOW | CAVE_MNLT))) return;
+ if (!(c_ptr->info & CAVE_MNLT) && ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW))
+ {
+ /* Not Ninja */
+ if (!p_ptr->see_nocto) return;
}
}
next_o_idx = o_ptr->next_o_idx;
/* Memorize objects */
- o_ptr->marked = TRUE;
+ o_ptr->marked |= OM_FOUND;
}
/* Hack -- memorize grids */
if (!(c_ptr->info & (CAVE_MARK)))
{
- if (p_ptr->pclass == CLASS_NINJA)
- {
- c_ptr->info |= (CAVE_MARK);
- }
/* Handle floor grids first */
- if ((c_ptr->feat <= FEAT_INVIS) || (c_ptr->feat == FEAT_DIRT) || (c_ptr->feat == FEAT_GRASS))
+ if ((feat <= FEAT_INVIS) || (feat == FEAT_DIRT) || (feat == FEAT_GRASS))
{
/* Option -- memorize all torch-lit floors */
- if (view_torch_grids && (c_ptr->info & (CAVE_LITE)))
+ if (view_torch_grids &&
+ ((c_ptr->info & (CAVE_LITE | CAVE_MNLT)) || p_ptr->see_nocto))
{
/* Memorize */
c_ptr->info |= (CAVE_MARK);
}
/* 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);
}
/* Memorize torch-lit walls */
- else if (c_ptr->info & (CAVE_LITE))
+ else if (c_ptr->info & (CAVE_LITE | CAVE_MNLT))
+ {
+ /* Memorize */
+ c_ptr->info |= (CAVE_MARK);
+ }
+
+ /* Memorize walls seen by noctovision of Ninja */
+ else if (p_ptr->see_nocto)
{
/* Memorize */
c_ptr->info |= (CAVE_MARK);
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);
#endif /* USE_TRANSPARENCY */
/* Hack -- fake monochrome */
- if (!use_graphics || streq(ANGBAND_SYS, "ibm"))
+ if (!use_graphics)
{
if (world_monster) a = TERM_DARK;
- else if (p_ptr->invuln || world_player) a = TERM_WHITE;
- else if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN)) a = TERM_WHITE;
+ else if (IS_INVULN() || world_player) a = TERM_WHITE;
else if (p_ptr->wraith_form) a = TERM_L_DARK;
}
void lite_spot(int y, int x)
{
/* Redraw if on screen */
- if (panel_contains(y, x))
+ if (panel_contains(y, x) && in_bounds2(y, x))
{
byte a;
char c;
#endif /* USE_TRANSPARENCY */
/* Hack -- fake monochrome */
- if (!use_graphics || streq(ANGBAND_SYS, "ibm"))
+ if (!use_graphics)
{
if (world_monster) a = TERM_DARK;
- else if (p_ptr->invuln || world_player) a = TERM_WHITE;
- else if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN)) a = TERM_WHITE;
+ else if (IS_INVULN() || world_player) a = TERM_WHITE;
else if (p_ptr->wraith_form) a = TERM_L_DARK;
}
+#ifdef JP
+ if (use_bigtile && is_ascii_graphics(a) && (isprint(c) || c == 127))
+ {
+ /* Term_queue_chars ¤ÏÁ´³ÑASCIIÃÏ·Á¤òÀµ¤·¤¯update¤¹¤ë¡£ */
+ Term_queue_chars(panel_col_of(x), y-panel_row_prt, 2, a, &ascii_to_zenkaku[2*(c-' ')]);
+ return;
+ }
+#endif
+
#ifdef USE_TRANSPARENCY
/* Hack -- Queue it */
- Term_queue_char(x-panel_col_prt, y-panel_row_prt, a, c, ta, tc);
+ Term_queue_char(panel_col_of(x), y-panel_row_prt, a, c, ta, tc);
+ if (use_bigtile)
+ Term_queue_char(panel_col_of(x)+1, y-panel_row_prt, 255, -1, 0, 0);
#else /* USE_TRANSPARENCY */
/* Hack -- Queue it */
- Term_queue_char(x-panel_col_prt, y-panel_row_prt, a, c);
+ Term_queue_char(panel_col_of(x), y-panel_row_prt, a, c);
+ if (use_bigtile)
+ Term_queue_char(panel_col_of(x)+1, y-panel_row_prt, 255, -1);
#endif /* USE_TRANSPARENCY */
+
+ /* Update sub-windows */
+ p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
}
}
{
int x, y;
int v;
- bool fake_monochrome = (!use_graphics || streq(ANGBAND_SYS, "ibm"));
+ /* map bounds */
+ s16b xmin, xmax, ymin, ymax;
+
+ int wid, hgt;
+
+ /* Get size */
+ Term_get_size(&wid, &hgt);
+
+ /* Remove map offset */
+ wid -= COL_MAP + 2;
+ hgt -= ROW_MAP + 2;
/* Access the cursor state */
(void)Term_get_cursor(&v);
/* Hide the cursor */
(void)Term_set_cursor(0);
+ /* Get bounds */
+ xmin = (0 < panel_col_min) ? panel_col_min : 0;
+ xmax = (cur_wid - 1 > panel_col_max) ? panel_col_max : cur_wid - 1;
+ ymin = (0 < panel_row_min) ? panel_row_min : 0;
+ ymax = (cur_hgt - 1 > panel_row_max) ? panel_row_max : cur_hgt - 1;
+
+ /* Bottom section of screen */
+ for (y = 1; y <= ymin - panel_row_prt; y++)
+ {
+ /* Erase the section */
+ Term_erase(COL_MAP, y, wid);
+ }
+
+ /* Top section of screen */
+ for (y = ymax - panel_row_prt; y <= hgt; y++)
+ {
+ /* Erase the section */
+ Term_erase(COL_MAP, y, wid);
+ }
+
/* Dump the map */
- for (y = panel_row_min; y <= panel_row_max; y++)
+ for (y = ymin; y <= ymax; y++)
{
/* Scan the columns of row "y" */
- for (x = panel_col_min; x <= panel_col_max; x++)
+ for (x = xmin; x <= xmax; x++)
{
- byte a;
- char c;
+ byte a, a2;
+ char c, c2;
#ifdef USE_TRANSPARENCY
byte ta;
/* Determine what is there */
map_info(y, x, &a, &c, &ta, &tc);
-
- /* Hack -- fake monochrome */
- if (fake_monochrome)
- {
- if (world_monster) a = TERM_DARK;
- else if (p_ptr->invuln || world_player) a = TERM_WHITE;
- else if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN)) a = TERM_WHITE;
- else if (p_ptr->wraith_form) a = TERM_L_DARK;
- }
-
- /* Efficiency -- Redraw that grid of the map */
- Term_queue_char(x-panel_col_prt, y-panel_row_prt, a, c, ta, tc);
-#else /* USE_TRANSPARENCY */
+#else
/* Determine what is there */
map_info(y, x, &a, &c);
+#endif
/* Hack -- fake monochrome */
- if (fake_monochrome)
+ if (!use_graphics)
{
if (world_monster) a = TERM_DARK;
- else if (p_ptr->invuln || world_player) a = TERM_WHITE;
- else if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN)) a = TERM_WHITE;
+ else if (IS_INVULN() || world_player) a = TERM_WHITE;
else if (p_ptr->wraith_form) a = TERM_L_DARK;
}
+ if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
+
/* Efficiency -- Redraw that grid of the map */
- Term_queue_char(x-panel_col_prt, y-panel_row_prt, a, c);
-#endif /* USE_TRANSPARENCY */
+#ifdef USE_TRANSPARENCY
+ Term_queue_char(panel_col_of(x), y-panel_row_prt, a, c, ta, tc);
+ if (use_bigtile) Term_queue_char(panel_col_of(x)+1, y-panel_row_prt, a2, c2, 0, 0);
+#else
+ Term_queue_char(panel_col_of(x), y-panel_row_prt, a, c);
+ if (use_bigtile) Term_queue_char(panel_col_of(x)+1, y-panel_row_prt, a2, c2);
+#endif
}
}
int path_n;
u16b path_g[512];
int default_color = TERM_SLATE;
- bool fake_monochrome = (!use_graphics || streq(ANGBAND_SYS, "ibm"));
if (!display_path) return;
if (-1 == project_length)
if (panel_contains(ny, nx))
{
- byte a = default_color;
- char c;
+ byte a2, a = default_color;
+ char c, c2;
#ifdef USE_TRANSPARENCY
byte ta;
char tc;
+#endif
if (cave[ny][nx].m_idx && m_list[cave[ny][nx].m_idx].ml)
{
/* Determine what is there */
+#ifdef USE_TRANSPARENCY
map_info(ny, nx, &a, &c, &ta, &tc);
-
- if (c == '.' && (a == TERM_WHITE || a == TERM_L_WHITE))
- a = default_color;
- else if (a == default_color)
- a = TERM_WHITE;
- }
-
- if (fake_monochrome)
- {
- if (world_monster) a = TERM_DARK;
- else if (p_ptr->invuln || world_player) a = TERM_WHITE;
- else if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN)) a = TERM_WHITE;
- else if (p_ptr->wraith_form) a = TERM_L_DARK;
- }
-
-
- /* Hack -- Queue it */
- Term_queue_char(nx-panel_col_prt, ny-panel_row_prt, a, '*', ta, tc);
-#else /* USE_TRANSPARENCY */
-
- if (cave[ny][nx].m_idx && m_list[cave[ny][nx].m_idx].ml)
- {
- /* Determine what is there */
+#else
map_info(ny, nx, &a, &c);
-
- if (c == '.' && (a == TERM_WHITE || a == TERM_L_WHITE))
+#endif
+ if (!is_ascii_graphics(a))
+ a = default_color;
+ else if (c == '.' && (a == TERM_WHITE || a == TERM_L_WHITE))
a = default_color;
else if (a == default_color)
a = TERM_WHITE;
}
- if (fake_monochrome)
+ if (!use_graphics)
{
if (world_monster) a = TERM_DARK;
- else if (p_ptr->invuln || world_player) a = TERM_WHITE;
- else if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN)) a = TERM_WHITE;
+ else if (IS_INVULN() || world_player) a = TERM_WHITE;
else if (p_ptr->wraith_form) a = TERM_L_DARK;
}
+ c = '*';
+ if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
+
/* Hack -- Queue it */
- Term_queue_char(nx-panel_col_prt, ny-panel_row_prt, a, '*');
-#endif /* USE_TRANSPARENCY */
+#ifdef USE_TRANSPARENCY
+ Term_queue_char(panel_col_of(nx), ny-panel_row_prt, a, c, ta, tc);
+ if (use_bigtile) Term_queue_char(panel_col_of(nx)+1, ny-panel_row_prt, a, c2, 0, 0);
+#else
+ Term_queue_char(panel_col_of(nx), ny-panel_row_prt, a, c);
+ if (use_bigtile) Term_queue_char(panel_col_of(nx)+1, ny-panel_row_prt, a, c2);
+#endif
}
/* Known Wall */
{
int i, j, x, y;
- byte ta;
- char tc;
+ byte ta, a2;
+ char tc, c2;
byte tp;
- byte bigma[MAX_HGT+2][MAX_WID+2];
- char bigmc[MAX_HGT+2][MAX_WID+2];
- byte bigmp[MAX_HGT+2][MAX_WID+2];
-
- byte ma[SCREEN_HGT + 2][SCREEN_WID + 2];
- char mc[SCREEN_HGT + 2][SCREEN_WID + 2];
+ byte **bigma;
+ char **bigmc;
+ byte **bigmp;
- byte mp[SCREEN_HGT + 2][SCREEN_WID + 2];
+ byte **ma;
+ char **mc;
+ byte **mp;
- bool old_view_special_lite;
- bool old_view_granite_lite;
-
- bool fake_monochrome = (!use_graphics || streq(ANGBAND_SYS, "ibm"));
+ /* Save lighting effects */
+ bool old_view_special_lite = view_special_lite;
+ bool old_view_granite_lite = view_granite_lite;
- int yrat = cur_hgt / SCREEN_HGT;
- int xrat = cur_wid / SCREEN_WID;
+ int hgt, wid, yrat, xrat;
+ int **match_autopick_yx;
+ object_type ***object_autopick_yx;
- int match_autopick_yx[SCREEN_HGT+2][SCREEN_WID+2];
- object_type *object_autopick_yx[SCREEN_HGT+2][SCREEN_WID+2];
+ /* Get size */
+ Term_get_size(&wid, &hgt);
+ hgt -= 2;
+ wid -= 14;
+ if (use_bigtile) wid /= 2;
- /* Save lighting effects */
- old_view_special_lite = view_special_lite;
- old_view_granite_lite = view_granite_lite;
+ yrat = (cur_hgt + hgt - 1) / hgt;
+ xrat = (cur_wid + wid - 1) / wid;
/* Disable lighting effects */
view_special_lite = FALSE;
view_granite_lite = FALSE;
- /* Clear the chars and attributes */
- for (y = 0; y < SCREEN_HGT + 2; ++y)
+ /* Allocate the maps */
+ C_MAKE(ma, (hgt + 2), byte_ptr);
+ C_MAKE(mc, (hgt + 2), char_ptr);
+ C_MAKE(mp, (hgt + 2), byte_ptr);
+ C_MAKE(match_autopick_yx, (hgt + 2), sint_ptr);
+ C_MAKE(object_autopick_yx, (hgt + 2), object_type **);
+
+ /* Allocate and wipe each line map */
+ for (y = 0; y < (hgt + 2); y++)
{
- for (x = 0; x < SCREEN_WID + 2; ++x)
+ /* Allocate one row each array */
+ C_MAKE(ma[y], (wid + 2), byte);
+ C_MAKE(mc[y], (wid + 2), char);
+ C_MAKE(mp[y], (wid + 2), byte);
+ C_MAKE(match_autopick_yx[y], (wid + 2), int);
+ C_MAKE(object_autopick_yx[y], (wid + 2), object_type *);
+
+ for (x = 0; x < wid + 2; ++x)
{
match_autopick_yx[y][x] = -1;
object_autopick_yx[y][x] = NULL;
}
}
- for (j = 0; j < cur_hgt + 2; ++j)
+ /* Allocate the maps */
+ C_MAKE(bigma, (cur_hgt + 2), byte_ptr);
+ C_MAKE(bigmc, (cur_hgt + 2), char_ptr);
+ C_MAKE(bigmp, (cur_hgt + 2), byte_ptr);
+
+ /* Allocate and wipe each line map */
+ for (y = 0; y < (cur_hgt + 2); y++)
{
- for (i = 0; i < cur_wid + 2; ++i)
+ /* Allocate one row each array */
+ C_MAKE(bigma[y], (cur_wid + 2), byte);
+ C_MAKE(bigmc[y], (cur_wid + 2), char);
+ C_MAKE(bigmp[y], (cur_wid + 2), byte);
+
+ for (x = 0; x < cur_wid + 2; ++x)
{
/* Nothing here */
- bigma[j][i] = TERM_WHITE;
- bigmc[j][i] = ' ';
+ bigma[y][x] = TERM_WHITE;
+ bigmc[y][x] = ' ';
/* No priority */
- bigmp[j][i] = 0;
+ bigmp[y][x] = 0;
}
}
/* Corners */
- x = SCREEN_WID + 1;
- y = SCREEN_HGT + 1;
+ x = wid + 1;
+ y = hgt + 1;
/* Draw the corners */
mc[0][0] = mc[0][x] = mc[y][0] = mc[y][x] = '+';
/* Draw the horizontal edges */
- for (x = 1; x <= SCREEN_WID; x++) mc[0][x] = mc[y][x] = '-';
+ for (x = 1; x <= wid; x++) mc[0][x] = mc[y][x] = '-';
/* Draw the vertical edges */
- for (y = 1; y <= SCREEN_HGT; y++) mc[y][0] = mc[y][x] = '|';
+ for (y = 1; y <= hgt; y++) mc[y][0] = mc[y][x] = '|';
/* Display each map line in order */
- for (y = 0; y < SCREEN_HGT+2; ++y)
+ for (y = 0; y < hgt + 2; ++y)
{
/* Start a new line */
Term_gotoxy(COL_MAP, y);
/* Display the line */
- for (x = 0; x < SCREEN_WID+2; ++x)
+ for (x = 0; x < wid + 2; ++x)
{
ta = ma[y][x];
tc = mc[y][x];
/* Hack -- fake monochrome */
- if (fake_monochrome)
+ if (!use_graphics)
{
if (world_monster) ta = TERM_DARK;
- else if (p_ptr->invuln || world_player) ta = TERM_WHITE;
- else if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN)) ta = TERM_WHITE;
+ else if (IS_INVULN() || world_player) ta = TERM_WHITE;
else if (p_ptr->wraith_form) ta = TERM_L_DARK;
}
+ if (use_bigtile) bigtile_attr(&tc, &ta, &c2, &a2);
+
/* Add the character */
Term_addch(ta, tc);
+ if (use_bigtile) Term_addch(a2, c2);
}
}
- for (y = 1; y < SCREEN_HGT+1; ++y)
+ for (y = 1; y < hgt + 1; ++y)
{
match_autopick = -1;
- for (x = 1; x <= SCREEN_WID; x++){
+ for (x = 1; x <= wid; x++){
if (match_autopick_yx[y][x] != -1 &&
(match_autopick > match_autopick_yx[y][x] ||
match_autopick == -1)){
#else
{
char buf[13] = "\0";
- strncpy(buf,autopick_name[match_autopick],12);
+ strncpy(buf,autopick_list[match_autopick].name,12);
buf[12] = '\0';
put_str(buf,y,0);
}
}
- /* Player location */
- (*cy) = py / yrat + 1 + ROW_MAP;
- (*cx) = px / xrat + 1 + COL_MAP;
+ /* Player location */
+ (*cy) = py / yrat + 1 + ROW_MAP;
+ if (!use_bigtile)
+ (*cx) = px / xrat + 1 + COL_MAP;
+ else
+ (*cx) = (px / xrat + 1) * 2 + COL_MAP;
+
+ /* Restore lighting effects */
+ view_special_lite = old_view_special_lite;
+ view_granite_lite = old_view_granite_lite;
+
+ /* Free each line map */
+ for (y = 0; y < (hgt + 2); y++)
+ {
+ /* Free one row each array */
+ C_FREE(ma[y], (wid + 2), byte);
+ C_FREE(mc[y], (wid + 2), char);
+ C_FREE(mp[y], (wid + 2), byte);
+ C_FREE(match_autopick_yx[y], (wid + 2), int);
+ C_FREE(object_autopick_yx[y], (wid + 2), object_type **);
+ }
+
+ /* Free each line map */
+ C_FREE(ma, (hgt + 2), byte_ptr);
+ C_FREE(mc, (hgt + 2), char_ptr);
+ C_FREE(mp, (hgt + 2), byte_ptr);
+ C_FREE(match_autopick_yx, (hgt + 2), sint_ptr);
+ C_FREE(object_autopick_yx, (hgt + 2), object_type **);
+ /* Free each line map */
+ for (y = 0; y < (cur_hgt + 2); y++)
+ {
+ /* Free one row each array */
+ C_FREE(bigma[y], (cur_wid + 2), byte);
+ C_FREE(bigmc[y], (cur_wid + 2), char);
+ C_FREE(bigmp[y], (cur_wid + 2), byte);
+ }
- /* Restore lighting effects */
- view_special_lite = old_view_special_lite;
- view_granite_lite = old_view_granite_lite;
+ /* Free each line map */
+ C_FREE(bigma, (cur_hgt + 2), byte_ptr);
+ C_FREE(bigmc, (cur_hgt + 2), char_ptr);
+ C_FREE(bigmp, (cur_hgt + 2), byte_ptr);
}
/* Clear the screen */
Term_clear();
- display_autopick = 0;
+ display_autopick = 0;
/* Display the map */
display_map(&cy, &cx);
/* Wait for it */
- if(max_autopick && !p_ptr->wild_mode)
+ if(max_autopick && !p_ptr->wild_mode)
{
display_autopick = ITEM_DISPLAY;
int i;
byte flag;
+ int wid, hgt, row_message;
+
+ Term_get_size(&wid, &hgt);
+ row_message = hgt - 1;
+
#ifdef JP
- put_str("²¿¤«¥¡¼¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤('M':½¦¤¦ 'N':ÊüÃÖ 'D':M+N 'K':²õ¤¹¥¢¥¤¥Æ¥à¤òɽ¼¨)", 23, 1);
+ put_str("²¿¤«¥¡¼¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤('M':½¦¤¦ 'N':ÊüÃÖ 'D':M+N 'K':²õ¤¹¥¢¥¤¥Æ¥à¤òɽ¼¨)", row_message, 1);
#else
- put_str(" Hit M, N(for ~), K(for !), or D(same as M+N) to display auto-picker items.", 23, 1);
+ put_str(" Hit M, N(for ~), K(for !), or D(same as M+N) to display auto-picker items.", row_message, 1);
#endif
/* Hilite the player */
i = inkey();
if ('M' == i)
- flag = DO_AUTOPICK;
+ flag = (DO_AUTOPICK | DO_QUERY_AUTOPICK);
else if ('N' == i)
flag = DONT_AUTOPICK;
else if ('K' == i)
flag = DO_AUTODESTROY;
else if ('D' == i)
- flag = (DO_AUTOPICK | DONT_AUTOPICK);
+ flag = (DO_AUTOPICK | DO_QUERY_AUTOPICK | DONT_AUTOPICK);
else
break;
cave[y][x].info &= ~(CAVE_LITE);
/* Redraw */
- lite_spot(y, x);
+ /* lite_spot(y, x); Perhaps don't need? */
}
/* None left */
/*
+ * For delayed visual update
+ */
+#define cave_note_and_redraw_later(C,Y,X) \
+{\
+ (C)->info |= CAVE_NOTE; \
+ cave_redraw_later((C), (Y), (X)); \
+}
+
+
+/*
+ * For delayed visual update
+ */
+#define cave_redraw_later(C,Y,X) \
+{\
+ if (!((C)->info & CAVE_REDRAW)) \
+ { \
+ (C)->info |= CAVE_REDRAW; \
+ redraw_y[redraw_n] = (Y); \
+ redraw_x[redraw_n++] = (X); \
+ } \
+}
+
+
+/*
* XXX XXX XXX
*
* This macro allows us to efficiently add a grid to the "lite" array,
* list the "nearby" grids before the more "distant" ones in the
* array of torch-lit grids.
*
- * We will correctly handle "large" radius lites, though currently,
- * it is impossible for the player to have more than radius 3 lite.
- *
* We assume that "radius zero" lite is in fact no lite at all.
*
* Torch Lantern Artifacts
{
int i, x, y, min_x, max_x, min_y, max_y;
int p = p_ptr->cur_lite;
+ cave_type *c_ptr;
/*** Special case ***/
+#if 0
/* Hack -- Player has no lite */
if (p <= 0)
{
/* Forget the old lite */
- forget_lite();
+ /* forget_lite(); Perhaps don't need? */
- /* Draw the player */
- lite_spot(py, px);
+ /* Add it to later visual update */
+ cave_redraw_later(&cave[py][px], py, px);
}
-
+#endif
/*** Save the old "lite" grids for later ***/
int d;
/* Paranoia -- see "LITE_MAX" */
- if (p > 5) p = 5;
+ if (p > 14) p = 14;
/* South-East of the player */
if (cave_floor_bold(py+1, px+1))
y = lite_y[i];
x = lite_x[i];
- /* Update fresh grids */
- if (cave[y][x].info & (CAVE_TEMP)) continue;
+ c_ptr = &cave[y][x];
- /* Note */
- note_spot(y, x);
+ /* Update fresh grids */
+ if (c_ptr->info & (CAVE_TEMP)) continue;
- /* Redraw */
- lite_spot(y, x);
+ /* Add it to later visual update */
+ cave_note_and_redraw_later(c_ptr, y, x);
}
/* Clear them all */
y = temp_y[i];
x = temp_x[i];
+ c_ptr = &cave[y][x];
+
/* No longer in the array */
- cave[y][x].info &= ~(CAVE_TEMP);
+ c_ptr->info &= ~(CAVE_TEMP);
/* Update stale grids */
- if (cave[y][x].info & (CAVE_LITE)) continue;
+ if (c_ptr->info & (CAVE_LITE)) continue;
- /* Redraw */
- lite_spot(y, x);
+ /* Add it to later visual update */
+ cave_redraw_later(c_ptr, y, x);
}
/* None left */
temp_n = 0;
+
+ /* Mega-Hack -- Visual update later */
+ p_ptr->update |= (PU_DELAY_VIS);
}
static bool mon_invis;
+static s16b mon_fy, mon_fx;
/*
* Add a square to the changes array
static void mon_lite_hack(int y, int x)
{
cave_type *c_ptr;
+ int midpoint, dpf, d;
- /* Out of bounds */
- if (!in_bounds2(y, x)) return;
+ /* We trust this grid is in bounds */
+ /* if (!in_bounds2(y, x)) return; */
c_ptr = &cave[y][x];
/* Want a unlit square in view of the player */
if ((c_ptr->info & (CAVE_MNLT | 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 (!cave_floor_grid(c_ptr))
+ {
+ /* Hack XXX XXX - Is it a wall and monster not in LOS? */
+ if (mon_invis) return;
+
+ /* Hack -- Prevent monster lite leakage in walls */
- /* Save this square */
- if (temp_n < TEMP_MAX)
+ /* Horizontal walls between player and a monster */
+ if (((y < py) && (y > mon_fy)) || ((y > py) && (y < mon_fy)))
+ {
+ dpf = py - mon_fy;
+ d = y - mon_fy;
+ midpoint = mon_fx + ((px - mon_fx) * ABS(d)) / ABS(dpf);
+
+ /* Only first wall viewed from mid-x is lit */
+ if (x < midpoint)
+ {
+ if (!cave_floor_bold(y, x + 1)) return;
+ }
+ else if (x > midpoint)
+ {
+ if (!cave_floor_bold(y, x - 1)) return;
+ }
+ }
+
+ /* Vertical walls between player and a monster */
+ if (((x < px) && (x > mon_fx)) || ((x > px) && (x < mon_fx)))
+ {
+ dpf = px - mon_fx;
+ d = x - mon_fx;
+ midpoint = mon_fy + ((py - mon_fy) * ABS(d)) / ABS(dpf);
+
+ /* Only first wall viewed from mid-y is lit */
+ if (y < midpoint)
+ {
+ if (!cave_floor_bold(y + 1, x)) return;
+ }
+ else if (y > midpoint)
+ {
+ if (!cave_floor_bold(y - 1, x)) return;
+ }
+ }
+ }
+
+ /* We trust temp_n does not exceed 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;
+ int midpoint, dpf, d;
+
+ /* We trust this grid is in 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 | CAVE_MNDK | CAVE_VIEW)) != CAVE_VIEW) return;
+
+ if (!cave_floor_grid(c_ptr))
+ {
+ /* Hack XXX XXX - Is it a wall and monster not in LOS? */
+ if (mon_invis) return;
+
+ /* Hack -- Prevent monster dark lite leakage in walls */
+
+ /* Horizontal walls between player and a monster */
+ if (((y < py) && (y > mon_fy)) || ((y > py) && (y < mon_fy)))
+ {
+ dpf = py - mon_fy;
+ d = y - mon_fy;
+ midpoint = mon_fx + ((px - mon_fx) * ABS(d)) / ABS(dpf);
+
+ /* Only first wall viewed from mid-x is lit */
+ if (x < midpoint)
+ {
+ if (!cave_floor_bold(y, x + 1)) return;
+ }
+ else if (x > midpoint)
+ {
+ if (!cave_floor_bold(y, x - 1)) return;
+ }
+ }
+
+ /* Vertical walls between player and a monster */
+ if (((x < px) && (x > mon_fx)) || ((x > px) && (x < mon_fx)))
+ {
+ dpf = px - mon_fx;
+ d = x - mon_fx;
+ midpoint = mon_fy + ((py - mon_fy) * ABS(d)) / ABS(dpf);
+
+ /* Only first wall viewed from mid-y is lit */
+ if (y < midpoint)
+ {
+ if (!cave_floor_bold(y + 1, x)) return;
+ }
+ else if (y > midpoint)
+ {
+ if (!cave_floor_bold(y - 1, x)) return;
+ }
+ }
+ }
+
+ /* We trust temp_n does not exceed TEMP_MAX */
+
+ /* Save this square */
+ temp_x[temp_n] = x;
+ temp_y[temp_n] = y;
+ temp_n++;
+
+ /* 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().
*/
cave_type *c_ptr;
s16b fx, fy;
+ void (*add_mon_lite)(int, int);
s16b end_temp;
- bool daytime = ((turn % (20L * TOWN_DAWN)) < ((20L * TOWN_DAWN) / 2));
+ /* Non-Ninja player in the darkness */
+ 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++)
/* 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 */
if (!m_ptr->r_idx) continue;
/* Is it too far away? */
- if (m_ptr->cdis > ((d_info[dungeon_type].flags1 & DF1_DARKNESS) ? MAX_SIGHT / 2 + 1 : MAX_SIGHT + 3)) continue;
+ if (m_ptr->cdis > dis_lim) continue;
+
+ /* If a monster stops time, break */
+ if (world_monster) break;
/* Get lite radius */
rad = 0;
/* 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 && daytime) || p_ptr->inside_battle)) continue;
-
- if (world_monster) continue;
-
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) rad = 1;
+ 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;
+ add_mon_lite = mon_lite_hack;
+ }
+ else
+ {
+ if (!(r_ptr->flags7 & (RF7_SELF_DARK_1 | RF7_SELF_DARK_2)) && (m_ptr->csleep || (!dun_level && !is_daytime()))) continue;
+ add_mon_lite = mon_dark_hack;
+ rad = -rad; /* Use absolute value */
+ }
/* Access the location */
- fx = m_ptr->fx;
- fy = m_ptr->fy;
+ mon_fx = m_ptr->fx;
+ mon_fy = m_ptr->fy;
/* Is the monster visible? */
- mon_invis = !(cave[fy][fx].info & CAVE_VIEW);
+ mon_invis = !(cave[mon_fy][mon_fx].info & CAVE_VIEW);
/* The square it is on */
- mon_lite_hack(fy, fx);
+ add_mon_lite(mon_fy, mon_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);
+ add_mon_lite(mon_fy + 1, mon_fx);
+ add_mon_lite(mon_fy - 1, mon_fx);
+ add_mon_lite(mon_fy, mon_fx + 1);
+ add_mon_lite(mon_fy, mon_fx - 1);
+ add_mon_lite(mon_fy + 1, mon_fx + 1);
+ add_mon_lite(mon_fy + 1, mon_fx - 1);
+ add_mon_lite(mon_fy - 1, mon_fx + 1);
+ add_mon_lite(mon_fy - 1, mon_fx - 1);
/* Radius 2 */
if (rad >= 2)
{
/* South of the monster */
- if (cave_floor_bold(fy + 1, fx))
+ if (cave_floor_bold(mon_fy + 1, mon_fx))
{
- mon_lite_hack(fy + 2, fx + 1);
- mon_lite_hack(fy + 2, fx);
- mon_lite_hack(fy + 2, fx - 1);
+ add_mon_lite(mon_fy + 2, mon_fx + 1);
+ add_mon_lite(mon_fy + 2, mon_fx);
+ add_mon_lite(mon_fy + 2, mon_fx - 1);
- c_ptr = &cave[fy + 2][fx];
+ c_ptr = &cave[mon_fy + 2][mon_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);
+ add_mon_lite(mon_fy + 3, mon_fx + 1);
+ add_mon_lite(mon_fy + 3, mon_fx);
+ add_mon_lite(mon_fy + 3, mon_fx - 1);
}
}
/* North of the monster */
- if (cave_floor_bold(fy - 1, fx))
+ if (cave_floor_bold(mon_fy - 1, mon_fx))
{
- mon_lite_hack(fy - 2, fx + 1);
- mon_lite_hack(fy - 2, fx);
- mon_lite_hack(fy - 2, fx - 1);
+ add_mon_lite(mon_fy - 2, mon_fx + 1);
+ add_mon_lite(mon_fy - 2, mon_fx);
+ add_mon_lite(mon_fy - 2, mon_fx - 1);
- c_ptr = &cave[fy - 2][fx];
+ c_ptr = &cave[mon_fy - 2][mon_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);
+ add_mon_lite(mon_fy - 3, mon_fx + 1);
+ add_mon_lite(mon_fy - 3, mon_fx);
+ add_mon_lite(mon_fy - 3, mon_fx - 1);
}
}
/* East of the monster */
- if (cave_floor_bold(fy, fx + 1))
+ if (cave_floor_bold(mon_fy, mon_fx + 1))
{
- mon_lite_hack(fy + 1, fx + 2);
- mon_lite_hack(fy, fx + 2);
- mon_lite_hack(fy - 1, fx + 2);
+ add_mon_lite(mon_fy + 1, mon_fx + 2);
+ add_mon_lite(mon_fy, mon_fx + 2);
+ add_mon_lite(mon_fy - 1, mon_fx + 2);
- c_ptr = &cave[fy][fx + 2];
+ c_ptr = &cave[mon_fy][mon_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);
+ add_mon_lite(mon_fy + 1, mon_fx + 3);
+ add_mon_lite(mon_fy, mon_fx + 3);
+ add_mon_lite(mon_fy - 1, mon_fx + 3);
}
}
/* West of the monster */
- if (cave_floor_bold(fy, fx - 1))
+ if (cave_floor_bold(mon_fy, mon_fx - 1))
{
- mon_lite_hack(fy + 1, fx - 2);
- mon_lite_hack(fy, fx - 2);
- mon_lite_hack(fy - 1, fx - 2);
+ add_mon_lite(mon_fy + 1, mon_fx - 2);
+ add_mon_lite(mon_fy, mon_fx - 2);
+ add_mon_lite(mon_fy - 1, mon_fx - 2);
- c_ptr = &cave[fy][fx - 2];
+ c_ptr = &cave[mon_fy][mon_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);
+ add_mon_lite(mon_fy + 1, mon_fx - 3);
+ add_mon_lite(mon_fy, mon_fx - 3);
+ add_mon_lite(mon_fy - 1, mon_fx - 3);
}
}
}
if (rad == 3)
{
/* South-East of the monster */
- if (cave_floor_bold(fy + 1, fx + 1))
+ if (cave_floor_bold(mon_fy + 1, mon_fx + 1))
{
- mon_lite_hack(fy + 2, fx + 2);
+ add_mon_lite(mon_fy + 2, mon_fx + 2);
}
/* South-West of the monster */
- if (cave_floor_bold(fy + 1, fx - 1))
+ if (cave_floor_bold(mon_fy + 1, mon_fx - 1))
{
- mon_lite_hack(fy + 2, fx - 2);
+ add_mon_lite(mon_fy + 2, mon_fx - 2);
}
/* North-East of the monster */
- if (cave_floor_bold(fy - 1, fx + 1))
+ if (cave_floor_bold(mon_fy - 1, mon_fx + 1))
{
- mon_lite_hack(fy - 2, fx + 2);
+ add_mon_lite(mon_fy - 2, mon_fx + 2);
}
/* North-West of the monster */
- if (cave_floor_bold(fy - 1, fx - 1))
+ if (cave_floor_bold(mon_fy - 1, mon_fx - 1))
{
- mon_lite_hack(fy - 2, fx - 2);
+ add_mon_lite(mon_fy - 2, mon_fx - 2);
}
}
}
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 */
+ {
+ /* 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 is now unlit */
- note_spot(fy, fx);
- lite_spot(fy, fx);
+ /* 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 */
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)
{
/* It is now lit */
- lite_spot(fy, fx);
- note_spot(fy, fx);
+ /* Add it to later visual update */
+ cave_note_and_redraw_later(c_ptr, fy, fx);
+ }
+ }
+ 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 array */
- mon_lite_x[mon_lite_n] = fx;
- mon_lite_y[mon_lite_n] = fy;
- mon_lite_n++;
}
+
+ /* 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 */
temp_n = 0;
+ /* Mega-Hack -- Visual update later */
+ p_ptr->update |= (PU_DELAY_VIS);
+
p_ptr->monlite = (cave[py][px].info & CAVE_MNLT) ? TRUE : FALSE;
if (p_ptr->special_defense & NINJA_S_STEALTH)
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 */
/* Forget that the grid is viewable */
c_ptr->info &= ~(CAVE_VIEW);
+ if (!panel_contains(y, x)) continue;
+
/* Update the screen */
- lite_spot(y, x);
+ /* lite_spot(y, x); Perhaps don't need? */
}
/* None left */
/* Update only newly viewed grids */
if (c_ptr->info & (CAVE_TEMP)) continue;
- /* Note */
- note_spot(y, x);
-
- /* Redraw */
- lite_spot(y, x);
+ /* Add it to later visual update */
+ cave_note_and_redraw_later(c_ptr, y, x);
}
/* Wipe the old grids, update as needed */
/* Update only non-viewable grids */
if (c_ptr->info & (CAVE_VIEW)) continue;
- /* Redraw */
- lite_spot(y, x);
+ /* Add it to later visual update */
+ cave_redraw_later(c_ptr, y, x);
}
/* None left */
temp_n = 0;
+
+ /* Mega-Hack -- Visual update later */
+ p_ptr->update |= (PU_DELAY_VIS);
}
+/*
+ * Mega-Hack -- Delayed visual update
+ * Only used if update_view(), update_lite() or update_mon_lite() was called
+ */
+void delayed_visual_update(void)
+{
+ int i, y, x;
+ cave_type *c_ptr;
+
+ /* Update needed grids */
+ for (i = 0; i < redraw_n; i++)
+ {
+ y = redraw_y[i];
+ x = redraw_x[i];
+
+ /* Access the grid */
+ c_ptr = &cave[y][x];
+ /* Update only needed grids (prevent multiple updating) */
+ if (!(c_ptr->info & CAVE_REDRAW)) continue;
+ /* If required, note */
+ if (c_ptr->info & CAVE_NOTE) note_spot(y, x);
+ /* Redraw */
+ lite_spot(y, x);
-/*
- * Hack -- provide some "speed" for the "flow" code
- * This entry is the "current index" for the "when" field
- * Note that a "when" value of "zero" means "not used".
- *
- * Note that the "cost" indexes from 1 to 127 are for
- * "old" data, and from 128 to 255 are for "new" data.
- *
- * This means that as long as the player does not "teleport",
- * then any monster up to 128 + MONSTER_FLOW_DEPTH will be
- * able to track down the player, and in general, will be
- * able to track down either the player or a position recently
- * occupied by the player.
- */
-static int flow_n = 0;
+ /* Hack -- Visual update of monster on this grid */
+ if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+
+ /* No longer in the array */
+ c_ptr->info &= ~(CAVE_NOTE | CAVE_REDRAW);
+ }
+
+ /* None left */
+ redraw_n = 0;
+}
/*
{
int x, y;
- /* Nothing to forget */
- if (!flow_n) return;
-
/* Check the entire dungeon */
for (y = 0; y < cur_hgt; y++)
{
cave[y][x].when = 0;
}
}
-
- /* Start over */
- flow_n = 0;
}
int flow_head = 1;
int flow_tail = 0;
- /* Hack -- disabled */
- if (stupid_monsters) return;
-
/* Paranoia -- make sure the array is empty */
if (temp_n) return;
x = tx + ddx_ddd[d];
/* Ignore player's grid */
- if (x == px && y == py) continue;
+ if (player_bold(y, x)) continue;
c_ptr = &cave[y][x];
-
- if ((c_ptr->feat >= FEAT_DOOR_HEAD) && (c_ptr->feat <= FEAT_SECRET)) m += 3;
+
+ if (is_closed_door(c_ptr->feat)) m += 3;
/* Ignore "pre-stamped" entries */
if (c_ptr->dist != 0 && c_ptr->dist <= n && c_ptr->cost <= m) continue;
/* Ignore "walls" and "rubble" */
- if ((c_ptr->feat > FEAT_SECRET) && (c_ptr->feat != FEAT_TREES) && !cave_floor_grid(c_ptr)) continue;
+ if ((c_ptr->feat >= FEAT_RUBBLE) && (c_ptr->feat != FEAT_TREES) && !cave_floor_grid(c_ptr)) continue;
/* Save the flow cost */
if (c_ptr->cost == 0 || c_ptr->cost > m) c_ptr->cost = m;
c_ptr = &cave[y][x];
/* Walls, water, and lava cannot hold scent. */
- if ((c_ptr->feat > FEAT_SECRET) && (c_ptr->feat != FEAT_TREES) && !cave_floor_grid(c_ptr)) continue;
+ if ((c_ptr->feat >= FEAT_RUBBLE) && (c_ptr->feat != FEAT_TREES) && !cave_floor_grid(c_ptr)) continue;
/* Grid must not be blocked by walls from the character */
if (!player_has_los_bold(y, x)) continue;
cave_type *c_ptr;
+ byte feat;
+
if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
/* Scan that area */
c_ptr = &cave[y][x];
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* All non-walls are "checked" */
- if ((c_ptr->feat < FEAT_SECRET) ||
- (c_ptr->feat == FEAT_RUBBLE) ||
- ((c_ptr->feat >= FEAT_MINOR_GLYPH) &&
- (c_ptr->feat <= FEAT_TREES)) ||
- (c_ptr->feat >= FEAT_TOWN))
+ if ((feat <= FEAT_DOOR_TAIL) ||
+ (feat == FEAT_RUBBLE) ||
+ ((feat >= FEAT_MINOR_GLYPH) &&
+ (feat <= FEAT_TREES)) ||
+ (feat >= FEAT_TOWN))
{
/* Memorize normal features */
- if ((c_ptr->feat > FEAT_INVIS) && (c_ptr->feat != FEAT_DIRT) && (c_ptr->feat != FEAT_GRASS))
+ if ((feat > FEAT_INVIS) && (feat != FEAT_DIRT) && (feat != FEAT_GRASS))
{
/* Memorize the object */
c_ptr->info |= (CAVE_MARK);
{
c_ptr = &cave[y + ddy_ddd[i]][x + ddx_ddd[i]];
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Memorize walls (etc) */
- if ((c_ptr->feat >= FEAT_SECRET) && (c_ptr->feat != FEAT_DIRT) && (c_ptr->feat != FEAT_GRASS))
+ if ((feat >= FEAT_RUBBLE) && (feat != FEAT_DIRT) && (feat != FEAT_GRASS))
{
/* Memorize the walls */
c_ptr->info |= (CAVE_MARK);
* since this would prevent the use of "view_torch_grids" as a method to
* keep track of what grids have been observed directly.
*/
-void wiz_lite(bool wizard, bool ninja)
+void wiz_lite(bool ninja)
{
int i, y, x;
+ byte feat;
/* Memorize objects */
for (i = 1; i < o_max; i++)
/* Skip held objects */
if (o_ptr->held_m_idx) continue;
-#if 0
- /* Skip objects in vaults, if not a wizard. -LM- */
- if ((wizard == FALSE) &&
- (cave[o_ptr->iy][o_ptr->ix].info & (CAVE_ICKY))) continue;
-#endif
-
/* Memorize */
- o_ptr->marked = TRUE;
+ o_ptr->marked |= OM_FOUND;
}
/* Scan all normal grids */
{
cave_type *c_ptr = &cave[y][x];
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Process all non-walls */
- if (cave_floor_bold(y, x) || (c_ptr->feat == FEAT_RUBBLE) || (c_ptr->feat == FEAT_TREES) || (c_ptr->feat == FEAT_MOUNTAIN))
+ if (cave_floor_bold(y, x) || (feat == FEAT_RUBBLE) || (feat == FEAT_TREES) || (feat == FEAT_MOUNTAIN))
{
/* Scan all neighbors */
for (i = 0; i < 9; i++)
/* Get the grid */
c_ptr = &cave[yy][xx];
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Memorize normal features */
if (ninja)
{
}
else
{
- if ((c_ptr->feat > FEAT_INVIS))
+ if ((feat > FEAT_INVIS))
{
/* Memorize the grid */
c_ptr->info |= (CAVE_MARK);
/* Forget every grid */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 1; y < cur_hgt - 1; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 1; x < cur_wid - 1; x++)
{
cave_type *c_ptr = &cave[y][x];
/* Process the grid */
- c_ptr->info &= ~(CAVE_MARK);
+ c_ptr->info &= ~(CAVE_MARK | CAVE_IN_DETECT);
+ c_ptr->info |= (CAVE_UNSAFE);
}
}
+ /* Forget every grid on horizontal edge */
+ for (x = 0; x < cur_wid; x++)
+ {
+ cave[0][x].info &= ~(CAVE_MARK);
+ cave[cur_hgt - 1][x].info &= ~(CAVE_MARK);
+ }
+
+ /* Forget every grid on vertical edge */
+ for (y = 1; y < (cur_hgt - 1); y++)
+ {
+ cave[y][0].info &= ~(CAVE_MARK);
+ cave[y][cur_wid - 1].info &= ~(CAVE_MARK);
+ }
+
/* Forget all objects */
for (i = 1; i < o_max; i++)
{
if (o_ptr->held_m_idx) continue;
/* Forget the object */
- o_ptr->marked = FALSE;
+ o_ptr->marked = 0;
}
/* Mega-Hack -- Forget the view and lite */
p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
/* Update the view and lite */
- p_ptr->update |= (PU_VIEW | PU_LITE);
+ p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
/* Update the monsters */
p_ptr->update |= (PU_MONSTERS);
{
cave_type *c_ptr = &cave[y][x];
+ /* Clear mimic type */
+ c_ptr->mimic = 0;
+
+ /* Remove flag for mirror/glyph */
+ c_ptr->info &= ~(CAVE_OBJECT);
+
/* Change the feature */
c_ptr->feat = feat;
+ /* Hack -- glow the deep lava */
+ if ((feat == FEAT_DEEP_LAVA) && !(d_info[dungeon_type].flags1 & DF1_DARKNESS))
+ {
+ int i, yy, xx;
+
+ for (i = 0; i < 9; i++)
+ {
+ yy = y + ddy_ddd[i];
+ xx = x + ddx_ddd[i];
+ if (!in_bounds2(yy, xx)) continue;
+ cave[yy][xx].info |= CAVE_GLOW;
+ if (player_has_los_bold(yy, xx))
+ {
+ /* Notice */
+ note_spot(yy, xx);
+
+ /* Redraw */
+ lite_spot(yy, xx);
+ }
+ }
+ }
+
+ /* Notice */
+ note_spot(y, x);
+
+ /* Redraw */
+ lite_spot(y, x);
+}
+
+/* Remove a mirror */
+void remove_mirror(int y, int x)
+{
+ /* Remove the mirror */
+ cave[y][x].info &= ~(CAVE_OBJECT);
+ cave[y][x].mimic = 0;
+
+ if (d_info[dungeon_type].flags1 & DF1_DARKNESS)
+ {
+ cave[y][x].info &= ~(CAVE_GLOW);
+ if( !view_torch_grids )cave[y][x].info &= ~(CAVE_MARK);
+ }
/* Notice */
note_spot(y, x);
}
+/*
+ * Return TRUE if there is a mirror on the grid.
+ */
+bool is_mirror_grid(cave_type *c_ptr)
+{
+ if ((c_ptr->info & CAVE_OBJECT) && c_ptr->mimic == FEAT_MIRROR)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+
+/*
+ * Return TRUE if there is a mirror on the grid.
+ */
+bool is_glyph_grid(cave_type *c_ptr)
+{
+ if ((c_ptr->info & CAVE_OBJECT) && c_ptr->mimic == FEAT_GLYPH)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+
+/*
+ * Return TRUE if there is a mirror on the grid.
+ */
+bool is_explosive_rune_grid(cave_type *c_ptr)
+{
+ if ((c_ptr->info & CAVE_OBJECT) && c_ptr->mimic == FEAT_MINOR_GLYPH)
+ return TRUE;
+ else
+ return FALSE;
+}
+
/*
* Calculate "incremental motion". Used by project() and shoot().
u16b grid_g[512];
/* Check the projection path */
- grid_n = project_path(grid_g, MAX_RANGE, y1, x1, y2, x2, 0);
+ grid_n = project_path(grid_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, 0);
/* No grid is ever projectable from itself */
if (!grid_n) return (FALSE);
*/
void health_track(int m_idx)
{
+ /* Mount monster is already tracked */
+ if (m_idx && m_idx == p_ptr->riding) return;
+
/* Track a new guy */
p_ptr->health_who = m_idx;
/*
* Hack -- track the given monster race
*/
-void monster_race_track(bool kage, int r_idx)
+void monster_race_track(int r_idx)
{
- if (kage) r_idx = MON_KAGE;
-
/* Save this monster ID */
p_ptr->monster_race_idx = r_idx;
/* Flush the input if requested */
if (flush_disturb) flush();
}
+
+
+/*
+ * Glow deep lava and building entrances in the floor
+ */
+void glow_deep_lava_and_bldg(void)
+{
+ int y, x, i, yy, xx;
+ cave_type *c_ptr;
+ byte feat;
+
+ /* Not in the darkness dungeon */
+ if (d_info[dungeon_type].flags1 & DF1_DARKNESS) return;
+
+ for (y = 0; y < cur_hgt; y++)
+ {
+ for (x = 0; x < cur_wid; x++)
+ {
+ c_ptr = &cave[y][x];
+
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
+ if ((feat == FEAT_DEEP_LAVA) ||
+ ((feat >= FEAT_SHOP_HEAD) &&
+ (feat <= FEAT_SHOP_TAIL)) ||
+ (feat == FEAT_MUSEUM) ||
+ ((feat >= FEAT_BLDG_HEAD) &&
+ (feat <= FEAT_BLDG_TAIL)))
+ {
+ for (i = 0; i < 9; i++)
+ {
+ yy = y + ddy_ddd[i];
+ xx = x + ddx_ddd[i];
+ if (!in_bounds2(yy, xx)) continue;
+ cave[yy][xx].info |= CAVE_GLOW;
+ if (player_has_los_bold(yy, xx)) note_spot(yy, xx);
+ }
+ }
+ }
+ }
+}