OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadspel.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_SPEL_H
2 #define OPENMW_ESM_SPEL_H
3 
4 #include <string>
5 
6 #include "effectlist.hpp"
7 
8 namespace ESM
9 {
10 
11 class ESMReader;
12 class ESMWriter;
13 
14 struct Spell
15 {
16  static unsigned int sRecordId;
18  static std::string getRecordType() { return "Spell"; }
19 
20  enum SpellType
21  {
22  ST_Spell = 0, // Normal spell, must be cast and costs mana
23  ST_Ability = 1, // Inert ability, always in effect
24  ST_Blight = 2, // Blight disease
25  ST_Disease = 3, // Common disease
26  ST_Curse = 4, // Curse (?)
27  ST_Power = 5 // Power, can use once a day
28  };
29 
30  enum Flags
31  {
32  F_Autocalc = 1, // Can be selected by NPC spells auto-calc
33  F_PCStart = 2, // Can be selected by player spells auto-calc
34  F_Always = 4 // Casting always succeeds
35  };
36 
37  struct SPDTstruct
38  {
39  int mType; // SpellType
40  int mCost; // Mana cost
41  int mFlags; // Flags
42  };
43 
45  std::string mId, mName;
47 
48  void load(ESMReader &esm, bool &isDeleted);
49  void save(ESMWriter &esm, bool isDeleted = false) const;
50 
51  void blank();
53 };
54 }
55 #endif
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadspel.cpp:56
Definition: loadspel.hpp:34
void load(ESMReader &esm, bool &isDeleted)
Definition: loadspel.cpp:11
Definition: esmreader.hpp:21
Definition: loadspel.hpp:14
Definition: loadspel.hpp:23
Flags
Definition: loadspel.hpp:30
std::string mName
Definition: loadspel.hpp:45
Definition: loadspel.hpp:37
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadspel.hpp:18
Definition: loadspel.hpp:24
SPDTstruct mData
Definition: loadspel.hpp:44
Definition: esmwriter.hpp:17
Definition: loadspel.hpp:27
void blank()
Set record to default state (does not touch the ID/index).
Definition: loadspel.cpp:71
Definition: loadspel.hpp:22
int mFlags
Definition: loadspel.hpp:41
Definition: loadspel.hpp:26
Definition: loadspel.hpp:32
std::string mId
Definition: loadspel.hpp:45
EffectList mEffects
Definition: loadspel.hpp:46
Definition: loadspel.hpp:33
SpellType
Definition: loadspel.hpp:20
Definition: loadspel.hpp:25
EffectList, ENAM subrecord.
Definition: effectlist.hpp:33
static unsigned int sRecordId
Definition: loadspel.hpp:16
int mCost
Definition: loadspel.hpp:40
int mType
Definition: loadspel.hpp:39