Hostile monsters that are occupied by fighting, seeking etc. won't pick up anything dropped or thrown by you. Since they cannot know when or why you dropped or threw an item, they just have to assume that it was done to distract them. Our monsters are smart, and won't fall for such cheap ploys. :P
Occupied monsters won't pick up throwable weapons if they would just stack with existing missiles.
Monsters won't pick up empty wands, and they may drop an empty wand if they come across a charged one (however unlikely that combination may be).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4661 c06c8d41-db1a-0410-9941-cceddc491573
XKDPUWDOAFP4ZVWY6AOYPX3TJLTFBNZWRYSPIMEJHFX577WAJGMAC
GHP3H4FU6XZTSZ7IWNOT5Z34GJL3BFRMARHPXXW5MJUQ4SOZ7ATQC
Y2NYY7HWFZ2LQDK3ACSLGS37F2J2IJ5LRGCIMZYXLEOSVPD3A4DAC
QDTVLBRGHDTRUVT7I3O72K6TMOYAUSAJBZUHGOEFU2RKJNUPWZSQC
QS3ZRS3E6KL3YJHPKYEWCWJYRBJSXD5OOYF6Y25HZVECGPJRDB5QC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
NVSFIV2ZKP44XHCSCXG6OZVGL67OIFINC34J2EMKTA4KULCERUEAC
6FOJLFMHFOIDE6F47OSS3N5PDPVP6MEBOP3JJ3QQ4RRGSDMVAE5AC
ASH5CK6CPBKMLGGIRJ5GKTWMS5W3OBVHTL66RTYZIPFM6KFBYA3QC
TTCA2KKE56DAAKEVUGAP7ZRNF5KDLOWRVO37E3D6KDNMLDBVL7MAC
if (mslot_item(MSLOT_MISSILE) && pickup(item, MSLOT_MISSILE, near, true))
// If occupied, don't pick up a throwable weapons if it would just
// stack with an existing one. (Upgrading is possible.)
if (mslot_item(MSLOT_MISSILE)
&& behaviour == BEH_WANDER
&& pickup(item, MSLOT_MISSILE, near, true))
{
return (hit_dice < 14 && pickup(item, MSLOT_WAND, near));
if (hit_dice >= 14)
return (false);
// If you already have a charged wand, don't bother.
// Otherwise, replace with a charged one.
if (item_def *wand = mslot_item(MSLOT_WAND))
{
if (wand->plus > 0)
return (false);
if (!drop_item(MSLOT_WAND, near))
return (false);
}
return (pickup(item, MSLOT_WAND, near));
return false;
}
if (itype == OBJ_ARMOUR || itype == OBJ_CORPSES
|| itype == OBJ_MISCELLANY || itype == OBJ_GOLD)
{
return false;
}
if (itype == OBJ_WEAPONS || itype == OBJ_MISSILES)
{
// Fleeing monster only pick up emergency equipment.
if (behaviour == BEH_FLEE)
return false;
// Fleeing monster only pick up emergency equipment.
if (behaviour == BEH_FLEE
&& (itype == OBJ_WEAPONS || itype == OBJ_MISSILES))
{
return (false);
// While occupied, hostile monsters won't pick up items
// dropped or thrown by you. (You might have done that to
// distract them.)
if (!mons_friendly(this)
&& (testbits(item.flags, ISFLAG_DROPPED)
|| testbits(item.flags, ISFLAG_THROWN)))
{
return false;
}
}