]> granicus.if.org Git - nethack/commitdiff
make a distinction between rock and unexplored area
authornhmall <nhmall@nethack.org>
Sat, 8 Feb 2020 05:48:03 +0000 (00:48 -0500)
committernhmall <nhmall@nethack.org>
Sat, 8 Feb 2020 05:48:03 +0000 (00:48 -0500)
This adds a pair of new glyphs: GLYPH_UNEXPLORED and GLYPH_NOTHING

GLYPH_UNEXPLORED is meant to be the glyph for areas of the map that
haven't been explored yet.

GLYPH_NOTHING is a glyph that represents that which cannot be seen,
for instance the dark part of a room when the dark_room option is
not set.  Since the symbol for stone can now be overridden to
a players choice, it no longer made sense using S_stone for the
dark areas of the room with dark_room off. This allows the same
intended result even if S_stone symbol is mapped to something visible.

GLYPH_UNEXPLORED is what areas of the map get initialized to now
instead of STONE.

This adds a pair of new symbols: S_unexplored and S_nothing.

S_nothing is meant to be left as an unseen character (space) in
order to achieve the intended effect on the display.

S_unexplored is the symbol that is mapped to GLYPH_UNEXPLORED, and
is a distinct symbol from S_stone, even if they are set to the same
character. They don't have to be set to the same character.

Hopefully there are minimal bugs, but it is a deviation from a
fairly long-standing approach so there could be some unintended
glitches that will need repair.

19 files changed:
doc/Guidebook.mn
doc/Guidebook.tex
include/decl.h
include/display.h
include/hack.h
include/rm.h
src/bones.c
src/decl.c
src/display.c
src/do_name.c
src/drawing.c
src/mapglyph.c
src/mklev.c
src/options.c
src/pager.c
src/read.c
src/save.c
win/share/other.txt
win/share/tilemap.c

index f4901601a146e139f08c12ca5ca6a4cd98d15dba..96de3d7e5b09b0f369fa05c41d21e41feb444265 100644 (file)
@@ -4797,8 +4797,7 @@ s S_spider        (arachnid or centipede)
 @      S_ss3   (magic shield 3 of 4)
 *      S_ss4   (magic shield 4 of 4)
 \(ha   S_statue_trap   (statue trap)
-\      S_stone (solid rock or unexplored terrain
-\      \       \ or dark part of a room)
+\      S_stone (solid rock)
 ]      S_strange_obj   (strange object)
 \-     S_sw_bc (swallow bottom center)
 \\     S_sw_bl (swallow bottom left)
@@ -4822,6 +4821,7 @@ T S_troll (troll)
 |      S_trwall        (wall)
 \-     S_tuwall        (wall)
 U      S_umber (umber hulk)
+\      S_unexplored    (unexplored terrain)
 u      S_unicorn       (unicorn or horse)
 <      S_upladder      (ladder up)
 <      S_upstair       (staircase up)
index 97eab4d2429e0e0f9347113e39422a8535c7027c..50cc5b6178b31f81e71cb18eb2da9b1b2e27d841 100644 (file)
@@ -5222,8 +5222,7 @@ Default                      & Symbol Name                & Description\\
 \verb+@+ & S\verb+_+ss3                     &  (magic shield 3 of 4)\\
 \verb@*@ & S\verb+_+ss4                     &  (magic shield 4 of 4)\\
 \verb@^@ & S\verb+_+statue\verb+_+trap            &    (statue trap)\\
-\verb@ @ & S\verb+_+stone                   &  (solid rock or unexplored terrain\\
-         &                                  &   \,or dark part of a room)\\
+\verb@ @ & S\verb+_+stone                   &  (solid rock)\\
 \verb@]@ & S\verb+_+strange\verb+_+obj      &  (strange object)\\
 \verb@-@ & S\verb+_+sw\verb+_+bc                  &    (swallow bottom center)\\
 \verb@\@ & S\verb+_+sw\verb+_+bl                  &    (swallow bottom left)\\
@@ -5247,6 +5246,7 @@ Default                      & Symbol Name                & Description\\
 \verb@|@ & S\verb+_+trwall                  &  (wall)\\
 \verb@-@ & S\verb+_+tuwall                  &  (wall)\\
 \verb@U@ & S\verb+_+umber                   &  (umber hulk)\\
+\verb@ @ & S\verb+_+unexplored              &  (unexplored terrain)\\
 \verb@u@ & S\verb+_+unicorn                 &  (unicorn or horse)\\
 \verb@<@ & S\verb+_+upladder                &  (ladder up)\\
 \verb@<@ & S\verb+_+upstair                 &  (staircase up)\\
index 335eaec92caebdc8b518c48baae5c37848fc5ccb..37d78675dcd2cab30012a1b10a33f899bef9fd6d 100644 (file)
@@ -1199,6 +1199,7 @@ struct const_globals {
     const struct obj zeroobj;      /* used to zero out a struct obj */
     const struct monst zeromonst;  /* used to zero out a struct monst */
     const anything zeroany;        /* used to zero out union any */
+    const struct rm zerorm;        /* used to zero out struct rm */
 };
 
 E const struct const_globals cg;
index 2a2e56baed5c2d8a983f3f7a5e8ba076356ffa9c..4fd7b99157e76e59591610aa05cafa4b84594c04 100644 (file)
  *
  * statue       One for each monster.  Count: NUMMONS
  *
+ * unexplored   One for unexplored areas of the map
+ * nothing      Nothing but background
+ *
  * The following are offsets used to convert to and from a glyph.
  */
 #define NUM_ZAP 8 /* number of zap beam types */
 #define GLYPH_SWALLOW_OFF ((NUM_ZAP << 2) + GLYPH_ZAP_OFF)
 #define GLYPH_WARNING_OFF ((NUMMONS << 3) + GLYPH_SWALLOW_OFF)
 #define GLYPH_STATUE_OFF  (WARNCOUNT + GLYPH_WARNING_OFF)
