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

@@ -170,6 +170,7 @@ E char *NDECL(do_statusline2);
E void NDECL(bot);
E void NDECL(timebot);
E int FDECL(xlev_to_rank, (int));
E int FDECL(rank_to_xlev, (int));
E const char *FDECL(rank_of, (int, SHORT_P, BOOLEAN_P));
E int FDECL(title_to_mon, (const char *, int *, int *));
E void NDECL(max_rank_sz);
@@ -1007,9 +1008,10 @@ E void FDECL(youhiding, (BOOLEAN_P, int));
E char *FDECL(trap_predicament, (char *, int, BOOLEAN_P));
E int NDECL(doconduct);
E void FDECL(show_conduct, (int));
E void FDECL(record_achievement, (XCHAR_P));
E boolean FDECL(remove_achievement, (XCHAR_P));
E void FDECL(record_achievement, (SCHAR_P));
E boolean FDECL(remove_achievement, (SCHAR_P));
E int NDECL(count_achievements);
E schar FDECL(achieve_rank, (int));
E int NDECL(dovanquished);
E int NDECL(doborn);
E void FDECL(list_vanquished, (CHAR_P, BOOLEAN_P));

View File

@@ -93,14 +93,15 @@ enum achivements {
ACH_NOVL = 20, /* read at least one passage from a Discworld novel */
ACH_SOKO = 21, /* entered Sokoban */
ACH_BGRM = 22, /* entered Bigroom (not guaranteed to be in every dgn) */
/* 23..31, 9 available potential achievements; #32 currently off-limits */
/* 23..30 are negated if hero is female at the time new rank is gained */
ACH_RNK1 = 23, ACH_RNK2 = 24, ACH_RNK3 = 25, ACH_RNK4 = 26,
ACH_RNK5 = 27, ACH_RNK6 = 28, ACH_RNK7 = 29, ACH_RNK8 = 30,
/* foo=31, 1 available potential achievement; #32 currently off-limits */
N_ACH = 32 /* allocate room for 31 plus a slot for 0 terminator */
};
/*
* Other potential achievements to track (this comment briefly resided
* in encodeachieve(topten.c) and has been revised since moving here:
* [reached experience level N for a few interesting values of N
* or perhaps "became a <rank title>" for each new rank reached]
* got quest summons,
* entered quest branch,
* chatted with leader,
@@ -456,7 +457,7 @@ struct you {
struct skills weapon_skills[P_NUM_SKILLS];
boolean twoweap; /* KMH -- Using two-weapon combat */
short mcham; /* vampire mndx if shapeshifted to bat/cloud */
xchar uachieved[N_ACH]; /* list of achievements in the order attained */
schar uachieved[N_ACH]; /* list of achievements in the order attained */
}; /* end of `struct you' */
#define Upolyd (u.umonnum != u.umonster)