summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/command.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-29 11:11:32 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-29 11:11:32 +0000
commit7fcfce7d250e09f85bc09f9e720dda5cf723e68e (patch)
treef70f14cb977e44bcded985b8527e7cd01ad50663 /crawl-ref/source/command.cc
parent10a49dc866d7cb5b0d5fe0400ae02f30e8be4d85 (diff)
downloadcrawl-ref-7fcfce7d250e09f85bc09f9e720dda5cf723e68e.tar.gz
crawl-ref-7fcfce7d250e09f85bc09f9e720dda5cf723e68e.zip
* Dump spells contained in randart spellbooks, marking memorised spells
with an asterisk. * Sif Muna no longer gifts the books specific to Kiku and Vehumet (Necronomicon, Annihilations, Demonology) though the spells contained there-in may crop up in randart books. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8011 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/command.cc')
-rw-r--r--crawl-ref/source/command.cc54
1 files changed, 1 insertions, 53 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index 1fbab5fdfe..7751761b85 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -1247,58 +1247,6 @@ static bool _append_books(std::string &desc, item_def &item, std::string key)
return (true);
}
-// Adds a list of all spells contained in a book or rod to its
-// description string.
-static void _append_spells(std::string &desc, const item_def &item)
-{
- if (!item.has_spells())
- return;
-
- desc += "$$Spells Type Level$";
-
- for (int j = 0; j < 8; j++)
- {
- spell_type stype = which_spell_in_book(item, j);
- if (stype == SPELL_NO_SPELL)
- continue;
-
- std::string name = spell_title(stype);
- desc += name;
- for (unsigned int i = 0; i < 35 - name.length(); i++)
- desc += " ";
-
- name = "";
- if (item.base_type == OBJ_STAVES)
- name += "Evocations";
- else
- {
- bool already = false;
-
- for (int i = 0; i <= SPTYP_LAST_EXPONENT; i++)
- {
- if (spell_typematch( stype, 1 << i ))
- {
- if (already)
- name += "/" ;
-
- name += spelltype_name( 1 << i );
- already = true;
- }
- }
- }
- desc += name;
-
- for (unsigned int i = 36; i < 65 - name.length(); i++)
- desc += " ";
-
- char sval[3];
- itoa( spell_difficulty( stype ), sval, 10 );
- desc += sval;
- desc += "$";
- }
-
-}
-
static bool _do_description(std::string key, std::string type,
std::string footer = "")
{
@@ -1411,7 +1359,7 @@ static bool _do_description(std::string key, std::string type,
|| get_item_by_name(&mitm[thing_created], name, OBJ_STAVES))
{
if (!_append_books(desc, mitm[thing_created], key))
- _append_spells(desc, mitm[thing_created]);
+ append_spells(desc, mitm[thing_created]);
}
else
_append_non_item(desc, key);