1 /*
2  * Copyright 2011-2012 Arx Libertatis Team (see the AUTHORS file)
3  *
4  * This file is part of Arx Libertatis.
5  *
6  * Arx Libertatis is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Arx Libertatis is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Arx Libertatis.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 /* Based on:
20 ===========================================================================
21 ARX FATALIS GPL Source Code
22 Copyright (C) 1999-2010 Arkane Studios SA, a ZeniMax Media company.
23 
24 This file is part of the Arx Fatalis GPL Source Code ('Arx Fatalis Source Code').
25 
26 Arx Fatalis Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
27 License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
28 
29 Arx Fatalis Source Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
30 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
31 
32 You should have received a copy of the GNU General Public License along with Arx Fatalis Source Code.  If not, see
33 <http://www.gnu.org/licenses/>.
34 
35 In addition, the Arx Fatalis Source Code is also subject to certain additional terms. You should have received a copy of these
36 additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Arx
37 Fatalis Source Code. If not, please request a copy in writing from Arkane Studios at the address below.
38 
39 If you have questions concerning this license or the applicable additional terms, you may contact in writing Arkane Studios, c/o
40 ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
41 ===========================================================================
42 */
43 
44 #ifndef ARX_GAME_ITEM_H
45 #define ARX_GAME_ITEM_H
46 
47 #include "game/Entity.h"
48 
49 enum EquipmentModifierType {
50 	IO_EQUIPITEM_ELEMENT_STRENGTH         = 0,
51 	IO_EQUIPITEM_ELEMENT_DEXTERITY        = 1,
52 	IO_EQUIPITEM_ELEMENT_CONSTITUTION     = 2,
53 	IO_EQUIPITEM_ELEMENT_MIND             = 3,
54 	IO_EQUIPITEM_ELEMENT_Stealth          = 4,
55 	IO_EQUIPITEM_ELEMENT_Mecanism         = 5,
56 	IO_EQUIPITEM_ELEMENT_Intuition        = 6,
57 	IO_EQUIPITEM_ELEMENT_Etheral_Link     = 7,
58 	IO_EQUIPITEM_ELEMENT_Object_Knowledge = 8,
59 	IO_EQUIPITEM_ELEMENT_Casting          = 9,
60 	IO_EQUIPITEM_ELEMENT_Projectile       = 10,
61 	IO_EQUIPITEM_ELEMENT_Close_Combat     = 11,
62 	IO_EQUIPITEM_ELEMENT_Defense          = 12,
63 	IO_EQUIPITEM_ELEMENT_Armor_Class      = 13,
64 	IO_EQUIPITEM_ELEMENT_Resist_Magic     = 14,
65 	IO_EQUIPITEM_ELEMENT_Resist_Poison    = 15,
66 	IO_EQUIPITEM_ELEMENT_Critical_Hit     = 16,
67 	IO_EQUIPITEM_ELEMENT_Damages          = 17,
68 	IO_EQUIPITEM_ELEMENT_Duration         = 18,
69 	IO_EQUIPITEM_ELEMENT_AimTime          = 19,
70 	IO_EQUIPITEM_ELEMENT_Identify_Value   = 20,
71 	IO_EQUIPITEM_ELEMENT_Life             = 21,
72 	IO_EQUIPITEM_ELEMENT_Mana             = 22,
73 	IO_EQUIPITEM_ELEMENT_MaxLife          = 23,
74 	IO_EQUIPITEM_ELEMENT_MaxMana          = 24,
75 	IO_EQUIPITEM_ELEMENT_SPECIAL_1        = 25,
76 	IO_EQUIPITEM_ELEMENT_SPECIAL_2        = 26,
77 	IO_EQUIPITEM_ELEMENT_SPECIAL_3        = 27,
78 	IO_EQUIPITEM_ELEMENT_SPECIAL_4        = 28,
79 	IO_EQUIPITEM_ELEMENT_Number
80 };
81 
82 enum EquipmentModifierFlag {
83 	IO_ELEMENT_FLAG_PERCENT = (1<<0)
84 };
85 DECLARE_FLAGS(EquipmentModifierFlag, EquipmentModifierFlags)
86 DECLARE_FLAGS_OPERATORS(EquipmentModifierFlags)
87 
88 enum EquipmentModifiedSpecialType {
89 	IO_SPECIAL_ELEM_NONE       = 0,
90 	IO_SPECIAL_ELEM_PARALYZE   = 1,
91 	IO_SPECIAL_ELEM_DRAIN_LIFE = 2,
92 };
93 
94 struct IO_EQUIPITEM_ELEMENT {
95 	float value;
96 	EquipmentModifierFlags flags;
97 	EquipmentModifiedSpecialType special;
98 };
99 
100 struct IO_EQUIPITEM {
101 	IO_EQUIPITEM_ELEMENT elements[IO_EQUIPITEM_ELEMENT_Number];
102 };
103 
104 struct IO_ITEMDATA {
105 	IO_EQUIPITEM * equipitem; // Equipitem Datas
106 	long price;
107 	short maxcount; // max number cumulable
108 	short count; // current number
109 	char food_value;
110 	char stealvalue;
111 	short playerstacksize;
112 	short LightValue;
113 };
114 
115 #endif // ARX_GAME_ITEM_H
116