vampshifting by poly'd hero

Hero polymorphed into a vampire or v.lord can use #monster to switch
to vampire bat or fog cloud [or wolf for lord] but it was a one shot
polymorph.  Remember when current form is a shape-shifted vampire and
allow #monster in shifted form to pick another shifted form or the
vampire form.

Genocide of the alternate shape forces back to base vampire.  Genocide
of base vampire does too, then reverts to human (or dwarf, &c) as
vampires go away.  Being killed while shafe-shifted reverts all the
way to human rather than to vampire.  [Just realized:  interaction
with Unchanging wasn't taken into consideration so hasn't been tested.]

Since 'youmonst' isn't saved and restored, I had to add a field to 'u'
to hold youmonst.cham during save/restore.

Tested with 3.6.2+ and seemed to be working (except saving while
shape-shifted restored as ordinary bat/cloud/wolf because new u.mcham
wasn't there to hold youmonst.cham yet).  Builds with 3.7.0- but not
execution tested yet (I didn't want to clobber my current playground).
This commit is contained in:
PatR
2019-06-06 16:51:43 -07:00
parent eebbac1c65
commit a27ca52b03
12 changed files with 107 additions and 33 deletions

View File

@@ -821,6 +821,8 @@ struct obj *obj;
if (obj->cursed && !rn2(2)) {
if (!Blind)
pline_The("%s fogs up and doesn't reflect!", mirror);
else
pline("Nothing seems to happen.");
return 1;
}
if (!u.dx && !u.dy && !u.dz) {
@@ -841,19 +843,23 @@ struct obj *obj;
}
g.nomovemsg = 0; /* default, "you can move again" */
}
} else if (g.youmonst.data->mlet == S_VAMPIRE)
} else if (is_vampire(g.youmonst.data)
|| is_vampshifter(&g.youmonst)) {
You("don't have a reflection.");
else if (u.umonnum == PM_UMBER_HULK) {
} else if (u.umonnum == PM_UMBER_HULK) {
pline("Huh? That doesn't look like you!");
make_confused(HConfusion + d(3, 4), FALSE);
} else if (Hallucination)
} else if (Hallucination) {
You(look_str, hcolor((char *) 0));
else if (Sick)
} else if (Sick) {
You(look_str, "peaked");
else if (u.uhs >= WEAK)
} else if (u.uhs >= WEAK) {
You(look_str, "undernourished");
else
} else if (Upolyd) {
You("look like %s.", an(mons[u.umonnum].mname));
} else {
You("look as %s as ever.", uvisage);
}
}
return 1;
}
@@ -884,8 +890,8 @@ struct obj *obj;
/* couldsee(mtmp->mx, mtmp->my) is implied by the fact that bhit()
targetted it, so we can ignore possibility of X-ray vision */
vis = canseemon(mtmp);
/* ways to directly see monster (excludes X-ray vision, telepathy,
extended detection, type-specific warning) */
/* ways to directly see monster (excludes X-ray vision, telepathy,
extended detection, type-specific warning) */
#define SEENMON (MONSEEN_NORMAL | MONSEEN_SEEINVIS | MONSEEN_INFRAVIS)
how_seen = vis ? howmonseen(mtmp) : 0;
/* whether monster is able to use its vision-based capabilities */
@@ -953,7 +959,8 @@ struct obj *obj;
if (vis)
You("discern no obvious reaction from %s.", mon_nam(mtmp));
else
You_feel("a bit silly gesturing the mirror in that direction.");
You_feel(
"a bit silly gesturing the mirror in that direction.");
do_react = FALSE;
}
if (do_react) {