a spell's description, pressing 'M' will try to memorise that spell from
that particular book.
FR 2815575: Instead of moving "spell levels left" to the top of the spell memorisation menu, make it light-green in color.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10558 c06c8d41-db1a-0410-9941-cceddc491573
C35MTVNINKCQBR7V52L7SLPO7455LDCQ5MBBXJFPQKJBF43JHRPQC
M37SPVN6HIVMCINBTCAJSEJDLM67DWEZRCR45QTIILJ2XQ73ZF6QC
EZOLOYGEKWHZKTETREC3LK3RZFRBJJHR6O4EQT2WOZYXLFYPDXVQC
BFCFMN2BXNLXJCYYCL2V2XTDQQNM3PJPSRB6CU76FM3332NC7GMAC
4NNN5LKBZLDXMDN2322PBG7WFHF4TWOEMVODSO7BXXCM3AZKQN4QC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
TRZAZJJA5VQBJ65SO5H5DNSILIZEJHIZCBYEBHEATCT6ZSMWIFKQC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
I6BG7QKQHT7OMBMSD5LN6ILPSZOT6RM4RY3VB2HFUXZMWQTZPW2AC
LZ4UZ7OHXQZ6KQHDKAJ53SYUDICKYODTPDYK52PEBLWUFU6BZIHAC
JZTWTPXIUEVACX5B6FYQRVRJD3KQN653C4G4GXT2VSMX4EP7WS3AC
RBAGQ2PB7V5YAM5KSHSZR2E3MLKDSRVM5XYGI2TIXP5QMVBOQHDQC
SVY2PTCLXR3KNPQAWXVXTTGCC5DR334HOAKHYO3VDDRWM2BWMALAC
JVSCP4FTW2G57C6YD5HZOZXTODGZH7TR75JQGFJBEPX3LCZH236QC
UEI5JAVCMN7Y2SACTEZPZSNFJWOJTC55G24Q6LKQCT4XNDH5ZQIAC
DDU4A3JGN5IUIPP5IASOODKPR2WBHSDSV4FITZ6HNXNSXXQACWAQC
25CH7HH4LKXFIZ75YNMXS3TSXO6O27DYSOPLOD45K4OCNFWLS4LQC
out.cprintf( "Select a spell to read its description." EOL );
if (book.base_type == OBJ_BOOKS && in_inventory(book))
out.cprintf( "Select a spell to read its description or to "
"memorise it." EOL );
else
out.cprintf( "Select a spell to read its description." EOL );
if (player_spell_levels() < spell_levels_required(specspell))
spells_to_books::iterator it = book_hash.find(specspell);
item_def book;
book.base_type = OBJ_BOOKS;
book.sub_type = it->second;
book.quantity = 1;
book.flags |= ISFLAG_IDENT_MASK;
return learn_spell(specspell, book, true);
}
bool learn_spell(spell_type specspell, const item_def &book,
bool is_safest_book)
{
if (!can_learn_spell())
return (false);
if (you_cannot_memorise(specspell))
mpr("You can't memorise that many levels of magic yet!");
mprf("You cannot memorise that spell because you are a %s.",
lowercase_string(species_name(you.species, 0)).c_str());
return (false);
}
if (player_knows_spell(specspell))
{
mpr("You already know that spell!");
return (false);
}
if (you.spell_no >= 21 && specspell != SPELL_SELECTIVE_AMNESIA)
{
mpr("Your head is already too full of spells!");
char buf[180];
if (is_safest_book)
prompt = "The only spellbook you have which contains that spell ";
else
prompt = "The spellbook you are reading from ";
prompt += make_stringf("is %s, a dangerous spellbook which will "
"strike back at you if your memorisation "
"attempt fails. Attempt to memorise anyway?",
book.name(DESC_NOCAP_THE).c_str());
sprintf(buf, "The only spellbook you have which contains that spell "
"is %s, a dangerous spellbook which will strike back at you "
"if your memorisation attempt fails. Attempt to memorise "
"anyway?",
book.name(DESC_NOCAP_THE).c_str());
if (!yesno(buf, false, 'n'))
if (!yesno(prompt.c_str(), false, 'n'))