OpenMW
components/esm/loadspel.hpp
Go to the documentation of this file.
00001 #ifndef OPENMW_ESM_SPEL_H
00002 #define OPENMW_ESM_SPEL_H
00003 
00004 #include <string>
00005 
00006 #include "effectlist.hpp"
00007 
00008 namespace ESM
00009 {
00010 
00011 class ESMReader;
00012 class ESMWriter;
00013 
00014 struct Spell
00015 {
00016     static unsigned int sRecordId;
00017 
00018     enum SpellType
00019     {
00020         ST_Spell = 0,   // Normal spell, must be cast and costs mana
00021         ST_Ability = 1, // Inert ability, always in effect
00022         ST_Blight = 2,  // Blight disease
00023         ST_Disease = 3, // Common disease
00024         ST_Curse = 4,   // Curse (?)
00025         ST_Power = 5    // Power, can use once a day
00026     };
00027 
00028     enum Flags
00029     {
00030         F_Autocalc = 1,
00031         F_PCStart = 2,
00032         F_Always = 4 // Casting always succeeds
00033     };
00034 
00035     struct SPDTstruct
00036     {
00037         int mType; // SpellType
00038         int mCost; // Mana cost
00039         int mFlags; // Flags
00040     };
00041 
00042     SPDTstruct mData;
00043     std::string mId, mName;
00044     EffectList mEffects;
00045 
00046     void load(ESMReader &esm);
00047     void save(ESMWriter &esm) const;
00048 
00049     void blank();
00051 };
00052 }
00053 #endif