From 339992ffcd0935a285e768a1488bb7c91463ea47 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 11 Aug 2012 19:43:28 +0000 Subject: Added functions for armor item categories git-svn-id: http://mc-server.googlecode.com/svn/trunk@727 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Defines.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'source') diff --git a/source/Defines.h b/source/Defines.h index fb856b835..70368373f 100644 --- a/source/Defines.h +++ b/source/Defines.h @@ -275,6 +275,58 @@ namespace ItemCategory || IsHoe ( a_ItemID ) || IsShovel ( a_ItemID ); } + + + + inline bool IsHelmet(ENUM_ITEM_ID a_ItemType) + { + return ( + (a_ItemType == E_ITEM_LEATHER_CAP) || + (a_ItemType == E_ITEM_GOLD_HELMET) || + (a_ItemType == E_ITEM_CHAIN_HELMET) || + (a_ItemType == E_ITEM_IRON_HELMET) || + (a_ItemType == E_ITEM_DIAMOND_HELMET) + ); + } + + + + inline bool IsChestPlate(ENUM_ITEM_ID a_ItemType) + { + return ( + (a_ItemType == E_ITEM_LEATHER_TUNIC) || + (a_ItemType == E_ITEM_GOLD_CHESTPLATE) || + (a_ItemType == E_ITEM_CHAIN_CHESTPLATE) || + (a_ItemType == E_ITEM_IRON_CHESTPLATE) || + (a_ItemType == E_ITEM_DIAMOND_CHESTPLATE) + ); + } + + + + inline bool IsLeggings(ENUM_ITEM_ID a_ItemType) + { + return ( + (a_ItemType == E_ITEM_LEATHER_PANTS) || + (a_ItemType == E_ITEM_GOLD_LEGGINGS) || + (a_ItemType == E_ITEM_CHAIN_LEGGINGS) || + (a_ItemType == E_ITEM_IRON_LEGGINGS) || + (a_ItemType == E_ITEM_DIAMOND_LEGGINGS) + ); + } + + + + inline bool IsBoots(ENUM_ITEM_ID a_ItemType) + { + return ( + (a_ItemType == E_ITEM_LEATHER_BOOTS) || + (a_ItemType == E_ITEM_GOLD_BOOTS) || + (a_ItemType == E_ITEM_CHAIN_BOOTS) || + (a_ItemType == E_ITEM_IRON_BOOTS) || + (a_ItemType == E_ITEM_DIAMOND_BOOTS) + ); + } } //tolua_end -- cgit v1.2.3