summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/describe.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-23 21:08:10 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-23 21:08:10 +0000
commit2bcedfdf3c59078e54d15d03b3a9473ed4bdd44b (patch)
treeba54660d8b3ecaa06b113aa13c9f4c104a9d0fd1 /crawl-ref/source/describe.cc
parentc38a52f9377b9f87e66cdccfeab2abbaa72faad8 (diff)
downloadcrawl-ref-2bcedfdf3c59078e54d15d03b3a9473ed4bdd44b.tar.gz
crawl-ref-2bcedfdf3c59078e54d15d03b3a9473ed4bdd44b.zip
* Allow viewing of card descriptions from Triple Draw and Stack Deck.
* Sort items in 'V' screen according to pickup menu sort order. * Name Xom's randart book gifts more randomly. * Colour items seen by 'x' with message colour tags and same for pickup messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9541 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r--crawl-ref/source/describe.cc46
1 files changed, 28 insertions, 18 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index c57a3beb73..2150e15e31 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -1966,29 +1966,40 @@ std::string get_item_description( const item_def &item, bool verbose,
case OBJ_STAVES:
if (item_is_rod( item ))
{
- description <<
- "$It uses its own mana reservoir for casting spells, and "
- "recharges automatically by channeling mana from its "
- "wielder.";
-
- const int max_charges = MAX_ROD_CHARGE;
- if (item_ident(item, ISFLAG_KNOW_PLUSES))
+ if (verbose)
{
- const int num_charges = item.plus2 / ROD_CHARGE_MULT;
- if (max_charges > num_charges)
+ description <<
+ "$It uses its own mana reservoir for casting spells, and "
+ "recharges automatically by channeling mana from its "
+ "wielder.";
+
+ const int max_charges = MAX_ROD_CHARGE;
+ if (item_ident(item, ISFLAG_KNOW_PLUSES))
{
- description << "$It can currently hold " << num_charges
- << " charges. It can be magically recharged "
- << "to contain up to " << max_charges
- << " charges.";
+ const int num_charges = item.plus2 / ROD_CHARGE_MULT;
+ if (max_charges > num_charges)
+ {
+ description << "$It can currently hold " << num_charges
+ << " charges. It can be magically recharged "
+ << "to contain up to " << max_charges
+ << " charges.";
+ }
+ else
+ description << "$It is fully charged.";
}
else
- description << "$It is fully charged.";
+ {
+ description << "$It can have at most " << max_charges
+ << " charges.";
+ }
}
- else
+ else if (Options.dump_book_spells)
{
- description << "$It can have at most " << max_charges
- << " charges.";
+ append_spells( desc, item );
+ if (desc.empty())
+ need_extra_line = false;
+ else
+ description << desc;
}
}
else
@@ -2208,7 +2219,6 @@ static bool _show_item_description(const item_def &item)
const unsigned int lineWidth = get_number_of_cols() - 1;
const int height = get_number_of_lines();
- describe_info inf;
std::string desc =
get_item_description(item, true, false, Options.tutorial_left);