summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-19 23:38:07 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-19 23:38:07 +0000
commit3a736d2bc2536ceaa45a9b6646c64b3a92132171 (patch)
tree543af2132e0a69a869e05a90b5b41ee77e93419d /crawl-ref/source
parenta3cdba5e574e71ac75b07c41ab42d87efb4b42fe (diff)
downloadcrawl-ref-3a736d2bc2536ceaa45a9b6646c64b3a92132171.tar.gz
crawl-ref-3a736d2bc2536ceaa45a9b6646c64b3a92132171.zip
Clean up follower and cleansing flame routines some more. If you
worship a good god, cleansing flame will no longer damage neutral monsters, since attacking neutrals offends the good gods. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4393 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/beam.cc9
-rw-r--r--crawl-ref/source/ouch.cc6
-rw-r--r--crawl-ref/source/religion.cc26
-rw-r--r--crawl-ref/source/religion.h2
4 files changed, 16 insertions, 27 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index c77948cf80..7045e08851 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -1777,13 +1777,14 @@ int mons_adjust_flavoured( monsters *monster, bolt &pbolt,
break;
case BEAM_HOLY: // flame of cleansing
- if (mons_is_unholy(monster))
- hurted = (hurted * 3) / 2;
- else if (mons_is_holy(monster)
- || is_good_god(you.religion) && is_follower(monster))
+ if (mons_is_holy(monster)
+ || (is_good_god(you.religion)
+ && (is_follower(monster) || mons_neutral(monster))))
{
hurted = 0;
}
+ else if (mons_is_unholy(monster))
+ hurted = (hurted * 3) / 2;
else if (!mons_is_evil(monster))
hurted /= 2;
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index fa15841a3a..46f7e76462 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -241,10 +241,10 @@ int check_your_resists(int hurted, beam_type flavour)
break;
case BEAM_HOLY:
- if (you.is_undead || you.species != SP_DEMONSPAWN)
- hurted = (hurted * 3) / 2;
- else if (is_good_god(you.religion))
+ if (is_good_god(you.religion))
hurted = 0;
+ else if (you.is_undead || you.species != SP_DEMONSPAWN)
+ hurted = (hurted * 3) / 2;
else if (!is_evil_god(you.religion))
hurted /= 2;
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 1ff77bcc29..fbb588ddfd 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -773,7 +773,7 @@ static void _give_nemelex_gift()
}
}
-bool is_tso_follower(const monsters* mon)
+bool is_good_follower(const monsters* mon)
{
return (mon->alive() && !mons_is_evil_or_unholy(mon)
&& mons_friendly(mon));
@@ -788,24 +788,12 @@ bool is_orcish_follower(const monsters* mon)
bool is_follower(const monsters* mon)
{
- bool result = false;
-
- switch (you.religion)
- {
- case GOD_SHINING_ONE:
- result = is_tso_follower(mon);
- break;
-
- case GOD_BEOGH:
- result = is_orcish_follower(mon);
- break;
-
- default:
- result = (mon->alive() && mons_friendly(mon));
- break;
- }
-
- return result;
+ if (is_good_god(you.religion))
+ return is_good_follower(mon);
+ else if (you.religion == GOD_BEOGH)
+ return is_orcish_follower(mon);
+ else
+ return (mon->alive() && mons_friendly(mon));
}
static bool _blessing_wpn(monsters *mon)
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index 62fb239a85..29cf763615 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -75,7 +75,7 @@ bool ely_destroy_weapons();
bool trog_burn_books();
bool tso_stab_safe_monster(const actor *act);
-bool is_tso_follower(const monsters* mon);
+bool is_good_follower(const monsters* mon);
bool is_orcish_follower(const monsters* mon);
bool is_follower(const monsters* mon);
bool bless_follower(monsters* follower = NULL,