From 436078067b93a484213ed2a2bc212e7127f75e49 Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 19 Jan 2009 18:36:11 +0000 Subject: Rename cleansing flame resistance to holy energy resistance, and clean up holy wrath weapon checks. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8595 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 14 +++++++------- crawl-ref/source/effects.cc | 7 +------ crawl-ref/source/externs.h | 6 +++--- crawl-ref/source/fight.cc | 13 +++++++++---- crawl-ref/source/fight.h | 1 + crawl-ref/source/mon-util.cc | 2 +- crawl-ref/source/ouch.cc | 8 ++++---- crawl-ref/source/player.cc | 2 +- 8 files changed, 27 insertions(+), 26 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 4c7fd7f5fd..346ba40798 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2259,12 +2259,12 @@ int mons_adjust_flavoured(monsters *monster, bolt &pbolt, int hurted, case BEAM_HOLY: { // Cleansing flame. - const int rcf = monster->res_cleansing_flame(pbolt.agent()); - if (rcf > 0) + const int rhe = monster->res_holy_energy(pbolt.agent()); + if (rhe > 0) hurted = 0; - else if (rcf == 0) + else if (rhe == 0) hurted /= 2; - else if (rcf < -1) + else if (rhe < -1) hurted = (hurted * 3) / 2; if (doFlavouredEffects) @@ -3207,7 +3207,7 @@ bool bolt::is_harmless(const monsters *mon) const return (true); case BEAM_HOLY: - return (mon->res_cleansing_flame(agent()) > 0); + return (mon->res_holy_energy(agent()) > 0); case BEAM_STEAM: return (mons_res_steam(mon) >= 3); @@ -5365,7 +5365,7 @@ bool bolt::nasty_to(const monsters *mon) const { // Cleansing flame. if (flavour == BEAM_HOLY) - return (mon->res_cleansing_flame(agent()) <= 0); + return (mon->res_holy_energy(agent()) <= 0); // Take care of other non-enchantments. if (!is_enchantment()) @@ -5596,7 +5596,7 @@ std::string beam_type_name(beam_type type) case BEAM_STEAM: return("steam"); case BEAM_ENERGY: return("energy"); - case BEAM_HOLY: return("holy power"); + case BEAM_HOLY: return("holy energy"); case BEAM_FRAG: return("fragments"); case BEAM_LAVA: return("magma"); case BEAM_ICE: return("ice"); diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 151cf040ff..01ac21506a 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -122,13 +122,8 @@ int holy_word_monsters(coord_def where, int pow, int caster) monsters *monster = &menv[mon]; - if (!monster->alive() - || !mons_is_unholy(monster) - || (is_good_god(you.religion) - && (is_follower(monster) || mons_neutral(monster)))) - { + if (!monster->alive() || mons_res_holy_energy(monster) > 0) return retval; - } const int hploss = roll_dice(2, 15) + (random2(pow) / 3); retval = 1; diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index bc0bcbca8d..6e5e55edec 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -386,7 +386,7 @@ public: virtual int res_asphyx() const = 0; virtual int res_poison() const = 0; virtual int res_sticky_flame() const = 0; - virtual int res_cleansing_flame(const actor *attacker) const = 0; + virtual int res_holy_energy(const actor *attacker) const = 0; virtual int res_negative_energy() const = 0; virtual int res_rotting() const = 0; virtual int res_torment() const = 0; @@ -1094,7 +1094,7 @@ public: int res_asphyx() const; int res_poison() const; int res_sticky_flame() const; - int res_cleansing_flame(const actor *) const; + int res_holy_energy(const actor *) const; int res_negative_energy() const; int res_rotting() const; int res_torment() const; @@ -1469,7 +1469,7 @@ public: int res_asphyx() const; int res_poison() const; int res_sticky_flame() const; - int res_cleansing_flame(const actor *) const; + int res_holy_energy(const actor *) const; int res_negative_energy() const; int res_rotting() const; int res_torment() const; diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index adb65edeff..16a72a5847 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2048,6 +2048,14 @@ int melee_attack::fire_res_apply_cerebov_downgrade(int res) return (res); } +bool melee_attack::defender_is_unholy() +{ + if (defender->atype() == ACT_PLAYER) + return (player_is_unholy()); + else + return (mons_is_unholy(defender_as_monster())); +} + void melee_attack::drain_defender() { if (defender->atype() == ACT_MONSTER && one_chance_in(3)) @@ -2768,11 +2776,8 @@ bool melee_attack::apply_damage_brand() break; case SPWPN_HOLY_WRATH: - if (defender->holiness() == MH_UNDEAD - || defender->holiness() == MH_DEMONIC) - { + if (defender_is_unholy()) special_damage = 1 + (random2(damage_done * 15) / 10); - } if (special_damage && defender_visible) { diff --git a/crawl-ref/source/fight.h b/crawl-ref/source/fight.h index 7a28c08b1c..9ae999e89d 100644 --- a/crawl-ref/source/fight.h +++ b/crawl-ref/source/fight.h @@ -200,6 +200,7 @@ private: int res, const char *verb); int fire_res_apply_cerebov_downgrade(int res); + bool defender_is_unholy(); void drain_defender(); void check_defender_train_armour(); void check_defender_train_dodging(); diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 6c89b9e210..3e8868e625 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -5793,7 +5793,7 @@ int monsters::res_sticky_flame() const return (mons_res_sticky_flame(this)); } -int monsters::res_cleansing_flame(const actor *attacker) const +int monsters::res_holy_energy(const actor *attacker) const { if (mons_is_unholy(this)) return (-2); diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index ca82412f81..ca1954ef41 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -220,12 +220,12 @@ int check_your_resists(int hurted, beam_type flavour) case BEAM_HOLY: { // Cleansing flame. - const int rcf = you.res_cleansing_flame(NULL); - if (rcf > 0) + const int rhe = you.res_holy_energy(NULL); + if (rhe > 0) hurted = 0; - else if (rcf == 0) + else if (rhe == 0) hurted /= 2; - else if (rcf < -1) + else if (rhe < -1) hurted = (hurted * 3) / 2; if (hurted == 0) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index a5c1eaff1a..7893590e4e 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -6827,7 +6827,7 @@ int player::res_sticky_flame() const return (player_res_sticky_flame()); } -int player::res_cleansing_flame(const actor *attacker) const +int player::res_holy_energy(const actor *attacker) const { if (player_is_unholy()) return (-2); -- cgit v1.2.3-54-g00ecf