]> granicus.if.org Git - nethack/commitdiff
shapechanger's inventory (trunk only)
authornethack.rankin <nethack.rankin>
Wed, 31 Oct 2007 09:02:31 +0000 (09:02 +0000)
committernethack.rankin <nethack.rankin>
Wed, 31 Oct 2007 09:02:31 +0000 (09:02 +0000)
     Newsgroup discussion points out that a chameleon which starts out
in nymph form also starts out with nymph's inventory (50% chance each for
mirror and potion of object detection).  That's not right; shapechanging
shouldn't manufacture items.  Also, the post-3.4.3 code to initialize
vampires was overly complicated in order to preserve chameleon behavior,
but the old chameleon initialization which used rndmonst() instead of
selecting a preferred shape was just that way by accident (says the
person who implemented preferred shapes however long ago and completely
overlooked that at the time...).

     This is tricky to test; ^G these days forces a created shapechanger
to start out in its natural form.  That's a bit odd to begin with (a side-
effect of transforming requests for uniques and other special monsters
into doggelgangers), but downright strange when monpolycontrol is enabled;
a prompt to pick monster shape is issued, then the player's choice gets
overridden.  I'm not sure which aspect, if any, of all this should be
changed to fix a wizard mode quirk.

doc/fixes35.0
src/makemon.c

index 02e98a029f4b8ecac8e66d4d36ef4ae42edea45c..70dfff8a92e9d7a569760a2699464b9af76cd579 100644 (file)
@@ -379,6 +379,7 @@ hallucination provides partial protection against gaze attacks
 attempting to read "dull" spellbook might cause hero to fall asleep
 dipping prompt is more precise
 using F to attack wall/boulder/statue while wielding pick digs/breaks target
+shapechangers shouldn't receive starting inventory of their initial shape
 
 
 Platform- and/or Interface-Specific New Features
index 58e33278d5959f0a7ed7a1ca933c68bfac3a3478..5fe0e23b9164032f3246a247361f0155fa73c92f 100644 (file)
@@ -1042,22 +1042,22 @@ register int    mmflags;
        if ((mcham = pm_to_cham(mndx)) != NON_PM) {
                /* this is a shapechanger after all */
                if (Protection_from_shape_changers) {
-                       ;       /* stuck in its natural form (NON_PM) */
-               } else {
-                       /* General shapechangers start out with random form
-                          (this explicitly picks something from the normal
-                          selection for current difficulty level rather
-                          than from among shapechanger's preferred forms).
-                          Vampires are the exception. */
-                       struct permonst *tmpcham = rndmonst();
-                       mtmp->cham = mcham;
-                       if (is_vampshifter(mtmp)){
-                           int chamidx = select_newcham_form(mtmp);
-                           if (chamidx != NON_PM)
-                               tmpcham = &mons[chamidx];
-                       }
-                       if (mtmp->cham != PM_VLAD_THE_IMPALER)
-                           (void) newcham(mtmp,tmpcham,FALSE, FALSE);
+                   ;   /* stuck in its natural form (NON_PM) */
+               } else { 
+                   /* Note: shapechanger's initial form used to be
+                      chosen with rndmonst(), yielding a monster
+                      which was approriate to the level's difficulty
+                      but ignored the changer's usual type selection
+                      so would be inppropriate for vampshifters. */
+                   mtmp->cham = mcham; /* remember base form */
+                   if (mcham != PM_VLAD_THE_IMPALER &&
+                       /* select initial shape */
+                           (mcham = select_newcham_form(mtmp)) != NON_PM) {
+                       /* take on initial shape; if successful,
+                          avoid giving that shape's usual inventory */
+                       if (newcham(mtmp, &mons[mcham], FALSE, FALSE))
+                           allow_minvent = FALSE;
+                   }
                }
        } else if (mndx == PM_WIZARD_OF_YENDOR) {
                mtmp->iswiz = TRUE;