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/godpassive.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/godpassive.cc')
-rw-r--r-- | crawl-ref/source/godpassive.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crawl-ref/source/godpassive.cc b/crawl-ref/source/godpassive.cc index cd0d3cedab..4560ccec4d 100644 --- a/crawl-ref/source/godpassive.cc +++ b/crawl-ref/source/godpassive.cc @@ -28,7 +28,7 @@ int che_stat_boost(int piety) { - if (you.religion != GOD_CHEIBRIADOS || you.penance[GOD_CHEIBRIADOS]) + if (!you_worship(GOD_CHEIBRIADOS) || you.penance[GOD_CHEIBRIADOS]) return 0; if (piety < 30) // Since you've already begun to slow down. return 1; @@ -41,7 +41,7 @@ int che_stat_boost(int piety) void jiyva_eat_offlevel_items() { // For wizard mode 'J' command - if (you.religion != GOD_JIYVA) + if (!you_worship(GOD_JIYVA)) return; if (crawl_state.game_is_sprint()) @@ -167,7 +167,7 @@ static bool _two_handed() void ash_check_bondage(bool msg) { - if (you.religion != GOD_ASHENZARI) + if (!you_worship(GOD_ASHENZARI)) return; int cursed[NUM_ET] = {0}, slots[NUM_ET] = {0}; @@ -381,7 +381,7 @@ static bool _jewel_auto_id(const item_def& item) case RING_INTELLIGENCE: return !!item.plus; case AMU_FAITH: - return (you.religion != GOD_NO_GOD); + return (!you_worship(GOD_NO_GOD)); case AMU_THE_GOURMAND: return (you.species != SP_MUMMY && player_mutation_level(MUT_HERBIVOROUS) < 3); @@ -406,7 +406,7 @@ bool god_id_item(item_def& item, bool silent) iflags_t old_ided = item.flags & ISFLAG_IDENT_MASK; iflags_t ided = 0; - if (you.religion == GOD_ASHENZARI) + if (you_worship(GOD_ASHENZARI)) { // Don't identify runes or the orb, since this has no gameplay purpose // and might mess up other things. @@ -464,7 +464,7 @@ bool god_id_item(item_def& item, bool silent) ided |= ISFLAG_EQ_JEWELLERY_MASK; } } - else if (you.religion == GOD_ELYVILON) + else if (you_worship(GOD_ELYVILON)) { if ((item.base_type == OBJ_STAVES || item.base_type == OBJ_RODS) && (is_evil_item(item) || is_unholy_item(item))) @@ -510,7 +510,7 @@ bool god_id_item(item_def& item, bool silent) void ash_id_monster_equipment(monster* mon) { - if (you.religion != GOD_ASHENZARI) + if (!you_worship(GOD_ASHENZARI)) return; bool id = false; @@ -585,7 +585,7 @@ static bool _check_portal(coord_def where) int ash_detect_portals(bool all) { - if (you.religion != GOD_ASHENZARI) + if (!you_worship(GOD_ASHENZARI)) return 0; int portals_found = 0; |