summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-book.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-24 00:50:31 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-24 00:50:31 +0000
commitdd34bc7bf8b38a93cffba657eb2658a48c2dacff (patch)
tree8af9cbdc13945b26e90f172addc532ec2b862664 /crawl-ref/source/spl-book.cc
parent532d8dccff760d21593d5db61275e1d00a6af25b (diff)
downloadcrawl-ref-dd34bc7bf8b38a93cffba657eb2658a48c2dacff.tar.gz
crawl-ref-dd34bc7bf8b38a93cffba657eb2658a48c2dacff.zip
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
Diffstat (limited to 'crawl-ref/source/spl-book.cc')
-rw-r--r--crawl-ref/source/spl-book.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index dfd3db7e3b..dad9800e5d 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -982,10 +982,10 @@ static unsigned char _lowest_rarity[NUM_SPELLS];
void init_spell_rarities()
{
- for (int i = 0; i < NUM_SPELLS; i++)
+ for (int i = 0; i < NUM_SPELLS; ++i)
_lowest_rarity[i] = 255;
- for (int i = 0; i < NUM_FIXED_BOOKS; i++)
+ for (int i = 0; i < NUM_FIXED_BOOKS; ++i)
{
const int rarity = book_rarity(i);
@@ -994,14 +994,14 @@ void init_spell_rarities()
if (rarity >= 20)
continue;
- for (int j = 0; j < SPELLBOOK_SIZE; j++)
+ for (int j = 0; j < SPELLBOOK_SIZE; ++j)
{
spell_type spell = which_spell_in_book(i, j);
if (spell == SPELL_NO_SPELL)
continue;
#ifdef DEBUG
- int unsigned flags = get_spell_flags(spell);
+ unsigned int flags = get_spell_flags(spell);
if (flags & (SPFLAG_MONSTER | SPFLAG_TESTING))
{