summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg.cc
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2010-02-23 01:11:22 +0100
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2010-02-23 01:11:22 +0100
commit8667fe46808e8dca18fcdf568613e0da572be667 (patch)
treecf9e31a6e33afd38f3525cb32ac3d38e09e934cd /crawl-ref/source/tilereg.cc
parente13d4aaf17222d32e822e6927167517a5e9f9e7e (diff)
downloadcrawl-ref-8667fe46808e8dca18fcdf568613e0da572be667.tar.gz
crawl-ref-8667fe46808e8dca18fcdf568613e0da572be667.zip
Implement #624: Allow browsing of identified "risky" spellbooks.
* If you encounter the book of Annihilations/Demonology or Necronomicon in a bookshop, you can now browse its contents. * If you buy such a book, it is already identified, so you can continue to read the spell descriptions at your leisure. * You can still not memorise these spells if you don't fulfil the requirements. They will also be coloured useless while that is the case. * If you find these books lying around in the dungeon, reading them will _not_ identify them (or give away their spell list) unless you meet the requirements. [1] I also added the old "beyond your current level of understanding" line to both book and corresponding spell descriptions. Tested for the Necronomicon seen in a shop, Demonology seen in a shop and bought, and Annihilations found unidentified (in wizard mode), using (r)ead, (i)nventory, (M)emorise, ?/, and the Tiles mouseclick interface (again, read/describe/Memorise commands and Memorise tab). [1] I don't know if it's worth keeping that restriction. If we do, we should add an autoinscription because the simple act of (r)eading it will give away that it's one of those three special books, though not which one.
Diffstat (limited to 'crawl-ref/source/tilereg.cc')
-rw-r--r--crawl-ref/source/tilereg.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 4d4c946f5f..160c301603 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -3238,10 +3238,14 @@ bool InventoryRegion::update_tip_text(std::string& tip)
if (item_type_known(item)
&& item.sub_type != BOOK_MANUAL
&& item.sub_type != BOOK_DESTRUCTION
- && you.skills[SK_SPELLCASTING] > 0)
+ && can_learn_spell(true))
{
- tip += "Memorise (%)";
- cmd.push_back(CMD_MEMORISE_SPELL);
+ if (player_can_memorise_from_spellbook(item)
+ || has_spells_to_memorise(true))
+ {
+ tip += "Memorise (%)";
+ cmd.push_back(CMD_MEMORISE_SPELL);
+ }
if (wielded)
_handle_wield_tip(tip, cmd, "\n[Ctrl-L-Click]", true);
break;