-#define MAX_GLYPH         (NUMMONS + GLYPH_STATUE_OFF)
+#define GLYPH_UNEXPLORED_OFF (NUMMONS + GLYPH_STATUE_OFF)
+#define GLYPH_NOTHING_OFF (GLYPH_UNEXPLORED_OFF + 1)
+#define MAX_GLYPH         (GLYPH_NOTHING_OFF + 1)
 
 #define NO_GLYPH          MAX_GLYPH
 #define GLYPH_INVISIBLE   GLYPH_INVIS_OFF
+#define GLYPH_UNEXPLORED  GLYPH_UNEXPLORED_OFF
+#define GLYPH_NOTHING     GLYPH_NOTHING_OFF
 
 #define warning_to_glyph(mwarnlev) ((mwarnlev) + GLYPH_WARNING_OFF)
 #define mon_to_glyph(mon, rng)                                      \
 #define glyph_is_warning(glyph)   \
     ((glyph) >= GLYPH_WARNING_OFF \
      && (glyph) < (GLYPH_WARNING_OFF + WARNCOUNT))
+#define glyph_is_unexplored(glyph) ((glyph) == GLYPH_UNEXPLORED)
+#define glyph_is_nothing(glyph) ((glyph) == GLYPH_NOTHING)
 
 #endif /* DISPLAY_H */
index eba5d7bb140a12a0b4b66566d84a93411b16306e..87b5e7784adbe5dba417119827ee7fdca951b8a6 100644 (file)
@@ -18,6 +18,7 @@
 #define BOLT_LIM 8        /* from this distance ranged attacks will be made */
 #define MAX_CARR_CAP 1000 /* so that boulders can be heavier */
 #define DUMMY { 0 }       /* array initializer, letting [1..N-1] default */
+#define DEF_NOTHING ' '   /* default symbol for NOTHING and UNEXPLORED  */
 
 /* The UNDEFINED macros are used to initialize variables whose
    initialized value is not relied upon.
@@ -93,6 +94,8 @@ enum dismount_types {
 #define MG_BW_LAVA 0x0080  /* 'black & white lava': highlight lava if it
                               can't be distringuished from water by color */
 #define MG_BW_ICE  0x0100  /* similar for ice vs floor */
+#define MG_NOTHING 0x0200  /* char represents GLYPH_NOTHING */
+#define MG_UNEXPL  0x0400  /* char represents GLYPH_UNEXPLORED */
 
 /* sellobj_state() states */
 #define SELL_NORMAL (0)
index f660ec83b49d53d25c949db0d6695f0d186995d8..6bb488660842f85f8ec50ff9c82e8692355985ef 100644 (file)
@@ -264,11 +264,13 @@ struct symparse {
 };
 
 /* misc symbol definitions */
-#define SYM_BOULDER 0
-#define SYM_INVISIBLE 1
-#define SYM_PET_OVERRIDE 2
-#define SYM_HERO_OVERRIDE 3
-#define MAXOTHER 4
+#define SYM_NOTHING 0
+#define SYM_UNEXPLORED 1
+#define SYM_BOULDER 2
+#define SYM_INVISIBLE 3
+#define SYM_PET_OVERRIDE 4
+#define SYM_HERO_OVERRIDE 5
+#define MAXOTHER 6
 
 /* linked list of symsets and their characteristics */
 struct symsetentry {
index 623eeea29c28203af80e840a1852d6eade39f10d..d7341a86947ad5993e013ac2f15ce6e53e5d0c49 100644 (file)
@@ -482,9 +482,7 @@ struct obj *corpse;
     /* Clear all memory from the level. */
     for (x = 1; x < COLNO; x++)
         for (y = 0; y < ROWNO; y++) {
-            levl[x][y].seenv = 0;
-            levl[x][y].waslit = 0;
-            levl[x][y].glyph = cmap_to_glyph(S_stone);
+            levl[x][y] = cg.zerorm;
             g.lastseentyp[x][y] = 0;
         }
 
index 6bf82e986b4025590ca1d2a862719482142bfc5f..91b922f7997f2e11e423e50d31e3793950b0ea44 100644 (file)
@@ -699,6 +699,7 @@ const struct const_globals cg = {
     DUMMY, /* zeroobj */
     DUMMY, /* zeromonst */
     DUMMY, /* zeroany */
+    { GLYPH_UNEXPLORED, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
 };
 
 #define ZERO(x) memset(&x, 0, sizeof(x))
index 35e1f41a0a3d7a0f9c4effc9d63580e293367965..62ccabe4af9696d4256281bb9af306f60bb46de6 100644 (file)
@@ -169,9 +169,9 @@ int show;
     if (!cansee(x, y) && !lev->waslit) {
         /* Floor spaces are dark if unlit.  Corridors are dark if unlit. */
         if (lev->typ == ROOM && glyph == cmap_to_glyph(S_room))
-            glyph = cmap_to_glyph((flags.dark_room && iflags.use_color)
-                                      ? (DARKROOMSYM)
-                                      : S_stone);
+            glyph = (flags.dark_room && iflags.use_color)
+                        ? cmap_to_glyph(DARKROOMSYM)
+                        : GLYPH_NOTHING;
         else if (lev->typ == CORR && glyph == cmap_to_glyph(S_litcorr))
             glyph = cmap_to_glyph(S_corr);
     }
@@ -1137,7 +1137,7 @@ int first;
         for (y = lasty - 1; y <= lasty + 1; y++)
             for (x = lastx - 1; x <= lastx + 1; x++)
                 if (isok(x, y))
-                    show_glyph(x, y, cmap_to_glyph(S_stone));
+                    show_glyph(x, y, GLYPH_UNEXPLORED);
     }
 
     swallower = monsndx(u.ustuck->data);
@@ -1211,7 +1211,7 @@ int mode;
         for (y = lasty - 1; y <= lasty + 1; y++)
             for (x = lastx - 1; x <= lastx + 1; x++)
                 if (isok(x, y))
-                    show_glyph(x, y, cmap_to_glyph(S_stone));
+                    show_glyph(x, y, GLYPH_UNEXPLORED);
     }
 
     /*
@@ -1222,7 +1222,7 @@ int mode;
         for (y = u.uy - 1; y <= u.uy + 1; y++)
             if (isok(x, y) && (is_pool_or_lava(x, y) || is_ice(x, y))) {
                 if (Blind && !(x == u.ux && y == u.uy))
-                    show_glyph(x, y, cmap_to_glyph(S_stone));
+                    show_glyph(x, y, GLYPH_UNEXPLORED);
                 else
                     newsym(x, y);
             }
@@ -1411,8 +1411,7 @@ docrt()
     for (x = 1; x < COLNO; x++) {
         lev = &levl[x][0];
         for (y = 0; y < ROWNO; y++, lev++)
-            if (lev->glyph != cmap_to_glyph(S_stone))
-                show_glyph(x, y, lev->glyph);
+            show_glyph(x, y, lev->glyph);
     }
 
     /* see what is to be seen */
