Show level annotation on level entry

Idea by Chris Smith, via Unnethack
This commit is contained in:
Pasi Kallinen
2015-04-26 10:46:38 +03:00
parent 8624709c0d
commit 4e067f5f2b
3 changed files with 15 additions and 0 deletions

View File

@@ -570,6 +570,7 @@ E boolean FDECL(Invocation_lev, (d_level *));
E xchar NDECL(level_difficulty);
E schar FDECL(lev_by_name, (const char *));
E schar FDECL(print_dungeon, (BOOLEAN_P,schar *,xchar *));
E char *FDECL(get_annotation, (d_level *));
E int NDECL(donamelevel);
E int NDECL(dooverview);
E void FDECL(show_overview, (int,int));

View File

@@ -1069,6 +1069,7 @@ boolean at_stairs, falling, portal;
boolean new = FALSE; /* made a new level? */
struct monst *mtmp;
char whynot[BUFSZ];
char *annotation;
if (dunlev(newlevel) > dunlevs_in_dungeon(newlevel))
newlevel->dlevel = dunlevs_in_dungeon(newlevel);
@@ -1458,6 +1459,9 @@ boolean at_stairs, falling, portal;
save_currentstate();
#endif
if ((annotation = get_annotation(&u.uz)))
You("remember this level as %s.", annotation);
/* assume this will always return TRUE when changing level */
(void) in_out_region(u.ux, u.uy);
(void) pickup(1);

View File

@@ -1848,6 +1848,16 @@ d_level *dest;
}
}
char *
get_annotation(lev)
d_level *lev;
{
mapseen *mptr;
if ((mptr = find_mapseen(lev)))
return mptr->custom;
return NULL;
}
/* #annotate command - add a custom name to the current level */
int
donamelevel()