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-01-29 22:20:54 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-29 22:20:54 +0000
commit10676923ec3e6a636e021089ef8e0e39c097e983 (patch)
tree8d808505b259b446cea3f6fd15afbcd144aa8492 /crawl-ref/source/effects.cc
parenteeaba130f2a67321b64889c935fe443af70e3e97 (diff)
downloadcrawl-ref-10676923ec3e6a636e021089ef8e0e39c097e983.tar.gz
crawl-ref-10676923ec3e6a636e021089ef8e0e39c097e983.zip
FR 2532818: Allow randart books to be named after uniques and legendary mages.
Also, randart books created by acquirement (not gifts) have a chance to be named after the player. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8848 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 92da990d38..8acf483ce6 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1566,16 +1566,24 @@ static void _do_book_acquirement(item_def &book, int agent)
book.sub_type = choice;
+ // 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))
+ {
+ owner = you.your_name;
+ }
+
switch (choice)
{
case BOOK_RANDART_THEME:
- make_book_theme_randart(book, 0, 0, 7, 22);
+ make_book_theme_randart(book, 0, 0, 7, 22, SPELL_NO_SPELL, owner);
break;
case BOOK_RANDART_LEVEL:
{
int num_spells = 7 - (level + 1) / 2 + random_range(1, 2);
- make_book_level_randart(book, level, num_spells);
+ make_book_level_randart(book, level, num_spells, owner);
break;
}