summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player-act.cc
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-07-25 23:34:03 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-07-25 23:34:03 -0700
commitabea293a62c99dfa66bc3b3947e472c134a77fe6 (patch)
tree2424bd44d15ee8be7964e9355d4387876a5dabaa /crawl-ref/source/player-act.cc
parent97ab1de69b8c3bc7317c6ff0717fdbd564c50c1a (diff)
downloadcrawl-ref-abea293a62c99dfa66bc3b3947e472c134a77fe6.tar.gz
crawl-ref-abea293a62c99dfa66bc3b3947e472c134a77fe6.zip
Make ranged weapon delay display properly on @
It only works if you have the appropriate projectile type quivered (otherwise it shows you as if using the weapon in melee, i.e. breadswing speed), but that's still an improvement. Also, constify.
Diffstat (limited to 'crawl-ref/source/player-act.cc')
-rw-r--r--crawl-ref/source/player-act.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/crawl-ref/source/player-act.cc b/crawl-ref/source/player-act.cc
index e0a17477ac..d60ca4fd57 100644
--- a/crawl-ref/source/player-act.cc
+++ b/crawl-ref/source/player-act.cc
@@ -284,8 +284,21 @@ brand_type player::damage_brand(int)
return ret;
}
-random_var player::attack_delay(item_def *weap, item_def *projectile,
- bool random, bool scaled) const
+
+/**
+ * Return the delay caused by attacking with the provided weapon & projectile.
+ *
+ * @param weap The weapon to be used; may be null.
+ * @param projectile The projectile to be fired/thrown; may be null.
+ * @param random Whether to randomize delay, or provide a fixed value
+ * for display.
+ * @param scaled Whether to apply special delay modifiers (finesse)
+ * @return The time taken by an attack with the given weapon &
+ * projectile, in aut.
+ */
+random_var player::attack_delay(const item_def *weap,
+ const item_def *projectile, bool random,
+ bool scaled) const
{
random_var attk_delay = constant(15);
const int armour_penalty = adjusted_body_armour_penalty(20);