stone-to-flesh on corpse-wielding golem (trunk only)

A couple of months ago Michael forwarded a thread from the newsgroup
about how wielding a cockatrice corpse without gloves while polymorphed
into something capable of that would leave you wielding that corpse
bare-handed if you changed form, turned to stone, then got life-saved.
That got fixed; the corpse becomes unwielded.  However, one of the
messages in that described a different bug:  if you were wielding such a
corpse as a stone golem and cast stone-to-flesh at yourself, you would
continue to wield it bare-handed as a flesh golem.  This makes you revert
back to stone golem once the first transformation has finished.

     This also fixes an attribute exercising bug in polymon().  It was
being done after the polymorph was completed, so the attempt to exercise
Con didn't do anything because exercise() of anything other than Wis has
no effect when the hero is polymorphed.
This commit is contained in:
nethack.rankin
2006-12-02 04:44:56 +00:00
parent 5a9b766e74
commit b99f8a0ebb
2 changed files with 26 additions and 12 deletions

View File

@@ -174,6 +174,8 @@ tweak levitation timeout if trap is being triggered on same turn it is to end
if Rider corpse revival fails, usually try again later instead of rotting away
worn item transformed by polymorph remains worn if feasible
can't dip or apply grease to a worn item that's covered by another worn item
hero poly'd into stone golem and wielding cockatrice corpse casts stone-to-
flesh at self to become flesh golem will revert to stone if no gloves
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)polyself.c 3.5 2006/07/08 */
/* SCCS Id: @(#)polyself.c 3.5 2006/12/01 */
/* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
@@ -20,6 +20,9 @@ STATIC_DCL int FDECL(armor_to_dragon,(int));
STATIC_DCL void NDECL(newman);
STATIC_DCL boolean FDECL(polysense,(struct permonst *));
STATIC_VAR const char no_longer_petrify_resistant[] =
"No longer petrify-resistant, you";
/* update the youmonst.data structure pointer */
void
set_uasmon()
@@ -349,7 +352,7 @@ int psflags;
}
made_change:
if (!uarmg) selftouch("No longer petrify-resistant, you");
if (!uarmg) selftouch(no_longer_petrify_resistant);
new_light = emits_light(youmonst.data);
if (old_light != new_light) {
if (old_light)
@@ -379,6 +382,11 @@ int mntmp;
/* KMH, conduct */
u.uconduct.polyselfs++;
/* exercise used to be at the very end but only Wis was affected
there since the polymorph was always in effect by then */
exercise(A_CON, FALSE);
exercise(A_WIS, TRUE);
if (!Upolyd) {
/* Human to monster; save human stats */
u.macurr = u.acurr;
@@ -502,14 +510,14 @@ int mntmp;
#ifdef STEED
if (u.usteed) {
if (touch_petrifies(u.usteed->data) &&
!Stone_resistance && rnl(3)) {
char buf[BUFSZ];
!Stone_resistance && rnl(3)) {
char buf[BUFSZ];
pline("No longer petrifying-resistant, you touch %s.",
mon_nam(u.usteed));
Sprintf(buf, "riding %s", an(u.usteed->data->mname));
instapetrify(buf);
}
pline("%s touch %s.", no_longer_petrify_resistant,
mon_nam(u.usteed));
Sprintf(buf, "riding %s", an(u.usteed->data->mname));
instapetrify(buf);
}
if (!can_ride(u.usteed)) dismount_steed(DISMOUNT_POLY);
}
#endif
@@ -592,9 +600,12 @@ int mntmp;
context.botl = 1;
vision_full_recalc = 1;
see_monsters();
exercise(A_CON, FALSE);
exercise(A_WIS, TRUE);
(void) encumber_msg();
/* this might trigger a recursize call to polymon() [stone golem
wielding cockatrice corpse and hit by stone-to-flesh, becomes
flesh golem above, now gets transformed back into stone golem] */
if (!uarmg) selftouch(no_longer_petrify_resistant);
return(1);
}
@@ -758,7 +769,7 @@ rehumanize()
killer.format = KILLED_BY;
done(DIED);
}
if (!uarmg) selftouch("No longer petrify-resistant, you");
if (!uarmg) selftouch(no_longer_petrify_resistant);
nomul(0);
context.botl = 1;
@@ -1448,4 +1459,5 @@ struct permonst *mptr;
HWarn_of_mon &= ~FROMRACE;
return FALSE;
}
/*polyself.c*/