summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/attitude-change.cc
diff options
context:
space:
mode:
authorBrendan Hickey <brendan@bhickey.net>2013-07-28 00:31:07 -0700
committerBrendan Hickey <brendan@bhickey.net>2013-07-28 00:37:53 -0700
commitcc0fb03b9eee93cd3fbfb7b9ea40c8b1bfa7a872 (patch)
tree2534d2f5cac007ec674bc966576f0d47542d17b0 /crawl-ref/source/attitude-change.cc
parent772cbec2479d6b59ccb91cad149c7edf8968cf6f (diff)
downloadcrawl-ref-cc0fb03b9eee93cd3fbfb7b9ea40c8b1bfa7a872.tar.gz
crawl-ref-cc0fb03b9eee93cd3fbfb7b9ea40c8b1bfa7a872.zip
Refactor 'you.religion' checks.
Pull 'you.religion [!=]= FOO' checks into a function: you_worship(FOO). This change is part of a large plan to clean up religion.
Diffstat (limited to 'crawl-ref/source/attitude-change.cc')
-rw-r--r--crawl-ref/source/attitude-change.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/attitude-change.cc b/crawl-ref/source/attitude-change.cc
index d25ffd1791..2b7d49af72 100644
--- a/crawl-ref/source/attitude-change.cc
+++ b/crawl-ref/source/attitude-change.cc
@@ -79,7 +79,7 @@ void beogh_follower_convert(monster* mons, bool orc_hit)
return;
// For followers of Beogh, decide whether orcs will join you.
- if (you.religion == GOD_BEOGH
+ if (you_worship(GOD_BEOGH)
&& mons->foe == MHITYOU
&& mons_genus(mons->type) == MONS_ORC
&& !mons->is_summoned()
@@ -105,7 +105,7 @@ void beogh_follower_convert(monster* mons, bool orc_hit)
void slime_convert(monster* mons)
{
- if (you.religion == GOD_JIYVA && mons_is_slime(mons)
+ if (you_worship(GOD_JIYVA) && mons_is_slime(mons)
&& !mons->is_shapeshifter()
&& !mons->neutral()
&& !mons->friendly()
@@ -124,7 +124,7 @@ void slime_convert(monster* mons)
void fedhas_neutralise(monster* mons)
{
- if (you.religion == GOD_FEDHAS
+ if (you_worship(GOD_FEDHAS)
&& mons->attitude == ATT_HOSTILE
&& fedhas_neutralises(mons)
&& !testbits(mons->flags, MF_ATT_CHANGE_ATTEMPT)