diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-13 18:55:53 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-13 18:55:53 +0000 |
commit | 2bd8f39fa42d7c774a27121c2ce3bf82e0104993 (patch) | |
tree | 069b83e5b94614e675ee1804c07b661821712f54 /crawl-ref/source/item_use.cc | |
parent | be6a0a38de9cba44caca289f155d46df6324d0a5 (diff) | |
download | crawl-ref-2bd8f39fa42d7c774a27121c2ce3bf82e0104993.tar.gz crawl-ref-2bd8f39fa42d7c774a27121c2ce3bf82e0104993.zip |
Made Tome of Destruction more consistent for those with high Evoc.
Made manuals visibly different from spellbooks. Also, you can't
cancel reading a manual; so you risk wasting it if you read all
unIDed books.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2851 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r-- | crawl-ref/source/item_use.cc | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 522b130787..3e048b4b97 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -3672,20 +3672,17 @@ static bool enchant_armour( void ) static void handle_read_book( int item_slot ) { - int spell, spell_index; + item_def& book(you.inv[item_slot]); - if (you.inv[item_slot].sub_type == BOOK_DESTRUCTION) + if (book.sub_type == BOOK_DESTRUCTION) { if (silenced(you.x_pos, you.y_pos)) - { mpr("This book does not work if you cannot read it aloud!"); - return; - } - - tome_of_power(item_slot); + else + tome_of_power(item_slot); return; } - else if (you.inv[item_slot].sub_type == BOOK_MANUAL) + else if (book.sub_type == BOOK_MANUAL) { skill_manual(item_slot); return; @@ -3694,25 +3691,23 @@ static void handle_read_book( int item_slot ) while (true) { // Spellbook - spell = read_book( you.inv[item_slot], RBOOK_READ_SPELL ); + const int ltr = read_book( book, RBOOK_READ_SPELL ); - if (spell < 'a' || spell > 'h') //jmf: was 'g', but 8=h + if (ltr < 'a' || ltr > 'h') //jmf: was 'g', but 8=h { mesclr( true ); return; } - spell_index = letter_to_index( spell ); - - const spell_type nthing = - which_spell_in_book(you.inv[item_slot].sub_type, spell_index); - if (nthing == SPELL_NO_SPELL) + const spell_type spell = which_spell_in_book(book.sub_type, + letter_to_index(ltr)); + if (spell == SPELL_NO_SPELL) { mesclr( true ); return; } - describe_spell( nthing ); + describe_spell( spell ); } } |