summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemname.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-02 14:09:20 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-02 14:09:20 +0000
commit021366461aba2e0504b2722d28d2b967778b3702 (patch)
treea2d759df280b978514814dd96f2c8eac7bf7cc1b /crawl-ref/source/itemname.cc
parent29d2d1be7e3d8ef6096100e6c51f1dde66f3a028 (diff)
downloadcrawl-ref-021366461aba2e0504b2722d28d2b967778b3702.tar.gz
crawl-ref-021366461aba2e0504b2722d28d2b967778b3702.zip
The start of randart spellbooks. Never randomly generated and only created via
the wizard command &+, since there's no logic to how the random set of spells are selected and there's no valuation code in shopping.cc. No randart manuals or books of destruction, since I have no clue what they'd be like. The code allows for any book or spell to have its normal set of spells overridden by an arbitrary/customized set of spells, but this is only used by randart spellbooks as of now. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7722 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r--crawl-ref/source/itemname.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 89a6d3c251..a76dc938ff 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -1466,6 +1466,14 @@ std::string item_def::name_aux( description_level_type desc,
break;
case OBJ_BOOKS:
+ if (is_random_artefact( *this ) && !dbname && !basename)
+ {
+ if (know_type)
+ buff << "book" << get_artefact_name(*this);
+ else
+ buff << get_artefact_name(*this) << "book";
+ break;
+ }
if (basename)
buff << (item_typ == BOOK_MANUAL ? "manual" : "book");
else if (!know_type)
@@ -1560,7 +1568,8 @@ std::string item_def::name_aux( description_level_type desc,
buff.str( pluralise(buff.str()) );
// Disambiguation
- if (!terse && !basename && !dbname && know_type)
+ if (!terse && !basename && !dbname && know_type &&
+ !is_random_artefact( *this ))
{
switch (this->base_type)
{