Tourists gain experience by seeing new types of creatures up close
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
This commit is contained in:
@@ -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);
|
||||
@@ -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
|
||||
@@ -410,6 +433,7 @@ moveloop_core(void)
|
||||
else if (u.uburied)
|
||||
under_ground(0);
|
||||
|
||||
see_nearby_monsters();
|
||||
} /* actual time passed */
|
||||
|
||||
/****************************************/
|
||||
|
||||
Reference in New Issue
Block a user