fix #H4146 - more enlightenment vs drain resistance
Duplicate of another recent report as far as drain resistance from Excalibur/Stormbringer/Staff of Aesculapius not being shown by enlightenment goes, but this one mentioned that it also wasn't being shown for lycanthropy. Being inflicted by that does confers level- drain resistance. were_change() wasn't calling set_uasmon() since it isn't changing youmonst.data, but set_uasmon() is were intrinsics conferred by creature form are set up. So call it when changing were-form. Direct access to u.ulycn wasn't calling it either, so add a new routine to assign the value to that instead doing so directly.
This commit is contained in:
26
src/were.c
26
src/were.c
@@ -37,6 +37,8 @@ register struct monst *mon;
|
||||
} else if (!rn2(30) || Protection_from_shape_changers) {
|
||||
new_were(mon); /* change back into human form */
|
||||
}
|
||||
/* update innate intrinsics (mainly Drain_resistance) */
|
||||
set_uasmon(); /* new_were() doesn't do this */
|
||||
}
|
||||
|
||||
int
|
||||
@@ -118,15 +120,15 @@ register struct monst *mon;
|
||||
possibly_unwield(mon, FALSE);
|
||||
}
|
||||
|
||||
int were_summon(ptr, yours, visible,
|
||||
genbuf) /* were-creature (even you) summons a horde */
|
||||
register struct permonst *ptr;
|
||||
register boolean yours;
|
||||
/* were-creature (even you) summons a horde */
|
||||
int were_summon(ptr, yours, visible, genbuf)
|
||||
struct permonst *ptr;
|
||||
boolean yours;
|
||||
int *visible; /* number of visible helpers created */
|
||||
char *genbuf;
|
||||
{
|
||||
register int i, typ, pm = monsndx(ptr);
|
||||
register struct monst *mtmp;
|
||||
int i, typ, pm = monsndx(ptr);
|
||||
struct monst *mtmp;
|
||||
int total = 0;
|
||||
|
||||
*visible = 0;
|
||||
@@ -194,11 +196,21 @@ boolean purify;
|
||||
|
||||
if (purify) {
|
||||
You_feel("purified.");
|
||||
u.ulycn = NON_PM; /* cure lycanthropy */
|
||||
set_ulycn(NON_PM); /* cure lycanthropy */
|
||||
}
|
||||
if (!Unchanging && is_were(youmonst.data)
|
||||
&& (!controllable_poly || yn("Remain in beast form?") == 'n'))
|
||||
rehumanize();
|
||||
}
|
||||
|
||||
/* lycanthropy is being caught or cured, but no shape change is involved */
|
||||
void
|
||||
set_ulycn(which)
|
||||
int which;
|
||||
{
|
||||
u.ulycn = which;
|
||||
/* add or remove lycanthrope's innate intrinsics (Drain_resistance) */
|
||||
set_uasmon();
|
||||
}
|
||||
|
||||
/*were.c*/
|
||||
|
||||
Reference in New Issue
Block a user