diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-27 10:10:27 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-27 10:10:27 +0000 |
commit | 0a5123f9f193aff98a112bdc915ef94aa819cc5d (patch) | |
tree | 3516fa78da5aa339667e4911e192beda5fcc726b /crawl-ref/source | |
parent | 556886168570d1bc5996e07182ab0b4225063144 (diff) | |
download | crawl-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')
-rw-r--r-- | crawl-ref/source/invent.cc | 30 | ||||
-rw-r--r-- | crawl-ref/source/item_use.cc | 6 |
2 files changed, 34 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)); } diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index d614bc768c..8113033a6b 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -2836,6 +2836,12 @@ bool remove_ring(int slot, bool announce) return (false); } } + else if (!check_warning_inscriptions(you.inv[you.equip[hand_used]], + OPER_REMOVE)) + { + canned_msg(MSG_OK); + return (false); + } if (you.equip[EQ_GLOVES] != -1 && item_cursed( you.inv[you.equip[EQ_GLOVES]] ) |