hearing an unseen monster read a scroll

Heroes recognized unseen same-race monsters by voice, but it yielded
an unexpected result if the monster was unique.  Change it so that
hero will recognize any type of monster by its voice if that monster
has been seen and limit unseen same-race ones to non-unique monsters.
Treats shopkeepers as unique since they have distinct names.

This adds a new flag to struct monst in order to track whether each
specific monster has ever been seen or sensed.
This commit is contained in:
PatR
2023-04-22 02:00:04 -07:00
parent 861fcdf9c4
commit 85a002c157
5 changed files with 61 additions and 31 deletions
+10
View File
@@ -1002,6 +1002,8 @@ recharge(struct obj* obj, int curse_bless)
static void
forget(int howmuch)
{
struct monst *mtmp;
if (Punished)
u.bc_felt = 0; /* forget felt ball&chain */
@@ -1010,6 +1012,14 @@ forget(int howmuch)
/* Forget some skills. */
drain_weapon_skill(rnd(howmuch ? 5 : 3));
/* forget having seen monsts (affects recognizing unseen ones by sound) */
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
if (mtmp != u.usteed && mtmp != u.ustuck)
mtmp->meverseen = 0;
/* [perhaps ought to forget having seen every monster on every level] */
for (mtmp = gm.migrating_mons; mtmp; mtmp = mtmp->nmon)
mtmp->meverseen = 0;
}
/* monster is hit by scroll of taming's effect */