From 237615f9d9d7507b5ab9ba1c47b1857cf3e9a543 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 10 May 2007 02:14:10 +0000 Subject: [PATCH] Sunsword vs shades From the newsgroup: Sunsword is ineffective against shades. It gets a special bonus of double damage vs undead, but since it's not made of silver it was only doing 1 point of damage against shades. Make the bonus-vs-undead attribute override the silver-required criterion. (If there's ever a whip or other flimsy weapon which gets a bonus against some type(s) of thick-skinned monster, its attack will override the skin thickness in similar fashion.) --- doc/fixes34.4 | 1 + src/weapon.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 119ee0356..6450cc927 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -349,6 +349,7 @@ increase damage bonus applies when kicking while polymorphed into a monster if magically removing steed's saddle is fatal, don't leave it saddled in bones charging prompt used wrong criteria when deciding whether to list rings an orc (or gnome) will respond to #chat if hero is also an orc (or gnome) +override non-silver vs shades for artifacts which deal extra damage to undead Platform- and/or Interface-Specific Fixes diff --git a/src/weapon.c b/src/weapon.c index a3e46ca71..e7a382a25 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)weapon.c 3.5 2007/02/09 */ +/* SCCS Id: @(#)weapon.c 3.5 2007/05/09 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -291,11 +291,16 @@ struct monst *mon; if (tmp < 0) tmp = 0; } - if (objects[otyp].oc_material <= LEATHER && thick_skinned(ptr)) + /* don't need hard material or silver if using an artifact which + gets a special bonus against this target (Sunsword vs shades) */ + if (tmp && (thick_skinned(ptr) || ptr == &mons[PM_SHADE]) && + (!otmp->oartifact || !spec_dbon(otmp, mon, tmp))) { + if (objects[otyp].oc_material <= LEATHER && thick_skinned(ptr)) /* thick skinned/scaled creatures don't feel it */ tmp = 0; - if (ptr == &mons[PM_SHADE] && objects[otyp].oc_material != SILVER) + if (ptr == &mons[PM_SHADE] && objects[otyp].oc_material != SILVER) tmp = 0; + } /* "very heavy iron ball"; weight increase is in increments of 160 */ if (otyp == HEAVY_IRON_BALL && tmp > 0) {