From: nethack.allison Date: Sun, 9 Nov 2003 23:38:33 +0000 (+0000) Subject: silver wands X-Git-Tag: MOVE2GIT~1603 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8212618221e788740414f793bf7cce49e7b4de73;p=nethack silver wands From the newsgroup: > () > Newsgroups: rec.games.roguelike.nethack > Subject: Question: Why don't silver wands give silver damage? > Date: 9 Nov 2003 09:18:50 -0800 > Organization: http://groups.google.com > Lines: 7 > > > I had a character cornered by a werejackal the other day. I'm not too > bothered by the death but why didn't the silver wand he desperately > wielded in his final moments do extra damage? I mean, silver rings do > so why not wands? I realise this is a pretty minor problem since not > that many people will be going around wielding wands, but still. > > ~ There was a code path for objects such as wands that avoided all the silver checks. Now fixed. --- diff --git a/doc/fixes34.3 b/doc/fixes34.3 index d2c136c04..c2cdc1933 100644 --- a/doc/fixes34.3 +++ b/doc/fixes34.3 @@ -88,6 +88,7 @@ sleeping shopkeeper responds to various events without waking rotting corpses grammar fix allow successful teleport to more locations on debug mode level teleport menu trapped monster repeatedly switched between ranged and hand-to-hand weapon +silver items such as wands avoided all the silver checks in hmon_hitmon() Platform- and/or Interface-Specific Fixes diff --git a/src/uhitm.c b/src/uhitm.c index 0396a0fda..1a18afd77 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -544,7 +544,7 @@ int thrown; boolean hittxt = FALSE, destroyed = FALSE, already_killed = FALSE; boolean get_dmg_bonus = TRUE; boolean ispoisoned = FALSE, needpoismsg = FALSE, poiskilled = FALSE; - boolean silvermsg = FALSE; + boolean silvermsg = FALSE, silverobj = FALSE; boolean valid_weapon_attack = FALSE; boolean unarmed = !uwep && !uarm && !uarms; #ifdef STEED @@ -665,8 +665,9 @@ int thrown; hittxt = TRUE; } if (objects[obj->otyp].oc_material == SILVER - && hates_silver(mdat)) - silvermsg = TRUE; + && hates_silver(mdat)) { + silvermsg = TRUE; silverobj = TRUE; + } #ifdef STEED if (u.usteed && !thrown && tmp > 0 && weapon_type(obj) == P_LANCE && mon != u.ustuck) { @@ -888,6 +889,15 @@ int thrown; if(tmp < 1) tmp = 1; else tmp = rnd(tmp); if(tmp > 6) tmp = 6; + /* + * Things like silver wands can arrive here so + * so we need another silver check. + */ + if (objects[obj->otyp].oc_material == SILVER + && hates_silver(mdat)) { + tmp += rnd(20); + silvermsg = TRUE; silverobj = TRUE; + } } } } @@ -1026,13 +1036,20 @@ int thrown; if (silvermsg) { const char *fmt; char *whom = mon_nam(mon); + char silverobjbuf[BUFSZ]; if (canspotmon(mon)) { if (barehand_silver_rings == 1) fmt = "Your silver ring sears %s!"; else if (barehand_silver_rings == 2) fmt = "Your silver rings sear %s!"; - else + else if (silverobj) { + Sprintf(silverobjbuf, "Your %s%s %s %%s!", + strstri(xname(obj), "silver") ? + "" : "silver ", + xname(obj), otense(obj, "sear")); + fmt = silverobjbuf; + } else fmt = "The silver sears %s!"; } else { *whom = highc(*whom); /* "it" -> "It" */