shapechanger's inventory (trunk only)

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.
This commit is contained in:
nethack.rankin
2007-10-31 09:02:31 +00:00
parent 96247e7fd9
commit 408a36bc5f
2 changed files with 17 additions and 16 deletions

View File

@@ -379,6 +379,7 @@ hallucination provides partial protection against gaze attacks
attempting to read "dull" spellbook might cause hero to fall asleep attempting to read "dull" spellbook might cause hero to fall asleep
dipping prompt is more precise dipping prompt is more precise
using F to attack wall/boulder/statue while wielding pick digs/breaks target 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 Platform- and/or Interface-Specific New Features

View File

@@ -1042,22 +1042,22 @@ register int mmflags;
if ((mcham = pm_to_cham(mndx)) != NON_PM) { if ((mcham = pm_to_cham(mndx)) != NON_PM) {
/* this is a shapechanger after all */ /* this is a shapechanger after all */
if (Protection_from_shape_changers) { if (Protection_from_shape_changers) {
; /* stuck in its natural form (NON_PM) */ ; /* stuck in its natural form (NON_PM) */
} else { } else {
/* General shapechangers start out with random form /* Note: shapechanger's initial form used to be
(this explicitly picks something from the normal chosen with rndmonst(), yielding a monster
selection for current difficulty level rather which was approriate to the level's difficulty
than from among shapechanger's preferred forms). but ignored the changer's usual type selection
Vampires are the exception. */ so would be inppropriate for vampshifters. */
struct permonst *tmpcham = rndmonst(); mtmp->cham = mcham; /* remember base form */
mtmp->cham = mcham; if (mcham != PM_VLAD_THE_IMPALER &&
if (is_vampshifter(mtmp)){ /* select initial shape */
int chamidx = select_newcham_form(mtmp); (mcham = select_newcham_form(mtmp)) != NON_PM) {
if (chamidx != NON_PM) /* take on initial shape; if successful,
tmpcham = &mons[chamidx]; avoid giving that shape's usual inventory */
} if (newcham(mtmp, &mons[mcham], FALSE, FALSE))
if (mtmp->cham != PM_VLAD_THE_IMPALER) allow_minvent = FALSE;
(void) newcham(mtmp,tmpcham,FALSE, FALSE); }
} }
} else if (mndx == PM_WIZARD_OF_YENDOR) { } else if (mndx == PM_WIZARD_OF_YENDOR) {
mtmp->iswiz = TRUE; mtmp->iswiz = TRUE;