From af420e351770b201f4d77d1892169b4111727c91 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Tue, 10 Nov 2009 21:26:29 -0600 Subject: Replace actor::is_unholy() with actor::undead_or_demonic(). --- crawl-ref/source/attitude-change.cc | 2 +- crawl-ref/source/effects.cc | 4 ++-- crawl-ref/source/fight.cc | 2 +- crawl-ref/source/item_use.cc | 4 ++-- crawl-ref/source/mon-gear.cc | 2 +- crawl-ref/source/mon-util.cc | 2 +- crawl-ref/source/monster.cc | 12 ++++++------ crawl-ref/source/player.cc | 10 ++++++---- crawl-ref/source/religion.cc | 11 ++++++----- crawl-ref/source/spells2.cc | 2 +- crawl-ref/source/spl-cast.cc | 4 ++-- 11 files changed, 29 insertions(+), 26 deletions(-) diff --git a/crawl-ref/source/attitude-change.cc b/crawl-ref/source/attitude-change.cc index ae4777cba5..56d0d27b90 100644 --- a/crawl-ref/source/attitude-change.cc +++ b/crawl-ref/source/attitude-change.cc @@ -28,7 +28,7 @@ void good_god_follower_attitude_change(monsters *monster) { - if (you.is_unholy() || crawl_state.arena) + if (you.undead_or_demonic() || crawl_state.arena) return; // For followers of good gods, decide whether holy beings will be diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 5ed0c37bf8..195aaa9792 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -70,7 +70,7 @@ int holy_word_player(int pow, int caster, actor *attacker) { - if (!you.is_unholy()) + if (!you.undead_or_demonic()) return (0); int hploss; @@ -132,7 +132,7 @@ int holy_word_monsters(coord_def where, int pow, int caster, if (monster == NULL) return (retval); - if (!monster->alive() || !monster->is_unholy()) + if (!monster->alive() || !monster->undead_or_demonic()) return (retval); int hploss; diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 46455cc9f0..7bd0f6d512 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -3159,7 +3159,7 @@ bool melee_attack::apply_damage_brand() break; case SPWPN_HOLY_WRATH: - if (defender->is_unholy()) + if (defender->undead_or_demonic()) special_damage = 1 + (random2(damage_done * 15) / 10); if (special_damage && defender_visible) diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 82b625cfe1..8214497c93 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -151,7 +151,7 @@ bool can_wield(item_def *weapon, bool say_reason, return (false); } - if (you.is_unholy() && is_holy_item(*weapon)) + if (you.undead_or_demonic() && is_holy_item(*weapon)) { if (say_reason) { @@ -1750,7 +1750,7 @@ static bool _item_penetrates_victim(const bolt &beam, const actor *victim, static bool _silver_damages_victim(bolt &beam, actor* victim, int &dmg, std::string &dmg_msg) { - if (victim->is_unholy() || victim->is_chaotic()) + if (victim->undead_or_demonic() || victim->is_chaotic()) { dmg *= 2; diff --git a/crawl-ref/source/mon-gear.cc b/crawl-ref/source/mon-gear.cc index 7cb2860ea9..b1573d11a7 100644 --- a/crawl-ref/source/mon-gear.cc +++ b/crawl-ref/source/mon-gear.cc @@ -41,7 +41,7 @@ static void _give_monster_item(monsters *mon, int thing, mthing.link = NON_ITEM; unset_ident_flags(mthing, ISFLAG_IDENT_MASK); - if (mon->is_unholy() + if (mon->undead_or_demonic() && (is_blessed_blade(mthing) || get_weapon_brand(mthing) == SPWPN_HOLY_WRATH)) { diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 1342a571b8..b0a831e167 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -425,7 +425,7 @@ int mons_unusable_items(const monsters *mon) if (mon->is_holy()) ret += _scan_mon_inv_items(mon, is_evil_item) > 0; - else if (mon->is_unholy()) + else if (mon->undead_or_demonic()) { ret += _scan_mon_inv_items(mon, is_holy_item) > 0; diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index e102e81615..14020cb7f3 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -632,8 +632,8 @@ bool monsters::could_wield(const item_def &item, bool ignore_brand, if (brand == SPWPN_ORC_SLAYING && is_orckind(this)) return (false); - // Demonic/undead monsters won't use holy weapons. - if (is_unholy() && is_holy_item(item)) + // Undead and demonic monsters won't use holy weapons. + if (undead_or_demonic() && is_holy_item(item)) return (false); // Holy monsters and monsters that are gifts of good gods won't @@ -3190,7 +3190,7 @@ int monsters::res_asphyx() const { int res = get_mons_resists(this).asphyx; const mon_holy_type holi = holiness(); - if (is_unholy() + if (undead_or_demonic() || holi == MH_NONLIVING || holi == MH_PLANT) { @@ -3258,12 +3258,12 @@ int monsters::res_rotting() const int monsters::res_holy_energy(const actor *attacker) const { + if (undead_or_demonic()) + return (-2); + if (is_evil()) return (-1); - if (is_unholy()) - return (-2); - if (is_holy() || is_good_god(god) || neutral() diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index c3e79c0cfd..28cac3250c 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5781,11 +5781,13 @@ bool player::could_wield(const item_def &item, bool ignore_brand, // Small species wielding large weapons... if (body_size(PSIZE_BODY) < SIZE_MEDIUM && !check_weapon_wieldable_size(item, body_size(PSIZE_BODY))) + { return (false); + } if (!ignore_brand) { - if (is_unholy() && is_holy_item(item)) + if (undead_or_demonic() && is_holy_item(item)) return (false); } @@ -6490,12 +6492,12 @@ int player::res_sticky_flame() const int player::res_holy_energy(const actor *attacker) const { + if (undead_or_demonic()) + return (-2); + if (is_evil()) return (-1); - if (is_unholy()) - return (-2); - if (is_holy()) return (1); diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 9c33ba50b7..2f31a0c9d9 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -518,7 +518,8 @@ std::string get_god_likes(god_type which_god, bool verbose) break; case GOD_FEDHAS: - snprintf(info, INFO_SIZE, "you promote decomposition of nearby corpses%s", + snprintf(info, INFO_SIZE, "you promote decomposition of nearby " + "corpses%s", verbose ? " via the a command" : ""); likes.push_back(info); break; @@ -4869,7 +4870,7 @@ bool player_can_join_god(god_type which_god) if (you.species == SP_DEMIGOD) return (false); - if (is_good_god(which_god) && you.is_unholy()) + if (is_good_god(which_god) && you.undead_or_demonic()) return (false); if (which_god == GOD_BEOGH && you.species != SP_HILL_ORC) @@ -4891,7 +4892,7 @@ void god_pitch(god_type which_god) more(); // Note: using worship we could make some gods not allow followers to - // return, or not allow worshippers from other religions. -- bwr + // return, or not allow worshippers from other religions. - bwr // Gods can be racist... if (!player_can_join_god(which_god)) @@ -4965,7 +4966,7 @@ void god_pitch(god_type which_god) more(); // When you start worshipping a good god, you make all non-hostile - // evil and unholy beings hostile; when you start worshipping Zin, + // unholy and evil beings hostile; when you start worshipping Zin, // you make all non-hostile chaotic beings hostile; and when you // start worshipping Trog, you make all non-hostile magic users // hostile. @@ -5017,7 +5018,7 @@ void god_pitch(god_type which_god) else if (is_evil_god(you.religion)) { // Note: Using worshipped[] we could make this sort of grudge - // permanent instead of based off of penance. -- bwr + // permanent instead of based off of penance. - bwr if (you.penance[GOD_SHINING_ONE]) { _inc_penance(GOD_SHINING_ONE, 30); diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index bf1a9d5414..57293bf40d 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -746,7 +746,7 @@ bool vampiric_drain(int pow, const dist &vmove) return (false); } - if (monster->is_unholy()) + if (monster->undead_or_demonic()) { mpr("Aaaarggghhhhh!"); dec_hp(random2avg(39, 2) + 10, false, "vampiric drain backlash"); diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 70d1002139..c9bfabc9fe 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -1003,7 +1003,7 @@ static bool _vampire_cannot_cast(spell_type spell) static bool _spell_is_uncastable(spell_type spell) { - if (you.is_unholy() && is_holy_spell(spell)) + if (you.undead_or_demonic() && is_holy_spell(spell)) { mpr("You can't use this type of magic!"); return (true); @@ -1011,7 +1011,7 @@ static bool _spell_is_uncastable(spell_type spell) // Normally undead can't memorise these spells, so this check is // to catch those in Lich form. As such, we allow the Lich form - // to be extended here. -- bwr + // to be extended here. - bwr if (spell != SPELL_NECROMUTATION && you_cannot_memorise(spell)) { mpr( "You cannot cast that spell in your current form!" ); -- cgit v1.2.3-54-g00ecf