summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/invent.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-27 10:10:27 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-27 10:10:27 +0000
commit0a5123f9f193aff98a112bdc915ef94aa819cc5d (patch)
tree3516fa78da5aa339667e4911e192beda5fcc726b /crawl-ref/source/invent.cc
parent556886168570d1bc5996e07182ab0b4225063144 (diff)
downloadcrawl-ref-0a5123f9f193aff98a112bdc915ef94aa819cc5d.tar.gz
crawl-ref-0a5123f9f193aff98a112bdc915ef94aa819cc5d.zip
Fixed !R inscription not confirming remove when only one item is worn (jarpiain).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2618 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/invent.cc')
-rw-r--r--crawl-ref/source/invent.cc30
1 files changed, 28 insertions, 2 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index bc48e94588..f8af3d11e1 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -1069,15 +1069,41 @@ static bool check_old_item_warning( const item_def& item,
return yesno(prompt.c_str(), false, 'n');
}
+static std::string operation_verb(operation_types oper)
+{
+ switch (oper)
+ {
+ case OPER_WIELD: return "wield";
+ case OPER_QUAFF: return "quaff";
+ case OPER_DROP: return "drop";
+ case OPER_EAT: return "eat";
+ case OPER_TAKEOFF: return "take off";
+ case OPER_WEAR: return "wear";
+ case OPER_PUTON: return "put on";
+ case OPER_REMOVE: return "remove";
+ case OPER_READ: return "read";
+ case OPER_MEMORISE: return "memorise from";
+ case OPER_ZAP: return "zap";
+ case OPER_THROW: return "throw";
+ case OPER_EXAMINE: return "examine";
+ case OPER_FIRE: return "fire";
+ case OPER_PRAY: return "sacrifice";
+ case OPER_EVOKE: return "evoke";
+ case OPER_ANY:
+ default:
+ return "choose";
+ }
+}
+
/* return true if user OK'd it (or no warning), false otherwise */
bool check_warning_inscriptions( const item_def& item,
operation_types oper )
{
if (is_valid_item( item ) && has_warning_inscription(item, oper) )
{
- std::string prompt = "Really choose ";
+ std::string prompt = "Really " + operation_verb(oper) + " ";
prompt += item.name(DESC_INVENTORY);
- prompt += '?';
+ prompt += "? ";
return (yesno(prompt.c_str(), false, 'n')
&& check_old_item_warning(item, oper));
}