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
+7 -4
View File
@@ -867,23 +867,26 @@ Amulet_on(void)
make_slimed(0L, (char *) 0);
break;
case AMULET_OF_CHANGE: {
int orig_sex = poly_gender();
int new_sex, orig_sex = poly_gender();
if (Unchanging)
break;
change_sex();
new_sex = poly_gender();
/* Don't use same message as polymorph */
if (orig_sex != poly_gender()) {
if (new_sex != orig_sex) {
makeknown(AMULET_OF_CHANGE);
You("are suddenly very %s!",
flags.female ? "feminine" : "masculine");
g.context.botl = 1;
newsym(u.ux, u.uy); /* glyphmon flag and tile may have gone
from male to female or vice versa */
} else
* from male to female or vice versa */
} else {
/* already polymorphed into single-gender monster; only
changed the character's base sex */
You("don't feel like yourself.");
}
livelog_newform(FALSE, orig_sex, new_sex);
pline_The("amulet disintegrates!");
if (orig_sex == poly_gender() && uamul->dknown
&& !objects[AMULET_OF_CHANGE].oc_name_known