From 24dcf42aa81549a812a8a12372243877137460ad Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 18 Jan 2009 01:59:10 +0000 Subject: Generalize the check for unchivalric attacks via cleansing flame. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8527 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/beam.cc') 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); -- cgit v1.2.3-54-g00ecf