From 85e282c81b99e4c0a1f6433a25a55179f8481b0d Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 29 Dec 2008 19:27:55 +0000 Subject: * Also describe enchantment limits for weapons (+9, right?), missiles, and armour (+5 for body armour and bardings, else +2). Tidied up the code a bit. * Prettify waypoint messages as suggested by slinkies in FR 2329972. (I really should reread those tracker items before starting to code them...) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8021 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/describe.cc | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/describe.cc') diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 11892384bf..1ec8ed1c21 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1116,6 +1116,17 @@ static std::string _describe_weapon(const item_def &item, bool verbose) } } + if (!is_artefact(item)) + { + if (item_ident( item, ISFLAG_KNOW_PLUSES ) + && item.plus >= 9 && item.plus2 >= 9) + { + description += "$It is maximally enchanted."; + } + else + description += "$It can be maximally enchanted to +9, +9."; + } + return (description); } @@ -1243,6 +1254,11 @@ static std::string _describe_ammo( const item_def &item ) append_missile_info(description); + if (item_ident( item, ISFLAG_KNOW_PLUSES ) && item.plus >= 9) + description += "$It is maximally enchanted."; + else + description += "$It can be maximally enchanted to +9."; + return (description); } @@ -1414,6 +1430,19 @@ static std::string _describe_armour( const item_def &item, bool verbose ) } } + if (!is_artefact(item)) + { + const int max_ench = armour_max_enchant(item); + if (item.plus < max_ench || !item_ident( item, ISFLAG_KNOW_PLUSES )) + { + description += "$It can be maximally enchanted to "; + _append_value(description, max_ench, false); + description += "."; + } + else + description += "$It is maximally enchanted."; + } + return description; } @@ -1881,7 +1910,8 @@ std::string get_item_description( const item_def &item, bool verbose, if (item_type_known(item)) { const int max_charges = 3 * wand_charge_value(item.sub_type); - if (item.plus < max_charges) + if (item.plus < max_charges + || !item_ident(item, ISFLAG_KNOW_PLUSES)) { description << "$It can have at most " << max_charges << " charges."; -- cgit v1.2.3-54-g00ecf