From af7fe6ad37f466a8e926cc29765197f5b0e7224f Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 10 Sep 2009 21:34:21 +0000 Subject: 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 --- crawl-ref/source/describe.cc | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'crawl-ref/source/describe.cc') 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); } -- cgit v1.2.3-54-g00ecf