From 3aa8f2c3c6a065779bdb64db863fbb4fcf8102c8 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 30 Dec 2008 12:31:12 +0000 Subject: * Fix charge/enchantment description leaking information about unidentified items. * Add two new inscriptions: {fully charged} and {tried on item} * Add freshness to default sort_menus (sorting chunks by age) One question: Is it guaranteed that artefacts (of any type) will have different descriptions than ego items? If so, we should probably display the "This is an ancient artefact. It cannot be modified by any means. It may have hidden properties" text for unidentified ones. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8030 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/describe.cc | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'crawl-ref/source/describe.cc') diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 3f3be7e6c6..a2ba75be49 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1116,7 +1116,7 @@ static std::string _describe_weapon(const item_def &item, bool verbose) } } - if (!is_artefact(item)) + if (!is_known_artefact(item)) { if (item_ident( item, ISFLAG_KNOW_PLUSES ) && item.plus >= MAX_WPN_ENCHANT && item.plus2 >= MAX_WPN_ENCHANT) @@ -1440,7 +1440,7 @@ static std::string _describe_armour( const item_def &item, bool verbose ) } } - if (!is_artefact(item)) + if (!is_known_artefact(item)) { const int max_ench = armour_max_enchant(item); if (item.plus < max_ench || !item_ident( item, ISFLAG_KNOW_PLUSES )) @@ -1724,7 +1724,7 @@ bool is_dumpable_artefact( const item_def &item, bool verbose) { bool ret = false; - if (is_artefact( item ) ) + if (is_known_artefact( item )) { ret = item_ident( item, ISFLAG_KNOW_PROPERTIES ); } @@ -1820,7 +1820,7 @@ std::string get_item_description( const item_def &item, bool verbose, { std::string db_name = item.name(DESC_DBNAME, true, false, false); std::string db_desc = getLongDescription(db_name); - if (!noquote && !is_artefact(item)) + if (!noquote && !is_known_artefact(item)) { const unsigned int lineWidth = get_number_of_cols(); const int height = get_number_of_lines(); @@ -2004,24 +2004,33 @@ std::string get_item_description( const item_def &item, bool verbose, break; case OBJ_STAVES: - if (item_type_known(item)) + if (item_is_rod( item )) { - 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 * ROD_CHARGE_MULT; + if (item_ident(item, ISFLAG_KNOW_PLUSES) + && item.plus2 >= max_charges && item.plus >= item.plus2) { - description << - "$It uses its own mana reservoir for casting spells, and " - "recharges automatically by channeling mana from its " - "wielder."; + description << "$It is fully charged."; } else { - description << - "$Damage rating: 7 Accuracy rating: +6 " - "Attack delay: 120%"; - - description << "$$It falls into the 'staves' category."; + description << "$It can have at most " << max_charges + << " charges."; } } + else + { + description << + "$Damage rating: 7 Accuracy rating: +6 " + "Attack delay: 120%"; + + description << "$$It falls into the 'staves' category."; + } break; case OBJ_MISCELLANY: -- cgit v1.2.3-54-g00ecf