From 64336d12b0e30861c3eb9d8a9262e328635c95a6 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Tue, 10 Nov 2009 11:02:43 -0600 Subject: Replace monsters::is_magic_user() with monsters::is_actual_spellcaster(), as it's simpler, and monsters with the "actual spells" flag should always have spells anyway. --- crawl-ref/source/attitude-change.cc | 10 +++++----- crawl-ref/source/attitude-change.h | 2 +- crawl-ref/source/monplace.cc | 2 +- crawl-ref/source/monspeak.cc | 4 ++-- crawl-ref/source/monster.cc | 5 ----- crawl-ref/source/monster.h | 7 ++----- crawl-ref/source/monstuff.cc | 2 +- crawl-ref/source/religion.cc | 2 +- 8 files changed, 13 insertions(+), 21 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/attitude-change.cc b/crawl-ref/source/attitude-change.cc index 17ea662244..ae4777cba5 100644 --- a/crawl-ref/source/attitude-change.cc +++ b/crawl-ref/source/attitude-change.cc @@ -271,7 +271,7 @@ bool chaotic_beings_attitude_change() return (apply_to_all_dungeons(_chaotic_beings_on_level_attitude_change)); } -static bool _magic_users_on_level_attitude_change() +static bool _spellcasters_on_level_attitude_change() { bool success = false; @@ -279,10 +279,10 @@ static bool _magic_users_on_level_attitude_change() { monsters *monster = &menv[i]; if (monster->alive() - && monster->is_magic_user()) + && monster->is_actual_spellcaster()) { #ifdef DEBUG_DIAGNOSTICS - mprf(MSGCH_DIAGNOSTICS, "Magic user attitude changing: %s on level %d, branch %d", + mprf(MSGCH_DIAGNOSTICS, "Spellcaster attitude changing: %s on level %d, branch %d", monster->name(DESC_PLAIN).c_str(), static_cast(you.your_level), static_cast(you.where_are_you)); @@ -305,9 +305,9 @@ static bool _magic_users_on_level_attitude_change() return (success); } -bool magic_users_attitude_change() +bool spellcasters_attitude_change() { - return (apply_to_all_dungeons(_magic_users_on_level_attitude_change)); + return (apply_to_all_dungeons(_spellcasters_on_level_attitude_change)); } // Make summoned (temporary) god gifts disappear on penance or when diff --git a/crawl-ref/source/attitude-change.h b/crawl-ref/source/attitude-change.h index c54b686b02..a7433689c5 100644 --- a/crawl-ref/source/attitude-change.h +++ b/crawl-ref/source/attitude-change.h @@ -9,7 +9,7 @@ void slime_convert(monsters *monster); bool holy_beings_attitude_change(); bool evil_beings_attitude_change(); bool chaotic_beings_attitude_change(); -bool magic_users_attitude_change(); +bool spellcasters_attitude_change(); bool yred_slaves_abandon_you(); bool beogh_followers_abandon_you(); bool jiyva_slimes_abandon_you(); diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index 1d28ddcbb9..8d1edb789e 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 && mon->is_magic_user()); + (you.religion == GOD_TROG && mon->is_actual_spellcaster()); if (holy) *holy = isHoly; diff --git a/crawl-ref/source/monspeak.cc b/crawl-ref/source/monspeak.cc index 3241200ae1..8f66ebb025 100644 --- a/crawl-ref/source/monspeak.cc +++ b/crawl-ref/source/monspeak.cc @@ -339,8 +339,8 @@ static std::string _player_ghost_speak_str(const monsters *monster, // speech? static bool _polyd_can_speak(const monsters* monster) { - // Wizard and priest monsters can always speak. - if (monster->is_actual_spellcaster() || monster->is_priest()) + // Priest and wizard monsters can always speak. + if (monster->is_priest() || monster->is_actual_spellcaster()) return (true); // Silent or non-sentient monsters can't use the original speech. diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index ab4c212706..ae61c51364 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -3855,11 +3855,6 @@ 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 5c8881e9f5..84a351e774 100644 --- a/crawl-ref/source/monster.h +++ b/crawl-ref/source/monster.h @@ -142,13 +142,10 @@ public: // Has the 'priest' flag. bool is_priest() const; - // Is an actual wizard-type spellcaster (it can be silenced, etc.). + // Is an actual wizard-type spellcaster (it can be silenced, Trog + // will dislike it, 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 e6f7ef6f6a..82788f6b40 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 (monster->is_magic_user()) + if (monster->is_actual_spellcaster()) { did_god_conduct(DID_KILL_WIZARD, monster->hit_dice, true, monster); diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 7625f252c0..5acee0cfd9 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -4977,7 +4977,7 @@ void god_pitch(god_type which_god) if (you.religion == GOD_ZIN && chaotic_beings_attitude_change()) mpr("Your chaotic allies forsake you.", MSGCH_MONSTER_ENCHANT); - else if (you.religion == GOD_TROG && magic_users_attitude_change()) + else if (you.religion == GOD_TROG && spellcasters_attitude_change()) mpr("Your magic-using allies forsake you.", MSGCH_MONSTER_ENCHANT); if (you.religion == GOD_ELYVILON) -- cgit v1.2.3-54-g00ecf