summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-30 12:31:12 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-30 12:31:12 +0000
commit3aa8f2c3c6a065779bdb64db863fbb4fcf8102c8 (patch)
treebe2729a1a305593cf6562b3aa9b76e81c01a899b /crawl-ref/source/item_use.cc
parentbeac344a52eafddd8a3ae1d67635773cf9216325 (diff)
downloadcrawl-ref-3aa8f2c3c6a065779bdb64db863fbb4fcf8102c8.tar.gz
crawl-ref-3aa8f2c3c6a065779bdb64db863fbb4fcf8102c8.zip
* 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
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc22
1 files changed, 18 insertions, 4 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index a1d9ba74a8..e503e5b4a2 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -3562,7 +3562,7 @@ void zap_wand(int slot)
wand.plus--;
// Zap counts count from the last recharge.
- if (wand.plus2 == ZAPCOUNT_RECHARGED)
+ if (wand.plus2 == ZAPCOUNT_MAX_CHARGED || wand.plus2 == ZAPCOUNT_RECHARGED)
wand.plus2 = 0;
// Increment zap count.
if (wand.plus2 >= 0)
@@ -4391,6 +4391,7 @@ void read_scroll(int slot)
// It is the exception, not the rule, that the scroll will not
// be identified. {dlb}
bool id_the_scroll = true; // to prevent unnecessary repetition
+ bool tried_on_item = false; // used to modify item (?EA, ?RC, ?ID)
switch (which_scroll)
{
@@ -4545,27 +4546,39 @@ void read_scroll(int slot)
case SCR_VORPALISE_WEAPON:
id_the_scroll = _vorpalise_weapon();
- if ( !id_the_scroll )
+ if (!id_the_scroll)
canned_msg(MSG_NOTHING_HAPPENS);
break;
case SCR_IDENTIFY:
if (!item_type_known(scroll))
+ {
id_the_scroll = _scroll_modify_item(scroll);
+ if (!id_the_scroll)
+ tried_on_item = true;
+ }
else
identify(-1);
break;
case SCR_RECHARGING:
if (!item_type_known(scroll))
+ {
id_the_scroll = _scroll_modify_item(scroll);
+ if (!id_the_scroll)
+ tried_on_item = true;
+ }
else
recharge_wand(-1);
break;
case SCR_ENCHANT_ARMOUR:
if (!item_type_known(scroll))
+ {
id_the_scroll = _scroll_modify_item(scroll);
+ if (!id_the_scroll)
+ tried_on_item = true;
+ }
else
_handle_enchant_armour(-1);
break;
@@ -4633,8 +4646,9 @@ void read_scroll(int slot)
break;
}
- set_ident_type(scroll,
- (id_the_scroll) ? ID_KNOWN_TYPE : ID_TRIED_TYPE);
+ set_ident_type(scroll, id_the_scroll ? ID_KNOWN_TYPE :
+ tried_on_item ? ID_TRIED_ITEM_TYPE
+ : ID_TRIED_TYPE);
// Finally, destroy and identify the scroll.
// Scrolls of immolation were already destroyed earlier.