summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 00ed42a243..9b1cbb25cb 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -5420,11 +5420,16 @@ int mons_thrown_weapon_damage(const item_def *weap)
return std::max(0, (property(*weap, PWPN_DAMAGE) + weap->plus2 / 2));
}
+int mons_weapon_damage_rating(const item_def &launcher)
+{
+ return (property(launcher, PWPN_DAMAGE) + launcher.plus2);
+}
+
// Returns a rough estimate of damage from firing/throwing missile.
-int mons_missile_damage(const item_def *launch,
+int mons_missile_damage(monsters *mons, const item_def *launch,
const item_def *missile)
{
- if (!missile || (!launch && !is_throwable(*missile)))
+ if (!missile || (!launch && !is_throwable(mons, *missile)))
return (0);
const int missile_damage = property(*missile, PWPN_DAMAGE) / 2 + 1;
@@ -5432,11 +5437,6 @@ int mons_missile_damage(const item_def *launch,
return std::max(0, launch_damage + missile_damage);
}
-int mons_weapon_damage_rating(const item_def &launcher)
-{
- return (property(launcher, PWPN_DAMAGE) + launcher.plus2);
-}
-
// Given the monster's current weapon and alt weapon (either or both of
// which may be NULL), works out whether using missiles or throwing the
// main weapon (with returning brand) is better. If using missiles that
@@ -5465,7 +5465,7 @@ int mons_pick_best_missile(monsters *mons, item_def **launcher,
launch = NULL;
const int tdam = mons_thrown_weapon_damage(melee);
- const int fdam = mons_missile_damage(launch, missiles);
+ const int fdam = mons_missile_damage(mons, launch, missiles);
if (!tdam && !fdam)
return (NON_ITEM);