summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monster.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-05 16:27:48 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-05 16:41:54 -0600
commit6a61a14d3d3832efe8573471860c5ad996f0bdd9 (patch)
treec566206e8742f5db8f236b2b6247842209dbb707 /crawl-ref/source/monster.cc
parent8906a6bb5c2f1caca99203876ed2657a1e818437 (diff)
downloadcrawl-ref-6a61a14d3d3832efe8573471860c5ad996f0bdd9.tar.gz
crawl-ref-6a61a14d3d3832efe8573471860c5ad996f0bdd9.zip
Name the checks for monsters with evil or chaotic spells consistently.
Diffstat (limited to 'crawl-ref/source/monster.cc')
-rw-r--r--crawl-ref/source/monster.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 21b8efb4db..3f11106f54 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -435,7 +435,7 @@ int monsters::damage_brand(int which_attack)
return (!is_range_weapon(*mweap) ? get_weapon_brand(*mweap) : SPWPN_NORMAL);
}
-int monsters::damage_type(int which_attack)
+int monsters::damage_type(int which_attack) const
{
const item_def *mweap = weapon(which_attack);
@@ -2702,28 +2702,28 @@ bool monsters::has_spells() const
return (false);
}
-bool monsters::has_evil_spells() const
+bool monsters::has_spell(spell_type spell) const
{
for (int i = 0; i < NUM_MONSTER_SPELL_SLOTS; ++i)
- if (is_evil_spell(spells[i]))
+ if (spells[i] == spell)
return (true);
return (false);
}
-bool monsters::has_chaotic_spells() const
+bool monsters::has_evil_spell() const
{
for (int i = 0; i < NUM_MONSTER_SPELL_SLOTS; ++i)
- if (is_chaotic_spell(spells[i]))
+ if (is_evil_spell(spells[i]))
return (true);
return (false);
}
-bool monsters::has_spell(spell_type spell) const
+bool monsters::has_chaotic_spell() const
{
for (int i = 0; i < NUM_MONSTER_SPELL_SLOTS; ++i)
- if (spells[i] == spell)
+ if (is_chaotic_spell(spells[i]))
return (true);
return (false);
@@ -2876,7 +2876,7 @@ bool monsters::is_evil() const
if (is_priest() && (is_evil_god(god) || god == GOD_NAMELESS))
return (true);
- if (has_evil_spells())
+ if (has_evil_spell())
return (true);
if (mons_class_flag(type, M_EVIL))
@@ -2904,7 +2904,7 @@ bool monsters::is_chaotic() const
if (is_priest() && is_chaotic_god(god))
return (true);
- if (has_chaotic_spells())
+ if (has_chaotic_spell())
return (true);
if (has_attack_flavour(AF_MUTATE)