From: PatR Date: Wed, 22 Jan 2020 02:29:23 +0000 (-0800) Subject: wizard mode un-polymorph X-Git-Tag: NetHack-3.7.0_WIP~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=424750867ab80c9e468aaded7313f1ab0f48cdca;p=nethack wizard mode un-polymorph When already polymorphed, polymorphing into 'human' (or character's species) to revert to normal when at low level has the infuriating tendency to yield "your new form isn't healthy enough to survive". Allow specifying your own role as a way to rehumanize() instead of going through newman() and level/sex/characteristics randomization which that performs. --- diff --git a/src/polyself.c b/src/polyself.c index d61a461cb..691e70c86 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 polyself.c $NHDT-Date: 1579649789 2020/01/21 23:36:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.148 $ */ +/* NetHack 3.6 polyself.c $NHDT-Date: 1579660157 2020/01/22 02:29:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.149 $ */ /* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ @@ -462,14 +462,19 @@ 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) { + /* in wizard mode, picking own role while poly'd reverts to + normal without newman()'s chance of level or sex change */ + rehumanize(); + goto made_change; } else if (iswere && (were_beastie(mntmp) == u.ulycn || mntmp == counter_were(u.ulycn) || (Upolyd && mntmp == PM_HUMAN))) { goto do_shift; - /* Note: humans are illegal as monsters, but an - * illegal monster forces newman(), which is what we - * want if they specified a human.... */ } else if (!polyok(&mons[mntmp]) + /* Note: humans are illegal as monsters, but an + illegal monster forces newman(), which is what + we want if they specified a human.... */ && !(mntmp == PM_HUMAN || your_race(&mons[mntmp]) || mntmp == g.urole.malenum || mntmp == g.urole.femalenum)) {