books. Fix titles such as "Sif Muna's A Primer on Magic". Add a fourth step for fixed level naming: starting for level 1.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8860 c06c8d41-db1a-0410-9941-cceddc491573
3CRSIZM7N5F46UWBKM2Y3CNKADWZGLI4JWMUO762ND2TT4247RGQC
ED7MV353FW7C4KZWLXUOEULWZZWMRCJVWMLAFC5OLCKZNPDBLQAQC
CEZMQA2KOTLG7IO5QBVAM2OALIZJ45CFLNLCG3OQA6IX6URDCCYAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
JVFPF4MBNVY2UEXPWJDKTWL6RY7WCXPB6GBOK3WPJOGM6CX3D7HQC
UC6V7JDZ6CKQNL5AARWFJ4ZPX4ZYCO5J3FW52I52I3PBJO6T6VEAC
2I5XEYRJKLUS7MO42MCR6KT2URGFQ3YDKTNTIBNKVKLX5LMG6CEQC
CCRQESB4ADT4WA7FGLNZZXAJ6G5QMCTYCZIWORBN45P6ZPILC34AC
3KBPG2GCDMENTQJY6UARZAWI57CKHP5JO24LRN243OP4WTUPFK4QC
if (bookname.find("@level@", 0) != std::string::npos)
{
std::string number;
switch (level)
{
case 1: number = "One"; break;
case 2: number = "Two"; break;
case 3: number = "Three"; break;
case 4: number = "Four"; break;
case 5: number = "Five"; break;
case 6: number = "Six"; break;
case 7: number = "Seven"; break;
case 8: number = "Eight"; break;
case 9: number = "Nine"; break;
default:
number = ""; break;
}
bookname = replace_all(bookname, "@level@", number);
}
// ... and change disc1 and disc2 accordingly.
disc1 = 1 << max1;
if (max1 == max2)
disc2 = disc1;
else
disc2 = 1 << max2;
// Every spell in the book is of school disc1.
if (disc1 == disc2)
all_spells_disc1 = true;
// For the actual name there's a 50% chance of getting something like
// Flames and Displacement (Fire/Translocation), else
// Fiery Translocation
// For the actual name there's a 66% chance of getting something like
// <book> of the Fiery Traveller (Translocation/Fire), else
// <book> of Displacement and Flames.
# Fixed level books are categorized into "easy" (level 1-3),
# "moderate" (level 4-6) and "difficult" (level 7-9), a keyword that is
# used as a prefix for "level book".
# Fixed level books are categorized into "starting" (level 1),
# "easy" (level 2-4), "moderate" (level 4-6) and "difficult" (level 7-9),
# a keyword that is used as a prefix for "level book".
# @level@ is parsed to the word describing the spell level.
# level 1-3
# level 1
starting level book
@the_book_magic@ for @beginners@
w:2
@the_book_magic@ 101
A Beginning Course on @the_book_magic@
@the_book_magic@, Part One
An Introduction to @the_book_magic@
w:2
An Initiation to @the_book_magic@
First Steps in @the_book_magic@
%%%%
# level 2-4