From c291ba47b3ccecc4e70d1b01a82a58407680601c Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 4 Nov 2007 22:14:50 +0000 Subject: 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 --- crawl-ref/source/acr.cc | 19 +++++++++++++++++-- crawl-ref/source/item_use.cc | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 020bc11f50..3207be08e6 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1835,8 +1835,19 @@ void process_command( command_type cmd ) } else if (you.attribute[ATTR_HELD]) { - mpr("You cannot shoot anything while held in a net!"); - break; + const item_def *weapon = you.weapon(); + if (!weapon || !is_range_weapon(*weapon)) + { + mpr("You cannot throw anything while held in a net!"); + break; + } + else if (weapon->sub_type != WPN_BLOWGUN) + { + mprf("You cannot shoot with your %s while held in a net!", + weapon->name(DESC_BASENAME).c_str()); + break; + } + // else shooting is possible } if (Options.tutorial_left) Options.tut_throw_counter++; @@ -3622,6 +3633,10 @@ void drift_player(int move_x, int move_y) int drift_dir = -1; int okay_dirs = 0; + // don't drift if held in a net + if (you.attribute[ATTR_HELD]) + return; + for (int i = 0; i < 8; i++) { const coord_def drift_delta = Compass[i]; 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 -- cgit v1.2.3-54-g00ecf