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 // Code: Cyril Meynier
44 //
45 // Copyright (c) 1999-2001 ARKANE Studios SA. All rights reserved
46 
47 #ifndef ARX_GAME_EQUIPMENT_H
48 #define ARX_GAME_EQUIPMENT_H
49 
50 #include <stddef.h>
51 #include <string>
52 
53 #include "game/Item.h"
54 #include "math/MathFwd.h"
55 #include "platform/Flags.h"
56 
57 class Entity;
58 
59 enum WeaponType {
60 	WEAPON_BARE = 0,
61 	WEAPON_DAGGER = 1,
62 	WEAPON_1H = 2,
63 	WEAPON_2H = 3,
64 	WEAPON_BOW = 4
65 };
66 
67 enum EquipmentSlot {
68 	EQUIP_SLOT_RING_LEFT = 0,
69 	EQUIP_SLOT_RING_RIGHT = 1,
70 	EQUIP_SLOT_WEAPON = 2,
71 	EQUIP_SLOT_SHIELD = 3,
72 	EQUIP_SLOT_TORCH = 4,
73 	EQUIP_SLOT_ARMOR = 5,
74 	EQUIP_SLOT_HELMET = 6,
75 	EQUIP_SLOT_LEGGINGS = 7
76 };
77 
78 void ARX_EQUIPMENT_Init();
79 void ARX_EQUIPMENT_Remove_All_Special(Entity * io);
80 void ARX_EQUIPMENT_SetEquip(Entity * io, bool special,
81                             const std::string & param2, float val,
82                             EquipmentModifierFlags flags);
83 
84 //! Sets/unsets an object type flag
85 bool ARX_EQUIPMENT_SetObjectType(Entity & io, const std::string & temp, bool set);
86 
87 ItemType ARX_EQUIPMENT_GetObjectTypeFlag(const std::string& temp);
88 void ARX_EQUIPMENT_Equip(Entity * target, Entity * toequip);
89 void ARX_EQUIPMENT_UnEquip(Entity * target, Entity * toequip, long flags = 0);
90 void ARX_EQUIPMENT_ReleaseAll(Entity * io);
91 
92 void ARX_EQUIPMENT_AttachPlayerWeaponToHand();
93 void ARX_EQUIPMENT_AttachPlayerWeaponToBack();
94 void ARX_EQUIPMENT_LaunchPlayerReadyWeapon();
95 
96 void ARX_EQUIPMENT_LaunchPlayerUnReadyWeapon();
97 long ARX_EQUIPMENT_GetPlayerWeaponType();
98 float ARX_EQUIPMENT_Apply(Entity * io, EquipmentModifierType ident,
99                                        float trueval);
100 float ARX_EQUIPMENT_ApplyPercent(Entity * io, EquipmentModifierType ident,
101                                  float trueval);
102 bool ARX_EQUIPMENT_Strike_Check(Entity * io_source, Entity * io_weapon, float percentaim, long flags, long targ = -1);
103 void ARX_EQUIPMENT_RecreatePlayerMesh();
104 float ARX_EQUIPMENT_ComputeDamages(Entity * io_source, Entity * io_target, float ratioaim, Vec3f * pos = NULL);
105 
106 void ARX_EQUIPMENT_IdentifyAll();
107 
108 void ARX_EQUIPMENT_UnEquipAllPlayer();
109 float GetHitValue(const std::string & name);
110 void ARX_EQUIPMENT_UnEquipPlayerWeapon();
111 bool ARX_EQUIPMENT_IsPlayerEquip(Entity * _pIO);
112 
113 #endif // ARX_GAME_EQUIPMENT_H
114