summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-06-12 01:36:41 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-06-12 15:10:27 +0200
commitfea71b51790dfb1c5babc22c32226a976a1d5fde (patch)
treeeca851da1ea35080a389d0c7548a57a167b14b74 /crawl-ref/source/itemprop.h
parent13f14d0f7d75f1164c1ba97fc38272f8dc6b441a (diff)
downloadcrawl-ref-fea71b51790dfb1c5babc22c32226a976a1d5fde.tar.gz
crawl-ref-fea71b51790dfb1c5babc22c32226a976a1d5fde.zip
Make staves and rods separate object classes.
They have about no overlap, more than both being usable as weapons. A vast majority of uses immediately checked item_is_rod()/item_is_staff(). I kept them shared for acquirement, for now. Also, eliminate rods of smiting -- hardly ever used, problematic theme-wise as they use "divine providence" without worship. Keeping rods of striking for now, could be used to fix artificer problems. Adding/removing rod enums is a mess due to tile handling, renaming ROD_SMITING to ROD_LIGHTNING for now.
Diffstat (limited to 'crawl-ref/source/itemprop.h')
-rw-r--r--crawl-ref/source/itemprop.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h
index 15b511a315..a160bb53d3 100644
--- a/crawl-ref/source/itemprop.h
+++ b/crawl-ref/source/itemprop.h
@@ -132,10 +132,6 @@ launch_retval is_launched(const actor *actor, const item_def *launcher,
reach_type weapon_reach(const item_def &item);
int reach_range(reach_type rt);
-// staff/rod functions:
-bool item_is_rod(const item_def &item);
-bool item_is_staff(const item_def &item);
-
// Macguffins
bool item_is_rune(const item_def &item, rune_type which_rune = NUM_RUNE_TYPES);
bool item_is_unique_rune(const item_def &item);
@@ -184,4 +180,11 @@ std::string food_type_name (int sub_type);
const char* weapon_base_name(uint8_t subtype);
void seen_item(const item_def &item);
+
+static inline bool is_weapon(const item_def &item)
+{
+ return item.base_type == OBJ_WEAPONS
+ || item.base_type == OBJ_STAVES
+ || item.base_type == OBJ_RODS;
+}
#endif