diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-02 08:59:42 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-02 08:59:42 +0000 |
commit | b8b49ddd428d786879014d4623996f0dc37f7115 (patch) | |
tree | cfde266515126b943c88ecfb8142a27684a1afb5 /crawl-ref/source | |
parent | f971ca6da48e4ff297f48984a41f7cbda264b856 (diff) | |
download | crawl-ref-b8b49ddd428d786879014d4623996f0dc37f7115.tar.gz crawl-ref-b8b49ddd428d786879014d4623996f0dc37f7115.zip |
The wizard command to create a book (&%:) can now take the string "all"
(without the quotes), which will cause all non-randart spellbooks to be
created.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9882 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/debug.cc | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 7cf438e693..6158cdf588 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -1162,6 +1162,27 @@ static bool _book_from_spell(const char* specs, item_def &item) return (false); } +static void _make_all_books() +{ + for (int i = 0; i < NUM_FIXED_BOOKS; ++i) + { + int thing = items(0, OBJ_BOOKS, i, true, 0, MAKE_ITEM_NO_RACE, + 0, 0, AQ_WIZMODE); + if (thing == NON_ITEM) + continue; + + move_item_to_grid(&thing, you.pos()); + + item_def book(mitm[thing]); + + mark_had_book(book); + set_ident_flags(book, ISFLAG_KNOW_TYPE); + set_ident_flags(book, ISFLAG_IDENT_MASK); + + mprf("%s", book.name(DESC_PLAIN).c_str()); + } +} + //--------------------------------------------------------------- // // create_spec_object @@ -1294,7 +1315,10 @@ void wizard_create_spec_object() } else { - mpr("What type of item? ", MSGCH_PROMPT); + if (class_wanted == OBJ_BOOKS) + mpr("What type of item? (\"all\" for all) ", MSGCH_PROMPT); + else + mpr("What type of item? ", MSGCH_PROMPT); get_input_line( specs, sizeof( specs ) ); std::string temp = specs; @@ -1302,6 +1326,12 @@ void wizard_create_spec_object() lowercase(temp); strcpy(specs, temp.c_str()); + if (class_wanted == OBJ_BOOKS && temp == "all") + { + _make_all_books(); + return; + } + if (specs[0] == '\0') { canned_msg( MSG_OK ); |