summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index e6c1ac97d6..885ed6eb37 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -3972,6 +3972,7 @@ int monsters::missile_count()
{
if (const item_def *missile = missiles())
return (missile->quantity);
+
return (0);
}
@@ -3991,7 +3992,7 @@ item_def *monsters::weapon(int which_attack)
if (attk.type != AT_HIT)
return (NULL);
- // Even/odd attacks use main/offhand weapon
+ // Even/odd attacks use main/offhand weapon.
if (which_attack > 1)
which_attack &= 1;
@@ -5411,7 +5412,7 @@ void monsters::wield_melee_weapon(int near)
item_def *monsters::slot_item(equipment_type eq)
{
- return mslot_item(equip_slot_to_mslot(eq));
+ return (mslot_item(equip_slot_to_mslot(eq)));
}
item_def *monsters::mslot_item(mon_inv_type mslot) const
@@ -5925,6 +5926,18 @@ bool monsters::has_attack_flavour(int flavour) const
return (false);
}
+bool monsters::has_damage_type(int dam_type)
+{
+ for (int i = 0; i < 4; ++i)
+ {
+ const int dmg_type = damage_type(i);
+ if (dmg_type == dam_type)
+ return (true);
+ }
+
+ return (false);
+}
+
bool monsters::visible() const
{
return (mons_near(this) && player_monster_visible(this));