summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/religion.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-01 10:10:02 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-01 10:10:59 -0600
commita0de356f3d007e58152f257212ed13d8b44fdfc0 (patch)
treef58fc43277e2f4fcb5f99ef57b51eeeef05a9905 /crawl-ref/source/religion.cc
parent7e8ebade4e8c0001439b89f333174f9443b74eb0 (diff)
downloadcrawl-ref-a0de356f3d007e58152f257212ed13d8b44fdfc0.tar.gz
crawl-ref-a0de356f3d007e58152f257212ed13d8b44fdfc0.zip
Move checks for a player or monster's being chaotic into another
convenience function in the actor interface.
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r--crawl-ref/source/religion.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index a1a87c7508..1e0cd81bc5 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -1477,7 +1477,7 @@ bool _has_jelly()
bool is_good_lawful_follower(const monsters* mon)
{
return (mon->alive() && !mons_is_evil_or_unholy(mon)
- && !mons_is_chaotic(mon) && mons_friendly(mon));
+ && !mon->is_chaotic() && mons_friendly(mon));
}
bool is_good_follower(const monsters* mon)
@@ -5219,7 +5219,7 @@ static bool _chaotic_beings_on_level_attitude_change()
{
monsters *monster = &menv[i];
if (monster->alive()
- && mons_is_chaotic(monster))
+ && monster->is_chaotic())
{
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "Chaotic attitude changing: %s on level %d, branch %d",
@@ -6811,16 +6811,19 @@ bool player_can_join_god(god_type which_god)
if (you.species == SP_DEMIGOD)
return (false);
- if (you.is_unholy() && is_good_god(which_god))
+ if (is_good_god(which_god) && you.is_unholy())
return (false);
- // Feawn hates undead, but will accept demonspawn.
- if (which_god == GOD_FEAWN && you.holiness() == MH_UNDEAD)
+ if (which_god == GOD_ZIN && you.is_chaotic())
return (false);
if (which_god == GOD_BEOGH && you.species != SP_HILL_ORC)
return (false);
+ // Feawn hates undead, but will accept demonspawn.
+ if (which_god == GOD_FEAWN && you.holiness() == MH_UNDEAD)
+ return (false);
+
return (true);
}