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

@@ -3414,7 +3414,21 @@ int mndx;
return TRUE; /* potential new form is ok */
}
/* prevent wizard mode user from specifying invalid vampshifter shape */
/* used for hero polyself handling */
boolean
valid_vampshiftform(base, form)
int base, form;
{
if (base >= LOW_PM && is_vampire(&mons[base])) {
if (form == PM_VAMPIRE_BAT || form == PM_FOG_CLOUD
|| (form == PM_WOLF && base != PM_VAMPIRE))
return TRUE;
}
return FALSE;
}
/* prevent wizard mode user from specifying invalid vampshifter shape
when using monpolycontrol to assign a new form to a vampshifter */
boolean
validvamp(mon, mndx_p, monclass)
struct monst *mon;