@@ -1565,19 +1564,19 @@ int x, y, glyph;
  * Reset the changed glyph borders so that none of the 3rd screen has
  * changed.
  */
-#define reset_glyph_bbox()             \
-    {                                  \
-        int i;                         \
-                                       \
-        for (i = 0; i < ROWNO; i++) {  \
+#define reset_glyph_bbox()               \
+    {                                    \
+        int i;                           \
+                                         \
+        for (i = 0; i < ROWNO; i++) {    \
             g.gbuf_start[i] = COLNO - 1; \
             g.gbuf_stop[i] = 0;          \
-        }                              \
+        }                                \
     }
 
-static const gbuf_entry nul_gbuf = { 0, cmap_to_glyph(S_stone) };
+static const gbuf_entry nul_gbuf = { 0, GLYPH_UNEXPLORED };
 /*
- * Turn the 3rd screen into stone.
+ * Turn the 3rd screen into UNEXPLORED.
  */
 void
 clear_glyph_buffer()
@@ -1595,7 +1594,7 @@ clear_glyph_buffer()
 }
 
 /*
- * Assumes that the indicated positions are filled with S_stone glyphs.
+ * Assumes that the indicated positions are filled with GLYPH_UNEXPLORED glyphs.
  */
 void
 row_refresh(start, stop, y)
@@ -1604,13 +1603,14 @@ int start, stop, y;
     register int x;
 
     for (x = start; x <= stop; x++)
-        if (g.gbuf[y][x].glyph != cmap_to_glyph(S_stone))
+        if (g.gbuf[y][x].glyph != GLYPH_UNEXPLORED)
             print_glyph(WIN_MAP, x, y, g.gbuf[y][x].glyph, get_bk_glyph(x, y));
 }
 
 void
 cls()
 {
+    int y;
     static boolean in_cls = 0;
 
     if (in_cls)
@@ -1621,6 +1621,10 @@ cls()
     clear_nhwindow(WIN_MAP);              /* clear physical screen */
 
     clear_glyph_buffer(); /* this is sort of an extra effort, but OK */
+    for (y = 0; y < ROWNO; y++) {
+        g.gbuf_start[y] = 0;
+        g.gbuf_stop[y] = COLNO - 1;
+    }
     in_cls = FALSE;
 }
 
