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

View File

@@ -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

View File

@@ -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" */