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>
|
|
|
|
|
|
|
|
#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 20:51:54 +00:00
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
2012-09-30 19:34:53 +00:00
|
|
|
struct Spell
|
2010-02-19 13:23:22 +00:00
|
|
|
{
|
2013-09-24 11:17:28 +00:00
|
|
|
static unsigned int sRecordId;
|
|
|
|
|
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
|
|
|
{
|
2014-07-11 05:31:18 +00:00
|
|
|
F_Autocalc = 1, // Can be selected by NPC spells auto-calc
|
|
|
|
F_PCStart = 2, // Can be selected by player spells auto-calc
|
2011-04-08 13:58:21 +00:00
|
|
|
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;
|
2012-10-07 17:24:47 +00:00
|
|
|
std::string mId, mName;
|
2012-09-17 07:37:50 +00:00
|
|
|
EffectList mEffects;
|
2010-02-19 13:23:22 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
void load(ESMReader &esm);
|
2013-09-16 10:32:35 +00:00
|
|
|
void save(ESMWriter &esm) const;
|
2013-04-09 09:40:36 +00:00
|
|
|
|
|
|
|
void blank();
|
|
|
|
///< Set record to default state (does not touch the ID/index).
|
2010-02-20 20:55:51 +00:00
|
|
|
};
|
2010-02-19 13:23:22 +00:00
|
|
|
}
|
|
|
|
#endif
|