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-20 22:53:45 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-20 22:53:45 +0000
commit2846de53110f56c1732a3e9b2ab71b396af3c5a0 (patch)
tree70179e2b3f1b9a30606cd17a83da7b62b70d7a1f /crawl-ref/source/effects.cc
parent1fd9aa7314df4f54f5e3ca2240ee564d94a16508 (diff)
downloadcrawl-ref-2846de53110f56c1732a3e9b2ab71b396af3c5a0.tar.gz
crawl-ref-2846de53110f56c1732a3e9b2ab71b396af3c5a0.zip
* Lower randart probabilities for book acquirement.
* Lower number of spells in randart books. * Fix acquirement generating manuals of (null). * Lower chance of randart books being named after Pan lords. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9142 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index c5acfe2441..e71c3658d8 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1413,12 +1413,12 @@ static void _do_book_acquirement(item_def &book, int agent)
// Count magic skills double to bias against manuals
// for magic users.
if (i >= SK_SPELLCASTING && i <= SK_POISON_MAGIC)
- magic_weights += 2*weight;
+ magic_weights += weight;
else
other_weights += weight;
}
- if (x_chance_in_y(other_weights, magic_weights + other_weights))
+ if (x_chance_in_y(other_weights, 2*magic_weights + other_weights))
{
choice = BOOK_MANUAL;
if (magic_weights > 0)
@@ -1429,17 +1429,15 @@ static void _do_book_acquirement(item_def &book, int agent)
if (choice == NUM_BOOKS)
{
choice = random_choose_weighted(
- 60, BOOK_RANDART_THEME,
- agent == GOD_SIF_MUNA ? 24 : 34, book.sub_type,
- level == -1 ? 0 :
- agent == GOD_SIF_MUNA ? 4 : 1, BOOK_RANDART_LEVEL,
- 0);
+ 30, BOOK_RANDART_THEME,
+ agent == GOD_SIF_MUNA ? 10 : 40, book.sub_type,
+ level == -1 ? 0 : 1, BOOK_RANDART_LEVEL, 0);
}
// Acquired randart books have a chance of being named after the player.
std::string owner = "";
- if (agent == AQ_SCROLL && one_chance_in(10)
- || agent == AQ_CARD_GENIE && one_chance_in(5))
+ if (agent == AQ_SCROLL && one_chance_in(12)
+ || agent == AQ_CARD_GENIE && one_chance_in(6))
{
owner = you.your_name;
}
@@ -1467,14 +1465,15 @@ static void _do_book_acquirement(item_def &book, int agent)
// else intentional fall-through
}
case BOOK_RANDART_THEME:
- book.sub_type = choice;
- make_book_theme_randart(book, 0, 0, 7, 22, SPELL_NO_SPELL, owner);
+ book.sub_type = BOOK_RANDART_THEME;
+ make_book_theme_randart(book, 0, 0, 5 + coinflip(), 20, SPELL_NO_SPELL,
+ owner);
break;
case BOOK_RANDART_LEVEL:
{
- book.sub_type = choice;
- int num_spells = 7 - (level + 1) / 2 + random_range(1, 2);
+ book.sub_type = BOOK_RANDART_LEVEL;
+ int num_spells = 5 - (level + 1) / 2 + random_range(1, 3);
make_book_level_randart(book, level, num_spells, owner);
break;
}
@@ -1490,7 +1489,8 @@ static void _do_book_acquirement(item_def &book, int agent)
for (int i = 0; i < NUM_SKILLS; i++)
{
- if (i > SK_UNARMED_COMBAT && i < SK_SPELLCASTING)
+ if (i == SK_UNUSED_1
+ || i > SK_UNARMED_COMBAT && i < SK_SPELLCASTING)
{
weights[i] = 0;
continue;
@@ -1504,7 +1504,7 @@ static void _do_book_acquirement(item_def &book, int agent)
// If we don't know any magic skills, make non-magic skills
// more likely.
- if (!knows_magic && i < SK_SPELLCASTING)
+ if (!knows_magic && (i < SK_SPELLCASTING || i > SK_POISON_MAGIC))
w *= 2;
weights[i] = w;