track eight more achievements

Record reaching experience level 3, 6, 10, 14, 18, 22, 26, and 30,
the levels where the character gets a new rank title, and report
those as achievements at end of game.  These achievements persist
even if enough levels to lose a rank are lost, and if lost ranks
are regained the original achievement is the one that gets tracked
and disclosed.
This commit is contained in:
PatR
2020-05-04 16:35:40 -07:00
parent 16562b2892
commit 116642ce1e
8 changed files with 117 additions and 28 deletions

View File

@@ -299,9 +299,12 @@ boolean incr; /* true iff via incremental experience growth */
/* increase level (unless already maxxed) */
if (u.ulevel < MAXULEV) {
int newrank, oldrank = xlev_to_rank(u.ulevel);
/* increase experience points to reflect new level */
if (incr) {
long tmp = newuexp(u.ulevel + 1);
if (u.uexp >= tmp)
u.uexp = tmp - 1;
} else {
@@ -314,6 +317,9 @@ boolean incr; /* true iff via incremental experience growth */
if (u.ulevelmax < u.ulevel)
u.ulevelmax = u.ulevel;
adjabil(u.ulevel - 1, u.ulevel); /* give new intrinsics */
newrank = xlev_to_rank(u.ulevel);
if (newrank > oldrank)
record_achievement(achieve_rank(newrank));
}
g.context.botl = TRUE;
}