temple priest, or vault guard from the level was off of it at the
time, the monster's eshk, epri, or egd data became invalid and would
cause trouble if the monster returned to its 'home' level
+blessed potion of polymorph will prompt user for monster to poly into
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
DISMOUNT_BYCHOICE = 6
};
+/* polyself flags */
+enum polyself_flags {
+ POLY_NOFLAGS = 0x00,
+ POLY_CONTROLLED = 0x01,
+ POLY_MONSTER = 0x02,
+ POLY_REVERT = 0x04,
+ POLY_LOW_CTRL = 0x08
+};
+
/* sellobj_state() states */
#define SELL_NORMAL (0)
#define SELL_DELIBERATE (1)
if (g.multi >= 0) {
stop_occupation();
if (mvl_change == 1)
- polyself(0);
+ polyself(POLY_NOFLAGS);
else
you_were();
mvl_change = 0;
static int
wiz_polyself(void)
{
- polyself(1);
+ polyself(POLY_CONTROLLED);
return ECMD_OK;
}
You("%s.", (pm == PM_GENETIC_ENGINEER)
? "undergo a freakish metamorphosis"
: "feel a change coming over you");
- polyself(0);
+ polyself(POLY_NOFLAGS);
}
break;
case PM_DISPLACER_BEAST:
pline("This %s contains toxic wastes!", hliquid("water"));
if (!Unchanging) {
You("undergo a freakish metamorphosis!");
- polyself(0);
+ polyself(POLY_NOFLAGS);
}
break;
/* more odd messages --JJB */
/* system shock might take place in polyself() */
if (u.ulycn == NON_PM) {
You("are subjected to a freakish metamorphosis.");
- polyself(0);
+ polyself(POLY_NOFLAGS);
} else if (u.umonnum != u.ulycn) {
You_feel("an unnatural urge coming on.");
you_were();
{
char buf[BUFSZ];
int old_light, new_light, mntmp, class, tryct, gvariant = NEUTRAL;
- boolean forcecontrol = (psflags == 1),
- monsterpoly = (psflags == 2),
- formrevert = (psflags == 3),
+ boolean forcecontrol = ((psflags & POLY_CONTROLLED) != 0),
+ low_control = ((psflags & POLY_LOW_CTRL) != 0),
+ monsterpoly = ((psflags & POLY_MONSTER) != 0),
+ formrevert = ((psflags & POLY_REVERT) != 0),
draconian = (uarm && Is_dragon_armor(uarm)),
iswere = (u.ulycn >= LOW_PM),
isvamp = (is_vampire(g.youmonst.data)
monsterpoly = TRUE;
controllable_poly = FALSE;
}
+
+ if (forcecontrol && low_control
+ && (draconian || monsterpoly || isvamp || iswere))
+ forcecontrol = FALSE;
+
if (monsterpoly && isvamp)
goto do_vampyr;
struct permonst *savedat = g.youmonst.data;
if (is_vampire(g.youmonst.data) || is_vampshifter(&g.youmonst)) {
- polyself(2);
+ polyself(POLY_MONSTER);
if (savedat != g.youmonst.data) {
You("transform into %s.",
an(pmname(g.youmonst.data, Ugender)));
}
static void
-peffect_polymorph(struct obj *otmp UNUSED)
+peffect_polymorph(struct obj *otmp)
{
You_feel("a little %s.", Hallucination ? "normal" : "strange");
- if (!Unchanging)
- polyself(0);
+ if (!Unchanging) {
+ if (!otmp->blessed || (u.umonnum != u.umonster))
+ polyself(POLY_NOFLAGS);
+ else {
+ polyself(POLY_CONTROLLED|POLY_LOW_CTRL);
+ if (u.mtimedone && u.umonnum != u.umonster)
+ u.mtimedone = min(u.mtimedone, rn2(15) + 10);
+ }
+ }
}
int
case POT_POLYMORPH:
You_feel("a little %s.", Hallucination ? "normal" : "strange");
if (!Unchanging && !Antimagic)
- polyself(0);
+ polyself(POLY_NOFLAGS);
break;
case POT_ACID:
if (!Acid_resistance) {
if (Upolyd && vampshifted(&g.youmonst)
/* current shifted form or base vampire form */
&& (i == u.umonnum || i == g.youmonst.cham))
- polyself(3); /* vampshifter back to vampire */
+ polyself(POLY_REVERT); /* vampshifter back to vampire */
if (Upolyd && i == u.umonnum) {
u.mh = -1;
if (Unchanging) {
/* first revert if current shifted form or base vampire form */
if (Upolyd && vampshifted(&g.youmonst)
&& (mndx == u.umonnum || mndx == g.youmonst.cham))
- polyself(3); /* vampshifter (bat, &c) back to vampire */
+ polyself(POLY_REVERT); /* vampshifter (bat, &c) back to vampire */
/* Although "genus" is Latin for race, the hero benefits
* from both race and role; thus genocide affects either.
*/
deltrap(trap); /* delete trap before polymorph */
newsym(u.ux, u.uy); /* get rid of trap symbol */
You_feel("a change coming over you.");
- polyself(0);
+ polyself(POLY_NOFLAGS);
}
} else {
boolean in_sight = canseemon(mtmp) || (mtmp == u.usteed);
case SPE_POLYMORPH:
if (!Unchanging) {
learn_it = TRUE;
- polyself(0);
+ polyself(POLY_NOFLAGS);
}
break;