Show level annotation on level entry
Idea by Chris Smith, via Unnethack
This commit is contained in:
@@ -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));
|
||||
|
||||
4
src/do.c
4
src/do.c
@@ -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);
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user