silver wands

From the newsgroup:
> <email deleted> (<Someone>)
> 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
> <email deleted>
>
> 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.
>
>  ~<Someone>

There was a code path for objects such as wands that avoided
all the silver checks. Now fixed.
This commit is contained in:
nethack.allison
2003-11-09 23:38:33 +00:00
parent d290e918c6
commit 8212618221
2 changed files with 22 additions and 4 deletions
+1
View File
@@ -88,6 +88,7 @@ sleeping shopkeeper responds to various events without waking
rotting corpses grammar fix rotting corpses grammar fix
allow successful teleport to more locations on debug mode level teleport menu allow successful teleport to more locations on debug mode level teleport menu
trapped monster repeatedly switched between ranged and hand-to-hand weapon 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 Platform- and/or Interface-Specific Fixes
+21 -4
View File
@@ -544,7 +544,7 @@ int thrown;
boolean hittxt = FALSE, destroyed = FALSE, already_killed = FALSE; boolean hittxt = FALSE, destroyed = FALSE, already_killed = FALSE;
boolean get_dmg_bonus = TRUE; boolean get_dmg_bonus = TRUE;
boolean ispoisoned = FALSE, needpoismsg = FALSE, poiskilled = FALSE; boolean ispoisoned = FALSE, needpoismsg = FALSE, poiskilled = FALSE;
boolean silvermsg = FALSE; boolean silvermsg = FALSE, silverobj = FALSE;
boolean valid_weapon_attack = FALSE; boolean valid_weapon_attack = FALSE;
boolean unarmed = !uwep && !uarm && !uarms; boolean unarmed = !uwep && !uarm && !uarms;
#ifdef STEED #ifdef STEED
@@ -665,8 +665,9 @@ int thrown;
hittxt = TRUE; hittxt = TRUE;
} }
if (objects[obj->otyp].oc_material == SILVER if (objects[obj->otyp].oc_material == SILVER
&& hates_silver(mdat)) && hates_silver(mdat)) {
silvermsg = TRUE; silvermsg = TRUE; silverobj = TRUE;
}
#ifdef STEED #ifdef STEED
if (u.usteed && !thrown && tmp > 0 && if (u.usteed && !thrown && tmp > 0 &&
weapon_type(obj) == P_LANCE && mon != u.ustuck) { weapon_type(obj) == P_LANCE && mon != u.ustuck) {
@@ -888,6 +889,15 @@ int thrown;
if(tmp < 1) tmp = 1; if(tmp < 1) tmp = 1;
else tmp = rnd(tmp); else tmp = rnd(tmp);
if(tmp > 6) tmp = 6; 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) { if (silvermsg) {
const char *fmt; const char *fmt;
char *whom = mon_nam(mon); char *whom = mon_nam(mon);
char silverobjbuf[BUFSZ];
if (canspotmon(mon)) { if (canspotmon(mon)) {
if (barehand_silver_rings == 1) if (barehand_silver_rings == 1)
fmt = "Your silver ring sears %s!"; fmt = "Your silver ring sears %s!";
else if (barehand_silver_rings == 2) else if (barehand_silver_rings == 2)
fmt = "Your silver rings sear %s!"; 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!"; fmt = "The silver sears %s!";
} else { } else {
*whom = highc(*whom); /* "it" -> "It" */ *whom = highc(*whom); /* "it" -> "It" */