From 6a61a14d3d3832efe8573471860c5ad996f0bdd9 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Thu, 5 Nov 2009 16:27:48 -0600 Subject: Name the checks for monsters with evil or chaotic spells consistently. --- crawl-ref/source/monster.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source/monster.cc') 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) -- cgit v1.2.3-54-g00ecf