1 #ifndef GAME_MWMECHANICS_MAGICEFFECTS_H
2 #define GAME_MWMECHANICS_MAGICEFFECTS_H
29 bool operator< (
const EffectKey& left,
const EffectKey& right);
63 return param += right;
69 return param -= right;
78 const std::string& sourceName,
const std::string& sourceId,
int casterActorId,
79 float magnitude,
float remainingTime = -1,
float totalTime = -1) = 0;
Definition: magiceffects.hpp:73
void writeState(ESM::MagicEffects &state) const
Definition: magiceffects.cpp:196
EffectKey(int id, int arg=-1)
Definition: magiceffects.hpp:24
Effects currently affecting a NPC or creature.
Definition: magiceffects.hpp:83
int getBase() const
Definition: magiceffects.cpp:53
EffectKey()
Definition: magiceffects.cpp:12
Collection::const_iterator end() const
Definition: magiceffects.hpp:97
Definition: magiceffects.hpp:31
int mBase
Definition: magiceffects.hpp:37
virtual ~EffectSourceVisitor()
Definition: magiceffects.hpp:75
float getMagnitude() const
Get the total magnitude including base and modifier.
Definition: magiceffects.cpp:43
std::map< EffectKey, EffectParam > Collection
Definition: magiceffects.hpp:87
Definition: effectlist.hpp:17
MagicEffects & operator+=(const MagicEffects &effects)
Definition: magiceffects.cpp:126
static MagicEffects diff(const MagicEffects &prev, const MagicEffects &now)
Return changes from prev to now.
Definition: magiceffects.cpp:162
void add(const EffectKey &key, const EffectParam ¶m)
Definition: magiceffects.cpp:94
virtual void visit(MWMechanics::EffectKey key, const std::string &sourceName, const std::string &sourceId, int casterActorId, float magnitude, float remainingTime=-1, float totalTime=-1)=0
Definition: magiceffects.hpp:17
EffectParam()
Definition: magiceffects.cpp:73
void modifyBase(const EffectKey &key, int diff)
Definition: magiceffects.cpp:108
Definition: magiceffects.hpp:12
float mModifier
Definition: magiceffects.hpp:35
EffectParam & operator+=(const EffectParam ¶m)
Definition: magiceffects.cpp:75
Collection::const_iterator begin() const
Definition: magiceffects.hpp:95
int mId
Definition: magiceffects.hpp:19
void setModifier(float mod)
Definition: magiceffects.cpp:63
bool operator<(const EffectKey &left, const EffectKey &right)
Definition: magiceffects.cpp:32
EffectParam operator+(const EffectParam &left, const EffectParam &right)
Definition: magiceffects.hpp:60
Collection mCollection
Definition: magiceffects.hpp:91
EffectParam operator-(const EffectParam &left, const EffectParam &right)
Definition: magiceffects.hpp:66
EffectParam(float magnitude)
Definition: magiceffects.hpp:53
int mArg
Definition: magiceffects.hpp:20
void setModifiers(const MagicEffects &effects)
Copy Modifier values from effects, but keep original mBase values.
Definition: magiceffects.cpp:113
void setBase(int base)
Definition: magiceffects.cpp:58
EffectParam & operator-=(const EffectParam ¶m)
Definition: magiceffects.cpp:82
void readState(const ESM::MagicEffects &state)
Definition: magiceffects.cpp:209
void modifyBase(int diff)
Change mBase by diff.
Definition: magiceffects.cpp:48
float getModifier() const
Definition: magiceffects.cpp:68