photograph experience gains often counted only prior to first move

More details in https://github.com/NetHack/NetHack/issues/1430

track photographed monsters using a distinct bit

also adds a pair of new context fields to track the total number of monsters seen up close,
and the total number of monsters photographed.

So, if somebody wants to add unique end-of-game disclosure statements for tourists that relate to
those, the groundwork should be there.

NOTE: This increments EDITLEVEL, so existing save and bones files will become outdated.

Fixes #1430
This commit is contained in:
nhmall
2025-07-26 11:03:20 -04:00
parent 36dcb92288
commit f145cc02f4
6 changed files with 22 additions and 7 deletions

View File

@@ -5896,13 +5896,18 @@ adj_erinys(unsigned abuse)
pm->difficulty = min(10 + (u.ualign.abuse / 3), 25);
}
/* mark monster type as seen from close-up,
/* mark individual monster type as seen from close-up,
if we haven't seen it nearby before */
void
see_monster_closeup(struct monst *mtmp)
see_monster_closeup(struct monst *mtmp, boolean photo)
{
if (!svm.mvitals[monsndx(mtmp->data)].seen_close) {
svm.mvitals[monsndx(mtmp->data)].seen_close = TRUE;
svc.context.lifelist.total_seen_upclose++;
}
if (photo && !svm.mvitals[monsndx(mtmp->data)].photographed) {
svm.mvitals[monsndx(mtmp->data)].photographed = 1;
svc.context.lifelist.total_photographed++;
if (Role_if(PM_TOURIST)) {
more_experienced(experience(mtmp, 0), 0);
newexplevel();
@@ -5921,8 +5926,11 @@ see_nearby_monsters(void)
if (isok(x, y) && MON_AT(x, y)) {
struct monst *mtmp = m_at(x, y);
if (canspotmon(mtmp) && !mtmp->mundetected && !M_AP_TYPE(mtmp))
svm.mvitals[monsndx(mtmp->data)].seen_close = TRUE;
if (canspotmon(mtmp) && !mtmp->mundetected && !M_AP_TYPE(mtmp)
&& !svm.mvitals[monsndx(mtmp->data)].seen_close) {
svm.mvitals[monsndx(mtmp->data)].seen_close = 1;
svc.context.lifelist.total_seen_upclose++;
}
}
}