Skip to content

Commit

Permalink
stone-to-flesh on corpse-wielding golem (trunk only)
Browse files Browse the repository at this point in the history
     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.
  • Loading branch information
nethack.rankin committed Dec 2, 2006
1 parent 5a9b766 commit b99f8a0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
2 changes: 2 additions & 0 deletions doc/fixes35.0
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 25 additions & 13 deletions src/polyself.c
Original file line number Diff line number Diff line change
@@ -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. */

Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -502,14 +510,14 @@ int mntmp;
#ifdef STEED
if (u.usteed) {
if (touch_petrifies(u.usteed->data) &&
!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);
}
!Stone_resistance && rnl(3)) {
char buf[BUFSZ];

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
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1448,4 +1459,5 @@ struct permonst *mptr;
HWarn_of_mon &= ~FROMRACE;
return FALSE;
}

/*polyself.c*/

0 comments on commit b99f8a0

Please sign in to comment.