summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-03 23:09:10 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-03 23:09:10 +0000
commit30e4163e934e8f9dcd201e1cfba1a13a7f3b79c3 (patch)
treec10066a70df3e56145fc9d36cfc8986415b8d3d1 /crawl-ref/source/itemprop.cc
parent610652dba6b72b800879510c3e715c1aeb4e5747 (diff)
downloadcrawl-ref-30e4163e934e8f9dcd201e1cfba1a13a7f3b79c3.tar.gz
crawl-ref-30e4163e934e8f9dcd201e1cfba1a13a7f3b79c3.zip
[FR 1903593] Change identification process of
?recharging, ?enchant armour and ?identify. If you read one of these scrolls and the type isn't known yet you are prompted with "Modify which item?" (better message needed!) and get to choose from the entire inventory. If the chosen item can be usefully "modified" by the scroll (unID'd item for identify, wand for recharging, enchantable armour for EA) the usual effect takes place and the scroll is identified. (Reading other scrolls of the same type will then only offer a more sensible selection of items.) Otherwise, nothing happens. Further, recharging and enchant armour now allow direct choice of the item in question, and it doesn't even have to be wielded or worn. I think this change actually makes the id game more interesting and also improves the interface. Gameplay might dictate that we reintroduce the "armour needs to be worn" rule, but that remains to be seen until after some more playtesting. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3514 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r--crawl-ref/source/itemprop.cc41
1 files changed, 41 insertions, 0 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 86e20cd1d2..73e90c32dd 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -1284,6 +1284,47 @@ bool check_armour_shape( const item_def &item, bool quiet )
return (true);
}
+bool item_is_rechargable(const item_def &it, bool known)
+{
+ // These are obvious
+ if (it.base_type == OBJ_WANDS || item_is_rod(it))
+ return (true);
+
+ // ... but electro-weapons can also be charged
+ return ( it.base_type == OBJ_WEAPONS
+ && !is_random_artefact( it )
+ && !is_fixed_artefact( it )
+ && get_weapon_brand( it ) == SPWPN_ELECTROCUTION
+ && (!known || item_type_known(it)) );
+}
+
+bool is_enchantable_armour(const item_def &arm, bool uncurse)
+{
+ if (arm.base_type != OBJ_ARMOUR)
+ return (false);
+
+ // only equipped items should be affected
+// if (!item_is_equipped(arm))
+// return (false);
+
+ // artefacts cannot be enchanted
+ if (is_fixed_artefact( arm )
+ || is_random_artefact( arm ))
+ {
+ return (uncurse && item_cursed( arm )); // ?EA may uncurse artefacts
+ }
+
+ // Nor can highly enchanted items
+ if ( arm.plus >= 2
+ && (arm.sub_type >= ARM_CLOAK && arm.sub_type <= ARM_BOOTS
+ || is_shield(arm)) )
+ {
+ return (uncurse && item_cursed( arm )); // ?EA may uncurse item
+ }
+
+ return (true);
+}
+
//
// Weapon information and checking functions:
//