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>2009-06-08 11:19:12 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-08 11:19:12 +0000
commitd4577487e64c62a629be512f5f21404e3192a0fe (patch)
tree504eb853c918e5b2e46729f42ad86173470edc27 /crawl-ref/source/item_use.cc
parentd5f262eb187ed2a96b0216103210c8ba8057d59c (diff)
downloadcrawl-ref-d4577487e64c62a629be512f5f21404e3192a0fe.tar.gz
crawl-ref-d4577487e64c62a629be512f5f21404e3192a0fe.zip
Apply tiles inscription fixes to trunk.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9922 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc53
1 files changed, 18 insertions, 35 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 37ab147cc9..d82638b0d0 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -24,9 +24,7 @@ REVISION("$Rev$");
#include "cloud.h"
#include "command.h"
#include "debug.h"
-#ifdef USE_TILE
#include "decks.h"
-#endif
#include "delay.h"
#include "describe.h"
#include "directn.h"
@@ -181,9 +179,12 @@ static bool _valid_weapon_swap(const item_def &item)
if (item.base_type == OBJ_WEAPONS || item.base_type == OBJ_STAVES)
return (true);
- // Misc. items need to be wielded to be evoked.
- if (item.base_type == OBJ_MISCELLANY && item.sub_type != MISC_RUNE_OF_ZOT)
+ // Some misc. items need to be wielded to be evoked.
+ if (is_deck(item) || item.base_type == OBJ_MISCELLANY
+ && item.sub_type == MISC_LANTERN_OF_SHADOWS)
+ {
return (true);
+ }
// Some missiles need to be wielded for spells.
if (item.base_type == OBJ_MISSILES)
@@ -5424,23 +5425,11 @@ void tile_item_use_secondary(int idx)
if (check_warning_inscriptions(item, OPER_FIRE))
fire_thing(idx); // fire weapons
}
- else if (item.base_type == OBJ_MISCELLANY
- || item.base_type == OBJ_STAVES
- && item_is_rod(item)) // unwield rods/misc. items
- {
- if (you.equip[EQ_WEAPON] == idx
- && check_warning_inscriptions(item, OPER_WIELD))
- {
- wield_weapon(true, PROMPT_GOT_SPECIAL); // unwield
- }
- }
- else if (you.equip[EQ_WEAPON] == idx
- && check_warning_inscriptions(item, OPER_WIELD))
+ else if (you.equip[EQ_WEAPON] == idx)
{
wield_weapon(true, PROMPT_GOT_SPECIAL); // unwield
}
- else if (_valid_weapon_swap(item)
- && check_warning_inscriptions(item, OPER_WIELD))
+ else if (_valid_weapon_swap(item))
{
// secondary wield for several spells and such
wield_weapon(true, idx); // wield
@@ -5473,37 +5462,36 @@ void tile_item_use(int idx)
&& (item.base_type == OBJ_ARMOUR
|| item.base_type == OBJ_JEWELLERY))
{
- if (!check_warning_inscriptions(item, OPER_WIELD))
- return;
-
wield_weapon(true, PROMPT_GOT_SPECIAL);
return;
}
+ const int type = item.base_type;
+
// Use it
- switch (item.base_type)
+ switch (type)
{
case OBJ_WEAPONS:
case OBJ_STAVES:
case OBJ_MISCELLANY:
+ case OBJ_WANDS:
// Wield any unwielded item of these types.
if (!equipped
- && (item.base_type != OBJ_MISCELLANY || is_deck(item)
- || item.sub_type == MISC_LANTERN_OF_SHADOWS))
+ && (type == OBJ_WEAPONS || type == OBJ_STAVES || is_deck(item)
+ || type == OBJ_MISCELLANY
+ && item.sub_type == MISC_LANTERN_OF_SHADOWS))
{
- if (check_warning_inscriptions(item, OPER_WIELD))
- wield_weapon(true, idx);
+ wield_weapon(true, idx);
return;
}
- // Evoke misc. items and rods.
+ // Evoke misc. items, rods, or wands.
if (item_is_evokable(item))
{
- if (check_warning_inscriptions(item, OPER_EVOKE))
- evoke_item(idx);
+ evoke_item(idx);
return;
}
// Unwield wielded items.
- if (equipped && check_warning_inscriptions(item, OPER_WIELD))
+ if (equipped)
wield_weapon(true, PROMPT_GOT_SPECIAL); // unwield
return;
@@ -5527,11 +5515,6 @@ void tile_item_use(int idx)
wear_armour(idx);
return;
- case OBJ_WANDS:
- if (check_warning_inscriptions(item, OPER_ZAP))
- zap_wand(idx);
- return;
-
case OBJ_CORPSES:
if (you.species != SP_VAMPIRE
|| item.sub_type == CORPSE_SKELETON