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/map_knowledge.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/map_knowledge.cc')
-rw-r--r-- | crawl-ref/source/map_knowledge.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crawl-ref/source/map_knowledge.cc b/crawl-ref/source/map_knowledge.cc index d10add9505..901ea07af9 100644 --- a/crawl-ref/source/map_knowledge.cc +++ b/crawl-ref/source/map_knowledge.cc @@ -12,6 +12,7 @@ #include "mon-util.h" #include "notes.h" #include "options.h" +#include "religion.h" #include "show.h" #include "terrain.h" #ifdef USE_TILE @@ -89,8 +90,8 @@ static void _automap_from(int x, int y, int mutated) if (mutated) { magic_mapping(8 * mutated, - you.religion == GOD_ASHENZARI ? 25 + you.piety / 8 : 25, - true, you.religion == GOD_ASHENZARI, + you_worship(GOD_ASHENZARI) ? 25 + you.piety / 8 : 25, + true, you_worship(GOD_ASHENZARI), true, coord_def(x,y)); } } @@ -100,7 +101,7 @@ static int _map_quality() int passive = player_mutation_level(MUT_PASSIVE_MAPPING); // the explanation of this 51 vs max_piety of 200 is left as // an exercise to the reader - if (you.religion == GOD_ASHENZARI && !player_under_penance()) + if (you_worship(GOD_ASHENZARI) && !player_under_penance()) passive = max(passive, you.piety / 51); return passive; } |