Skip to content

Commit

Permalink
more statue animation and corpse revival (trunk only)
Browse files Browse the repository at this point in the history
     Reviving a corpse or statue restores the monster to life before
deciding whether the object which was used up in the process belongs to a
shop.  This resulted in a rather strange situation when the revived monster
was the shopkeeper involved.  The object can't have been stolen; there was
no shk to own it at the time it got used up.

  Manlobbi's statue of a shopkeeper comes to life.
  You owe Manlobbi N zorkmids for it.

Suppress "of a shopkeeper" in such a case, and do not charge the hero for
using up the statue.  The corpse case only needed the second part.

     This revises post-3.4.3 code so doesn't warrant a fixes entry.
  • Loading branch information
nethack.rankin committed Apr 21, 2005
1 parent 35a35de commit 046714c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
14 changes: 12 additions & 2 deletions src/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,15 @@ int *fail_reason;
"moves" : "comes to life";
if ((x == u.ux && y == u.uy) || cause == ANIMATE_SPELL) {
/* "the|your|Manlobbi's statue [of a wombat]" */
shkp = shop_keeper(*in_rooms(mon->mx, mon->my, SHOPBASE));
Sprintf(statuename, "%s%s", shk_your(tmpbuf, statue),
(cause == ANIMATE_SPELL) ? xname(statue) : "statue");
(cause == ANIMATE_SPELL &&
/* avoid "of a shopkeeper" if it's Manlobbi himself
(if carried, it can't be unpaid--hence won't be
described as "Manlobbi's statue"--because there
wasn't any living shk when statue was picked up) */
(mon != shkp || carried(statue))) ? xname(statue) :
"statue");
pline("%s %s!", upstart(statuename), comes_to_life);
} else if (cause == ANIMATE_SHATTER) {
if (cansee(x, y))
Expand All @@ -508,7 +515,10 @@ int *fail_reason;
which refers to "it" so needs to follow a message describing
the object ("the statue comes to life" one above) */
if (cause != ANIMATE_NORMAL && costly_spot(x, y) &&
(shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) != 0)
(shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) != 0 &&
/* avoid charging for Manlobbi's statue of Manlobbi
if stone-to-flesh is used on petrified shopkeep */
mon != shkp)
(void) stolen_value(statue, x, y,
(boolean)shkp->mpeaceful, FALSE);

Expand Down
5 changes: 3 additions & 2 deletions src/zap.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)zap.c 3.5 2005/03/28 */
/* SCCS Id: @(#)zap.c 3.5 2005/04/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -673,7 +673,8 @@ boolean by_hero;
stolen_value() will refer to the object as "it" */
pline("A corpse is resuscitated.");

if (shkp)
/* don't charge for shopkeeper's own corpse if we just revived him */
if (shkp && mtmp != shkp)
(void) stolen_value(corpse, x, y, (boolean)shkp->mpeaceful, FALSE);

/* [we don't give any comparable message about the corpse for
Expand Down

0 comments on commit 046714c

Please sign in to comment.