logging experience level changes again

The livelog message for losing a level had an off-by-1 error, showing
the level the hero ended up at rather than the level that was lost.

There was a message for regaining a previously lost level when rank
title stayed the same but no such message if the title changed (the
achievement of gaining a particular title only occurs once).

Say "regained" rather than "gained" when gaining a previously lost
level.  (Blessed potions of full healing regain levels but can also
reduce u.ulevelmax so a different way to remember peak experience
level has been added.)

Report level change due to polymorphing into new man/woman/elf/&c.
I hadn't realized that that hasn't been recording achievement for new
rank when applicable and decided to leave things that way.

Report gender change when putting on an amulet of change or becoming
a new man/&c unless hero is polymorphed at the time or experience
level is also changing.
This commit is contained in:
PatR
2022-02-10 05:45:07 -08:00
parent c036c59b00
commit 96ba3c04d1
7 changed files with 79 additions and 21 deletions

View File

@@ -2060,6 +2060,7 @@ extern void nhassert_failed(const char *, const char *, int);
extern void set_uasmon(void);
extern void float_vs_flight(void);
extern void change_sex(void);
extern void livelog_newform(boolean, int, int);
extern void polyself(int);
extern int polymon(int);
extern void rehumanize(void);

View File

@@ -17,7 +17,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 48
#define EDITLEVEL 49
/*
* Development status possibilities.

View File

@@ -358,8 +358,10 @@ struct you {
boolean umoved; /* changed map location (post-move) */
int last_str_turn; /* 0: none, 1: half turn, 2: full turn
+: turn right, -: turn left */
int ulevel; /* 1 to MAXULEV */
int ulevelmax;
int ulevel; /* 1 to MAXULEV (30) */
int ulevelmax; /* highest level, but might go down (to throttle
* lost level recovery via blessed full healing) */
int ulevelpeak; /* really highest level reached; never does down */
unsigned utrap; /* trap timeout */
unsigned utraptype; /* defined if utrap nonzero. one of utraptypes */
char urooms[5]; /* rooms (roomno + 3) occupied now */