diff options
-rw-r--r-- | crawl-ref/source/beam.cc | 11 | ||||
-rw-r--r-- | crawl-ref/source/externs.h | 6 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/ouch.cc | 11 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 2 |
5 files changed, 20 insertions, 15 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 5d0cb96c04..d38fc3f648 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2249,12 +2249,14 @@ int mons_adjust_flavoured(monsters *monster, bolt &pbolt, int hurted, break; case BEAM_HOLY: + { // Cleansing flame. - if (monster->res_cleansing_flame() > 0) + const int rcf = monster->res_cleansing_flame(pbolt.agent()); + if (rcf > 0) hurted = 0; - else if (monster->res_cleansing_flame() == 0) + else if (rcf == 0) hurted /= 2; - else if (monster->res_cleansing_flame() < -1) + else if (rcf < -1) hurted = (hurted * 3) / 2; if (doFlavouredEffects) @@ -2264,6 +2266,7 @@ int mons_adjust_flavoured(monsters *monster, bolt &pbolt, int hurted, : " writhes in agony!"); } break; + } case BEAM_ICE: // ice - about 50% of damage is cold, other 50% is impact and @@ -3196,7 +3199,7 @@ bool bolt::is_harmless(const monsters *mon) const return (true); case BEAM_HOLY: - return (mon->res_cleansing_flame() > 0); + return (mon->res_cleansing_flame(agent()) > 0); case BEAM_STEAM: return (mons_res_steam(mon) >= 3); diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index c600b6f648..85c1920513 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 = 0; + virtual int res_cleansing_flame(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; + int res_cleansing_flame(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; + int res_cleansing_flame(const actor *) const; int res_negative_energy() const; int res_rotting() const; int res_torment() const; diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index a301655205..a3ca0fe74d 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -5795,7 +5795,7 @@ int monsters::res_sticky_flame() const return (mons_res_sticky_flame(this)); } -int monsters::res_cleansing_flame() const +int monsters::res_cleansing_flame(const actor *attacker) const { if (mons_is_unholy(this)) return (-2); @@ -5806,8 +5806,7 @@ int monsters::res_cleansing_flame() const if (is_good_god(god) || mons_is_holy(this) || mons_neutral(this) - || you.religion == GOD_SHINING_ONE - && is_unchivalric_attack(&you, this) + || is_unchivalric_attack(attacker, this) || is_good_god(you.religion) && is_follower(this)) { diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 881216ee1a..2faca91b49 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -218,24 +218,27 @@ int check_your_resists(int hurted, beam_type flavour) break; case BEAM_HOLY: + { // Cleansing flame. - if (you.res_cleansing_flame() > 0) + const int rcf = you.res_cleansing_flame(NULL); + if (rcf > 0) hurted = 0; - else if (you.res_cleansing_flame() == 0) + else if (rcf == 0) hurted /= 2; - else if (you.res_cleansing_flame() < -1) + else if (rcf < -1) hurted = (hurted * 3) / 2; if (hurted == 0) canned_msg(MSG_YOU_RESIST); break; + } default: break; } // end switch return (hurted); -} // end check_your_resists() +} void splash_with_acid(int acid_strength, bool corrode_items) { diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index e13ba99ba5..e2a61eef58 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 +int player::res_cleansing_flame(const actor *attacker) const { if (player_is_unholy()) return (-2); |