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-01-13 20:34:46 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-13 20:34:46 +0000
commitdf31ea9fdcfedf252e62f6bf0c5cff53df4b93d0 (patch)
tree2d7966f0f0eac61f1c17fa7182aa2ea22490a98f /crawl-ref/source/item_use.cc
parent0962c7818135807861f1f8d659a952a8ea8f4ddb (diff)
downloadcrawl-ref-df31ea9fdcfedf252e62f6bf0c5cff53df4b93d0.tar.gz
crawl-ref-df31ea9fdcfedf252e62f6bf0c5cff53df4b93d0.zip
Mixed commit of small additions/changes.
FR 1870139: output "Tele" among enchantment abbrevs when "about to teleport" FR 1834016: print item slots along with rotting message (I added an option for this as I personally don't need this.) Gods: * Add ^ line for Zin's mutation protection. * Modify protection from harm adjectives in ^ screen to make difference between Ely and Zin/TSO more obvious. Tiles: Bug 1870238: Show mimics to be "autopickuable" (green frame). * Smarter handling of L-click actions in inventory. * code clean-up git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3269 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index e5b12df2ef..4a7237c0f2 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -4415,11 +4415,14 @@ void tile_use_item(int idx, InvAction act)
// Equipped?
bool equipped = false;
+ bool equipped_weapon = false;
for (unsigned int i=0; i< NUM_EQUIP;i++)
{
if (you.equip[i] == idx)
{
equipped = true;
+ if (i == EQ_WEAPON)
+ equipped_weapon = true;
break;
}
}
@@ -4428,7 +4431,11 @@ void tile_use_item(int idx, InvAction act)
// Special case for folks who are wielding something
// that they shouldn't be wielding.
- if (you.equip[EQ_WEAPON] == idx)
+ // Note that this is only a problem for equipables
+ // (otherwise it would only waste a turn)
+ if (you.equip[EQ_WEAPON] == idx
+ && (you.inv[idx].base_type == OBJ_ARMOUR
+ || you.inv[idx].base_type == OBJ_JEWELLERY))
{
if (!check_warning_inscriptions(you.inv[idx], OPER_WIELD))
return;
@@ -4437,6 +4444,7 @@ void tile_use_item(int idx, InvAction act)
return;
}
+
// Use it
switch (you.inv[idx].base_type)
{
@@ -4472,7 +4480,7 @@ void tile_use_item(int idx, InvAction act)
return;
case OBJ_ARMOUR:
- if (equipped)
+ if (equipped && !equipped_weapon)
{
if (!check_warning_inscriptions(you.inv[idx], OPER_TAKEOFF))
return;
@@ -4493,8 +4501,12 @@ void tile_use_item(int idx, InvAction act)
return;
case OBJ_CORPSES:
- if (you.species != SP_VAMPIRE)
+ if (you.species != SP_VAMPIRE
+ || you.inv[idx].sub_type == CORPSE_SKELETON
+ || you.inv[idx].special < 100)
+ {
break;
+ }
// intentional fall-through for Vampires
case OBJ_FOOD:
if (!check_warning_inscriptions(you.inv[idx], OPER_EAT))
@@ -4520,7 +4532,7 @@ void tile_use_item(int idx, InvAction act)
return;
case OBJ_JEWELLERY:
- if (equipped)
+ if (equipped && !equipped_weapon)
{
if (!check_warning_inscriptions(you.inv[idx], OPER_REMOVE))
return;