summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-04 22:14:50 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-04 22:14:50 +0000
commitc291ba47b3ccecc4e70d1b01a82a58407680601c (patch)
treea8b3d4f0e306657c964a8ca3e747c627c271120c /crawl-ref/source/item_use.cc
parent8bd7484493c7e96dd497e8f8e3fc39514265ff5d (diff)
downloadcrawl-ref-c291ba47b3ccecc4e70d1b01a82a58407680601c.tar.gz
crawl-ref-c291ba47b3ccecc4e70d1b01a82a58407680601c.zip
FR 1821775: While held in a net, you can fire blowguns, though there's
a penalty similar to the one when wearing a buckler and accuracy is lowered. I'm not sure about the numbers - they'll have to be tweaked a bit, I guess. Also fix possibility to drift out of net. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2756 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 0e058e912e..b2b438c811 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1192,6 +1192,20 @@ static bool fire_item_matches(const item_def &item, unsigned fire_type)
if (!is_valid_item(item))
return (false);
+ if (you.attribute[ATTR_HELD])
+ {
+ if (item.base_type == OBJ_MISSILES)
+ {
+ const item_def *weapon = you.weapon();
+ if (weapon && weapon->sub_type == WPN_BLOWGUN
+ && item.launched_by(*weapon))
+ {
+ return (true);
+ }
+ }
+ return (false);
+ }
+
if (item.base_type == OBJ_MISSILES)
{
if ((fire_type & FIRE_DART) && item.sub_type == MI_DART)
@@ -1498,6 +1512,18 @@ int launcher_final_speed(const item_def &launcher, const item_def *shield)
speed_base = speed_base * speed_adjust / 100;
speed_min = speed_min * speed_adjust / 100;
}
+
+ // do the same when trying to shoot while held in a net
+ if (you.attribute[ATTR_HELD]) // only for blowguns
+ {
+ int speed_adjust = 105; // analogous to buckler and one-handed weapon
+ speed_adjust -= ((speed_adjust - 100) * 5 / 10)
+ * you.skills[SK_THROWING] / 27;
+
+ // also reduce the speed cap.
+ speed_base = speed_base * speed_adjust / 100;
+ speed_min = speed_min * speed_adjust / 100;
+ }
int speed = speed_base - 4 * shoot_skill * speed_stat / 250;
if (speed < speed_min)
@@ -1768,6 +1794,12 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
}
}
}
+
+ // lower accuracy if held in a net (needs testing)
+ if (you.attribute[ATTR_HELD])
+ {
+ baseHit--;
+ }
// for all launched weapons, maximum effective specific skill
// is twice throwing skill. This models the fact that no matter