1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef CL_ATTACK_ID_H
18 #define CL_ATTACK_ID_H
20 #include "game_share/magic_fx.h"
21 #include "game_share/range_weapon_type.h"
24 /** Identifier of an attack (magic, range, melle, or creature)
25 * This helps doing the links between attack behaviour and its graphical representation
28 * \author Nicolas Vizerie
29 * \author Nevrax France
35 enum TType
{ Melee
= 0, Range
, Magic
, Creature
, DamageShield
, Unknown
};
40 MAGICFX::TSpellMode Mode
;
43 void build(const NLGEORGES::UFormElm
&item
, const std::string
&prefix
);
44 void serial(NLMISC::IStream
&f
);
50 CSpellInfo SpellInfo
; // valid if type == Magic
51 RANGE_WEAPON_TYPE::TRangeWeaponType RangeWeaponType
; // valid if type == Range
52 uint32 CreatureAttackIndex
; // valid if type == Creature. Currently, maybe 0 or 1 2 attack per creature)
53 uint32 DamageShieldType
; // valid if type == DamageShield
56 virtual void build(const NLGEORGES::UFormElm
&item
, const std::string
&prefix
);
57 virtual void serial(NLMISC::IStream
&f
);
60 // compares spell infos
61 bool operator == (const CAttackIDSheet::CSpellInfo
&lhs
, const CAttackIDSheet::CSpellInfo
&rhs
);
62 inline bool operator != (const CAttackIDSheet::CSpellInfo
&lhs
, const CAttackIDSheet::CSpellInfo
&rhs
) { return !(lhs
== rhs
); }
63 // build an ordering between attack ids
64 bool operator < (const CAttackIDSheet::CSpellInfo
&lhs
, const CAttackIDSheet::CSpellInfo
&rhs
);
65 // compares 2 attack ids
66 bool operator == (const CAttackIDSheet
&lhs
, const CAttackIDSheet
&rhs
);
67 inline bool operator != (const CAttackIDSheet
&lhs
, const CAttackIDSheet
&rhs
) { return !(lhs
== rhs
); }
68 // build an ordering between attack ids
69 bool operator < (const CAttackIDSheet
&lhs
, const CAttackIDSheet
&rhs
);