diff options
author | Brendan Hickey <brendan@bhickey.net> | 2013-07-28 00:31:07 -0700 |
---|---|---|
committer | Brendan Hickey <brendan@bhickey.net> | 2013-07-28 00:37:53 -0700 |
commit | cc0fb03b9eee93cd3fbfb7b9ea40c8b1bfa7a872 (patch) | |
tree | 2534d2f5cac007ec674bc966576f0d47542d17b0 /crawl-ref/source/spl-miscast.cc | |
parent | 772cbec2479d6b59ccb91cad149c7edf8968cf6f (diff) | |
download | crawl-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/spl-miscast.cc')
-rw-r--r-- | crawl-ref/source/spl-miscast.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/spl-miscast.cc b/crawl-ref/source/spl-miscast.cc index ec7b243cb7..fcac3eccac 100644 --- a/crawl-ref/source/spl-miscast.cc +++ b/crawl-ref/source/spl-miscast.cc @@ -672,7 +672,7 @@ bool MiscastEffect::avoid_lethal(int dam) if (recursion_depth == MAX_RECURSE) { // Any possible miscast would kill you, now that's interesting. - if (you.religion == GOD_XOM) + if (you_worship(GOD_XOM)) simple_god_message(" watches you with interest."); return true; } @@ -1608,7 +1608,7 @@ void MiscastEffect::_divination_mon(int severity) void MiscastEffect::_necromancy(int severity) { - if (target->is_player() && you.religion == GOD_KIKUBAAQUDGHA + if (target->is_player() && you_worship(GOD_KIKUBAAQUDGHA) && !player_under_penance() && you.piety >= piety_breakpoint(1)) { const bool death_curse = (cause.find("death curse") != string::npos); |