summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-10 10:40:43 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-10 10:40:43 -0600
commit87d388e09be6bf4a36178a3a2344c78fef4d06a1 (patch)
treeba303419aada80505141652e4a5530986fc9bd0d /crawl-ref
parenta70fa41dbe4a40c351d4b053734375f365b2e043 (diff)
downloadcrawl-ref-87d388e09be6bf4a36178a3a2344c78fef4d06a1.tar.gz
crawl-ref-87d388e09be6bf4a36178a3a2344c78fef4d06a1.zip
Replace mons_is_magic_user() with monsters::is_magic_user().
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/attitude-change.cc2
-rw-r--r--crawl-ref/source/mon-util.cc5
-rw-r--r--crawl-ref/source/mon-util.h1
-rw-r--r--crawl-ref/source/monplace.cc2
-rw-r--r--crawl-ref/source/monster.cc5
-rw-r--r--crawl-ref/source/monster.h9
-rw-r--r--crawl-ref/source/monstuff.cc2
7 files changed, 14 insertions, 12 deletions
diff --git a/crawl-ref/source/attitude-change.cc b/crawl-ref/source/attitude-change.cc
index 1576c078eb..17ea662244 100644
--- a/crawl-ref/source/attitude-change.cc
+++ b/crawl-ref/source/attitude-change.cc
@@ -279,7 +279,7 @@ static bool _magic_users_on_level_attitude_change()
{
monsters *monster = &menv[i];
if (monster->alive()
- && mons_is_magic_user(monster))
+ && monster->is_magic_user())
{
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "Magic user attitude changing: %s on level %d, branch %d",
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index a65be33321..8f35a290e5 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -2534,11 +2534,6 @@ static bool _ms_ranged_spell(spell_type monspell, bool attack_only = false,
}
}
-bool mons_is_magic_user(const monsters *mon)
-{
- return (mon->is_actual_spellcaster() && mon->has_spells());
-}
-
// Returns true if the monster has an ability that only needs LOS to
// affect the target.
bool mons_has_los_ability(int mclass)
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index 2520792e7c..7999466af5 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -591,7 +591,6 @@ bool ms_quick_get_away(const monsters *mon, spell_type monspell);
bool ms_waste_of_time(const monsters *mon, spell_type monspell);
bool ms_low_hitpoint_cast(const monsters *mon, spell_type monspell);
-bool mons_is_magic_user(const monsters *mon);
bool mons_has_los_ability(int mclass);
bool mons_has_los_attack(const monsters *mon);
bool mons_has_ranged_spell(const monsters *mon, bool attack_only = false,
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 3fb1dbaf99..1d28ddcbb9 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -2593,7 +2593,7 @@ bool player_will_anger_monster(monsters *mon, bool *holy,
const bool isLawful =
(you.religion == GOD_ZIN && mon->is_chaotic());
const bool isAntimagical =
- (you.religion == GOD_TROG && mons_is_magic_user(mon));
+ (you.religion == GOD_TROG && mon->is_magic_user());
if (holy)
*holy = isHoly;
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index ae61c51364..ab4c212706 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -3855,6 +3855,11 @@ bool monsters::is_actual_spellcaster() const
return (flags & MF_ACTUAL_SPELLS);
}
+bool monsters::is_magic_user() const
+{
+ return (is_actual_spellcaster() && has_spells());
+}
+
bool monsters::is_shapeshifter() const
{
return (has_ench(ENCH_GLOWING_SHAPESHIFTER, ENCH_SHAPESHIFTER));
diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h
index 8fdf14078a..5c8881e9f5 100644
--- a/crawl-ref/source/monster.h
+++ b/crawl-ref/source/monster.h
@@ -136,16 +136,19 @@ public:
bool has_hydra_multi_attack() const;
bool has_multitargeting() const;
- // Has the 'spellcaster' flag (may not actually have any spells)
+ // Has the 'spellcaster' flag (may not actually have any spells).
bool can_use_spells() const;
// Has the 'priest' flag.
bool is_priest() const;
- // Is an actual wizard-type spellcaster, i.e. Trog will dislike it, it
- // can be silenced, etc.
+ // Is an actual wizard-type spellcaster (it can be silenced, etc.).
bool is_actual_spellcaster() const;
+ // Is an actual wizard-type spellcaster, and has spells (Trog will
+ // dislike it).
+ bool is_magic_user() const;
+
// Has ENCH_SHAPESHIFTER or ENCH_GLOWING_SHAPESHIFTER.
bool is_shapeshifter() const;
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 9cee1e134a..e6f7ef6f6a 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1686,7 +1686,7 @@ int monster_die(monsters *monster, killer_type killer,
}
// jmf: Trog hates wizards.
- if (mons_is_magic_user(monster))
+ if (monster->is_magic_user())
{
did_god_conduct(DID_KILL_WIZARD,
monster->hit_dice, true, monster);