diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-09-10 21:34:21 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-09-10 21:34:21 +0000 |
commit | af7fe6ad37f466a8e926cc29765197f5b0e7224f (patch) | |
tree | f2362740ab56fec3d7f6018688c79221e9974615 /crawl-ref/source/describe.cc | |
parent | 1d23ad9eae6203fcabc6b1f9a933174bc907f2a9 (diff) | |
download | crawl-ref-af7fe6ad37f466a8e926cc29765197f5b0e7224f.tar.gz crawl-ref-af7fe6ad37f466a8e926cc29765197f5b0e7224f.zip |
Display spell cost, success chance, schools, power, range, and hunger in
the new tiles display (in the title, quantity, mouse-over description, and
right-click description).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10649 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r-- | crawl-ref/source/describe.cc | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 08afab6671..4dd09e5d6d 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -50,6 +50,7 @@ REVISION("$Rev$"); #include "spells3.h" #include "spl-book.h" #include "stuff.h" +#include "spl-cast.h" #include "spl-util.h" #include "transfor.h" #include "tutorial.h" @@ -1562,26 +1563,10 @@ void append_spells(std::string &desc, const item_def &item) for (unsigned int i = 0; i < 35 - name.length(); ++i) desc += " "; - name = ""; if (item.base_type == OBJ_STAVES) - name += "Evocations"; + desc += "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; + desc += spell_schools_string(stype); for (unsigned int i = 36; i < 65 - name.length(); ++i) desc += " "; @@ -2424,6 +2409,26 @@ bool _get_spell_description(const spell_type spell, std::string &description, description += "(M)emorise this spell."; return (true); } +#ifdef USE_TILE + else + { + const std::string schools = spell_schools_string(spell); + snprintf(info, INFO_SIZE, + "$Level: %d School%s: %s (%s)", + spell_difficulty(spell), + schools.find("/") != std::string::npos ? "s" : "", + schools.c_str(), + failure_rate_to_string(spell_fail(spell))); + description += info; + + description += "$$Power : "; + description += spell_power_string(spell); + description += "$Range : "; + description += spell_range_string(spell); + description += "$Hunger: "; + description += spell_hunger_string(spell); + } +#endif return (false); } |