]> granicus.if.org Git - nethack/commitdiff
fix buglist entry - artifact bow wielded by monsters
authornethack.rankin <nethack.rankin>
Fri, 27 Dec 2002 03:40:57 +0000 (03:40 +0000)
committernethack.rankin <nethack.rankin>
Fri, 27 Dec 2002 03:40:57 +0000 (03:40 +0000)
     The Longbow of Diana (ranger quest artifact) confers reflection
to the hero when wielded but didn't do the same for monsters when they
wielded it.

doc/fixes34.1
include/extern.h
src/artifact.c
src/muse.c

index 66571b385d8d8045eb5e307e9279ea29d643cbe8..2d032809ea2033e751004afc9df0a395cafe9435 100644 (file)
@@ -338,6 +338,8 @@ while over water, killing a monster that had engulfed you does not result
        in the usual water effects
 removing a ring of levitation while engulfed should not invoke spoteffects
 feedback from invoking Orb of Detection was sometimes misleading or wrong
+ranger quest artifact (Longbow of Diana) confers reflection when wielded by
+       monsters like it does for the player
 
 
 Platform- and/or Interface-Specific Fixes
index 3702eefce7b08328d51b9abb1fe89abddcd63b24..15d321d9b5fee89f5c4658fc7df8fd44ac550905 100644 (file)
@@ -63,6 +63,7 @@ E void FDECL(artifact_exists, (struct obj *,const char *,BOOLEAN_P));
 E int NDECL(nartifact_exist);
 E boolean FDECL(spec_ability, (struct obj *,unsigned long));
 E boolean FDECL(confers_luck, (struct obj *));
+E boolean FDECL(arti_reflects, (struct obj *));
 E boolean FDECL(restrict_name, (struct obj *,const char *));
 E boolean FDECL(defends, (int,struct obj *));
 E boolean FDECL(protects, (int,struct obj *));
index 514e5ea4bd24d7be49da4b9b50450a551a5a1c75..80e1ad3605e500719fad9bd9a19e752927a83a02 100644 (file)
@@ -259,6 +259,23 @@ struct obj *obj;
     return (obj->oartifact && spec_ability(obj, SPFX_LUCK));
 }
 
+/* used to check whether a monster is getting reflection from an artifact */
+boolean
+arti_reflects(obj)
+struct obj *obj;
+{
+    const struct artifact *arti = get_artifact(obj);
+
+    if (arti) {      
+       /* while being worn */
+       if ((obj->owornmask & ~W_ART) && (arti->spfx & SPFX_REFLECT))
+           return TRUE;
+       /* just being carried */
+       if (arti->cspfx & SPFX_REFLECT) return TRUE;
+    }
+    return FALSE;
+}
+
 #endif /* OVL0 */
 #ifdef OVLB
 
index 68a8a599542e36cd372906b746a93ecb0b9b0d7f..43bf8c570860e94ba410c0ffb175ae778042f3b1 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)muse.c     3.4     2002/08/29      */
+/*     SCCS Id: @(#)muse.c     3.4     2002/12/23      */
 /*     Copyright (C) 1990 by Ken Arromdee                         */
 /* NetHack may be freely redistributed.  See license for details.  */
 
@@ -2034,6 +2034,11 @@ const char *str;
                makeknown(SHIELD_OF_REFLECTION);
            }
            return TRUE;
+       } else if (arti_reflects(MON_WEP(mon))) {
+           /* due to wielded artifact weapon */
+           if (str)
+               pline(str, s_suffix(mon_nam(mon)), "weapon");
+           return TRUE;
        } else if ((orefl = which_armor(mon, W_AMUL)) &&
                                orefl->otyp == AMULET_OF_REFLECTION) {
            if (str) {