inappropriately sensing humans and elves
Discovered while testing the from-what enhancements to enlightenment. Polymorphing into a vampire confers the ability to sense humans and elves without having telepathy or being triggered by blindness. That would be taken away if you polymorphed into something else, but was being left in effect if polymorph just timed out and hero returned to normal form. Same thing occurred for sensing shriekers if you poly'd into a purple worm and then reverted to normal (something much less likely to get noticed and not really subject to abuse if it ever did). Bonus fix: the code involved was using 0 to mean that Warn_of_mon from polymorph wasn't in effect, but 0 is also giant ant. This makes it use NON_PM for that instead.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 polyself.c $NHDT-Date: 1448496566 2015/11/26 00:09:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.104 $ */
|
||||
/* NetHack 3.6 polyself.c $NHDT-Date: 1451082254 2015/12/25 22:24:14 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.105 $ */
|
||||
/* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -28,7 +28,7 @@ STATIC_DCL void FDECL(drop_weapon, (int));
|
||||
STATIC_DCL void NDECL(uunstick);
|
||||
STATIC_DCL int FDECL(armor_to_dragon, (int));
|
||||
STATIC_DCL void NDECL(newman);
|
||||
STATIC_DCL boolean FDECL(polysense, (struct permonst *));
|
||||
STATIC_DCL void NDECL(polysense);
|
||||
|
||||
STATIC_VAR const char no_longer_petrify_resistant[] =
|
||||
"No longer petrify-resistant, you";
|
||||
@@ -100,6 +100,8 @@ set_uasmon()
|
||||
#ifdef STATUS_VIA_WINDOWPORT
|
||||
status_initialize(REASSESS_ONLY);
|
||||
#endif
|
||||
|
||||
polysense();
|
||||
}
|
||||
|
||||
/* Levitation overrides Flying; set or clear BFlying|I_SPECIAL */
|
||||
@@ -347,7 +349,6 @@ newman()
|
||||
Strcpy(killer.name, "unsuccessful polymorph");
|
||||
done(DIED);
|
||||
newuhs(FALSE);
|
||||
(void) polysense(youmonst.data);
|
||||
return; /* lifesaved */
|
||||
}
|
||||
}
|
||||
@@ -362,7 +363,6 @@ newman()
|
||||
make_slimed(10L, (const char *) 0);
|
||||
}
|
||||
|
||||
(void) polysense(youmonst.data);
|
||||
context.botl = 1;
|
||||
see_monsters();
|
||||
(void) encumber_msg();
|
||||
@@ -827,7 +827,6 @@ int mntmp;
|
||||
u.utrap = 0;
|
||||
}
|
||||
check_strangling(TRUE); /* maybe start strangling */
|
||||
(void) polysense(youmonst.data);
|
||||
|
||||
context.botl = 1;
|
||||
vision_full_recalc = 1;
|
||||
@@ -1777,20 +1776,18 @@ int atyp;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Some species have awareness of other species
|
||||
*/
|
||||
static boolean
|
||||
polysense(mptr)
|
||||
struct permonst *mptr;
|
||||
/* some species have awareness of other species */
|
||||
static void
|
||||
polysense()
|
||||
{
|
||||
short warnidx = 0;
|
||||
short warnidx = NON_PM;
|
||||
|
||||
context.warntype.speciesidx = 0;
|
||||
context.warntype.speciesidx = NON_PM;
|
||||
context.warntype.species = 0;
|
||||
context.warntype.polyd = 0;
|
||||
HWarn_of_mon &= ~FROMRACE;
|
||||
|
||||
switch (monsndx(mptr)) {
|
||||
switch (u.umonnum) {
|
||||
case PM_PURPLE_WORM:
|
||||
warnidx = PM_SHRIEKER;
|
||||
break;
|
||||
@@ -1798,18 +1795,13 @@ struct permonst *mptr;
|
||||
case PM_VAMPIRE_LORD:
|
||||
context.warntype.polyd = M2_HUMAN | M2_ELF;
|
||||
HWarn_of_mon |= FROMRACE;
|
||||
return TRUE;
|
||||
return;
|
||||
}
|
||||
if (warnidx) {
|
||||
if (warnidx >= LOW_PM) {
|
||||
context.warntype.speciesidx = warnidx;
|
||||
context.warntype.species = &mons[warnidx];
|
||||
HWarn_of_mon |= FROMRACE;
|
||||
return TRUE;
|
||||
}
|
||||
context.warntype.speciesidx = 0;
|
||||
context.warntype.species = 0;
|
||||
HWarn_of_mon &= ~FROMRACE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*polyself.c*/
|
||||
|
||||
Reference in New Issue
Block a user