summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorjohnny shelley <jwshelley@shell-21010.(none)>2009-11-15 14:27:18 +0000
committerAdam Borowski <kilobyte@angband.pl>2009-11-15 15:39:37 +0100
commit0b6db307153345abeffc9f3ce971fc58b6535dcd (patch)
treed7c1b50ca7f3b3f8d76ca47a59f5d00c8633608c /crawl-ref/source/item_use.cc
parenta95b106ef7d064e28c297135fda53bf861169098 (diff)
downloadcrawl-ref-0b6db307153345abeffc9f3ce971fc58b6535dcd.tar.gz
crawl-ref-0b6db307153345abeffc9f3ce971fc58b6535dcd.zip
Returning ammo + launchers works now The relative skill is checked depending on what launcher was used. Yes, i know returning needles is silly, but someone will probably try it
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 61c0dda3cf..b4da7b7f6a 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2821,6 +2821,34 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
}
}
+ // check for returning ammo from launchers
+ if (returning && projected == LRET_LAUNCHED)
+ {
+ switch (lnchType)
+ {
+ case WPN_HAND_CROSSBOW:
+ case WPN_CROSSBOW:
+ if (returning && !one_chance_in(1 + skill_bump(SK_CROSSBOWS)))
+ did_return = true;
+ break;
+ case WPN_SLING:
+ if(returning && !one_chance_in(1 + skill_bump(SK_SLINGS)))
+ did_return = true;
+ break;
+ case WPN_BOW:
+ case WPN_LONGBOW:
+ if(returning && !one_chance_in(1 + skill_bump(SK_BOWS)))
+ did_return = true;
+ break;
+ case WPN_BLOWGUN:
+ if(returning && !one_chance_in(1 + skill_bump(SK_DARTS)))
+ did_return = true;
+ break;
+ default:
+ break;
+ }
+ }
+
// CALCULATIONS FOR THROWN WEAPONS
if (projected == LRET_THROWN)
{