@@ -1890,11 +1894,11 @@ static int
 get_bk_glyph(x, y)
 xchar x, y;
 {
-    int idx, bkglyph = NO_GLYPH;
+    int idx, bkglyph = GLYPH_UNEXPLORED;
     struct rm *lev = &levl[x][y];
 
     if (iflags.use_background_glyph && lev->seenv != 0
-        && g.gbuf[y][x].glyph != cmap_to_glyph(S_stone)) {
+        && (g.gbuf[y][x].glyph != GLYPH_UNEXPLORED)) {
         switch (lev->typ) {
         case SCORR:
         case STONE:
index 475b992589a666a88603f53d713558a0d1ff9a05..97f48c9b11eebce5c0ecd4c88441bc706439f832 100644 (file)
@@ -241,7 +241,7 @@ const void *b;
 #define IS_UNEXPLORED_LOC(x,y) \
     (isok((x), (y))                                     \
      && glyph_is_cmap(levl[(x)][(y)].glyph)             \
-     && glyph_to_cmap(levl[(x)][(y)].glyph) == S_stone  \
+     && levl[(x)][(y)].glyph == GLYPH_UNEXPLORED        \
      && !levl[(x)][(y)].seenv)
 
 #define GLOC_SAME_AREA(x,y)                                     \
index 8a97c44965f7be258f1e124321d9030d0034e30a..9b01bd46021482e84004dfeed908d4cab75ec6c2 100644 (file)
@@ -130,7 +130,7 @@ const struct symdef def_warnsyms[WARNCOUNT] = {
  *  Default screen symbols with explanations and colors.
  */
 const struct symdef defsyms[MAXPCHARS] = {
-/* 0*/ { ' ', "dark part of a room", C(NO_COLOR) },  /* stone */
+/* 0*/ { ' ', "stone", C(NO_COLOR) },                /* stone */
        { '|', "wall", C(CLR_GRAY) },                 /* vwall */
        { '-', "wall", C(CLR_GRAY) },                 /* hwall */
        { '-', "wall", C(CLR_GRAY) },                 /* tlcorn */
@@ -405,12 +405,22 @@ int idx, which_set;
                                   : g.primary_syms[oidx];
     if (!sym) {
         switch(idx) {
+            case SYM_NOTHING:
+            case SYM_UNEXPLORED:
+                sym = DEF_NOTHING;
+                break;
             case SYM_BOULDER:
                 sym = def_oc_syms[ROCK_CLASS].sym;
                 break;
             case SYM_INVISIBLE:
                 sym = DEF_INVISIBLE;
                 break;
+#if 0
+            /* these intentionally have no defaults */
+            case SYM_PET_OVERRIDE:
+            case SYM_HERO_OVERRIDE:
+                break;
+#endif
         }
     }
     return sym;
@@ -805,6 +815,8 @@ const struct symparse loadsyms[] = {
     { SYM_MON, S_LIZARD + SYM_OFF_M, "S_lizard" },
     { SYM_MON, S_WORM_TAIL + SYM_OFF_M, "S_worm_tail" },
     { SYM_MON, S_MIMIC_DEF + SYM_OFF_M, "S_mimic_def" },
+    { SYM_OTH, SYM_NOTHING + SYM_OFF_X, "S_nothing" },
+    { SYM_OTH, SYM_UNEXPLORED + SYM_OFF_X, "S_unexplored" },
     { SYM_OTH, SYM_BOULDER + SYM_OFF_X, "S_boulder" },
     { SYM_OTH, SYM_INVISIBLE + SYM_OFF_X, "S_invisible" },
     { SYM_OTH, SYM_PET_OVERRIDE + SYM_OFF_X, "S_pet_override" },
index 900279451fbc407f254394b0b4996917f41a6a25..3a6af5a39a743e3bc6fb8022a074b08e4f9ac08f 100644 (file)
@@ -102,7 +102,15 @@ unsigned mgflags;
      *  Warning:  For speed, this makes an assumption on the order of
      *            offsets.  The order is set in display.h.
      */
-    if ((offset = (glyph - GLYPH_STATUE_OFF)) >= 0) { /* a statue */
+    if ((offset = (glyph - GLYPH_NOTHING_OFF)) >= 0) {
+        idx = SYM_NOTHING + SYM_OFF_X;
+        color = NO_COLOR;
+        special |= MG_NOTHING;
+    } else if ((offset = (glyph - GLYPH_UNEXPLORED_OFF)) >= 0) {
+        idx = SYM_UNEXPLORED + SYM_OFF_X;
+        color = NO_COLOR;
+        special |= MG_UNEXPL;
+    } else if ((offset = (glyph - GLYPH_STATUE_OFF)) >= 0) { /* a statue */
         idx = mons[offset].mlet + SYM_OFF_M;
         if (has_rogue_color)
             color = CLR_RED;
index 965a4dca6dbc31973173c02d70ed2bfc6d5de186..d91563701ca96da9f0e3a54d119d645cb317d4c8 100644 (file)
@@ -584,8 +584,6 @@ makevtele()
 void
 clear_level_structures()
 {
-    static struct rm zerorm = { cmap_to_glyph(S_stone),
-                                0, 0, 0, 0, 0, 0, 0, 0, 0 };
     register int x, y;
     register struct rm *lev;
 
@@ -596,7 +594,7 @@ clear_level_structures()
     for (x = 0; x < COLNO; x++) {
         lev = &levl[x][0];
         for (y = 0; y < ROWNO; y++) {
-            *lev++ = zerorm;
+            *lev++ = cg.zerorm;
             /*
              * These used to be '#if MICROPORT_BUG',
              * with use of memset(0) for '#if !MICROPORT_BUG' below,
index c95ce0731b01e65d0aa7c99b071c88eded77cfd8..46607810f45a23dfc7408d7e9e2b141510ac645e 100644 (file)
@@ -587,12 +587,12 @@ reglyph_darkroom()
                 || Is_rogue_level(&u.uz)) {
                 if (lev->glyph == cmap_to_glyph(S_darkroom))
                     lev->glyph = lev->waslit ? cmap_to_glyph(S_room)
-                                             : cmap_to_glyph(S_stone);
+                                             : GLYPH_NOTHING;
             } else {
                 if (lev->glyph == cmap_to_glyph(S_room) && lev->seenv
                     && lev->waslit && !cansee(x, y))
                     lev->glyph = cmap_to_glyph(S_darkroom);
-                else if (lev->glyph == cmap_to_glyph(S_stone)
+                else if (lev->glyph == GLYPH_NOTHING
                          && lev->typ == ROOM && lev->seenv && !cansee(x, y))
                     lev->glyph = cmap_to_glyph(S_darkroom);
             }
@@ -600,7 +600,7 @@ reglyph_darkroom()
     if (flags.dark_room && iflags.use_color)
         g.showsyms[S_darkroom] = g.showsyms[S_room];
     else
-        g.showsyms[S_darkroom] = g.showsyms[S_stone];
+        g.showsyms[S_darkroom] = g.showsyms[SYM_NOTHING + SYM_OFF_X];
 }
 
 /* check whether a user-supplied option string is a proper leading
index 63f0619818c09a78c808bb6e6ffe3f2c8123c081..2607bb9e0ec190157d4595b14e0e8e52970b09b3 100644 (file)
@@ -478,6 +478,16 @@ char *buf, *monbuf;
         int warnindx = glyph_to_warning(glyph);
 
         Strcpy(buf, def_warnsyms[warnindx].explanation);
+    } else if (glyph_is_nothing(glyph)) {
+        Strcpy(buf, "dark part of a room");
+    } else if (glyph_is_unexplored(glyph)) {
+        if (Underwater && !Is_waterlevel(&u.uz)) {
+            /* "unknown" == previously mapped but not visible when
+               submerged; better terminology appreciated... */
+            Strcpy(buf, (distu(x, y) <= 2) ? "land" : "unknown");
+        } else {
+            Strcpy(buf, "unexplored area");
+        }
     } else if (!glyph_is_cmap(glyph)) {
         Strcpy(buf, "unexplored area");
     } else {
@@ -843,7 +853,7 @@ struct permonst **for_supplement;
                       unreconnoitered[] = "unreconnoitered";
     static char look_buf[BUFSZ];
     char prefix[BUFSZ], gobbledygook[33];
-    int i, alt_i, j, glyph = NO_GLYPH,
+    int i, j, glyph = NO_GLYPH,
         skipped_venom = 0, found = 0; /* count of matching syms found */
     boolean hit_trap, need_to_look = FALSE,
             submerged = (Underwater && !Is_waterlevel(&u.uz)),
@@ -979,24 +989,33 @@ struct permonst **for_supplement;
             found += append_str(out_str, an(unseen_explain));
         }
     }
-
-    /* Now check for graphics symbols */
-    alt_i = (sym == (looked ? g.showsyms[0] : defsyms[0].sym)) ? 0 : (2 + 1);
-    for (hit_trap = FALSE, i = 0; i < MAXPCHARS; i++) {
-        /* when sym is the default background character, we process
-           i == 0 three times: unexplored, stone, dark part of a room */
-        if (alt_i < 2) {
-            x_str = !alt_i++ ? "unexplored" : submerged ? "unknown" : "stone";
-            i = 0; /* for second iteration, undo loop increment */
-            /* alt_i is now 1 or 2 */
+    if ((glyph && glyph_is_nothing(glyph))
+        || (looked && sym == g.showsyms[SYM_NOTHING + SYM_OFF_X])) {
+        x_str = "the dark part of a room";
+        if (!found) {
+            Sprintf(out_str, "%s%s", prefix, x_str);
+            *firstmatch = x_str;
+            found++;
+        } else {
+            found += append_str(out_str, x_str);
+        }
+    }
+    if ((glyph && glyph_is_unexplored(glyph))
+        || (looked && sym == g.showsyms[SYM_UNEXPLORED + SYM_OFF_X])) {
+        x_str = "unexplored";
+        if (submerged)
+            x_str = "land"; /* replace "unexplored" */
+        if (!found) {
+            Sprintf(out_str, "%s%s", prefix, x_str);
+            *firstmatch = x_str;
+            found++;
         } else {
-            if (alt_i++ == 2)
-                i = 0; /* undo loop increment */
-            x_str = defsyms[i].explanation;
-            if (submerged && !strcmp(x_str, defsyms[0].explanation))
-                x_str = "land"; /* replace "dark part of a room" */
-            /* alt_i is now 3 or more and no longer of interest */
+            found += append_str(out_str, x_str);
         }
+    }
+    /* Now check for graphics symbols */
+    for (hit_trap = FALSE, i = 0; i < MAXPCHARS; i++) {
+        x_str = defsyms[i].explanation;
         if (sym == (looked ? g.showsyms[i] : defsyms[i].sym) && *x_str) {
             /* POOL, MOAT, and WATER are "water", LAVAPOOL is "molten lava" */
             boolean water_or_lava = (!strcmp(x_str, "water")
@@ -1005,11 +1024,15 @@ struct permonst **for_supplement;
                "a molten lava", "a floor of a room", "a dark part of a room";
                article==2 => "the", 1 => "an", 0 => (none) */
             int article = strstri(x_str, " of a room") ? 2
-                          : !(alt_i <= 2
+                          : !(i == S_stone
                               || strcmp(x_str, "air") == 0
                               || strcmp(x_str, "land") == 0
                               || water_or_lava);
 
+            /* check if dark part of a room was already included above */
+            if (i == S_darkroom && glyph && glyph_is_nothing(glyph))
+                continue;
+
             /* substitute for "water" and "molten lava" when hallucinating */
             if (water_or_lava && hallucinate) {
                 if (*gobbledygook)
index eea79ea8eecd1ae0a7ce8a33f5d9c8cd88af27d0..1b909a5bf52e1c983eac6e717e14bc8ed26ce9d9 100644 (file)
@@ -804,9 +804,7 @@ int howmuch;
         for (zy = 0; zy < ROWNO; zy++)
             if (howmuch & ALL_MAP || rn2(7)) {
                 /* Zonk all memory of this location. */
-                levl[zx][zy].seenv = 0;
-                levl[zx][zy].waslit = 0;
-                levl[zx][zy].glyph = cmap_to_glyph(S_stone);
+                levl[zx][zy] = cg.zerorm;
                 g.lastseentyp[zx][zy] = STONE;
             }
     /* forget overview data for this level */
index a8729f7355efa826d28646c132f0e4337c0d9602..4ed4bcde03a6de6c0e9486a295f4c788f6d57b93 100644 (file)
@@ -579,8 +579,7 @@ xchar lev;
             for (x = 0; x < COLNO; x++) {
                 g.level.monsters[x][y] = 0;
                 g.level.objects[x][y] = 0;
-                levl[x][y].seenv = 0;
-                levl[x][y].glyph = cmap_to_glyph(S_stone);
+                levl[x][y] = cg.zerorm;
             }
         fmon = 0;
         g.ftrap = 0;
index b13d334e965795e3489c38a2df7d49a8f7c9fa99..98cab26fef7083e34f176577d024e8c7aadedaa4 100644 (file)
@@ -27,24 +27,24 @@ Y = (149, 149, 149)
 Z = (195, 195, 195)
 0 = (100, 100, 100)
 1 = (72, 108, 108)
-# tile 0 (dark part of a room)
-{
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
-  AAAAAAAAAAAAAAAA
+# tile 0 (stone)
+{
+  PPPPPPPPPPPPPPPP
+  PAPPPPPPPPPPPPPP
+  PPAAPPPPPPPPPPPA
+  PPPPPPPPPPPPPPAP
+  PPPPPPPPPPPPPPPP
+  PPPPPPPPPPPPPPPP
+  PPPPPPPPPPPPPPPP
+  PPPPPPPPPPPPPPPP
+  PPPPPPPPPPPPPPPP
+  PPPPPPPPPPPPPPPP
+  PPPPPPPPPPPPPPPP
+  PPPPPPPPPPPPPPPP
+  PPPPPPPPPPPPPPPP
+  PPPPPPPPPPPPPPPP
+  PPPPPPPPPPPPPPPP
+  PPPPPPPPPPPPPPPP
 }
 # tile 1 (vertical wall)
 {
@@ -3599,7 +3599,45 @@ Z = (195, 195, 195)
   .......AA.......
   ................
 }
-# tile 188 (sub mine walls 0)
+# tile 191 (unexplored)
+{
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+}
+# tile 192 (nothing)
+{
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+  AAAAAAAAAAAAAAAA
+}
+# tile 189 (sub mine walls 0)
 {
   AJJKKKACJAAJJJAA
   AJKKKACLJJAJJJJA
@@ -3618,7 +3656,7 @@ Z = (195, 195, 195)
   AAJACKCKKJJJAJAA
   AAJCKKJAAAJJJJJA
 }
-# tile 189 (sub mine walls 1)
+# tile 190 (sub mine walls 1)
 {
   AJAAAAAAJJAAAJAA
   JJJAAAJJJJJAAAAJ
@@ -3637,7 +3675,7 @@ Z = (195, 195, 195)
   JJJJJJJJJJJJJJJJ
   AAAAAAAAAAAAAAAA
 }
-# tile 190 (sub mine walls 2)
+# tile 191 (sub mine walls 2)
 {
   AAAAAAKCCKKJAAAA
   AAAAKKCLCJKJJAAA
@@ -3656,7 +3694,7 @@ Z = (195, 195, 195)
   AAJACKCKKJJJAJAA
   AAJCKKJAAAJJJJJA
 }
-# tile 191 (sub mine walls 3)
+# tile 192 (sub mine walls 3)
 {
   AAAAAAKCCKKJAAAA
   AAAAKKCLCJKJJAAA
@@ -3675,7 +3713,7 @@ Z = (195, 195, 195)
   AAJACKCKKJJJAJAA
   AAJCKKJAAAJJJJJA
 }
-# tile 192 (sub mine walls 4)
+# tile 193 (sub mine walls 4)
 {
   AKKKAAKKKKAAJJJA
   AKKAAKCCCJJJAAJA
@@ -3694,7 +3732,7 @@ Z = (195, 195, 195)
   AJJJJJJJJJJJJJJJ
   AAAAAAAAAAAAAAAA
 }
-# tile 193 (sub mine walls 5)
+# tile 194 (sub mine walls 5)
 {
   AKKAAAKKAAAAJJJA
   AKAAKKLCKAAAAAJA
@@ -3713,7 +3751,7 @@ Z = (195, 195, 195)
   JJJJJJJJJJJJJJJA
   AAAAAAAAAAAAAAAA
 }
-# tile 194 (sub mine walls 6)
+# tile 195 (sub mine walls 6)
 {
   AAAAAAKCCKKJAAAA
   AAAAKCCLCJKJJAAA
@@ -3732,7 +3770,7 @@ Z = (195, 195, 195)
   AAJACKCKKJJJAJAA
   AAJCKKJAAAJJJJJA
 }
-# tile 195 (sub mine walls 7)
+# tile 196 (sub mine walls 7)
 {
   AKKAAAKKKKAAJJJA
   AKAAKKLCCJJJAAJA
@@ -3751,7 +3789,7 @@ Z = (195, 195, 195)
   JJJJJJJJJJJJJJJJ
   AAAAAAAAAAAAAAAA
 }
-# tile 196 (sub mine walls 8)
+# tile 197 (sub mine walls 8)
 {
   AAAAAAKCCKKJAAAA
   AAAAKCCLCJKJJAAA
@@ -3770,7 +3808,7 @@ Z = (195, 195, 195)
   AAJACKCKKJJJAJAA
   AAJCKKJAAAJJJJJA
 }
-# tile 197 (sub mine walls 9)
+# tile 198 (sub mine walls 9)
 {
   AKKAACKCCKKJAJJA
   AKACKKKLLJKJJAJA
@@ -3789,7 +3827,7 @@ Z = (195, 195, 195)
   AAJACKCKKJJJAJAA
   AAJCKKJAAAJJJJJA
 }
-# tile 198 (sub mine walls 10)
+# tile 199 (sub mine walls 10)
 {
   AKKAACKCCKKJAJJA
   AKACKKCLCJKJJAJA
@@ -3808,7 +3846,7 @@ Z = (195, 195, 195)
   AAJACKCKKJJJAJAA
   AAJCKKJAAAJJJJJA
 }
-# tile 199 (sub gehennom walls 0)
+# tile 200 (sub gehennom walls 0)
 {
   ALLDAJ11111JLLDA
   ADDDAJ1J11JJDDDA
@@ -3827,7 +3865,7 @@ Z = (195, 195, 195)
   AJJJAJJ1111JJJJA
   AD11AJJ1111JD1JA
 }
-# tile 200 (sub gehennom walls 1)
+# tile 201 (sub gehennom walls 1)
 {
   AAALDDAAAAALDDAA
   DDDLDDAJDDDLDDAJ
@@ -3846,7 +3884,7 @@ Z = (195, 195, 195)
   JJJJJJJJJJJJJJJJ
   AAAAAAAAAAAAAAAA
 }
-# tile 201 (sub gehennom walls 2)
+# tile 202 (sub gehennom walls 2)
 {
   AAALLLLDDDDDDAAA
   LLLLAAJJ1111DJJJ
@@ -3865,7 +3903,7 @@ Z = (195, 195, 195)
   AJJJAJJ1111JJJJA
   AD11AJJ1111JD1JA
 }
-# tile 202 (sub gehennom walls 3)
+# tile 203 (sub gehennom walls 3)
 {
   AAALLLLDDDDDDAAA
   LLLLAAJJ1111DJJJ
@@ -3884,7 +3922,7 @@ Z = (195, 195, 195)
   AJJJAJJ1111JJJJA
   AD11AJJ1111JD1JA
 }
-# tile 203 (sub gehennom walls 4)
+# tile 204 (sub gehennom walls 4)
 {
   AAALLLLDDDDDDAAA
   LLLLAAJJ1111DJJJ
@@ -3903,7 +3941,7 @@ Z = (195, 195, 195)
   JJJJJJJJJJJJJJJJ
   AAAAAAAAAAAAAAAA
 }
-# tile 204 (sub gehennom walls 5)
+# tile 205 (sub gehennom walls 5)
 {
   AAALLLLDDDDDDAAA
   LLLLAAJJ1111DJJJ
@@ -3922,7 +3960,7 @@ Z = (195, 195, 195)
   JJJJJJJJJJJJJJJJ
   AAAAAAAAAAAAAAAA
 }
-# tile 205 (sub gehennom walls 6)
+# tile 206 (sub gehennom walls 6)
 {
   AAALLLLDDDDDDAAA
   LLLLAAJJ1111DJJJ
@@ -3941,7 +3979,7 @@ Z = (195, 195, 195)
   AJJJAJJ1111JJJJA
   AD11AJJ1111JD1JA
 }
-# tile 206 (sub gehennom walls 7)
+# tile 207 (sub gehennom walls 7)
 {
   AAALLLLDDDDDDAAA
   LLLLAAJJ1111DJJJ
@@ -3960,7 +3998,7 @@ Z = (195, 195, 195)
   JJJJJJJJJJJJJJJJ
   AAAAAAAAAAAAAAAA
 }
-# tile 207 (sub gehennom walls 8)
+# tile 208 (sub gehennom walls 8)
 {
   AAALLLLDDDDDDAAA
   LLLLAAJJ1111DJJJ
@@ -3979,7 +4017,7 @@ Z = (195, 195, 195)
   AJJJAJJ1111JJJJA
   AD11AJJ1111JD1JA
 }
-# tile 208 (sub gehennom walls 9)
+# tile 209 (sub gehennom walls 9)
 {
   AAALLLLDDDDDDAAA
   LLLLAAJJ1111DJJJ
@@ -3998,7 +4036,7 @@ Z = (195, 195, 195)
   AJJJAJJ1111JJJJA
   AD11AJJ1111JD1JA
 }
-# tile 209 (sub gehennom walls 10)
+# tile 210 (sub gehennom walls 10)
 {
   AAALLLLDDDDDDAAA
   LLLLAAJJ1111DJJJ
@@ -4017,7 +4055,7 @@ Z = (195, 195, 195)
   AJJJAJJ1111JJJJA
   AD11AJJ1111JD1JA
 }
-# tile 210 (sub knox walls 0)
+# tile 211 (sub knox walls 0)
 {
   AJJJAAACJAAAJJJA
   AJJJAACLJJAAJJJA
@@ -4036,7 +4074,7 @@ Z = (195, 195, 195)
   AAJAAACKKJAAAJAA
   ACJJAAAAAAAACJJA
 }
-# tile 211 (sub knox walls 1)
+# tile 212 (sub knox walls 1)
 {
   AJAAAJAAAJAAAJAA
   JJJAAAJAJJJAAAJA
@@ -4055,7 +4093,7 @@ Z = (195, 195, 195)
   KJJACJJAKJJACJJA
   AAAAAAAAAAAAAAAA
 }
-# tile 212 (sub knox walls 2)
+# tile 213 (sub knox walls 2)
 {
   AAAAAAKCJKAAAAAA
   AAAAKKCLKJKKAAAA
@@ -4074,7 +4112,7 @@ Z = (195, 195, 195)
   AAJAAACKKJAAAJAA
   ACJJAAAAAAAACJJA
 }
-# tile 213 (sub knox walls 3)
+# tile 214 (sub knox walls 3)
 {
   AAAAAAKCJKAAAAAA
   AAAAKKCLKJKKAAAA
@@ -4093,7 +4131,7 @@ Z = (195, 195, 195)
   AAJAAACKKJAAAJAA
   ACJJAAAAAAAACJJA
 }
-# tile 214 (sub knox walls 4)
+# tile 215 (sub knox walls 4)
 {
   AAAAAAKCJKAAAAAA
   AAAAKKCLKJKKAAAA
@@ -4112,7 +4150,7 @@ Z = (195, 195, 195)
   KJJACJJAKJJACJJA
   AAAAAAAAAAAAAAAA
 }
-# tile 215 (sub knox walls 5)
+# tile 216 (sub knox walls 5)
 {
   AAAAAAKCJKAAAAAA
   AAAAKKCLKJKKAAAA
@@ -4131,7 +4169,7 @@ Z = (195, 195, 195)
   KJJACJJAKJJACJJA
   AAAAAAAAAAAAAAAA
 }
-# tile 216 (sub knox walls 6)
+# tile 217 (sub knox walls 6)
 {
   AAAAAAKCJKAAAAAA
   AAAAKKCLKJKKAAAA
@@ -4150,7 +4188,7 @@ Z = (195, 195, 195)
   AAJAAACKKJAAAJAA
   ACJJAAAAAAAACJJA
 }
-# tile 217 (sub knox walls 7)
+# tile 218 (sub knox walls 7)
 {
   AAAAAAKCJKAAAAAA
   AAAAKKCLKJKKAAAA
@@ -4169,7 +4207,7 @@ Z = (195, 195, 195)
   KJJACJJAKJJACJJA
   AAAAAAAAAAAAAAAA
 }
-# tile 218 (sub knox walls 8)
+# tile 219 (sub knox walls 8)
 {
   AAAAAAKCJKAAAAAA
   AAAAKKCLKJKKAAAA
@@ -4188,7 +4226,7 @@ Z = (195, 195, 195)
   AAJAAACKKJAAAJAA
   ACJJAAAAAAAACJJA
 }
-# tile 219 (sub knox walls 9)
+# tile 220 (sub knox walls 9)
 {
   AAAAAAKCJKAAAAAA
   AAAAKKCLKJKKAAAA
@@ -4207,7 +4245,7 @@ Z = (195, 195, 195)
   AAJAAACKKJAAAJAA
   ACJJAAAAAAAACJJA
 }
-# tile 220 (sub knox walls 10)
+# tile 221 (sub knox walls 10)
 {
   AAAAAAKCJKAAAAAA
   AAAAKKCLKJKKAAAA
@@ -4226,7 +4264,7 @@ Z = (195, 195, 195)
   AAJAAACKKJAAAJAA
   ACJJAAAAAAAACJJA
 }
-# tile 221 (sub sokoban walls 0)
+# tile 222 (sub sokoban walls 0)
 {
   ANNBA1EEEEE1NNBA
   ABBBA1E1EE11BBBA
@@ -4245,7 +4283,7 @@ Z = (195, 195, 195)
   A111A11EEEE1111A
   ABEEA11EEEE1BE1A
 }
-# tile 222 (sub sokoban walls 1)
+# tile 223 (sub sokoban walls 1)
 {
   AAANBBAAAAANBBAA
   BBBNBBA1BBBNBBA1
@@ -4264,7 +4302,7 @@ Z = (195, 195, 195)
   1111111111111111
   AAAAAAAAAAAAAAAA
 }
-# tile 223 (sub sokoban walls 2)
+# tile 224 (sub sokoban walls 2)
 {
   AAANNNNBBBBBBAAA
   NNNNAA11EEEEB111
@@ -4283,7 +4321,7 @@ Z = (195, 195, 195)
   A111A11EEEE1111A
   ABEEA11EEEE1BE1A
 }
-# tile 224 (sub sokoban walls 3)
+# tile 225 (sub sokoban walls 3)
 {
   AAANNNNBBBBBBAAA
   NNNNAA11EEEEB111
@@ -4302,7 +4340,7 @@ Z = (195, 195, 195)
   A111A11EEEE1111A
   ABEEA11EEEE1BE1A
 }
-# tile 225 (sub sokoban walls 4)
+# tile 226 (sub sokoban walls 4)
 {
   AAANNNNBBBBBBAAA
   NNNNAA11EEEEB111
@@ -4321,7 +4359,7 @@ Z = (195, 195, 195)
   1111111111111111
   AAAAAAAAAAAAAAAA
 }
-# tile 226 (sub sokoban walls 5)
+# tile 227 (sub sokoban walls 5)
 {
   AAANNNNBBBBBBAAA
   NNNNAA11EEEEB111
@@ -4340,7 +4378,7 @@ Z = (195, 195, 195)
   1111111111111111
   AAAAAAAAAAAAAAAA
 }
-# tile 227 (sub sokoban walls 6)
+# tile 228 (sub sokoban walls 6)
 {
   AAANNNNBBBBBBAAA
   NNNNAA11EEEEB111
@@ -4359,7 +4397,7 @@ Z = (195, 195, 195)
   A111A11EEEE1111A
   ABEEA11EEEE1BE1A
 }
-# tile 228 (sub sokoban walls 7)
+# tile 229 (sub sokoban walls 7)
 {
   AAANNNNBBBBBBAAA
   NNNNAA11EEEEB111
@@ -4378,7 +4416,7 @@ Z = (195, 195, 195)
   1111111111111111
   AAAAAAAAAAAAAAAA
 }
-# tile 229 (sub sokoban walls 8)
+# tile 230 (sub sokoban walls 8)
 {
   AAANNNNBBBBBBAAA
   NNNNAA11EEEEB111
@@ -4397,7 +4435,7 @@ Z = (195, 195, 195)
   A111A11EEEE1111A
   ABEEA11EEEE1BE1A
 }
-# tile 230 (sub sokoban walls 9)
+# tile 231 (sub sokoban walls 9)
 {
   AAANNNNBBBBBBAAA
   NNNNAA11EEEEB111
@@ -4416,7 +4454,7 @@ Z = (195, 195, 195)
   A111A11EEEE1111A
   ABEEA11EEEE1BE1A
 }
-# tile 231 (sub sokoban walls 10)
+# tile 232 (sub sokoban walls 10)
 {
   AAANNNNBBBBBBAAA
   NNNNAA11EEEEB111
index 6651332e9469577065c41af4406c7c738f7b2a3b..594aa89a873b4ff93f3ad18a95e2baef54356121 100644 (file)
@@ -207,6 +207,24 @@ int set, entry;
     }
     tilenum += WARNCOUNT;
 
+    i = entry - tilenum;
+    if (i < 1) {
+        if (set == OTH_GLYPH) {
+            Sprintf(buf, "unexplored");
+            return buf;
+        }
+    }
+    tilenum += 1;
+
+    i = entry - tilenum;
+    if (i < 1) {
+        if (set == OTH_GLYPH) {
+            Sprintf(buf, "nothing");
+            return buf;
+        }
+    }
+    tilenum += 1;
+
     for (i = 0; i < SIZE(substitutes); i++) {
         j = entry - tilenum;
         if (j <= substitutes[i].last_glyph - substitutes[i].first_glyph) {
@@ -361,6 +379,16 @@ init_tilemap()
         tilenum++;
     }
 
+    for (i = 0; i < 1; i++) {
+        tilemap[GLYPH_UNEXPLORED_OFF + i] = tilenum;
+        tilenum++;
+    }
+
+    for (i = 0; i < 1; i++) {
+        tilemap[GLYPH_NOTHING + i] = tilenum;
+        tilenum++;
+    }
+
 #ifndef STATUES_LOOK_LIKE_MONSTERS
     /* statue patch: statues still use the same glyph as in vanilla */