Sunsword vs shades, take II (trunk only)
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. (No comparable handling for flimsy weapons against thick-skinned critters this time.)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)artifact.c 3.5 2007/03/05 */
|
||||
/* SCCS Id: @(#)artifact.c 3.5 2007/05/09 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -275,6 +275,26 @@ struct obj *obj;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* decide whether this obj is effective when attacking against shades;
|
||||
does not consider the bonus for blessed objects versus undead */
|
||||
boolean
|
||||
shade_glare(obj)
|
||||
struct obj *obj;
|
||||
{
|
||||
const struct artifact *arti;
|
||||
|
||||
/* any silver object is effective */
|
||||
if (objects[obj->otyp].oc_material == SILVER) return TRUE;
|
||||
/* non-silver artifacts with bonus against undead also are effective */
|
||||
arti = get_artifact(obj);
|
||||
if (arti && (arti->spfx & SPFX_DFLAG2) && arti->mtype == M2_UNDEAD)
|
||||
return TRUE;
|
||||
/* [if there was anything with special bonus against noncorporeals,
|
||||
it would be effective too] */
|
||||
/* otherwise, harmless to shades */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
boolean
|
||||
restrict_name(otmp, name) /* returns 1 if name is restricted for otmp->otyp */
|
||||
register struct obj *otmp;
|
||||
|
||||
Reference in New Issue
Block a user