Returning brand implemented for daggers, hand axes, and spears. Monsters will pick up and use (and hopefully be occasionally generated with) returning weapons, which they can both throw for ranged attacks and use hand-to-hand. The chance of a returning weapon not returning is proportional to ranged combat skill (for the player) or HD (for monsters.) If it doesn't return, it just acts as if it was thrown normally.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1684 c06c8d41-db1a-0410-9941-cceddc491573
FA2V3G4NYTWJWUT7EWH75L3YOUX6YVOZ5LNRSFLO2XF273JKSUTAC
6GDKXNFXPKQ6AVNOSMJECN7CLELM2KCMVRM2A7BARLK2NNILN6SAC
E5DMZFW6WCFAKTKKOQPYTQXZ2CGLWMVH64LRXDUI2UIG4VYUHIVQC
GT7BSR54BVJKHUCLEBTELGBMNBFFDQW52EVC4XKVEMUVG2UGZMDAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
DTO3EUKWHZ5RJNGNCFYXSOVTIPVXPP637F2W7WFGYKJ7JK7VNKNQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
const int mon_item = monster->inv[MSLOT_MISSILE];
int mon_item;
const int mon_wpn = monster->inv[MSLOT_WEAPON];
bool returning = false;
// weapons of returning can be thrown
if ( mon_wpn != NON_ITEM &&
get_weapon_brand(mitm[mon_wpn]) == SPWPN_RETURNING )
{
mon_item = mon_wpn;
returning = true;
}
else
{
mon_item = monster->inv[MSLOT_MISSILE];
}