summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-03-01 22:24:34 -0700
committerSteve Melenchuk <smelenchuk@gmail.com>2014-03-01 22:29:12 -0700
commit8965cfaeaf5031f6bf24bdef5d686d4090f7f50c (patch)
tree14252cd35ab3e0389d661b00ba8aac6ebe601d3d /crawl-ref/source/effects.cc
parent7bbdbfb4c8d38454437051ac89c9d7d541fb87a9 (diff)
downloadcrawl-ref-8965cfaeaf5031f6bf24bdef5d686d4090f7f50c.tar.gz
crawl-ref-8965cfaeaf5031f6bf24bdef5d686d4090f7f50c.zip
Finish making all scrolls read ID.
This includes identify, enchant armour, and recharging. A lot of now-unnecessary code goes away with this.
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 8888112fed..caecd38eaf 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -697,9 +697,26 @@ int recharge_wand(int item_slot, bool known, string *pre_msg)
item_slot = prompt_invent_item("Charge which item?", MT_INVLIST,
OSEL_RECHARGE, true, true, false);
}
- if (prompt_failed(item_slot))
+
+ if (item_slot == PROMPT_NOTHING)
return -1;
+ if (item_slot == PROMPT_ABORT)
+ {
+ if (known
+ || crawl_state.seen_hups
+ || yesno("Really abort (and waste the scroll)?", false, 0))
+ {
+ canned_msg(MSG_OK);
+ return known || crawl_state.seen_hups ? -1 : 0;
+ }
+ else
+ {
+ item_slot = -1;
+ continue;
+ }
+ }
+
item_def &wand = you.inv[ item_slot ];
if (!item_is_rechargeable(wand, known))
@@ -737,7 +754,7 @@ int recharge_wand(int item_slot, bool known, string *pre_msg)
desc = info;
}
- if (pre_msg)
+ if (known && pre_msg)
mpr(pre_msg->c_str());
mprf("%s %s for a moment%s.",
@@ -787,7 +804,7 @@ int recharge_wand(int item_slot, bool known, string *pre_msg)
if (!work)
return 0;
- if (pre_msg)
+ if (known && pre_msg)
mpr(pre_msg->c_str());
mprf("%s glows for a moment.", wand.name(DESC_YOUR).c_str());