diff options
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 37d8e99a2b..800ddad4e7 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -143,17 +143,7 @@ static std::string _spell_base_description(spell_type spell, bool grey = false) desc << std::setw(30) << spell_title(spell); // spell schools - bool already = false; - for (int i = 0; i <= SPTYP_LAST_EXPONENT; ++i) - { - if (spell_typematch(spell, (1<<i))) - { - if (already) - desc << '/'; - desc << spelltype_name(1 << i); - already = true; - } - } + desc << spell_schools_string(spell); const int so_far = desc.str().length() - (grey ? 10 : 0); if (so_far < 60) @@ -2351,3 +2341,22 @@ std::string spell_range_string(spell_type spell) + "</darkgrey>"; } } + +std::string spell_schools_string(spell_type spell) +{ + std::string desc; + + bool already = false; + for (int i = 0; i <= SPTYP_LAST_EXPONENT; ++i) + { + if (spell_typematch(spell, (1<<i))) + { + if (already) + desc += "/"; + desc += spelltype_name(1 << i); + already = true; + } + } + + return (desc); +} |