summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/goditem.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-04-05 22:51:15 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-04-05 22:51:15 +0200
commit0d2ca58aa7379e1e931a1e8dd1e9e77dfc0bb264 (patch)
tree5811f949e76257b91ec1a28aea05a2af89b4f709 /crawl-ref/source/goditem.h
parent8ae89f4b34d951056d402f5825b9738b50ae6626 (diff)
downloadcrawl-ref-0d2ca58aa7379e1e931a1e8dd1e9e77dfc0bb264.tar.gz
crawl-ref-0d2ca58aa7379e1e931a1e8dd1e9e77dfc0bb264.zip
Cut some massive code duplication.
Every god conduct had a couple of functions, one for rods, one for spellbooks, just to be able to tell between the two -- and neither was needed. A single function can deal with all of this; only Trog cares if it's a book or a rod.
Diffstat (limited to 'crawl-ref/source/goditem.h')
-rw-r--r--crawl-ref/source/goditem.h31
1 files changed, 6 insertions, 25 deletions
diff --git a/crawl-ref/source/goditem.h b/crawl-ref/source/goditem.h
index 5b8dff9751..bf4e6fecf4 100644
--- a/crawl-ref/source/goditem.h
+++ b/crawl-ref/source/goditem.h
@@ -14,33 +14,14 @@ bool is_corpse_violating_item(const item_def& item);
bool is_evil_item(const item_def& item);
bool is_unclean_item(const item_def& item);
bool is_chaotic_item(const item_def& item);
-bool is_potentially_hasty_item(const item_def& item);
bool is_hasty_item(const item_def& item);
bool is_poisoned_item(const item_def& item);
-bool is_evil_discipline(int discipline);
-bool is_unholy_spell(spell_type spell, god_type god = GOD_NO_GOD);
-bool is_corpse_violating_spell(spell_type spell, god_type = GOD_NO_GOD);
-bool is_evil_spell(spell_type spell, god_type god = GOD_NO_GOD);
-bool is_unclean_spell(spell_type spell, god_type god = GOD_NO_GOD);
-bool is_chaotic_spell(spell_type spell, god_type god = GOD_NO_GOD);
-bool is_hasty_spell(spell_type spell, god_type god = GOD_NO_GOD);
-bool is_any_spell(spell_type spell, god_type god = GOD_NO_GOD);
-bool is_spellbook_type(const item_def& item, bool book_or_rod,
- bool (*suitable)(spell_type spell, god_type god) =
- is_any_spell,
- god_type god = you.religion);
-bool is_unholy_spellbook(const item_def& item);
-bool is_evil_spellbook(const item_def& item);
-bool is_unclean_spellbook(const item_def& item);
-bool is_chaotic_spellbook(const item_def& item);
-bool is_hasty_spellbook(const item_def& item);
-bool is_corpse_violating_spellbook(const item_def & item);
-bool is_unholy_rod(const item_def& item);
-bool is_evil_rod(const item_def& item);
-bool is_unclean_rod(const item_def& item);
-bool is_chaotic_rod(const item_def& item);
-bool is_hasty_rod(const item_def& item);
-bool is_corpse_violating_rod(const item_def & item);
+bool is_unholy_spell(spell_type spell);
+bool is_corpse_violating_spell(spell_type spell);
+bool is_evil_spell(spell_type spell);
+bool is_unclean_spell(spell_type spell);
+bool is_chaotic_spell(spell_type spell);
+bool is_hasty_spell(spell_type spell);
conduct_type good_god_hates_item_handling(const item_def &item);
conduct_type god_hates_item_handling(const item_def &item);