From dd34bc7bf8b38a93cffba657eb2658a48c2dacff Mon Sep 17 00:00:00 2001 From: dolorous Date: Wed, 24 Dec 2008 00:50:31 +0000 Subject: Generalize checks for spellbooks and rods of a particular class, or which your god disapproves of. Now, if at least half of the spells in a spellbook or rod are in a particular class (this threshold may need adjustment; it's in is_spellbook_type()), the entire item is considered to be, too. This means that artefact spellbooks containing many evil spells may be considered evil items by good gods, as will artefact rods if/when they're implemented. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7927 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/religion.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/religion.h') diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index 406d3dbb31..a2019b7201 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -107,14 +107,31 @@ void beogh_convert_orc(monsters *orc, bool emergency, bool is_holy_item(const item_def& item); bool is_evil_item(const item_def& item); bool is_chaotic_item(const item_def& item); +bool is_holy_discipline(int discipline); +bool is_evil_discipline(int discipline); +bool is_holy_spell(spell_type spell, god_type god = GOD_NO_GOD); +bool is_evil_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_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_holy_spellbook(const item_def& item); +bool is_evil_spellbook(const item_def& item); +bool is_chaotic_spellbook(const item_def& item); +bool god_dislikes_spellbook(const item_def& item); +bool is_holy_rod(const item_def& item); +bool is_evil_rod(const item_def& item); +bool is_chaotic_rod(const item_def& item); +bool god_dislikes_rod(const item_def& item); bool good_god_dislikes_item_handling(const item_def &item); bool god_dislikes_item_handling(const item_def &item); // NOTE: As of now, these two functions only say if a god won't give a // spell/school when giving a gift. bool god_dislikes_spell_type(spell_type spell, god_type god = you.religion); -bool god_dislikes_spell_discipline(int discipline, - god_type god = you.religion); +bool god_dislikes_spell_discipline(int discipline, god_type god = you.religion); bool trog_burn_spellbooks(); bool ely_destroy_weapons(); -- cgit v1.2.3-54-g00ecf