summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-16 18:58:08 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-16 18:58:08 +0000
commit67251d8f0ceb7cdd3c73fed911a5d47c279e494c (patch)
treefb70bb7363064ba358f06fc9f613d94b0459d6ce /crawl-ref/source/effects.cc
parent78a45dd9099c4340a9aec9d634d3ef91bab181ac (diff)
downloadcrawl-ref-67251d8f0ceb7cdd3c73fed911a5d47c279e494c.tar.gz
crawl-ref-67251d8f0ceb7cdd3c73fed911a5d47c279e494c.zip
Fix randart books being much too cheap. (Yes, this was actually a bug.)
A randart book's rarity is now defined as the average of its three rarest spells. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9101 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index f704f4243c..f13b2d70d1 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1431,7 +1431,7 @@ static void _do_book_acquirement(item_def &book, int agent)
60, BOOK_RANDART_THEME,
agent == GOD_SIF_MUNA ? 24 : 34, book.sub_type,
level == -1 ? 0 :
- agent == GOD_SIF_MUNA ? 3 : 1, BOOK_RANDART_LEVEL,
+ agent == GOD_SIF_MUNA ? 4 : 1, BOOK_RANDART_LEVEL,
0);
}
@@ -1481,6 +1481,9 @@ static void _do_book_acquirement(item_def &book, int agent)
int w = (skill < 12) ? skill + 3
: 25 - skill;
+ if (w < 0)
+ w = 0;
+
// If we don't know any magic skills, make non-magic skills
// more likely.
if (!knows_magic && i < SK_SPELLCASTING)