summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/invent.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-12 14:25:50 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-12 14:25:50 +0000
commit71e8cf1a93945211047ab78c851290e92938f6d1 (patch)
tree9231eb554aadafece148fabbcbf6e4d6d696ecda /crawl-ref/source/invent.cc
parent682e94e3c1534de75cc217733aa669798b9065ab (diff)
downloadcrawl-ref-71e8cf1a93945211047ab78c851290e92938f6d1.tar.gz
crawl-ref-71e8cf1a93945211047ab78c851290e92938f6d1.zip
Fix new firing interface to also apply when selecting items via tile inventory.
(This will also change the quiver, so that tile players no longer need to repeatedly choose the same stack of darts to fire: ff will work nicely.) Implement first part of FR 1911866: merging W/T, R/P The existing option "easy_unequip" now also allows direct choice of which armour to take off from the 'W' menu, and same for jewellery for 'P'. Warning inscriptions are respected. Now we only need to add a new sorting option sort_equipped that takes care of equipped stuff being listed first in the inventory. Last time I tried something like this (chunk sorting by age) I failed miserably, so I'm making no promises. Also tweak my recent {tried} modification to only apply to jewellery since for some reasons all unidentified randart weapons show {tried} where jewellery is really picky about which randarts have been tried and which haven't. Probably still needs fixing. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3607 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/invent.cc')
-rw-r--r--crawl-ref/source/invent.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index bda888740b..c0351d28e1 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -1144,6 +1144,38 @@ bool check_warning_inscriptions( const item_def& item,
{
if (is_valid_item( item ) && has_warning_inscription(item, oper) )
{
+ if (oper == OPER_WEAR)
+ {
+ if (item.base_type != OBJ_ARMOUR)
+ return (true);
+
+ // don't ask if item already worn
+ int equip = you.equip[get_armour_slot(item)];
+ if (equip != -1 && item.link == equip)
+ return (check_old_item_warning(item, oper));
+ }
+ else if (oper == OPER_PUTON)
+ {
+ if (item.base_type != OBJ_JEWELLERY)
+ return (true);
+
+ // don't ask if item already worn
+ int equip = -1;
+ if (jewellery_is_amulet(item))
+ equip = you.equip[EQ_AMULET];
+ else
+ {
+ equip = you.equip[EQ_LEFT_RING];
+ if (equip != -1 && item.link == equip)
+ return (check_old_item_warning(item, oper));
+ // or maybe the other ring?
+ equip = you.equip[EQ_RIGHT_RING];
+ }
+
+ if (equip != -1 && item.link == equip)
+ return (check_old_item_warning(item, oper));
+ }
+
std::string prompt = "Really " + operation_verb(oper) + " ";
prompt += item.name(DESC_INVENTORY);
prompt += "? ";