2 * The values for the "tval" field of various objects.
4 * This value is the primary means by which items are sorted in the
5 * player inventory_list, followed by "sval" and "cost".
7 * Note that a "BOW" with tval = 19 and sval S = 10*N+P takes a missile
8 * weapon with tval = 16+N, and does (xP) damage when so combined. This
9 * fact is not actually used in the source, but it kind of interesting.
11 * Note that as of 2.7.8, the "item flags" apply to all items, though
12 * only armor and weapons and a few other items use any of these flags.
17 #include "util/enum-range.h"
19 enum class ItemKindType : short {
21 SKELETON = 1, /* Skeletons ('s'), not specified */
22 BOTTLE = 2, /* Empty bottles ('!') */
23 JUNK = 3, /* Sticks, Pottery, etc ('~') */
24 WHISTLE = 4, /* Whistle ('~') */
25 SPIKE = 5, /* Spikes ('~') */
26 CHEST = 7, /* Chests ('&') */
27 FIGURINE = 8, /* Magical figurines */
28 STATUE = 9, /* Statue, what a silly object... */
29 CORPSE = 10, /* Corpses and Skeletons, specific */
30 CAPTURE = 11, /* Monster ball */
31 NO_AMMO = 15, /* Ammo for crimson */
32 SHOT = 16, /* Ammo for slings */
33 ARROW = 17, /* Ammo for bows */
34 BOLT = 18, /* Ammo for x-bows */
35 BOW = 19, /* Slings/Bows/Xbows */
36 DIGGING = 20, /* Shovels/Picks */
37 HAFTED = 21, /* Priest Weapons */
38 POLEARM = 22, /* Axes and Pikes */
39 SWORD = 23, /* Edged Weapons */
40 BOOTS = 30, /* Boots */
41 GLOVES = 31, /* Gloves */
42 HELM = 32, /* Helms */
43 CROWN = 33, /* Crowns */
44 SHIELD = 34, /* Shields */
45 CLOAK = 35, /* Cloaks */
46 SOFT_ARMOR = 36, /* Soft Armor */
47 HARD_ARMOR = 37, /* Hard Armor */
48 DRAG_ARMOR = 38, /* Dragon Scale Mail */
49 LITE = 39, /* Lites (including Specials) */
50 AMULET = 40, /* Amulets (including Specials) */
51 RING = 45, /* Rings (including Specials) */
74 GOLD = 127, /* Gold can only be picked up by players */
77 constexpr auto TV_WEARABLE_RANGE = EnumRange(ItemKindType::BOW, ItemKindType::CARD);
78 constexpr auto TV_WEAPON_RANGE = EnumRange(ItemKindType::BOW, ItemKindType::SWORD);