25 #include "common/scummsys.h" 26 #include "common/array.h" 27 #include "common/rect.h" 28 #include "common/serializer.h" 29 #include "mm/xeen/sprites.h" 34 #define INV_ITEMS_TOTAL 9 40 CATEGORY_WEAPON = 0, CATEGORY_ARMOR = 1, CATEGORY_ACCESSORY = 2, CATEGORY_MISC = 3,
41 NUM_ITEM_CATEGORIES = 4
44 enum AttributeCategory {
45 ATTR_MIGHT = 0, ATTR_INTELLECT = 1, ATTR_PERSONALITY = 2, ATTR_SPEED = 3,
46 ATTR_ACCURACY = 4, ATTR_LUCK = 5, ATTR_HIT_POINTS = 6, ATTR_SPELL_POINTS = 7,
47 ATTR_ARMOR_CLASS = 8, ATTR_THIEVERY = 9
50 enum ElementalCategory {
51 ELEM_FIRE = 0, ELEM_ELECTRICITY = 1, ELEM_COLD = 2, ELEM_ACID_POISON = 3,
52 ELEM_ENERGY = 4, ELEM_MAGIC = 5
55 enum EnchantmentType {
56 ENCHANTMENT_TYPE_ELEMENT = 1, ENCHANTMENT_TYPE_ATTR_BONUS = 2,
57 ENCHANTMENT_TYPE_MATERIAL = 3, ENCHANTMENT_TYPE_USABLE = 4
61 XEEN_SLAYER_SWORD = 34
65 EFFECTIVE_NONE = 0, EFFECTIVE_DRAGON = 1, EFFECTIVE_UNDEAD = 2, EFFECTIVE_GOLEM = 3,
66 EFFECTIVE_INSECT = 4, EFFEctIVE_MONSTERS = 5, EFFECTIVE_ANIMAL = 6
70 MAKE_ITEM_ENCHANT_WEAPON = 1, MAKE_ITEM_ENCHANT_ARMOR = 2,
71 MAKE_ITEM_ENCHANT_ACCESSORY = 3, MAKE_ITEM_SPECIAL_EVENT = 12
82 ItemState() : _counter(0), _cursed(false), _broken(false) {
90 _cursed = _broken =
false;
97 return !_counter && !_cursed && !_broken;
121 static const char *getItemName(ItemCategory category, uint
id);
144 return _state._cursed || _state._broken;
162 ElementalCategory getElementalCategory()
const;
167 static ElementalCategory getElementalCategory(
int material);
172 AttributeCategory getAttributeCategory()
const;
178 ItemCategory _category;
182 void equipError(
int itemIndex1, ItemCategory category1,
int itemIndex2,
183 ItemCategory category2);
198 const char *getMaeName(
int material);
220 bool passRestrictions(
int itemId,
bool suppressError =
false)
const;
227 virtual Common::String getFullDescription(
int itemIndex,
int displayNum = 15) = 0;
237 bool discardItem(
int itemIndex);
248 void removeItem(
int itemIndex);
258 virtual void enchantItem(
int itemIndex,
int amount);
281 void equipItem(
int itemIndex)
override;
287 Common::String getFullDescription(
int itemIndex,
int displayNum)
override;
292 void enchantItem(
int itemIndex,
int amount)
override;
297 bool hasElderWeapon()
const;
315 void equipItem(
int itemIndex)
override;
321 Common::String getFullDescription(
int itemIndex,
int displayNum)
override;
326 void enchantItem(
int itemIndex,
int amount)
override;
342 void equipItem(
int itemIndex)
override;
348 Common::String getFullDescription(
int itemIndex,
int displayNum)
override;
367 Common::String getFullDescription(
int itemIndex,
int displayNum)
override;
390 void breakAllItems();
395 void curseUncurse(
bool curse);
400 bool hasCursedItems()
const;
void synchronize(Common::Serializer &s)
bool isBad() const
Definition: item.h:143
void clear()
Definition: item.h:88
Definition: serializer.h:79
bool empty() const
Definition: item.h:96
virtual void equipItem(int itemIndex)
Definition: item.h:242
Definition: character.h:106
Definition: detection.h:27
bool isEquipped() const
Definition: item.h:150
ItemState()
Definition: item.h:82
void sort(T first, T last, StrictWeakOrdering comp)
Definition: algorithm.h:349
bool empty() const
Definition: item.h:136