summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/attack.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-04-27 17:10:19 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2014-04-27 17:11:35 -0600
commit8ed3cfbb11c625523fabc4239be42ac0c980a942 (patch)
tree9b4013dcb60c18dc60418b8dc2979f2357e5c194 /crawl-ref/source/attack.cc
parentec6fe075101a7cd1454f6b744753a9eef0785d77 (diff)
downloadcrawl-ref-8ed3cfbb11c625523fabc4239be42ac0c980a942.tar.gz
crawl-ref-8ed3cfbb11c625523fabc4239be42ac0c980a942.zip
Handle gloves of archery properly with new ranged combat.
Diffstat (limited to 'crawl-ref/source/attack.cc')
-rw-r--r--crawl-ref/source/attack.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/crawl-ref/source/attack.cc b/crawl-ref/source/attack.cc
index f720842ae4..a2c77d65f4 100644
--- a/crawl-ref/source/attack.cc
+++ b/crawl-ref/source/attack.cc
@@ -214,7 +214,10 @@ int attack::calc_to_hit(bool random)
}
// slaying bonus
- mhit += slaying_bonus(PWPN_HIT);
+ mhit += slaying_bonus(PWPN_HIT,
+ !weapon && wpn_skill == SK_THROWING
+ || (weapon && is_range_weapon(*weapon)
+ && using_weapon()));
// hunger penalty
if (you.hunger_state == HS_STARVING)
@@ -1356,7 +1359,10 @@ int attack::player_apply_slaying_bonuses(int damage, bool aux)
if (weapon->base_type == OBJ_RODS)
damage_plus = weapon->special;
}
- damage_plus += slaying_bonus(PWPN_DAMAGE);
+ damage_plus += slaying_bonus(PWPN_DAMAGE,
+ !weapon && wpn_skill == SK_THROWING
+ || (weapon && is_range_weapon(*weapon)
+ && using_weapon()));
damage += (damage_plus > -1) ? (random2(1 + damage_plus))
: (-random2(1 - damage_plus));