summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-12-08 23:15:03 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-12-08 23:16:37 +1000
commitde30595826d2800afff619d6a1dc01c0d3610950 (patch)
treed13c4ae7a49f217a6c104a02edcce1c06ee50e54 /crawl-ref/source/dungeon.cc
parent9840acaf22b2fc6690b3ce54c1a0f4a778d4af2f (diff)
downloadcrawl-ref-de30595826d2800afff619d6a1dc01c0d3610950.tar.gz
crawl-ref-de30595826d2800afff619d6a1dc01c0d3610950.zip
Allow vaults to create specifically themed randart books.
It is basically a simple wrapper onto spl-book.cc's make_book_theme_randart. More documentation can be found in syntax.txt.
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index b13f745005..652d9370f0 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -55,6 +55,8 @@
#include "random.h"
#include "religion.h"
#include "spells3.h"
+#include "spl-book.h"
+#include "spl-util.h"
#include "state.h"
#include "stuff.h"
#include "tags.h"
@@ -4718,6 +4720,19 @@ static void _dgn_place_item_explicit(const item_spec &spec,
{
item_def &item(mitm[item_made]);
item.pos = where;
+ CrawlHashTable props = spec.props;
+
+ if (props.exists("make_book_theme_randart"))
+ {
+ make_book_theme_randart(item,
+ props["randbook_disc1"].get_short(),
+ props["randbook_disc2"].get_short(),
+ props["randbook_num_spells"].get_short(),
+ props["randbook_slevels"].get_short(),
+ spell_by_name(props["randbook_spell"].get_string()),
+ props["randbook_owner"].get_string());
+ }
+
// Remove unsuitable inscriptions such as {god gift}.
item.inscription.clear();
// And wipe item origin to remove "this is a god gift!" from there.