death from touching silver ring or wand

From a reddit thread:  NAO's list of causes of death shows
|killed by handling a(n) ring of shock resistance
|killed by handling a(n) wand of fire
along with various other rings and wands and the poster wondered how
that could have killed characters.  Someone quickly figured out that
the heroes involved had lycanthropy and the items listed happened
to be silver in those games.

Avoid that sort of confusion in future by specifying "handling a
silver ring" or "handling a silver wand" instead of the specific
type of item when inflicting silver damage.  It still uses specific
item for other classes of objects where silver isn't shuffled among
potential items at start of game.
This commit is contained in:
PatR
2022-06-08 12:50:49 -07:00
parent f710a3175f
commit faf3d6f08a
2 changed files with 19 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
HDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.940 $ $NHDT-Date: 1654710405 2022/06/08 17:46:45 $
HDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.941 $ $NHDT-Date: 1654717838 2022/06/08 19:50:38 $
General Fixes and Modified Features
-----------------------------------
@@ -919,6 +919,9 @@ two-handed weapon message stated "welds to monster's hand" instead of
"welds to monster's hands"
when formatting an object, avoid capitalization of "The" in "<item> named
The <quest-artifact>"
be less specific when cause of death is "handling a <ring or wand>" that
happened to be silver for current game; list it as "a silver ring" or
"a silver wand" rather than "ring of searching" or "wand of locking"
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 artifact.c $NHDT-Date: 1646870837 2022/03/10 00:07:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.182 $ */
/* NetHack 3.7 artifact.c $NHDT-Date: 1654717838 2022/06/08 19:50:38 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.190 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2179,13 +2179,26 @@ retouch_object(
obj->owornmask ? " anymore" : "");
/* also inflict damage unless touch_artifact() already did so */
if (!touch_blasted) {
const char *what = killer_xname(obj);
if (ag && !obj->oartifact && !bane) {
/* 'obj' is silver; for rings and wands it ended up that
way due to randomization at start of game; showing this
game's silver item without stating that it is silver
potentially leads to confusion about cause of death */
if (obj->oclass == RING_CLASS)
what = "a silver ring";
else if (obj->oclass == WAND_CLASS)
what = "a silver wand";
/* for anything else, stick with killer_xname() */
}
/* damage is somewhat arbitrary; half the usual 1d20 physical
for silver, 1d10 magical for <foo>bane, potentially both */
if (ag)
tmp = rnd(10), dmg += Maybe_Half_Phys(tmp);
if (bane)
dmg += rnd(10);
Sprintf(buf, "handling %s", killer_xname(obj));
Sprintf(buf, "handling %s", what);
losehp(dmg, buf, KILLED_BY);
exercise(A_CON, FALSE);
}