Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
5 KB
Referenced Files
None
Subscribers
None
diff --git a/src/Items.h b/src/Items.h
index 86e041c..4b4012c 100644
--- a/src/Items.h
+++ b/src/Items.h
@@ -1,100 +1,143 @@
#ifndef ITEMS_H
#define ITEMS_H
+/** Alignment enum
+ * Alignment of the player and equipment.
+ */
+enum enumAlignment
+{
+ AlignmentNone, /**< No alignment */
+ AlignmentLight, /**< Light (order) */
+ AlignmentDark /**< Dark (chaos) */
+};
+/** Item type enum
+ * All the items and equipments.
+ */
enum enumItemType
{
- itemCopperCoin,
- itemSilverCoin,
- itemGoldCoin,
+ ItemCopperCoin,
+ ItemSilverCoin,
+ ItemGoldCoin,
itemHealth,
- itemMagicianHat, // first equip item
- itemLeatherBoots,
- itemBookDualShots,
- itemRageAmulet,
- itemBossKey,
- itemVibrationGloves,
- itemMahoganyStaff,
- itemFairy,
- itemLeatherBelt,
- itemBloodSnake,
- itemIceGem
+ ItemMagicianHat, // first equip item
+ ItemLeatherBoots,
+ ItemBookDualShots,
+ ItemRageAmulet,
+ ItemBossKey,
+ ItemVibrationGloves,
+ ItemMahoganyStaff,
+ ItemFairy,
+ ItemLeatherBelt,
+ ItemBloodSnake,
+ ItemIceGem
};
+const int FirstEquipItem = (int) ItemMagicianHat; /*!< Used as an offset when creating items */
+
+/*!
+ * \brief Item structure
+ *
+ * Contains all the data for an item.
+ */
struct itemStuct
{
- enumItemType type;
- std::string name;
- std::string description;
- int price;
- bool equip;
+ enumItemType type; /**< The item ID */
+ std::string name; /**< The item name */
+ std::string description; /**< The item description */
+ int price; /**< The item price (for shops) */
+ bool equip; /**< True if the item is an equipment */
+ bool canBeSold; /**< True if the item is can be sold */
+ int level; /**< Minimal level where the item can be found */
+ enumAlignment alignment; /**< Item alignment */
+ int requirement; /**< Pre-requisite item */
};
-const int NUMBER_ITEMS = 15;
+const int NUMBER_ITEMS = 15; /*!< Total number of items */
+
+/** Array with all the items and data */
const itemStuct items[NUMBER_ITEMS] =
{
{
- itemCopperCoin, "Copper coin", "A copper coin (value 1)", 1, false
+ ItemCopperCoin, "Copper coin", "A copper coin (value 1)",
+ 1, false, false, 1, AlignmentNone, -1
},
{
- itemSilverCoin, "Silver coin", "A silver coin (value 5)", 5, false
+ ItemSilverCoin, "Silver coin", "A silver coin (value 5)",
+ 5, false, false, 1, AlignmentNone, -1
},
{
- itemGoldCoin, "Gold coin", "A gold coin (value 20)", 20, false
+ ItemGoldCoin, "Gold coin", "A gold coin (value 20)",
+ 20, false, false, 1, AlignmentNone, -1
},
{
- itemHealth, "Health potion", "A health potion", 8, false
+ itemHealth, "Health potion", "A health potion",
+ 8, false, true, 1, AlignmentNone, -1
},
{
- itemMagicianHat, "Enchanter Hat", "Increases fire rate", 20, true
+ ItemMagicianHat, "Enchanter Hat", "Increases fire rate",
+ 20, true, true, 1, AlignmentNone, -1
},
{
- itemLeatherBoots, "Leather Boots", "Increases Boots", 20, true
+ ItemLeatherBoots, "Leather Boots", "Increases Boots",
+ 20, true, true, 1, AlignmentNone, -1
},
{
- itemBookDualShots, "Spell : Dual Bolts", "Shoots two bolts", 20, true
+ ItemBookDualShots, "Spell : Dual Bolts", "Shoots two bolts",
+ 20, true, true, 1, AlignmentNone, -1
},
{
- itemRageAmulet, "Rage Amulet", "Increases fire range", 20, true
+ ItemRageAmulet, "Rage Amulet", "Increases fire range",
+ 20, true, true, 1, AlignmentNone, -1
},
{
- itemBossKey, "Boss Key", "Open the Boss gate", 200, true
+ ItemBossKey, "Boss Key", "Open the Boss gate",
+ 200, true, false, 1, AlignmentNone, -1
},
{
- itemVibrationGloves, "Vibration Gloves", "Increases bolt's speed and damages", 20, true
+ ItemVibrationGloves, "Vibration Gloves", "Increases bolt's speed and damages",
+ 20, true, true, 1, AlignmentNone, -1
},
{
- itemMahoganyStaff, "Mahogany Staff", "Increases bolt's speed and damages", 20, true
+ ItemMahoganyStaff, "Mahogany Staff", "Increases bolt's speed and damages",
+ 20, true, true, 1, AlignmentNone, -1
},
{
- itemFairy, "Fairy", "Help you in the dungeon", 20, true
+ ItemFairy, "Fairy", "Help you in the dungeon",
+ 20, true, false, 1, AlignmentNone, -1
},
{
- itemLeatherBelt, "Leather Belt", "Increases fire rate", 20, true
+ ItemLeatherBelt, "Leather Belt", "Increases fire rate",
+ 20, true, true, 1, AlignmentNone, -1
},
{
- itemBloodSnake, "Blood Snake", "Increases damages", 25, true
+ ItemBloodSnake, "Blood Snake", "Increases damages",
+ 25, true, true, 1, AlignmentNone, -1
},
{
- itemIceGem, "Ice Gem", "Ice attack", 25, true
+ ItemIceGem, "Ice Gem", "Ice attack",
+ 25, true, true, 1, AlignmentNone, -1
}
};
-// Equip items
-const int NUMBER_EQUIP_ITEMS = 11;
+const int NUMBER_EQUIP_ITEMS = 11; /*!< Number of equip items */
+
+/** Item equipment type enum
+ * All the equipments.
+ */
enum item_equip_enum {
EQUIP_ENCHANTER_HAT,
EQUIP_LEATHER_BOOTS,
EQUIP_BOOK_DUAL,
EQUIP_CONCENTRATION_AMULET,
EQUIP_BOSS_KEY,
EQUIP_VIBRATION_GLOVES,
EQUIP_MAHOGANY_STAFF,
EQUIP_FAIRY,
EQUIP_LEATHER_BELT,
EQUIP_BLOOD_SNAKE,
EQUIP_ICE_GEM
};
#endif

File Metadata

Mime Type
text/x-diff
Expires
Thu, Jun 11, 11:34 AM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
68794
Default Alt Text
(5 KB)

Event Timeline