add some new, easier achievements

Introduce eight achievements that can be attained by more players.
 Entered Gnomish Mines  - self explanatory
 Entered Mine Town      - the town portion, not just the level
 Entered a shop         - any tended shop on any level
 Entered a temple       - likewise for temple
 Consulted the Oracle   - bought at least one major or minor oracle
 Read a Discworld Novel - read at least one passage
 Entered Sokoban        - like mines
 Entered the Big Room   - not always possible since not always present

The novel and bigroom ones aren't always achieveable since novels are
only guaranteed if a book or scroll shop gets created and bigroom is
only guaranteed in wizard mode.  No one ever claimed that every
possible achievement can be attained in a single game.  (If one for
entering the Fort Ludios level--or perhaps entering the Fort itself--
eventually gets add, that won't be possible in every game either.)

The mine town one probably needs some tweaking.  Two of the town's
seven variants have no town boundary (despite a rectangular area of
pre-defined map) and at present simply arriving on either of those
levels is enough to be credited with the entered-town achievement.

Bump EDITLEVEL because u.uachieved[] has increased in size.  This
time it has been expanded to the maximum that xlogfile's bitmask of
achievements can handle, enough for up to 9 more achievements without
another EDITLEVEL increment.
This commit is contained in:
PatR
2020-02-12 14:35:37 -08:00
parent 1ec6e6f96b
commit 804499d9be
15 changed files with 195 additions and 88 deletions

View File

@@ -106,8 +106,10 @@ struct novel_tracking { /* for choosing random passage when reading novel */
};
struct achievement_tracking {
unsigned mines_prize_oid, soko_prize_oid; /* obj->o_id */
/* short mines_prize_type, soko_prize_typ1, soko_prize_typ2; */
unsigned mines_prize_oid, /* luckstone->o_id */
soko_prize_oid, /* {bag or amulet}->o_id */
castle_prize_old; /* wand->o_id; not yet implemented */
boolean minetn_reached; /* avoid redundant checking for town entry */
};
struct context_info {

View File

@@ -14,7 +14,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 15
#define EDITLEVEL 16
#define COPYRIGHT_BANNER_A "NetHack, Copyright 1985-2020"
#define COPYRIGHT_BANNER_B \

View File

@@ -54,26 +54,76 @@ struct u_event {
Bitfield(ascended, 1); /* has offered the Amulet */
};
/* numerical order of these matters because they've been encoded in a
bitmask in xlogfile; reordering would break decoding that; during play
the number doesn't matter--they're recorded in the order achieved */
/*
* Achievements: milestones reached during the current game.
* Numerical order of these matters because they've been encoded in
* a bitmask in xlogfile. Reordering would break decoding that.
* Aside from that, the number isn't significant--they're recorded
* and eventually disclosed in the order achieved.
*
* Since xlogfile could be post-processed by unknown tools, we should
* limit these to 31 total (it's possible that 32-bit signed longs are
* the best such tools can offer). Eventually that is likely to need
* to change, probably by giving xlogfile an achieve2 field rather
* than by assuming that 64-bit longs are viable or by squeezing in a
* 32nd entry by switching to unsigned long.
*/
enum achivements {
ACH_BELL = 1, /* acquired Bell of Opening */
ACH_HELL = 2, /* entered Gehennom */
ACH_CNDL = 3, /* acquired Candelabrum of Invocation */
ACH_BOOK = 4, /* acquired Book of the Dead */
ACH_INVK = 5, /* performed invocation to gain access to Sanctum */
ACH_AMUL = 6, /* acuired The Amulet */
ACH_AMUL = 6, /* acquired The Amulet */
ACH_ENDG = 7, /* entered end game */
ACH_ASTR = 8, /* entered Astral Plane */
ACH_UWIN = 9, /* ascended */
ACH_LUCK = 10, /* acquired Mines' End luckstone */
ACH_SOKO = 11, /* acquired Sokoban bag of holding or amu of reflection */
ACH_MINE_PRIZE = 10, /* acquired Mines' End luckstone */
ACH_SOKO_PRIZE = 11, /* acquired Sokoban bag or amulet */
ACH_MEDU = 12, /* killed Medusa */
ACH_BLND = 13, /* hero was always blond, no, blind */
ACH_NUDE = 14, /* hero never wore armor */
N_ACH
/* 1 through 14 were present in 3.6.x; the rest are newer; first,
some easier ones so less skilled players can have achievements */
ACH_MINE = 15, /* entered Gnomish Mines */
ACH_TOWN = 16, /* reached Mine Town */
ACH_SHOP = 17, /* entered a shop */
ACH_TMPL = 18, /* entered a temple */
ACH_ORCL = 19, /* consulted the Oracle */
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 */
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,
* entered second or lower quest level (implies leader gave the Ok),
* entered last quest level,
* defeated nemesis (not same as acquiring Bell or artifact),
* completed quest (formally, by bringing artifact to leader),
* entered rogue level,
* entered Fort Ludios level/branch (not guaranteed to be achieveable),
* entered Medusa level,
* entered castle level,
* opened castle drawbridge,
* obtained castle wand (handle similarly to mines and sokoban prizes),
* passed Valley level (entered-Gehennom already covers Valley itself),
* [assorted demon lairs?],
* entered Vlad's tower branch,
* defeated Vlad (not same as acquiring Candelabrum),
* entered Wizard's tower area within relevant level,
* defeated Wizard,
* found vibrating square,
* entered sanctum level (maybe not; too close to performed-invocation),
* [defeated Famine, defeated Pestilence, defeated Death]
*/
struct u_realtime {
long realtime; /* accumulated playing time in seconds */