2012-09-23 18:11:08 +00:00
|
|
|
#ifndef OPENMW_ESM_SPEL_H
|
|
|
|
#define OPENMW_ESM_SPEL_H
|
2010-02-19 13:23:22 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
#include <string>
|
|
|
|
|
2012-04-08 09:51:52 +00:00
|
|
|
#include "record.hpp"
|
2012-09-17 07:37:50 +00:00
|
|
|
#include "effectlist.hpp"
|
2010-02-19 13:23:22 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2010-02-19 13:23:22 +00:00
|
|
|
|
2012-09-30 19:34:53 +00:00
|
|
|
struct Spell
|
2010-02-19 13:23:22 +00:00
|
|
|
{
|
2011-04-08 13:58:21 +00:00
|
|
|
enum SpellType
|
2010-02-19 13:23:22 +00:00
|
|
|
{
|
2011-04-08 13:58:21 +00:00
|
|
|
ST_Spell = 0, // Normal spell, must be cast and costs mana
|
|
|
|
ST_Ability = 1, // Inert ability, always in effect
|
|
|
|
ST_Blight = 2, // Blight disease
|
|
|
|
ST_Disease = 3, // Common disease
|
|
|
|
ST_Curse = 4, // Curse (?)
|
|
|
|
ST_Power = 5 // Power, can use once a day
|
2010-02-19 13:23:22 +00:00
|
|
|
};
|
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
enum Flags
|
2010-02-19 13:23:22 +00:00
|
|
|
{
|
2011-04-08 13:58:21 +00:00
|
|
|
F_Autocalc = 1,
|
|
|
|
F_PCStart = 2,
|
|
|
|
F_Always = 4 // Casting always succeeds
|
2010-02-19 13:23:22 +00:00
|
|
|
};
|
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
struct SPDTstruct
|
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
int mType; // SpellType
|
|
|
|
int mCost; // Mana cost
|
|
|
|
int mFlags; // Flags
|
2011-04-08 13:58:21 +00:00
|
|
|
};
|
2010-02-19 13:23:22 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
SPDTstruct mData;
|
|
|
|
std::string mName;
|
|
|
|
EffectList mEffects;
|
2010-02-19 13:23:22 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
void load(ESMReader &esm);
|
2012-04-06 19:04:30 +00:00
|
|
|
void save(ESMWriter &esm);
|
2010-02-20 20:55:51 +00:00
|
|
|
};
|
2010-02-19 13:23:22 +00:00
|
|
|
}
|
|
|
|
#endif
|