summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-11 22:16:30 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-11 22:16:30 +0000
commitdb37e43a07959371149a08dda64db664455b4d59 (patch)
treecb6e2392bb371ec618785c622d33235c5710aef8 /crawl-ref/source/itemprop.cc
parent0b8e38c4f5fbfbfa72180c48de2027ff9851bb67 (diff)
downloadcrawl-ref-db37e43a07959371149a08dda64db664455b4d59.tar.gz
crawl-ref-db37e43a07959371149a08dda64db664455b4d59.zip
Properly disallow randart versions of mundane items.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9417 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r--crawl-ref/source/itemprop.cc24
1 files changed, 21 insertions, 3 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index cbfb90505d..19ca2226ea 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -528,9 +528,7 @@ void do_uncurse_item( item_def &item )
item.flags &= (~ISFLAG_CURSED);
}
-//
-// Is item stationary (cannot be picked up?)
-//
+// Is item stationary (cannot be picked up)?
void set_item_stationary( item_def &item )
{
if (item.base_type == OBJ_MISSILES && item.sub_type == MI_THROWING_NET)
@@ -573,6 +571,26 @@ bool item_is_critical(const item_def &item)
&& item.plus != RUNE_ABYSSAL);
}
+// Is item something that no one would bother enchanting?
+bool item_is_mundane(const item_def &item)
+{
+ bool retval = false;
+
+ switch (item.base_type)
+ {
+ case OBJ_WEAPONS:
+ retval = (item.sub_type == WPN_CLUB
+ || item.sub_type == WPN_GIANT_CLUB
+ || item.sub_type == WPN_GIANT_SPIKED_CLUB
+ || item.sub_type == WPN_KNIFE);
+ break;
+ default:
+ break;
+ }
+
+ return (retval);
+}
+
void set_ident_flags( item_def &item, unsigned long flags )
{
preserve_quiver_slots p;