summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-book.cc
diff options
context:
space:
mode:
authorChris Campbell <chriscampbell89@gmail.com>2014-07-23 03:40:53 +0100
committerChris Campbell <chriscampbell89@gmail.com>2014-07-23 06:56:17 +0100
commitb62d1063ba2c848a43ec9d01fa300eeb48055f6d (patch)
tree5f34f866dd568dfbb7d2204ad914d77220901c73 /crawl-ref/source/spl-book.cc
parentb6cf2bc58d6b713433ea508f86a05975d3333713 (diff)
downloadcrawl-ref-b62d1063ba2c848a43ec9d01fa300eeb48055f6d.tar.gz
crawl-ref-b62d1063ba2c848a43ec9d01fa300eeb48055f6d.zip
Fix messaging for forms other than lichform making a spell unmemorisable
For correct messaging when trying to memorise Sublimation in statue form (in the future) for example. Probably would be better to allow memorising such spells regardless of temporary forms, though.
Diffstat (limited to 'crawl-ref/source/spl-book.cc')
-rw-r--r--crawl-ref/source/spl-book.cc23
1 files changed, 15 insertions, 8 deletions
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index e844c50847..d7f69b3007 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -755,6 +755,7 @@ static bool _get_mem_list(spell_list &mem_spells,
unsigned int num_low_xl = 0;
unsigned int num_low_levels = 0;
unsigned int num_memable = 0;
+ bool form = false;
for (spells_to_books::iterator i = book_hash.begin();
i != book_hash.end(); ++i)
@@ -763,7 +764,7 @@ static bool _get_mem_list(spell_list &mem_spells,
if (spell == current_spell || you.has_spell(spell))
num_known++;
- else if (you_cannot_memorise(spell))
+ else if (you_cannot_memorise(spell, form))
num_race++;
else
{
@@ -802,12 +803,18 @@ static bool _get_mem_list(spell_list &mem_spells,
mprf(MSGCH_PROMPT, "You already know all available spells.");
else if (num_race == total || (num_known + num_race) == total)
{
- const bool lichform = (you.form == TRAN_LICH);
- const string species = "a " + species_name(you.species);
- mprf(MSGCH_PROMPT,
- "You cannot memorise any of the available spells because you "
- "are %s.", lichform ? "in Lich form"
- : lowercase_string(species).c_str());
+ if (form)
+ {
+ mprf(MSGCH_PROMPT, "You cannot currently memorise any of the "
+ "available spells because you are in %s form.",
+ uppercase_first(transform_name()).c_str());
+ }
+ else
+ {
+ mprf(MSGCH_PROMPT, "You cannot memorise any of the available "
+ "spells because you are %s.",
+ article_a(species_name(you.species)).c_str());
+ }
}
else if (num_low_levels > 0 || num_low_xl > 0)
{
@@ -1129,7 +1136,7 @@ string desc_cannot_memorise_reason(bool form)
if (form)
desc += "in " + uppercase_first(transform_name()) + " form";
else
- desc += "a " + lowercase_string(species_name(you.species));
+ desc += article_a(species_name(you.species));
desc += ".";