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/>.
24 #include "nel/misc/types_nl.h"
25 #include "game_share/effect_families.h"
26 #include "game_share/damage_types.h"
27 #include "game_share/base_types.h"
30 * Class representing an effect managed by the EGS
31 * \author Nicolas Brigand
32 * \author Nevrax France
40 inline CSEffect( const TDataSetRow
& creatorRowId
, const TDataSetRow
& targetRowId
, EFFECT_FAMILIES::TEffectFamily family
, sint32 effectValue
, uint8 power
)
41 :_CreatorRowId(creatorRowId
),_TargetRowId(targetRowId
),_Family(family
),_Value(effectValue
),_Power(power
)
46 * return true if it is time to update the effect. It modifies the next update of the effect
48 virtual bool isTimeToUpdate() = 0;
51 * apply the effects of the... effect
52 * \param updateFlag is a flag telling which effect type has been already processed for an entity. An effect shoud set to 1 the bit corresponding to its effect family
53 * \return true if the effect ends must be removed
55 virtual bool update( uint32
& updateFlag
) = 0;
57 /// callback called when the effect is actually removed. Does nothing by default
58 virtual void removed(){}
62 inline uint32
getEffectId() const{ return _EffectId
;}
63 inline EFFECT_FAMILIES::TEffectFamily
getFamily() const{ return _Family
;}
64 inline const TDataSetRow
& getCreatorRowId() const{ return _CreatorRowId
;}
65 inline const TDataSetRow
& getTargetRowId() const{ return _TargetRowId
;}
66 inline sint32
getParamValue() const{ return _Value
;}
67 inline uint8
getPower() const{ return _Power
;}
70 ///\set the id of the effect. Should be set by the effect manager
71 inline void setEffectId(uint32 id
) { _EffectId
= id
; }
75 TDataSetRow _CreatorRowId
;
77 TDataSetRow _TargetRowId
;
79 EFFECT_FAMILIES::TEffectFamily _Family
;
84 /// power of the effect (to be counter with cures)
91 #endif // RY_S_EFFECT_H
94 /* End of s_effect.h */