summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monster.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/monster.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/monster.cc')
-rw-r--r--crawl-ref/source/monster.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 3d90ff9c81..f9707cf268 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -442,7 +442,19 @@ int monster::damage_type(int which_attack)
return get_vorpal_type(*mweap);
}
-random_var monster::attack_delay(item_def *weap, item_def *projectile,
+/**
+ * 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 Unused (interface parameter)
+ * @return The time taken by an attack with the given weapon &
+ * projectile, in aut.
+ */
+random_var monster::attack_delay(const item_def *weap,
+ const item_def *projectile,
bool random, bool scaled) const
{
const bool use_unarmed =