From de30595826d2800afff619d6a1dc01c0d3610950 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Tue, 8 Dec 2009 23:15:03 +1000 Subject: 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. --- crawl-ref/source/dungeon.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'crawl-ref/source/dungeon.cc') 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. -- cgit v1.2.3-54-g00ecf