]> granicus.if.org Git - nethack/commitdiff
wizard mode un-polymorph
authorPatR <rankin@nethack.org>
Wed, 22 Jan 2020 02:29:23 +0000 (18:29 -0800)
committerPatR <rankin@nethack.org>
Wed, 22 Jan 2020 02:29:23 +0000 (18:29 -0800)
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.

src/polyself.c

index d61a461cb258ccbd6b3bdd1372a1709a470e06cd..691e70c8640fff24ee40610eb8e5851a72f3a81f 100644 (file)
@@ -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)) {