fix buglist entry - artifact bow wielded by monsters

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.
This commit is contained in:
nethack.rankin
2002-12-27 03:40:57 +00:00
parent b9f66bb4c2
commit df07fd4b90
4 changed files with 26 additions and 1 deletions

View 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

View 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 *));

View 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

View 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) {