corpse revival nitpicks
Testing a forthcoming extension of monsters using wands of undead turning revealed a couple of pre-existing bugs. Previously only noticeable if hero zaps self or breaks a wand of undead turning so unlikely to have happened much. "Your <mon> corpse comes alive" was given even if it was revived as an undead. Also, it was "your <mon> corpse" instead of "one of your <mon> corpses" even when one from a stack was involved. If done by hero to self that message follows "one of your <mon> corpses glows iridescently" so the comes alive message was ok but verbose. Change that to "it comes alive" or "it reanimates" when following the glow message.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.172 $ $NHDT-Date: 1586384219 2020/04/08 22:16:59 $
|
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.175 $ $NHDT-Date: 1586633039 2020/04/11 19:23:59 $
|
||||||
|
|
||||||
General Fixes and Modified Features
|
General Fixes and Modified Features
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
@@ -124,6 +124,8 @@ object taking erosion damage might give feedback message when out of view
|
|||||||
inventory when out-of-view ice melted]
|
inventory when out-of-view ice melted]
|
||||||
it's possible to wish for tins of the Riders in wizard mode; eating one is
|
it's possible to wish for tins of the Riders in wizard mode; eating one is
|
||||||
fatal but if you're life-saved or decline to die, the game crashed
|
fatal but if you're life-saved or decline to die, the game crashed
|
||||||
|
revival via undead turning of corpse carried by hero said "your <mon> corpse
|
||||||
|
comes alive" even when revived monster was undead
|
||||||
|
|
||||||
|
|
||||||
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
||||||
|
|||||||
46
src/zap.c
46
src/zap.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 zap.c $NHDT-Date: 1580322890 2020/01/29 18:34:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.330 $ */
|
/* NetHack 3.6 zap.c $NHDT-Date: 1586633039 2020/04/11 19:23:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.335 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -852,6 +852,7 @@ boolean by_hero;
|
|||||||
if (one_of) /* could be simplified to ''corpse->quan = 1L;'' */
|
if (one_of) /* could be simplified to ''corpse->quan = 1L;'' */
|
||||||
corpse->quan--;
|
corpse->quan--;
|
||||||
pline("%s glows iridescently.", upstart(buf));
|
pline("%s glows iridescently.", upstart(buf));
|
||||||
|
iflags.last_msg = PLNMSG_OBJ_GLOWS; /* usually for BUC change */
|
||||||
} else if (shkp) {
|
} else if (shkp) {
|
||||||
/* need some prior description of the corpse since
|
/* need some prior description of the corpse since
|
||||||
stolen_value() will refer to the object as "it" */
|
stolen_value() will refer to the object as "it" */
|
||||||
@@ -957,11 +958,11 @@ struct monst *mon;
|
|||||||
struct obj *otmp, *otmp2;
|
struct obj *otmp, *otmp2;
|
||||||
struct monst *mtmp2;
|
struct monst *mtmp2;
|
||||||
char owner[BUFSZ], corpse[BUFSZ];
|
char owner[BUFSZ], corpse[BUFSZ];
|
||||||
boolean youseeit;
|
boolean youseeit, different_type, is_u = (mon == &g.youmonst);
|
||||||
int res = 0;
|
int corpsenm, res = 0;
|
||||||
|
|
||||||
youseeit = (mon == &g.youmonst) ? TRUE : canseemon(mon);
|
youseeit = is_u ? TRUE : canseemon(mon);
|
||||||
otmp2 = (mon == &g.youmonst) ? g.invent : mon->minvent;
|
otmp2 = is_u ? g.invent : mon->minvent;
|
||||||
owner[0] = corpse[0] = '\0'; /* lint suppression */
|
owner[0] = corpse[0] = '\0'; /* lint suppression */
|
||||||
|
|
||||||
while ((otmp = otmp2) != 0) {
|
while ((otmp = otmp2) != 0) {
|
||||||
@@ -972,20 +973,43 @@ struct monst *mon;
|
|||||||
continue;
|
continue;
|
||||||
/* save the name; the object is liable to go away */
|
/* save the name; the object is liable to go away */
|
||||||
if (youseeit) {
|
if (youseeit) {
|
||||||
Strcpy(corpse,
|
Strcpy(corpse, corpse_xname(otmp, (const char *) 0, CXN_NORMAL));
|
||||||
corpse_xname(otmp, (const char *) 0, CXN_SINGULAR));
|
/* shk_your/Shk_Your produces a value with a trailing space */
|
||||||
Shk_Your(owner, otmp); /* includes a trailing space */
|
if (otmp->quan > 1L) {
|
||||||
|
Strcpy(owner, "One of ");
|
||||||
|
(void) shk_your(eos(owner), otmp);
|
||||||
|
} else
|
||||||
|
(void) Shk_Your(owner, otmp);
|
||||||
}
|
}
|
||||||
|
/* for a stack, only one is revived; if is_u, revive() calls
|
||||||
/* for a stack, only one is revived */
|
useup() which calls update_inventory() but not encumber_msg() */
|
||||||
|
corpsenm = otmp->corpsenm;
|
||||||
if ((mtmp2 = revive(otmp, !g.context.mon_moving)) != 0) {
|
if ((mtmp2 = revive(otmp, !g.context.mon_moving)) != 0) {
|
||||||
++res;
|
++res;
|
||||||
|
/* might get revived as a zombie rather than corpse's monster */
|
||||||
|
different_type = (mtmp2->data != &mons[corpsenm]);
|
||||||
|
if (iflags.last_msg == PLNMSG_OBJ_GLOWS) {
|
||||||
|
/* when hero zaps undead turning at self (or breaks
|
||||||
|
non-empty wand), revive() reports "[one of] your <mon>
|
||||||
|
corpse[s] glows iridescently"; override saved corpse
|
||||||
|
and owner names to say "It comes alive" [note: we did
|
||||||
|
earlier setup because corpse gets used up but need to
|
||||||
|
do the override here after revive() sets 'last_msg'] */
|
||||||
|
Strcpy(corpse, "It");
|
||||||
|
owner[0] = '\0';
|
||||||
|
}
|
||||||
if (youseeit)
|
if (youseeit)
|
||||||
pline("%s%s suddenly comes alive!", owner, corpse);
|
pline("%s%s suddenly %s%s%s!", owner, corpse,
|
||||||
|
nonliving(mtmp2->data) ? "reanimates" : "comes alive",
|
||||||
|
different_type ? " as " : "",
|
||||||
|
different_type ? an(mtmp2->data->mname) : "");
|
||||||
else if (canseemon(mtmp2))
|
else if (canseemon(mtmp2))
|
||||||
pline("%s suddenly appears!", Amonnam(mtmp2));
|
pline("%s suddenly appears!", Amonnam(mtmp2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (is_u && res)
|
||||||
|
(void) encumber_msg();
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user