wizard mode polyself to "priest"

When polymorphing while already polymorphed, picking your own role
will rehumanize (wizard mode only; restores old characteristics and
experience level, unlike becoming a new man which can change those
and even be fatal if level drops below 1).  But it didn't work if
you were a priest or priestess because name_to_mon() yields aligned
cleric monster rather than cleric role.
This commit is contained in:
PatR
2021-12-08 16:08:57 -08:00
parent 5ce53f4d17
commit a80969f280
2 changed files with 13 additions and 2 deletions

View File

@@ -920,6 +920,9 @@ unpaid shop-owned glob that shrank to nothing had weight 0 which triggered
billing, the empty weight was shown to player if 'wizweight' was On
if 'showrace' was On and invisible hero couldn't see invisible so didn't see
self, the color of wharever could be seen underneath changed to white
in wizard mode, a poly'd priest/priestess attempting to polymorph into priest
or priestess in order to rehumanize became a new man or woman instead
because "priest" matched "aligned cleric" rather than the role monster
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support

View File

@@ -397,7 +397,7 @@ newman(void)
void
polyself(int psflags)
{
char buf[BUFSZ] = DUMMY;
char buf[BUFSZ];
int old_light, new_light, mntmp, class, tryct, gvariant = NEUTRAL;
boolean forcecontrol = (psflags == 1),
monsterpoly = (psflags == 2),
@@ -434,6 +434,7 @@ polyself(int psflags)
goto do_vampyr;
if (controllable_poly || forcecontrol) {
buf[0] = '\0';
tryct = 5;
do {
mntmp = NON_PM;
@@ -467,7 +468,14 @@ polyself(int psflags)
pline("I've never heard of such monsters.");
else
You_cant("polymorph into any of those.");
} else if (wizard && Upolyd && mntmp == u.umonster) {
} else if (wizard && Upolyd
&& (mntmp == u.umonster
/* "priest" and "priestess" match the monster
rather than the role; override that unless
the text explicitly contains "aligned" */
|| (u.umonster == PM_CLERIC
&& mntmp == PM_ALIGNED_CLERIC
&& !strstri(buf, "aligned")))) {
/* in wizard mode, picking own role while poly'd reverts to
normal without newman()'s chance of level or sex change */
rehumanize();