OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
activespells.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_ACTIVESPELLS_H
2 #define OPENMW_ESM_ACTIVESPELLS_H
3 
4 #include "effectlist.hpp"
5 #include "defs.hpp"
6 
7 #include <string>
8 #include <map>
9 
10 namespace ESM
11 {
12  class ESMReader;
13  class ESMWriter;
14 
15  // Parameters of an effect concerning lasting effects.
16  // Note we are not using ENAMstruct since the magnitude may be modified by magic resistance, etc.
17  // It could also be a negative magnitude, in case of inversing an effect, e.g. Absorb spell causes damage on target, but heals the caster.
18  struct ActiveEffect
19  {
20  int mEffectId;
21  float mMagnitude;
22  int mArg; // skill or attribute
23  float mDuration;
24  };
25 
26  // format 0, saved games only
27  struct ActiveSpells
28  {
30  {
31  std::vector<ActiveEffect> mEffects;
33  std::string mDisplayName;
35  };
36 
37  typedef std::multimap<std::string, ActiveSpellParams > TContainer;
39 
40  void load (ESMReader &esm);
41  void save (ESMWriter &esm) const;
42  };
43 }
44 
45 #endif
std::vector< ActiveEffect > mEffects
Definition: activespells.hpp:31
std::multimap< std::string, ActiveSpellParams > TContainer
Definition: activespells.hpp:37
ESM::TimeStamp mTimeStamp
Definition: activespells.hpp:32
Definition: activespells.hpp:18
TContainer mSpells
Definition: activespells.hpp:38
Definition: defs.hpp:11
Definition: esmreader.hpp:21
Definition: activespells.hpp:27
void load(ESMReader &esm)
Definition: activespells.cpp:32
int mCasterActorId
Definition: activespells.hpp:34
float mDuration
Definition: activespells.hpp:23
int mEffectId
Definition: activespells.hpp:20
Definition: esmwriter.hpp:17
int mArg
Definition: activespells.hpp:22
void save(ESMWriter &esm) const
Definition: activespells.cpp:9
float mMagnitude
Definition: activespells.hpp:21
Definition: activespells.hpp:29
std::string mDisplayName
Definition: activespells.hpp:33