Skip to content

Commit

Permalink
Tourists gain experience by seeing new types of creatures up close
Browse files Browse the repository at this point in the history
Experience equivalent to killing a monster is gained when starting a turn
adjacent to and being able to see the monster.

Breaks saves.

Idea and parts of code via dNetHack
  • Loading branch information
paxed committed Dec 6, 2024
1 parent 5eb7566 commit 89c4c3a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/fixes3-7-0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2730,6 +2730,7 @@ enlightenment/attribute disclosure for saving-grace: include a line for have
"X " for explore mode, or "D " for debug mode if any of the games
shown in its menu weren't saved during normal play; if they're all
normal play, the prefix is suppressed
tourists gain experience by seeing new types of creatures up close


Platform- and/or Interface-Specific New Features
Expand Down
1 change: 1 addition & 0 deletions include/hack.h
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ struct mvitals {
uchar born;
uchar died;
uchar mvflags;
Bitfield(seen_close, 1);
};


Expand Down
2 changes: 1 addition & 1 deletion include/patchlevel.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 110
#define EDITLEVEL 111

/*
* Development status possibilities.
Expand Down
24 changes: 24 additions & 0 deletions src/allmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

staticfn void moveloop_preamble(boolean);
staticfn void u_calc_moveamt(int);
staticfn void see_nearby_monsters(void);
staticfn void maybe_do_tutorial(void);
#ifdef POSITIONBAR
staticfn void do_positionbar(void);
Expand Down Expand Up @@ -154,6 +155,28 @@ u_calc_moveamt(int wtcap)
u.umovement = 0;
}

/* mark a monster type as seen when we see it next to us */
staticfn void
see_nearby_monsters(void)
{
coordxy x, y;

if (Blind || !Role_if(PM_TOURIST))
return;

for (x = u.ux - 1; x <= u.ux + 1; x++)
for (y = u.uy - 1; y <= u.uy + 1; y++)
if (isok(x, y) && MON_AT(x, y)) {
struct monst *mtmp = m_at(x, y);

if (canseemon(mtmp) && !svm.mvitals[monsndx(mtmp->data)].seen_close) {
svm.mvitals[monsndx(mtmp->data)].seen_close = TRUE;
more_experienced(experience(mtmp, 0), 0);
newexplevel();
}
}
}

#if defined(MICRO) || defined(WIN32)
static int mvl_abort_lev;
#endif
Expand Down Expand Up @@ -410,6 +433,7 @@ moveloop_core(void)
else if (u.uburied)
under_ground(0);

see_nearby_monsters();
} /* actual time passed */

/****************************************/
Expand Down

0 comments on commit 89c4c3a

Please sign in to comment.