diff options
author | Steve Melenchuk <smelenchuk@gmail.com> | 2014-05-01 20:34:39 -0600 |
---|---|---|
committer | Steve Melenchuk <smelenchuk@gmail.com> | 2014-05-01 20:52:06 -0600 |
commit | 718fc277b9651f92b09212030836f1da48ff123a (patch) | |
tree | 594b61c6e86afd24ad7d095e748af984a239f605 /crawl-ref/source/ranged_attack.cc | |
parent | c74132583f98fc21cceece8f29127a1650bf9331 (diff) | |
download | crawl-ref-718fc277b9651f92b09212030836f1da48ff123a.tar.gz crawl-ref-718fc277b9651f92b09212030836f1da48ff123a.zip |
Adjust scaling of throwing damage with throwing skill.
Namely, weapons smaller than large rocks have their bonus nerfed.
No darting Elf:3 to death.
Diffstat (limited to 'crawl-ref/source/ranged_attack.cc')
-rw-r--r-- | crawl-ref/source/ranged_attack.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crawl-ref/source/ranged_attack.cc b/crawl-ref/source/ranged_attack.cc index 01a8b28602..9ef37ef99a 100644 --- a/crawl-ref/source/ranged_attack.cc +++ b/crawl-ref/source/ranged_attack.cc @@ -314,6 +314,20 @@ int ranged_attack::weapon_damage() return dam; } +/** + * For ranged attacked, "unarmed" is throwing damage. + */ +int ranged_attack::calc_base_unarmed_damage() +{ + // No damage bonus for throwing non-throwing weapons. + if (!using_weapon()) + return 0; + + // The 20 is large rock base damage; they get the full bonus. + return div_rand_round(attack::calc_base_unarmed_damage() + * property(*projectile, PWPN_DAMAGE), 20); +} + int ranged_attack::calc_mon_to_hit_base() { ASSERT(attacker->is_monster()); |