From: PatR Date: Wed, 8 Jun 2022 19:50:49 +0000 (-0700) Subject: death from touching silver ring or wand X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=faf3d6f08a73207bc205794cb1e833f960bac5e5;p=nethack 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. --- diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 7745bb802..bbfc9e775 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -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 " named The " +be less specific when cause of death is "handling a " 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 diff --git a/src/artifact.c b/src/artifact.c index 2ecbb2bc8..522afd5b6 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -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 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); }