From 6fe9d2d6362915f3ab999971c87dd2f4d09e905f Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 21 Feb 2009 19:52:14 +0000 Subject: * Tweak spell number of randart books some more. * Loosen restrictions on spell levels of unknown spells for normal books, so there are more matches even for untrained schools. * Add a new option dump_book_spells that, if set to true (default), will dump the spells even for non-randart book. Useful if you don't know the books' contents by heart and want to know spells at your disposal without checking some spoilers. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9143 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/describe.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/describe.cc') diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 197de44d75..6147b21e21 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1632,7 +1632,7 @@ void append_spells(std::string &desc, const item_def &item) desc += "$$Spells Type Level$"; - for (int j = 0; j < 8; j++) + for (int j = 0; j < SPELLBOOK_SIZE; j++) { spell_type stype = which_spell_in_book(item, j); if (stype == SPELL_NO_SPELL) @@ -1861,8 +1861,11 @@ std::string get_item_description( const item_def &item, bool verbose, description << "$This book is beyond your current level of " "understanding."; } - else if (!verbose && is_random_artefact( item )) + else if (!verbose + && (Options.dump_book_spells || is_random_artefact(item))) { + mprf("book: %s, option: %s", item.name(DESC_PLAIN).c_str(), + Options.dump_book_spells ? "true" : "false"); append_spells( desc, item ); if (desc.empty()) need_extra_line = false; -- cgit v1.2.3-54-g00ecf